Compare commits

..

74 Commits

Author SHA1 Message Date
semantic-release-bot 8acba10ec5 chore(release): 0.1.0-develop.22 [skip ci]
# [0.1.0-develop.22](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.21...v0.1.0-develop.22) (2023-09-02)
2023-09-02 17:18:37 +00:00
Derrick Hammer d76ccbf4e4
Merge remote-tracking branch 'origin/develop' into develop 2023-09-02 13:17:17 -04:00
Derrick Hammer 171469e8fa
dep: update module hash 2023-09-02 13:17:11 -04:00
Derrick Hammer 3ff28c0995
dep: libkernel 2023-09-02 13:17:06 -04:00
semantic-release-bot 2b125b0599 chore(release): 0.1.0-develop.21 [skip ci]
# [0.1.0-develop.21](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.20...v0.1.0-develop.21) (2023-07-31)
2023-07-31 16:45:37 +00:00
Derrick Hammer a89c320f5c
Merge remote-tracking branch 'origin/develop' into develop 2023-07-31 12:44:33 -04:00
Derrick Hammer 16242a3856
dep: update module hash 2023-07-31 12:44:28 -04:00
semantic-release-bot 9b9da9e79a chore(release): 0.1.0-develop.20 [skip ci]
# [0.1.0-develop.20](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.19...v0.1.0-develop.20) (2023-07-30)
2023-07-30 00:45:22 +00:00
Derrick Hammer eb93bd25ef
dep: update module hash 2023-07-29 20:44:12 -04:00
semantic-release-bot aabf69c2b1 chore(release): 0.1.0-develop.19 [skip ci]
# [0.1.0-develop.19](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.18...v0.1.0-develop.19) (2023-07-30)
2023-07-30 00:36:12 +00:00
Derrick Hammer 60f7f5fde0
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 20:35:17 -04:00
Derrick Hammer 0832dfe924
dep: update module hash 2023-07-29 20:35:11 -04:00
semantic-release-bot 4505f3b02f chore(release): 0.1.0-develop.18 [skip ci]
# [0.1.0-develop.18](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.17...v0.1.0-develop.18) (2023-07-29)
2023-07-29 23:51:34 +00:00
Derrick Hammer ab3fbcb911
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 19:50:25 -04:00
Derrick Hammer 74619684cf
dep: update libkernel 2023-07-29 19:50:22 -04:00
semantic-release-bot b6756ff2b8 chore(release): 0.1.0-develop.17 [skip ci]
# [0.1.0-develop.17](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.16...v0.1.0-develop.17) (2023-07-29)
2023-07-29 23:37:52 +00:00
Derrick Hammer 8b35ceb9ae
dep: update libkernel 2023-07-29 19:36:34 -04:00
Derrick Hammer 5744f51b8b
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 19:35:23 -04:00
Derrick Hammer dfd79ea970
dep: update libkernel 2023-07-29 19:35:18 -04:00
semantic-release-bot 3db23ef93f chore(release): 0.1.0-develop.16 [skip ci]
# [0.1.0-develop.16](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.15...v0.1.0-develop.16) (2023-07-29)
2023-07-29 22:38:14 +00:00
Derrick Hammer 5a145435f0
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 18:36:59 -04:00
Derrick Hammer 624c7f31c9
dep: update module hash 2023-07-29 18:36:56 -04:00
semantic-release-bot 94bf381f32 chore(release): 0.1.0-develop.15 [skip ci]
# [0.1.0-develop.15](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.14...v0.1.0-develop.15) (2023-07-29)

### Bug Fixes

