From 41b98dc0dbc4c96a322bdba8b0219f11137961d9 Mon Sep 17 00:00:00 2001 From: fukaoi Date: Thu, 26 Oct 2023 07:46:08 +0000 Subject: [PATCH] Exec auto commit --- packages/storage/dist/cjs/nft-storage.d.ts | 4 ++-- .../storage/dist/cjs/nft-storage.d.ts.map | 2 +- packages/storage/dist/cjs/nft-storage.js | 8 +++---- packages/storage/dist/cjs/nft-storage.js.map | 2 +- packages/storage/dist/cjs/storage.d.ts | 4 ++-- packages/storage/dist/cjs/storage.js | 20 ++++++++-------- .../storage/dist/cjs/types/bundlr.d.ts.map | 2 +- packages/storage/dist/esm/nft-storage.d.ts | 4 ++-- .../storage/dist/esm/nft-storage.d.ts.map | 2 +- packages/storage/dist/esm/nft-storage.js | 14 +++++------ packages/storage/dist/esm/nft-storage.js.map | 2 +- packages/storage/dist/esm/storage.d.ts | 4 ++-- packages/storage/dist/esm/storage.js | 24 +++++++++---------- .../storage/dist/esm/types/bundlr.d.ts.map | 2 +- 14 files changed, 47 insertions(+), 47 deletions(-) diff --git a/packages/storage/dist/cjs/nft-storage.d.ts b/packages/storage/dist/cjs/nft-storage.d.ts index 8f2c693b9..a7ea9c837 100644 --- a/packages/storage/dist/cjs/nft-storage.d.ts +++ b/packages/storage/dist/cjs/nft-storage.d.ts @@ -1,5 +1,5 @@ -import { Result } from "@solana-suite/shared"; -import { FileContent, InfraSideInput } from "@solana-suite/shared-metaplex"; +import { Result } from '@solana-suite/shared'; +import { FileContent, InfraSideInput } from '@solana-suite/shared-metaplex'; export declare namespace NftStorage { const uploadContent: (filePath: FileContent) => Promise>; /** diff --git a/packages/storage/dist/cjs/nft-storage.d.ts.map b/packages/storage/dist/cjs/nft-storage.d.ts.map index e6b7b1825..b739c8e2f 100644 --- a/packages/storage/dist/cjs/nft-storage.d.ts.map +++ b/packages/storage/dist/cjs/nft-storage.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"nft-storage.d.ts","sourceRoot":"","sources":["../../src/nft-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,EAEP,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE5E,yBAAiB,UAAU,CAAC;IA4BnB,MAAM,aAAa,aACd,WAAW,KACpB,QAAQ,OAAO,MAAM,EAAE,KAAK,CAAC,CAgB/B,CAAC;IAEF;;;;;;;;;;;;;;;;;OAiBG;IACI,MAAM,cAAc,aACf,eAAe,QAAQ,KAChC,QAAQ,OAAO,MAAM,EAAE,KAAK,CAAC,CAQ/B,CAAC;CACH"} \ No newline at end of file +{"version":3,"file":"nft-storage.d.ts","sourceRoot":"","sources":["../../src/nft-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,MAAM,EAAO,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE5E,yBAAiB,UAAU,CAAC;IA4BnB,MAAM,aAAa,aACd,WAAW,KACpB,QAAQ,OAAO,MAAM,EAAE,KAAK,CAAC,CAgB/B,CAAC;IAEF;;;;;;;;;;;;;;;;;OAiBG;IACI,MAAM,cAAc,aACf,eAAe,QAAQ,KAChC,QAAQ,OAAO,MAAM,EAAE,KAAK,CAAC,CAQ/B,CAAC;CACH"} \ No newline at end of file diff --git a/packages/storage/dist/cjs/nft-storage.js b/packages/storage/dist/cjs/nft-storage.js index 426e6daa2..1f53541e0 100644 --- a/packages/storage/dist/cjs/nft-storage.js +++ b/packages/storage/dist/cjs/nft-storage.js @@ -62,16 +62,16 @@ var NftStorage; const connect = () => new nft_storage_1.NFTStorage({ token: getNftStorageApiKey() }); NftStorage.uploadContent = (filePath) => __awaiter(this, void 0, void 0, function* () { return (0, shared_1.Try)(() => __awaiter(this, void 0, void 0, function* () { - (0, shared_1.debugLog)("# upload content: ", filePath); + (0, shared_1.debugLog)('# upload content: ', filePath); let file; if (provenance_layer_1.ProvenanceLayer.isNodeable(filePath)) { - file = (yield Promise.resolve().then(() => __importStar(require("fs")))).readFileSync(filePath); + file = (yield Promise.resolve().then(() => __importStar(require('fs')))).readFileSync(filePath); } else if (provenance_layer_1.ProvenanceLayer.isBrowserable(filePath)) { file = Buffer.from(yield filePath.arrayBuffer()); } else { - throw Error("Supported environment: only Node.js and Browser js"); + throw Error('Supported environment: only Node.js and Browser js'); } const blobImage = new nft_storage_1.Blob([file]); const res = yield connect().storeBlob(blobImage); @@ -98,7 +98,7 @@ var NftStorage; */ NftStorage.uploadMetadata = (metadata) => __awaiter(this, void 0, void 0, function* () { return (0, shared_1.Try)(() => __awaiter(this, void 0, void 0, function* () { - (0, shared_1.debugLog)("# upload metadata: ", metadata); + (0, shared_1.debugLog)('# upload metadata: ', metadata); const blobJson = new nft_storage_1.Blob([JSON.stringify(metadata)]); const res = yield connect().storeBlob(blobJson); return createGatewayUrl(res); diff --git a/packages/storage/dist/cjs/nft-storage.js.map b/packages/storage/dist/cjs/nft-storage.js.map index a1e60889f..504be5198 100644 --- a/packages/storage/dist/cjs/nft-storage.js.map +++ b/packages/storage/dist/cjs/nft-storage.js.map @@ -1 +1 @@ -{"version":3,"file":"nft-storage.js","sourceRoot":"","sources":["../../src/nft-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+C;AAC/C,iDAK8B;AAC9B,yDAAqD;AAGrD,IAAiB,UAAU,CA6E1B;AA7ED,WAAiB,UAAU;IACzB,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,MAAM,mBAAmB,GAAG,GAAW,EAAE;QACvC,IAAI,CAAC,kBAAS,CAAC,gBAAgB,EAAE;YAC/B,IAAI,CAAC,gBAAgB,EAAE;gBACrB,OAAO,CAAC,IAAI,CACV;;;;;;;SAOD,CACA,CAAC;gBACF,gBAAgB,GAAG,IAAI,CAAC;aACzB;YACD,OAAO,kBAAS,CAAC,mBAAmB,CAAC;SACtC;aAAM;YACL,OAAO,kBAAS,CAAC,gB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cjs/storage.d.ts b/packages/storage/dist/cjs/storage.d.ts index 295d7ce32..4b3cbc79d 100644 --- a/packages/storage/dist/cjs/storage.d.ts +++ b/packages/storage/dist/cjs/storage.d.ts @@ -1,5 +1,5 @@ -import { Result, Secret } from "@solana-suite/shared"; -import { FileContent, InfraSideInput, StorageType, UserSideInput } from "@solana-suite/shared-metaplex"; +import { Result, Secret } from '@solana-suite/shared'; +import { FileContent, InfraSideInput, StorageType, UserSideInput } from '@solana-suite/shared-metaplex'; export declare namespace Storage { const toConvertOffchaindata: (input: UserSideInput.NftMetadata, sellerFeeBasisPoints: number) => InfraSideInput.Offchain; const uploadContent: (filePath: FileContent, storageType: StorageType, feePayer?: Secret) => Promise>; diff --git a/packages/storage/dist/cjs/storage.js b/packages/storage/dist/cjs/storage.js index e5cfd32ca..98ab11e92 100644 --- a/packages/storage/dist/cjs/storage.js +++ b/packages/storage/dist/cjs/storage.js @@ -23,30 +23,30 @@ var Storage; external_url: input.external_url, attributes: input.attributes, properties: input.properties, - image: "", + image: '', options: input.options, }; return data; }; Storage.uploadContent = (filePath, storageType, feePayer) => __awaiter(this, void 0, void 0, function* () { - if (storageType === "arweave") { + if (storageType === 'arweave') { if (!feePayer) { - throw Error("Arweave needs to have feepayer"); + throw Error('Arweave needs to have feepayer'); } return yield arweave_1.Arweave.uploadFile(filePath, feePayer); } - else if (storageType === "nftStorage") { + else if (storageType === 'nftStorage') { return yield nft_storage_1.NftStorage.uploadContent(filePath); } else { - throw Error("Not found storageType"); + throw Error('Not found storageType'); } }); Storage.uploadMetaAndContent = (input, filePath, storageType, feePayer) => __awaiter(this, void 0, void 0, function* () { let storage; - if (storageType === "arweave") { + if (storageType === 'arweave') { if (!feePayer) { - throw Error("Arweave needs to have feepayer"); + throw Error('Arweave needs to have feepayer'); } storage = yield (yield arweave_1.Arweave.uploadFile(filePath, feePayer)).unwrap((ok) => __awaiter(this, void 0, void 0, function* () { input.image = ok; @@ -55,7 +55,7 @@ var Storage; throw err; }); } - else if (storageType === "nftStorage") { + else if (storageType === 'nftStorage') { storage = yield (yield nft_storage_1.NftStorage.uploadContent(filePath)).unwrap((ok) => __awaiter(this, void 0, void 0, function* () { input.image = ok; return yield nft_storage_1.NftStorage.uploadMetadata(input); @@ -64,10 +64,10 @@ var Storage; }); } else { - throw Error("No match storageType"); + throw Error('No match storageType'); } if (!storage) { - throw Error("Empty storage object"); + throw Error('Empty storage object'); } return storage; }); diff --git a/packages/storage/dist/cjs/types/bundlr.d.ts.map b/packages/storage/dist/cjs/types/bundlr.d.ts.map index 560cff963..980af1df9 100644 --- a/packages/storage/dist/cjs/types/bundlr.d.ts.map +++ b/packages/storage/dist/cjs/types/bundlr.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"bundlr.d.ts","sourceRoot":"","sources":["../../../src/types/bundlr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,EAAE,SAAS,CAAA;CAErB,CAAC"} \ No newline at end of file +{"version":3,"file":"bundlr.d.ts","sourceRoot":"","sources":["../../../src/types/bundlr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,EAAE,SAAS,CAAC;CAEtB,CAAC"} \ No newline at end of file diff --git a/packages/storage/dist/esm/nft-storage.d.ts b/packages/storage/dist/esm/nft-storage.d.ts index 8f2c693b9..a7ea9c837 100644 --- a/packages/storage/dist/esm/nft-storage.d.ts +++ b/packages/storage/dist/esm/nft-storage.d.ts @@ -1,5 +1,5 @@ -import { Result } from "@solana-suite/shared"; -import { FileContent, InfraSideInput } from "@solana-suite/shared-metaplex"; +import { Result } from '@solana-suite/shared'; +import { FileContent, InfraSideInput } from '@solana-suite/shared-metaplex'; export declare namespace NftStorage { const uploadContent: (filePath: FileContent) => Promise>; /** diff --git a/packages/storage/dist/esm/nft-storage.d.ts.map b/packages/storage/dist/esm/nft-storage.d.ts.map index e6b7b1825..b739c8e2f 100644 --- a/packages/storage/dist/esm/nft-storage.d.ts.map +++ b/packages/storage/dist/esm/nft-storage.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"nft-storage.d.ts","sourceRoot":"","sources":["../../src/nft-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,EAEP,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE5E,yBAAiB,UAAU,CAAC;IA4BnB,MAAM,aAAa,aACd,WAAW,KACpB,QAAQ,OAAO,MAAM,EAAE,KAAK,CAAC,CAgB/B,CAAC;IAEF;;;;;;;;;;;;;;;;;OAiBG;IACI,MAAM,cAAc,aACf,eAAe,QAAQ,KAChC,QAAQ,OAAO,MAAM,EAAE,KAAK,CAAC,CAQ/B,CAAC;CACH"} \ No newline at end of file +{"version":3,"file":"nft-storage.d.ts","sourceRoot":"","sources":["../../src/nft-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,MAAM,EAAO,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE5E,yBAAiB,UAAU,CAAC;IA4BnB,MAAM,aAAa,aACd,WAAW,KACpB,QAAQ,OAAO,MAAM,EAAE,KAAK,CAAC,CAgB/B,CAAC;IAEF;;;;;;;;;;;;;;;;;OAiBG;IACI,MAAM,cAAc,aACf,eAAe,QAAQ,KAChC,QAAQ,OAAO,MAAM,EAAE,KAAK,CAAC,CAQ/B,CAAC;CACH"} \ No newline at end of file diff --git a/packages/storage/dist/esm/nft-storage.js b/packages/storage/dist/esm/nft-storage.js index ec75b95b0..0c7c5f9c7 100644 --- a/packages/storage/dist/esm/nft-storage.js +++ b/packages/storage/dist/esm/nft-storage.js @@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -import { Blob, NFTStorage } from "nft.storage"; -import { Constants, debugLog, Try, } from "@solana-suite/shared"; -import { ProvenanceLayer } from "./provenance-layer"; +import { Blob, NFTStorage } from 'nft.storage'; +import { Constants, debugLog, Try } from '@solana-suite/shared'; +import { ProvenanceLayer } from './provenance-layer'; export var NftStorage; (function (NftStorage) { let isDisplayWarning = false; @@ -36,16 +36,16 @@ export var NftStorage; const connect = () => new NFTStorage({ token: getNftStorageApiKey() }); NftStorage.uploadContent = (filePath) => __awaiter(this, void 0, void 0, function* () { return Try(() => __awaiter(this, void 0, void 0, function* () { - debugLog("# upload content: ", filePath); + debugLog('# upload content: ', filePath); let file; if (ProvenanceLayer.isNodeable(filePath)) { - file = (yield import("fs")).readFileSync(filePath); + file = (yield import('fs')).readFileSync(filePath); } else if (ProvenanceLayer.isBrowserable(filePath)) { file = Buffer.from(yield filePath.arrayBuffer()); } else { - throw Error("Supported environment: only Node.js and Browser js"); + throw Error('Supported environment: only Node.js and Browser js'); } const blobImage = new Blob([file]); const res = yield connect().storeBlob(blobImage); @@ -72,7 +72,7 @@ export var NftStorage; */ NftStorage.uploadMetadata = (metadata) => __awaiter(this, void 0, void 0, function* () { return Try(() => __awaiter(this, void 0, void 0, function* () { - debugLog("# upload metadata: ", metadata); + debugLog('# upload metadata: ', metadata); const blobJson = new Blob([JSON.stringify(metadata)]); const res = yield connect().storeBlob(blobJson); return createGatewayUrl(res); diff --git a/packages/storage/dist/esm/nft-storage.js.map b/packages/storage/dist/esm/nft-storage.js.map index 5ec36b061..f5445cac7 100644 --- a/packages/storage/dist/esm/nft-storage.js.map +++ b/packages/storage/dist/esm/nft-storage.js.map @@ -1 +1 @@ -{"version":3,"file":"nft-storage.js","sourceRoot":"","sources":["../../src/nft-storage.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,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EF;;;;;;;;;;;;;;;;;OAiBG;IACU,yBAAc,GAAG,CAC5B,QAAiC,EACD,EAAE;QAClC,OAAO,GAAG,CAAC,GAAS,EAAE;YACpB,QAAQ,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;YAE1C,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACtD,MAAM,GAAG,GAAG,MAAM,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAChD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC,EA7EgB,UAAU,KAAV,UAAU,QA6E1B"} \ No newline at end of file diff --git a/packages/storage/dist/esm/storage.d.ts b/packages/storage/dist/esm/storage.d.ts index 295d7ce32..4b3cbc79d 100644 --- a/packages/storage/dist/esm/storage.d.ts +++ b/packages/storage/dist/esm/storage.d.ts @@ -1,5 +1,5 @@ -import { Result, Secret } from "@solana-suite/shared"; -import { FileContent, InfraSideInput, StorageType, UserSideInput } from "@solana-suite/shared-metaplex"; +import { Result, Secret } from '@solana-suite/shared'; +import { FileContent, InfraSideInput, StorageType, UserSideInput } from '@solana-suite/shared-metaplex'; export declare namespace Storage { const toConvertOffchaindata: (input: UserSideInput.NftMetadata, sellerFeeBasisPoints: number) => InfraSideInput.Offchain; const uploadContent: (filePath: FileContent, storageType: StorageType, feePayer?: Secret) => Promise>; diff --git a/packages/storage/dist/esm/storage.js b/packages/storage/dist/esm/storage.js index 058450961..fd90ef2b6 100644 --- a/packages/storage/dist/esm/storage.js +++ b/packages/storage/dist/esm/storage.js @@ -7,8 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -import { Arweave } from "./arweave"; -import { NftStorage } from "./nft-storage"; +import { Arweave } from './arweave'; +import { NftStorage } from './nft-storage'; export var Storage; (function (Storage) { Storage.toConvertOffchaindata = (input, sellerFeeBasisPoints) => { @@ -20,30 +20,30 @@ export var Storage; external_url: input.external_url, attributes: input.attributes, properties: input.properties, - image: "", + image: '', options: input.options, }; return data; }; Storage.uploadContent = (filePath, storageType, feePayer) => __awaiter(this, void 0, void 0, function* () { - if (storageType === "arweave") { + if (storageType === 'arweave') { if (!feePayer) { - throw Error("Arweave needs to have feepayer"); + throw Error('Arweave needs to have feepayer'); } return yield Arweave.uploadFile(filePath, feePayer); } - else if (storageType === "nftStorage") { + else if (storageType === 'nftStorage') { return yield NftStorage.uploadContent(filePath); } else { - throw Error("Not found storageType"); + throw Error('Not found storageType'); } }); Storage.uploadMetaAndContent = (input, filePath, storageType, feePayer) => __awaiter(this, void 0, void 0, function* () { let storage; - if (storageType === "arweave") { + if (storageType === 'arweave') { if (!feePayer) { - throw Error("Arweave needs to have feepayer"); + throw Error('Arweave needs to have feepayer'); } storage = yield (yield Arweave.uploadFile(filePath, feePayer)).unwrap((ok) => __awaiter(this, void 0, void 0, function* () { input.image = ok; @@ -52,7 +52,7 @@ export var Storage; throw err; }); } - else if (storageType === "nftStorage") { + else if (storageType === 'nftStorage') { storage = yield (yield NftStorage.uploadContent(filePath)).unwrap((ok) => __awaiter(this, void 0, void 0, function* () { input.image = ok; return yield NftStorage.uploadMetadata(input); @@ -61,10 +61,10 @@ export var Storage; }); } else { - throw Error("No match storageType"); + throw Error('No match storageType'); } if (!storage) { - throw Error("Empty storage object"); + throw Error('Empty storage object'); } return storage; }); diff --git a/packages/storage/dist/esm/types/bundlr.d.ts.map b/packages/storage/dist/esm/types/bundlr.d.ts.map index 560cff963..980af1df9 100644 --- a/packages/storage/dist/esm/types/bundlr.d.ts.map +++ b/packages/storage/dist/esm/types/bundlr.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"bundlr.d.ts","sourceRoot":"","sources":["../../../src/types/bundlr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,EAAE,SAAS,CAAA;CAErB,CAAC"} \ No newline at end of file +{"version":3,"file":"bundlr.d.ts","sourceRoot":"","sources":["../../../src/types/bundlr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,EAAE,SAAS,CAAC;CAEtB,CAAC"} \ No newline at end of file