Compare commits

...

21 Commits

Author SHA1 Message Date
semantic-release-bot 33faf1cea5 chore(release): 0.1.0-develop.5 [skip ci]
# [0.1.0-develop.5](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.1.0-develop.4...v0.1.0-develop.5) (2023-11-17)

### Features

* add stat method ([7aa6225](7aa6225b4e))
2023-11-17 14:23:31 +00:00
Derrick Hammer f292e9aa84
Merge remote-tracking branch 'origin/develop' into develop 2023-11-17 09:22:47 -05:00
Derrick Hammer 7aa6225b4e
feat: add stat method 2023-11-17 09:22:35 -05:00
semantic-release-bot ec8b0f3dce chore(release): 0.1.0-develop.4 [skip ci]
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-11-17)

### Features

* add cat method ([5805dab](5805dabe27))
2023-11-17 14:08:29 +00:00
Derrick Hammer 48bb04a42e
Merge remote-tracking branch 'origin/develop' into develop 2023-11-17 09:07:36 -05:00
Derrick Hammer 5805dabe27
feat: add cat method 2023-11-17 09:07:32 -05:00
Derrick Hammer c4f0b930ee
dep: update libkernel 2023-11-17 09:00:48 -05:00
semantic-release-bot 1f98a6da9c chore(release): 0.1.0-develop.3 [skip ci]
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-10-13)
2023-10-13 12:18:37 +00:00
Derrick Hammer 1428b92436
Merge remote-tracking branch 'origin/develop' into develop 2023-10-13 08:17:32 -04:00
Derrick Hammer 5907eb133d
dep: update libkernel 2023-10-13 08:17:27 -04:00
Derrick Hammer 1468d23e95
dep: update module hash 2023-10-13 08:16:34 -04:00
semantic-release-bot 55da333ad2 chore(release): 0.1.0-develop.2 [skip ci]
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-09-03)
2023-09-03 05:00:12 +00:00
Derrick Hammer cbcc93ab7d
Merge remote-tracking branch 'origin/develop' into develop 2023-09-03 00:59:20 -04:00
Derrick Hammer be97963eb3
dep: update deps 2023-09-03 00:59:16 -04:00
Derrick Hammer c9ea0c8000
dep: update module hash 2023-09-03 00:58:33 -04:00
semantic-release-bot c354cedc6c chore(release): 0.1.0-develop.1 [skip ci]
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.0.1...v0.1.0-develop.1) (2023-09-01)

### Bug Fixes

* add main to package.json ([17d51be](17d51be71e))

### Features

* initial version ([b907b6f](b907b6f276))
2023-09-01 14:11:41 +00:00
Derrick Hammer 874b61e316
ci: override module setting in tsconfig 2023-09-01 10:10:23 -04:00
Derrick Hammer 8a8e50f69b
ci: add missing scripts 2023-09-01 10:07:04 -04:00
Derrick Hammer 17d51be71e
fix: add main to package.json 2023-09-01 09:52:36 -04:00
Derrick Hammer 2df349311b
ci: setup 2023-09-01 09:51:13 -04:00
Derrick Hammer b907b6f276
feat: initial version 2023-09-01 09:40:08 -04:00
7 changed files with 18585 additions and 1 deletions

13
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: Build/Publish
on:
push:
branches:
- master
- develop
- develop-*
jobs:
main:
uses: lumeweb/github-node-deploy-workflow/.github/workflows/main.yml@master
secrets: inherit

12
.presetterrc.json Normal file
View File

@ -0,0 +1,12 @@
{
"preset": [
"@lumeweb/node-library-preset"
],
"config": {
"tsconfig": {
"compilerOptions": {
"module": "nodenext"
}
}
}
}

29
CHANGELOG.md Normal file
View File

@ -0,0 +1,29 @@
# [0.1.0-develop.5](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.1.0-develop.4...v0.1.0-develop.5) (2023-11-17)
### Features
* add stat method ([7aa6225](https://git.lumeweb.com/LumeWeb/kernel-s5-client/commit/7aa6225b4e19b065d420459278ac62e16384af0a))
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-11-17)
### Features
* add cat method ([5805dab](https://git.lumeweb.com/LumeWeb/kernel-s5-client/commit/5805dabe277fa2fd4f2a43228b8a1bdb6c2dcf06))
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-10-13)
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-09-03)
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/kernel-s5-client/compare/v0.0.1...v0.1.0-develop.1) (2023-09-01)
### Bug Fixes
* add main to package.json ([17d51be](https://git.lumeweb.com/LumeWeb/kernel-s5-client/commit/17d51be71ea5c4d8aefa61830c9a8a4764310ce7))
### Features
* initial version ([b907b6f](https://git.lumeweb.com/LumeWeb/kernel-s5-client/commit/b907b6f276a35a25519f5c334e4356e80e83b795))

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 LumeWeb
Copyright (c) 2023 Hammer Technologies LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

18443
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

29
package.json Normal file
View File

@ -0,0 +1,29 @@
{
"name": "@lumeweb/kernel-s5-client",
"version": "0.1.0-develop.5",
"type": "module",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "gitea@git.lumeweb.com:LumeWeb/kernel-s5-client.git"
},
"devDependencies": {
"@lumeweb/node-library-preset": "^0.2.7",
"presetter": "*"
},
"readme": "ERROR: No README data found!",
"scripts": {
"prepare": "presetter bootstrap",
"build": "run build",
"semantic-release": "semantic-release"
},
"dependencies": {
"@lumeweb/libkernel": "0.1.0-develop.68"
},
"publishConfig": {
"access": "public"
},
"files": [
"lib"
]
}

58
src/index.ts Normal file
View File

@ -0,0 +1,58 @@
import { factory, NetworkClient } from "@lumeweb/libkernel/module";
import type { SignedRegistryEntry } from "@lumeweb/libs5";
export const MODULE = "zrjLjKVByzt233rfcjWvTQXrMfGFa11oBLydPaUk7gwnC2d";
export interface RegistryEntry {
key: Uint8Array;
data: Uint8Array;
revision: number;
}
export class S5Client extends NetworkClient {
public async getRegistryEntry(pubkey: Uint8Array | Buffer | string) {
return this.callModuleReturn("getRegistryEntry", { pubkey });
}
public async setRegistryEntry({
key,
data,
revision,
}: RegistryEntry): Promise<SignedRegistryEntry> {
return this.callModuleReturn("setRegistryEntry", { key, data, revision });
}
public registrySubscription(
pubkey: Uint8Array,
cb: (sre: SignedRegistryEntry) => void,
): () => void {
let done = false;
const [end, ret] = this.connectModule(
"registrySubscription",
{ pubkey },
cb,
);
ret.then((ret) => {
this.handleError(ret);
});
return () => {
if (done) {
return;
}
done = true;
end();
};
}
public async cat(cid: string) {
return this.callModuleReturn("cat", { cid });
}
public async stat(cid: string) {
return this.callModuleReturn("stat", { cid });
}
}
export const createClient = factory<S5Client>(S5Client, MODULE);