* Revert "dep: update module hash" ([cba7b16](cba7b16153))
2023-07-29 18:25:19 +00:00
Derrick Hammer b0c47a7431
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 14:24:20 -04:00
Derrick Hammer cba7b16153
fix: Revert "dep: update module hash"
This reverts commit 4a08d0c39c.
2023-07-29 14:24:12 -04:00
semantic-release-bot f7f58fe209 chore(release): 0.1.0-develop.14 [skip ci]
# [0.1.0-develop.14](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.13...v0.1.0-develop.14) (2023-07-29)
2023-07-29 18:14:53 +00:00
Derrick Hammer cb862b620d
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 14:13:56 -04:00
Derrick Hammer 4a08d0c39c
dep: update module hash 2023-07-29 14:13:43 -04:00
semantic-release-bot 74f0ea35fc chore(release): 0.1.0-develop.13 [skip ci]
# [0.1.0-develop.13](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.12...v0.1.0-develop.13) (2023-07-29)
2023-07-29 18:07:23 +00:00
Derrick Hammer b4aa8d3b1e
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 14:06:21 -04:00
Derrick Hammer 2b046c506e
dep: update module hash 2023-07-29 14:06:17 -04:00
semantic-release-bot b4c806c18b chore(release): 0.1.0-develop.12 [skip ci]
# [0.1.0-develop.12](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.11...v0.1.0-develop.12) (2023-07-29)
2023-07-29 16:48:05 +00:00
Derrick Hammer 282191379c
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 12:46:46 -04:00
Derrick Hammer 8a54440c21
dep: update module hash 2023-07-29 12:46:42 -04:00
semantic-release-bot 8b4809c20d chore(release): 0.1.0-develop.11 [skip ci]
# [0.1.0-develop.11](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.10...v0.1.0-develop.11) (2023-07-29)
2023-07-29 04:01:36 +00:00
Derrick Hammer fe9765fa83
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 00:00:29 -04:00
Derrick Hammer 48772bb299
dep: update module hash 2023-07-29 00:00:25 -04:00
semantic-release-bot 7eb3b0c4a1 chore(release): 0.1.0-develop.10 [skip ci]
# [0.1.0-develop.10](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.9...v0.1.0-develop.10) (2023-07-24)
2023-07-24 23:00:11 +00:00
Derrick Hammer b1eb37845c
Merge remote-tracking branch 'origin/develop' into develop 2023-07-24 18:59:01 -04:00
Derrick Hammer 3e03e1d4a6
dep: update module hash 2023-07-24 18:58:55 -04:00
semantic-release-bot 7e885c0414 chore(release): 0.1.0-develop.9 [skip ci]
# [0.1.0-develop.9](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.8...v0.1.0-develop.9) (2023-07-23)
2023-07-23 18:58:10 +00:00
Derrick Hammer 742af21ead
Merge remote-tracking branch 'origin/develop' into develop 2023-07-23 14:57:03 -04:00
Derrick Hammer e670c0656c
dep: update module hash 2023-07-23 14:56:59 -04:00
semantic-release-bot d4b58c3b91 chore(release): 0.1.0-develop.8 [skip ci]
# [0.1.0-develop.8](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.7...v0.1.0-develop.8) (2023-07-23)
2023-07-23 17:42:33 +00:00
Derrick Hammer 06a01b5b7c
Merge remote-tracking branch 'origin/develop' into develop 2023-07-23 13:41:30 -04:00
Derrick Hammer 6fb3186352
refactor: have IPFSClient extend NetworkClient 2023-07-23 13:41:18 -04:00
semantic-release-bot 38cb8b2392 chore(release): 0.1.0-develop.7 [skip ci]
# [0.1.0-develop.7](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.6...v0.1.0-develop.7) (2023-07-23)
2023-07-23 16:31:46 +00:00
Derrick Hammer ece86a88e6
Merge remote-tracking branch 'origin/develop' into develop 2023-07-23 12:30:30 -04:00
Derrick Hammer 2d6386298a
dep: update module hash 2023-07-23 12:30:24 -04:00
semantic-release-bot d2b6285638 chore(release): 0.1.0-develop.6 [skip ci]
# [0.1.0-develop.6](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.5...v0.1.0-develop.6) (2023-07-23)
2023-07-23 01:11:40 +00:00
Derrick Hammer 0ef62b88bc
Merge remote-tracking branch 'origin/develop' into develop 2023-07-22 21:10:43 -04:00
Derrick Hammer 5213a9bccd
dep: update module hash 2023-07-22 21:10:39 -04:00
semantic-release-bot 52fb152a5c chore(release): 0.1.0-develop.5 [skip ci]
# [0.1.0-develop.5](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.4...v0.1.0-develop.5) (2023-07-21)
2023-07-21 17:53:49 +00:00
Derrick Hammer 68a17d9ab0
Merge remote-tracking branch 'origin/develop' into develop 2023-07-21 13:52:50 -04:00
Derrick Hammer bb8c3b83c8
dep: update module hash 2023-07-21 13:52:46 -04:00
semantic-release-bot f7843c8a21 chore(release): 0.1.0-develop.4 [skip ci]
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-07-19)
2023-07-19 17:54:51 +00:00
Derrick Hammer 87a0cf52c6
Merge remote-tracking branch 'origin/develop' into develop 2023-07-19 13:53:52 -04:00
Derrick Hammer 24ddc96909
dep: update module hash 2023-07-19 13:53:47 -04:00
semantic-release-bot 6de017f59c chore(release): 0.1.0-develop.3 [skip ci]
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-07-19)
2023-07-19 17:47:23 +00:00
Derrick Hammer 6c906a65ab
Merge remote-tracking branch 'origin/develop' into develop 2023-07-19 13:46:15 -04:00
Derrick Hammer ca1ff4c040
dep: update module hash 2023-07-19 13:46:11 -04:00
semantic-release-bot 8f8ff60a0b chore(release): 0.1.0-develop.2 [skip ci]
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-07-19)
2023-07-19 17:33:44 +00:00
Derrick Hammer afe6c9c4b8
Merge remote-tracking branch 'origin/develop' into develop 2023-07-19 13:32:48 -04:00
Derrick Hammer 7eccec5df9
dep: update module hash 2023-07-19 13:32:29 -04:00
semantic-release-bot 8f2ae2aadd chore(release): 0.1.0-develop.1 [skip ci]
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.0.2-develop.1...v0.1.0-develop.1) (2023-07-19)

