@wovin/connect-nftstorage 0.0.1 → 0.0.3-RC1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as D,b as h,c as o}from"./chunk-NGDKLL6Y.min.js";import{a as i,b as n,c as s,d as c,e as p}from"./chunk-Q7RF3VV2.min.js";import{e as a}from"./chunk-ZATDQB6W.min.js";var{WARN:y,LOG:f,DEBUG:v,VERBOSE:w,ERROR:C}=a.setup(a.DEBUG),m=class u{constructor(e,r,t,g){this.keypair=e;this.serviceDID=r;this.apiKey=t;this.rootUcan=g}static async init({apiKey:e,keypair:r}){let{value:t}=await(await fetch("https://api.nft.storage/did")).json();return r||(r=await i.create()),f("Init NFT.Storage connector:",{serviceDID:t,keypair:r}),new u(r,t,e,null)}async storeCar(e){for(let r=0;r<3;r++)try{this.rootUcan||(await c(this.apiKey,this.keypair.did()),this.rootUcan=await p(this.apiKey));let t=await s(this.keypair,this.serviceDID,this.rootUcan);return n(e,t)}catch(t){if(t.message?.contains?.("ERROR_TOKEN_NOT_FOUND"))y("Token not found (might be a race condition), retrying...",t);else throw t}}async retrieveCar(e){return o(e)}};export{m as NftStorageConnector,h as resolveIPNS,o as retrieveCar,D as retrievePubStream};
1
+ import{a as D,b as h,c as o}from"./chunk-NGDKLL6Y.min.js";import{a as i,b as n,c as s,d as c,e as p}from"./chunk-ZCSMRYJN.min.js";import{e as a}from"./chunk-ZATDQB6W.min.js";var{WARN:y,LOG:f,DEBUG:v,VERBOSE:w,ERROR:C}=a.setup(a.DEBUG),m=class u{constructor(e,r,t,g){this.keypair=e;this.serviceDID=r;this.apiKey=t;this.rootUcan=g}static async init({apiKey:e,keypair:r}){let{value:t}=await(await fetch("https://api.nft.storage/did")).json();return r||(r=await i.create()),f("Init NFT.Storage connector:",{serviceDID:t,keypair:r}),new u(r,t,e,null)}async storeCar(e){for(let r=0;r<3;r++)try{this.rootUcan||(await c(this.apiKey,this.keypair.did()),this.rootUcan=await p(this.apiKey));let t=await s(this.keypair,this.serviceDID,this.rootUcan);return n(e,t)}catch(t){if(t.message?.contains?.("ERROR_TOKEN_NOT_FOUND"))y("Token not found (might be a race condition), retrying...",t);else throw t}}async retrieveCar(e){return o(e)}};export{m as NftStorageConnector,h as resolveIPNS,o as retrieveCar,D as retrievePubStream};
2
2
  //# sourceMappingURL=index.min.js.map
package/dist/store.min.js CHANGED
@@ -1,2 +1,2 @@
1
- import{b as a,c as b,d as c,e as d}from"./chunk-Q7RF3VV2.min.js";import"./chunk-ZATDQB6W.min.js";export{b as createRequestToken,d as getRootUcan,c as registerDid,a as storeCar};
1
+ import{b as a,c as b,d as c,e as d}from"./chunk-ZCSMRYJN.min.js";import"./chunk-ZATDQB6W.min.js";export{b as createRequestToken,d as getRootUcan,c as registerDid,a as storeCar};
2
2
  //# sourceMappingURL=store.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wovin/connect-nftstorage",
3
- "version": "0.0.1",
3
+ "version": "0.0.3-RC1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "rm -rf dist/ && concurrently \"pnpm build:code\" \"pnpm build:types\"",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@ipld/car": "^5.2.4",
34
34
  "@ucans/ucans": "^0.12.0",
35
- "@wovin/core": "0.0.1",
35
+ "@wovin/core": "0.0.3-RC1",
36
36
  "besonders-logger": "1.0.0-RC11",
37
37
  "multiformats": "^12.1.3",
38
38
  "ucan-storage": "^1.3.0"