@wovin/connect-nftstorage 0.0.10 → 0.0.11

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 s,b as f}from"./chunk-CMDKOQ7H.min.js";import{a,b as n,c,d as p}from"./chunk-2QFX3P3I.min.js";import{e as i}from"./chunk-BKKH6BET.min.js";var{WARN:l,LOG:v,DEBUG:m,VERBOSE:d,ERROR:y}=i.setup(i.DEBUG),u=class D{constructor(r,t,e,o){this.serviceDID=r;this.apiKey=t;this.keypair=e;this.rootUcan=o;if(!(t||e&&o))throw new Error("Needs apiKey - or keypair and rootUcan")}static async init({apiKey:r,keypair:t,rootUcan:e}){return m("Init NFT.Storage connector:",{apiKey:r,keypair:t,serviceDID:null}),new D(null,r,t,e)}get isSetup(){return!0}get isValid(){return!0}async storeCar(r){if(this.apiKey&&!this.keypair)return a(r,this.apiKey);if(!this.serviceDID){let{value:t}=await(await fetch("https://api.nft.storage/did")).json();this.serviceDID=t}for(let t=1;t<3;t++)try{this.rootUcan||(await c(this.apiKey,this.keypair.did()),this.rootUcan=await p(this.apiKey));let e=await n(this.keypair,this.serviceDID,this.rootUcan);return a(r,e)}catch(e){if(y("[nft-connector.storeCar] error:",e),e.message?.contains?.("ERROR_TOKEN_NOT_FOUND"))l(`Token not found (might be a race condition) (attempt=${t}):`,e);else throw e}}getGateway(){return{url:s}}};export{s as NFTSTORAGE_GATEWAY,u as NftStorageConnector,f as retrieveThread};
1
+ import{a as s,b as f}from"./chunk-ZPBUA66Z.min.js";import{a,b as n,c,d as p}from"./chunk-2QFX3P3I.min.js";import{e as i}from"./chunk-BKKH6BET.min.js";var{WARN:l,LOG:v,DEBUG:m,VERBOSE:d,ERROR:y}=i.setup(i.DEBUG),u=class D{constructor(r,t,e,o){this.serviceDID=r;this.apiKey=t;this.keypair=e;this.rootUcan=o;if(!(t||e&&o))throw new Error("Needs apiKey - or keypair and rootUcan")}static async init({apiKey:r,keypair:t,rootUcan:e}){return m("Init NFT.Storage connector:",{apiKey:r,keypair:t,serviceDID:null}),new D(null,r,t,e)}get isSetup(){return!0}get isValid(){return!0}async storeCar(r){if(this.apiKey&&!this.keypair)return a(r,this.apiKey);if(!this.serviceDID){let{value:t}=await(await fetch("https://api.nft.storage/did")).json();this.serviceDID=t}for(let t=1;t<3;t++)try{this.rootUcan||(await c(this.apiKey,this.keypair.did()),this.rootUcan=await p(this.apiKey));let e=await n(this.keypair,this.serviceDID,this.rootUcan);return a(r,e)}catch(e){if(y("[nft-connector.storeCar] error:",e),e.message?.contains?.("ERROR_TOKEN_NOT_FOUND"))l(`Token not found (might be a race condition) (attempt=${t}):`,e);else throw e}}getGateway(){return{url:s}}};export{s as NFTSTORAGE_GATEWAY,u as NftStorageConnector,f as retrieveThread};
2
2
  //# sourceMappingURL=index.min.js.map
@@ -1,2 +1,2 @@
1
- import{a,b}from"./chunk-CMDKOQ7H.min.js";import"./chunk-BKKH6BET.min.js";export{a as NFTSTORAGE_GATEWAY,b as retrieveThread};
1
+ import{a,b}from"./chunk-ZPBUA66Z.min.js";import"./chunk-BKKH6BET.min.js";export{a as NFTSTORAGE_GATEWAY,b as retrieveThread};
2
2
  //# sourceMappingURL=retrieve.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wovin/connect-nftstorage",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "main": "./dist/index.min.js",
6
6
  "module": "./dist/index.min.js",
@@ -33,8 +33,8 @@
33
33
  "dependencies": {
34
34
  "@ipld/car": "^5.2.6",
35
35
  "@ucans/ucans": "^0.12.0",
36
- "@wovin/connect-gateway": "0.0.10",
37
- "@wovin/core": "0.0.10",
36
+ "@wovin/connect-gateway": "0.0.11",
37
+ "@wovin/core": "0.0.11",
38
38
  "besonders-logger": "1.0.1",
39
39
  "multiformats": "^13.0.1",
40
40
  "ucan-storage": "^1.3.0"