### Features

* add register method for network registry ([e9c9944](e9c9944003))
2023-07-19 17:06:12 +00:00
Derrick Hammer 4e34b589d9
Merge remote-tracking branch 'origin/develop' into develop 2023-07-19 13:04:58 -04:00
Derrick Hammer e9c9944003
feat: add register method for network registry 2023-07-19 13:04:48 -04:00
Derrick Hammer 93a1e7e884
dep: update module hash 2023-07-19 13:02:53 -04:00
Derrick Hammer 20bc173aae
dep: update libkernel 2023-07-19 13:02:47 -04:00
semantic-release-bot 7255ee7b86 chore(release): 0.0.2-develop.1 [skip ci]
## [0.0.2-develop.1](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.0.1...v0.0.2-develop.1) (2023-07-14)
2023-07-14 09:03:29 +00:00
Derrick Hammer 440fddda34
ci: setup 2023-07-14 05:02:13 -04:00
Derrick Hammer be8591985a
chore: update README.md 2023-07-14 05:01:03 -04:00
Derrick Hammer 7fc2375fa2
dep: update module hash 2023-07-14 04:58:45 -04:00
Derrick Hammer 2ee6531298
refactor: move to new build system and sdks 2023-07-14 04:55:44 -04:00
11 changed files with 19791 additions and 127 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

5
.presetterrc.json Normal file
View File

@ -0,0 +1,5 @@
{
"preset": [
"@lumeweb/node-library-preset"
]
}

55
CHANGELOG.md Normal file
View File

@ -0,0 +1,55 @@
# [0.1.0-develop.22](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.21...v0.1.0-develop.22) (2023-09-02)
# [0.1.0-develop.21](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.20...v0.1.0-develop.21) (2023-07-31)
# [0.1.0-develop.20](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.19...v0.1.0-develop.20) (2023-07-30)
# [0.1.0-develop.19](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.18...v0.1.0-develop.19) (2023-07-30)
# [0.1.0-develop.18](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.17...v0.1.0-develop.18) (2023-07-29)
# [0.1.0-develop.17](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.16...v0.1.0-develop.17) (2023-07-29)
# [0.1.0-develop.16](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.15...v0.1.0-develop.16) (2023-07-29)
# [0.1.0-develop.15](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.14...v0.1.0-develop.15) (2023-07-29)
### Bug Fixes
* Revert "dep: update module hash" ([cba7b16](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/commit/cba7b1615308a5b5aa9f69c3a64842cb994c7201))
# [0.1.0-develop.14](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.13...v0.1.0-develop.14) (2023-07-29)
# [0.1.0-develop.13](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.12...v0.1.0-develop.13) (2023-07-29)
# [0.1.0-develop.12](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.11...v0.1.0-develop.12) (2023-07-29)
# [0.1.0-develop.11](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.10...v0.1.0-develop.11) (2023-07-29)
# [0.1.0-develop.10](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.9...v0.1.0-develop.10) (2023-07-24)
# [0.1.0-develop.9](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.8...v0.1.0-develop.9) (2023-07-23)
# [0.1.0-develop.8](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.7...v0.1.0-develop.8) (2023-07-23)
# [0.1.0-develop.7](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.6...v0.1.0-develop.7) (2023-07-23)
# [0.1.0-develop.6](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.5...v0.1.0-develop.6) (2023-07-23)
# [0.1.0-develop.5](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.4...v0.1.0-develop.5) (2023-07-21)
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-07-19)
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-07-19)
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-07-19)
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.0.2-develop.1...v0.1.0-develop.1) (2023-07-19)
### Features
* add register method for network registry ([e9c9944](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/commit/e9c994400325467fb2c146f4f5b3bea1a77d6502))
## [0.0.2-develop.1](https://git.lumeweb.com/LumeWeb/kernel-ipfs-client/compare/v0.0.1...v0.0.2-develop.1) (2023-07-14)

View File

@ -1,2 +1,2 @@
# kernel-ipfs-http-client
IPFS client interface to @lumeweb/kernel-ipfs-http module
# kernel-ipfs-client
IPFS client interface to @lumeweb/kernel-ipfs module

18
dist/index.d.ts vendored
View File

@ -1,18 +0,0 @@
import { Client } from "@lumeweb/libkernel-universal";
import { CatOptions, LsOptions, StatOptions } from "@helia/unixfs";
interface AbortableGenerator {
abort: () => void;
iterable: () => AsyncIterable<Uint8Array>;
}
export declare class IPFSClient extends Client {
ready(): Promise<any>;
stat(cid: string, options?: Partial<StatOptions>): Promise<any>;
ls(cid: string, options?: Partial<LsOptions>): AbortableGenerator;
cat(cid: string, options?: Partial<CatOptions>): AbortableGenerator;
ipns(cid: string): Promise<string>;
activePeers(): Promise<number>;
private connectModuleGenerator;
}
export declare const createClient: (...args: any) => IPFSClient;
export {};
//# sourceMappingURL=index.d.ts.map

1
dist/index.d.ts.map vendored
View File

@ -1 +0,0 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEnE,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,aAAa,CAAC,UAAU,CAAC,CAAC;CAC3C;AAED,qBAAa,UAAW,SAAQ,MAAM;IACvB,KAAK;IAIL,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;IAItD,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,kBAAkB;IAIjE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,kBAAkB;IAI7D,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIlC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C,OAAO,CAAC,sBAAsB;CAiD/B;AAED,eAAO,MAAM,YAAY,8BAGxB,CAAC"}

62
dist/index.js vendored
View File

@ -1,62 +0,0 @@
import { Client, factory } from "@lumeweb/libkernel-universal";
import defer from "p-defer";
export class IPFSClient extends Client {
async ready() {
return this.callModuleReturn("ready");
}
async stat(cid, options) {
return this.callModuleReturn("stat", { cid, options });
}
ls(cid, options) {
return this.connectModuleGenerator("ls", { cid, options });
}
cat(cid, options) {
return this.connectModuleGenerator("cat", { cid, options });
}
async ipns(cid) {
return this.callModuleReturn("ipnsResolve", { cid });
}
async activePeers() {
return this.callModuleReturn("getActivePeers");
}
connectModuleGenerator(method, data) {
let pipe = defer();
const [update, result] = this.connectModule(method, data, (item) => {
pipe.resolve(item);
});
(async () => {
const ret = await result;
this.handleError(ret);
pipe.resolve(undefined);
})();
return {
abort() {
update("abort");
},
iterable() {
return {
[Symbol.asyncIterator]() {
return {
async next() {
const chunk = await pipe.promise;
if (chunk === undefined) {
return {
value: new Uint8Array(),
done: true,
};
}
pipe = defer();
update("next");
return {
value: chunk,
done: false,
};
},
};
},
};
},
};
}
}
export const createClient = factory(IPFSClient, "AAA0F0m8xP2YVcP0YZ-1QT8nLqYPZjgANotOQO3nGST1Bg");

19686
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,31 @@
{
"name": "@lumeweb/kernel-ipfs-client",
"version": "0.1.0",
"version": "0.1.0-develop.22",
"type": "module",
"main": "dist/index.js",
"dependencies": {
"@lumeweb/libkernel-universal": "git+https://git.lumeweb.com/LumeWeb/libkernel-universal.git",
"libkernel": "^0.1.43",
"libkmodule": "^0.2.44",
"p-defer": "^4.0.0"
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "gitea@git.lumeweb.com:LumeWeb/kernel-ipfs-client.git"
},
"devDependencies": {
"@helia/unixfs": "^1.2.1",
"@types/node": "^18.0.6",
"prettier": "^2.7.1",
"typescript": "^5.0.3"
"@helia/unixfs": "^1.4.0",
"@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.38",
"p-defer": "^4.0.0"
},
"files": [
"lib"
],
"publishConfig": {
"access": "public"
}
}

View File

@ -1,4 +1,4 @@
import { Client, factory } from "@lumeweb/libkernel-universal";
import { Client, factory, NetworkClient } from "@lumeweb/libkernel/module";
import defer from "p-defer";
import { CatOptions, LsOptions, StatOptions } from "@helia/unixfs";
@ -7,11 +7,10 @@ interface AbortableGenerator {
iterable: () => AsyncIterable<Uint8Array>;
}
export class IPFSClient extends Client {
public async ready() {
return this.callModuleReturn("ready");
}
export const MODULE =
"z3o47iXr8DSRHot9iFsqoWRQjXkGbDuFVt1LqMYWpcvJMqq3t2qkePnYG8MM";
export class IPFSClient extends NetworkClient {
public async stat(cid: string, options?: Partial<StatOptions>) {
return this.callModuleReturn("stat", { cid, options });
}
@ -34,7 +33,7 @@ export class IPFSClient extends Client {
private connectModuleGenerator(
method: string,
data: any
data: any,
): AbortableGenerator {
let pipe = defer<Uint8Array>();
@ -83,7 +82,4 @@ export class IPFSClient extends Client {
}
}
export const createClient = factory<IPFSClient>(
IPFSClient,
"AAA0F0m8xP2YVcP0YZ-1QT8nLqYPZjgANotOQO3nGST1Bg"
);
export const createClient = factory<IPFSClient>(IPFSClient, MODULE);

View File

@ -1,23 +0,0 @@
{
"compilerOptions": {
"declaration": true,
"strict": true,
"module": "esnext",
"target": "esnext",
"esModuleInterop": true,
"sourceMap": false,
"rootDir": "src",
"outDir": "dist",
"typeRoots": [
"node_modules/@types",
],
"moduleResolution": "node",
"declarationMap": true,
"declarationDir": "dist",
"emitDeclarationOnly": false,
"allowJs": true
},
"include": [
"src"
]
}