@lumeweb/pinner 0.1.8 → 0.1.10
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/esm/adapters/pinata/legacy/adapter.js +16 -4
- package/dist/esm/adapters/pinata/legacy/adapter.js.map +1 -1
- package/dist/esm/adapters/pinata/v2/adapter.js +4 -0
- package/dist/esm/adapters/pinata/v2/adapter.js.map +1 -1
- package/dist/esm/api/generated/content/content.msw.d.ts +7 -2
- package/dist/esm/api/generated/content/content.msw.js +31 -3
- package/dist/esm/api/generated/content/content.msw.js.map +1 -1
- package/dist/esm/api/generated/internal/internal.msw.js +4 -0
- package/dist/esm/api/generated/internal/internal.msw.js.map +1 -1
- package/dist/esm/api/generated/ipns/ipns.msw.js +16 -1
- package/dist/esm/api/generated/ipns/ipns.msw.js.map +1 -1
- package/dist/esm/api/generated/schemas/iPNSKeyListResponse.d.ts +2 -0
- package/dist/esm/api/generated/schemas/iPNSKeyResponse.d.ts +2 -0
- package/dist/esm/api/generated/schemas/postUploadResponse.d.ts +42 -0
- package/dist/esm/api/generated/schemas/uploadResultResponse.d.ts +44 -0
- package/dist/esm/api/generated/schemas/websiteItem.d.ts +1 -0
- package/dist/esm/api/generated/schemas/websiteResponse.d.ts +1 -0
- package/dist/esm/api/generated/websites/websites.msw.js +20 -0
- package/dist/esm/api/generated/websites/websites.msw.js.map +1 -1
- package/dist/esm/api/mocks.d.ts +2 -2
- package/dist/esm/api/mocks.js +2 -2
- package/dist/esm/types/upload.d.ts +3 -1
- package/dist/esm/types/upload.js.map +1 -1
- package/dist/esm/upload/base-upload.js +27 -0
- package/dist/esm/upload/base-upload.js.map +1 -1
- package/dist/esm/upload/manager.d.ts +1 -0
- package/dist/esm/upload/manager.js +52 -13
- package/dist/esm/upload/manager.js.map +1 -1
- package/dist/esm/upload/tus-upload.js +4 -37
- package/dist/esm/upload/tus-upload.js.map +1 -1
- package/dist/esm/upload/xhr-upload.js +3 -14
- package/dist/esm/upload/xhr-upload.js.map +1 -1
- package/package.json +2 -2
|
@@ -15,10 +15,16 @@ function pinataLegacyAdapter(pinner, config) {
|
|
|
15
15
|
* Pin a file to IPFS
|
|
16
16
|
*/
|
|
17
17
|
async pinFileToIPFS(file, options) {
|
|
18
|
-
|
|
18
|
+
const result = await pinner.uploadAndWait(file, {
|
|
19
19
|
name: options?.metadata?.name,
|
|
20
20
|
keyvalues: options?.metadata?.keyvalues
|
|
21
|
-
})
|
|
21
|
+
});
|
|
22
|
+
if (!result.cid) throw new Error("Upload result has no CID yet — use waitForOperation() to poll for the CID");
|
|
23
|
+
return createUploadResponse({
|
|
24
|
+
cid: result.cid,
|
|
25
|
+
size: result.size,
|
|
26
|
+
createdAt: result.createdAt
|
|
27
|
+
}, file.name);
|
|
22
28
|
},
|
|
23
29
|
/**
|
|
24
30
|
* Pin JSON data to IPFS
|
|
@@ -26,10 +32,16 @@ function pinataLegacyAdapter(pinner, config) {
|
|
|
26
32
|
async pinJSONToIPFS(data, options) {
|
|
27
33
|
const jsonString = JSON.stringify(data);
|
|
28
34
|
const file = new File([jsonString], options?.metadata?.name || "data.json", { type: "application/json" });
|
|
29
|
-
|
|
35
|
+
const result = await pinner.uploadAndWait(file, {
|
|
30
36
|
name: options?.metadata?.name,
|
|
31
37
|
keyvalues: options?.metadata?.keyvalues
|
|
32
|
-
})
|
|
38
|
+
});
|
|
39
|
+
if (!result.cid) throw new Error("Upload result has no CID yet — use waitForOperation() to poll for the CID");
|
|
40
|
+
return createUploadResponse({
|
|
41
|
+
cid: result.cid,
|
|
42
|
+
size: result.size,
|
|
43
|
+
createdAt: result.createdAt
|
|
44
|
+
}, file.name);
|
|
33
45
|
},
|
|
34
46
|
/**
|
|
35
47
|
* Pin content by CID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","names":[],"sources":["../../../../../src/adapters/pinata/legacy/adapter.ts"],"sourcesContent":["/**\n * Pinata SDK 1.x Legacy Adapter\n * Provides compatibility with Pinata SDK 1.x API\n *\n * Source: https://github.com/PinataCloud/pinata/commit/c141177ff3036e46fa7b95fcc68c159b58817836\n * - src/core/pinataSDK.ts\n * - src/core/types.ts\n *\n * Copyright © 2024 Pinata Cloud Technologies\n * Type definitions and API interfaces adapted from Pinata SDK for compatibility.\n * Original Pinata SDK: https://github.com/PinataCloud/pinata\n */\n\nimport type { Pinner } from \"@/pinner\";\nimport type {\n\tPinataConfig,\n\tUploadResponse,\n\tUploadOptions,\n\tFileListResponse,\n\tFileListQuery,\n\tPinJobResponse,\n\tPinJobQuery,\n\tDeleteResponse,\n\tPinataMetadata,\n\tSignedUrlOptions,\n\tTopAnalyticsQuery,\n\tTopAnalyticsResponse,\n\tTimeIntervalAnalyticsQuery,\n\tTimeIntervalAnalyticsResponse,\n\tSwapCidOptions,\n\tSwapCidResponse,\n\tSwapHistoryOptions,\n} from \"../shared/types\";\nimport { parseCID, createUploadResponse, createFileListItem, createPinJobItem, notSupported } from \"../shared/utils\";\nimport { DEFAULT_GATEWAY } from \"@/types/constants\";\n\n/**\n * Pinata 1.x Legacy Adapter Interface\n * Matches Pinata SDK 1.x API exactly\n */\nexport interface PinataLegacyAdapter {\n\t/**\n\t * Upload a file to IPFS\n\t */\n\tpinFileToIPFS(file: File, options?: UploadOptions): Promise<UploadResponse>;\n\n\t/**\n\t * Upload JSON data to IPFS\n\t */\n\tpinJSONToIPFS(data: any, options?: UploadOptions): Promise<UploadResponse>;\n\n\t/**\n\t * Pin content by CID\n\t */\n\tpinByHash(cid: string, options?: UploadOptions): Promise<UploadResponse>;\n\n\t/**\n\t * List pinned files\n\t */\n\tpinList(query?: FileListQuery): Promise<FileListResponse>;\n\n\t/**\n\t * Unpin content by CID\n\t */\n\tunpin(cid: string): Promise<{ message: string }>;\n\n\t/**\n\t * Update pin metadata\n\t */\n\thashMetadata(cid: string, metadata: Record<string, string>): Promise<{ message: string }>;\n\n\t/**\n\t * Create signed URL for private IPFS files\n\t */\n\tcreateSignedURL(options: SignedUrlOptions): Promise<string>;\n\n\t/**\n\t * Get pin jobs\n\t */\n\tpinJobs(query?: PinJobQuery): Promise<PinJobResponse>;\n\n\t/**\n\t * Get top usage analytics\n\t */\n\ttopUsageAnalytics(query: TopAnalyticsQuery): Promise<TopAnalyticsResponse>;\n\n\t/**\n\t * Get date interval analytics\n\t */\n\tdateIntervalAnalytics(\n\t\tquery: TimeIntervalAnalyticsQuery,\n\t): Promise<TimeIntervalAnalyticsResponse>;\n\n\t/**\n\t * Swap CID\n\t */\n\tswapCid(options: SwapCidOptions): Promise<SwapCidResponse>;\n\n\t/**\n\t * Get swap history\n\t */\n\tswapHistory(options: SwapHistoryOptions): Promise<SwapCidResponse[]>;\n}\n\n/**\n * Create Pinata 1.x Legacy Adapter\n *\n * @param pinner - Pinner client instance\n * @param config - Pinata configuration\n * @returns PinataLegacyAdapter\n */\nexport function pinataLegacyAdapter(\n\tpinner: Pinner,\n\tconfig?: PinataConfig,\n): PinataLegacyAdapter {\n\treturn {\n\t\t/**\n\t\t * Pin a file to IPFS\n\t\t */\n\t\tasync pinFileToIPFS(\n\t\t\tfile: File,\n\t\t\toptions?: UploadOptions,\n\t\t): Promise<UploadResponse> {\n\t\t\tconst result = await pinner.uploadAndWait(file, {\n\t\t\t\tname: options?.metadata?.name,\n\t\t\t\tkeyvalues: options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\treturn createUploadResponse(result, file.name);\n\t\t},\n\n\t\t/**\n\t\t * Pin JSON data to IPFS\n\t\t */\n\t\tasync pinJSONToIPFS(\n\t\t\tdata: any,\n\t\t\toptions?: UploadOptions,\n\t\t): Promise<UploadResponse> {\n\t\t\t// Convert JSON to File\n\t\t\tconst jsonString = JSON.stringify(data);\n\t\t\tconst file = new File(\n\t\t\t\t[jsonString],\n\t\t\t\toptions?.metadata?.name || \"data.json\",\n\t\t\t\t{ type: \"application/json\" },\n\t\t\t);\n\n\t\t\tconst result = await pinner.uploadAndWait(file, {\n\t\t\t\tname: options?.metadata?.name,\n\t\t\t\tkeyvalues: options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\treturn createUploadResponse(result, file.name);\n\t\t},\n\n\t\t/**\n\t\t * Pin content by CID\n\t\t */\n\t\tasync pinByHash(\n\t\t\tcid: string,\n\t\t\toptions?: UploadOptions,\n\t\t): Promise<UploadResponse> {\n\t\t\tconst cidObj = parseCID(cid);\n\t\t\tconst generator = await pinner.pinByHash(cidObj, {\n\t\t\t\tname: options?.metadata?.name,\n\t\t\t\tmetadata: options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\tfor await (const _ of generator) {\n\t\t\t\t// Wait for pin to complete\n\t\t\t}\n\n\t\t\tconst pin = await pinner.getPinStatus(cidObj);\n\t\t\treturn createUploadResponse(\n\t\t\t\t{\n\t\t\t\t\tcid: pin.cid.toString(),\n\t\t\t\t\tsize: pin.size || 0,\n\t\t\t\t\tcreatedAt: pin.created,\n\t\t\t\t},\n\t\t\t\tpin.name || \"\",\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * List pinned files\n\t\t */\n\t\tasync pinList(query?: FileListQuery): Promise<FileListResponse> {\n\t\t\tconst pins = await pinner.listPins({\n\t\t\t\tlimit: query?.limit,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tfiles: pins.map(createFileListItem),\n\t\t\t\tnext_page_token: \"\",\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Unpin content\n\t\t */\n\t\tasync unpin(cid: string): Promise<{ message: string }> {\n\t\t\tawait pinner.unpin(cid);\n\t\t\treturn { message: `Unpinned ${cid}` };\n\t\t},\n\n\t\t/**\n\t\t * Update pin metadata\n\t\t */\n\t\tasync hashMetadata(\n\t\t\tcid: string,\n\t\t\tmetadata: Record<string, string>,\n\t\t): Promise<{ message: string }> {\n\t\t\tawait pinner.setPinMetadata(cid, metadata);\n\t\t\treturn { message: `Updated metadata for ${cid}` };\n\t\t},\n\n\t\t/**\n\t\t * Create signed URL (not fully supported in Pinner)\n\t\t * Returns a gateway URL instead\n\t\t */\n\t\tasync createSignedURL(options: SignedUrlOptions): Promise<string> {\n\t\t\t// Pinner doesn't support signed URLs for private files\n\t\t\t// Return a gateway URL as fallback\n\t\t\tconst gateway = config?.pinataGateway || DEFAULT_GATEWAY;\n\t\t\treturn `${gateway}/ipfs/${options.cid}`;\n\t\t},\n\n\t\t/**\n\t\t * Get pin jobs\n\t\t */\n\t\tasync pinJobs(query?: PinJobQuery): Promise<PinJobResponse> {\n\t\t\tconst pins = await pinner.listPins({\n\t\t\t\tlimit: query?.limit,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\trows: pins.map(createPinJobItem),\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Get top usage analytics (not supported in Pinner)\n\t\t * Returns empty data\n\t\t */\n\t\tasync topUsageAnalytics(\n\t\t\tquery: TopAnalyticsQuery,\n\t\t): Promise<TopAnalyticsResponse> {\n\t\t\t// Pinner doesn't support analytics\n\t\t\treturn {\n\t\t\t\tdata: [],\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Get date interval analytics (not supported in Pinner)\n\t\t * Returns empty data\n\t\t */\n\t\tasync dateIntervalAnalytics(\n\t\t\tquery: TimeIntervalAnalyticsQuery,\n\t\t): Promise<TimeIntervalAnalyticsResponse> {\n\t\t\t// Pinner doesn't support analytics\n\t\t\treturn {\n\t\t\t\ttotal_requests: 0,\n\t\t\t\ttotal_bandwidth: 0,\n\t\t\t\ttime_periods: [],\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Swap CID (not supported in Pinner)\n\t\t * Returns error\n\t\t */\n\t\tasync swapCid(options: SwapCidOptions): Promise<SwapCidResponse> {\n\t\t\tnotSupported(\"Swap CID\");\n\t\t},\n\n\t\t/**\n\t\t * Get swap history (not supported in Pinner)\n\t\t * Returns empty array\n\t\t */\n\t\tasync swapHistory(options: SwapHistoryOptions): Promise<SwapCidResponse[]> {\n\t\t\t// Pinner doesn't support swaps\n\t\t\treturn [];\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;AA+GA,SAAgB,oBACf,QACA,QACsB;AACtB,QAAO;;;;EAIN,MAAM,cACL,MACA,SAC0B;
|
|
1
|
+
{"version":3,"file":"adapter.js","names":[],"sources":["../../../../../src/adapters/pinata/legacy/adapter.ts"],"sourcesContent":["/**\n * Pinata SDK 1.x Legacy Adapter\n * Provides compatibility with Pinata SDK 1.x API\n *\n * Source: https://github.com/PinataCloud/pinata/commit/c141177ff3036e46fa7b95fcc68c159b58817836\n * - src/core/pinataSDK.ts\n * - src/core/types.ts\n *\n * Copyright © 2024 Pinata Cloud Technologies\n * Type definitions and API interfaces adapted from Pinata SDK for compatibility.\n * Original Pinata SDK: https://github.com/PinataCloud/pinata\n */\n\nimport type { Pinner } from \"@/pinner\";\nimport type {\n\tPinataConfig,\n\tUploadResponse,\n\tUploadOptions,\n\tFileListResponse,\n\tFileListQuery,\n\tPinJobResponse,\n\tPinJobQuery,\n\tDeleteResponse,\n\tPinataMetadata,\n\tSignedUrlOptions,\n\tTopAnalyticsQuery,\n\tTopAnalyticsResponse,\n\tTimeIntervalAnalyticsQuery,\n\tTimeIntervalAnalyticsResponse,\n\tSwapCidOptions,\n\tSwapCidResponse,\n\tSwapHistoryOptions,\n} from \"../shared/types\";\nimport { parseCID, createUploadResponse, createFileListItem, createPinJobItem, notSupported } from \"../shared/utils\";\nimport { DEFAULT_GATEWAY } from \"@/types/constants\";\n\n/**\n * Pinata 1.x Legacy Adapter Interface\n * Matches Pinata SDK 1.x API exactly\n */\nexport interface PinataLegacyAdapter {\n\t/**\n\t * Upload a file to IPFS\n\t */\n\tpinFileToIPFS(file: File, options?: UploadOptions): Promise<UploadResponse>;\n\n\t/**\n\t * Upload JSON data to IPFS\n\t */\n\tpinJSONToIPFS(data: any, options?: UploadOptions): Promise<UploadResponse>;\n\n\t/**\n\t * Pin content by CID\n\t */\n\tpinByHash(cid: string, options?: UploadOptions): Promise<UploadResponse>;\n\n\t/**\n\t * List pinned files\n\t */\n\tpinList(query?: FileListQuery): Promise<FileListResponse>;\n\n\t/**\n\t * Unpin content by CID\n\t */\n\tunpin(cid: string): Promise<{ message: string }>;\n\n\t/**\n\t * Update pin metadata\n\t */\n\thashMetadata(cid: string, metadata: Record<string, string>): Promise<{ message: string }>;\n\n\t/**\n\t * Create signed URL for private IPFS files\n\t */\n\tcreateSignedURL(options: SignedUrlOptions): Promise<string>;\n\n\t/**\n\t * Get pin jobs\n\t */\n\tpinJobs(query?: PinJobQuery): Promise<PinJobResponse>;\n\n\t/**\n\t * Get top usage analytics\n\t */\n\ttopUsageAnalytics(query: TopAnalyticsQuery): Promise<TopAnalyticsResponse>;\n\n\t/**\n\t * Get date interval analytics\n\t */\n\tdateIntervalAnalytics(\n\t\tquery: TimeIntervalAnalyticsQuery,\n\t): Promise<TimeIntervalAnalyticsResponse>;\n\n\t/**\n\t * Swap CID\n\t */\n\tswapCid(options: SwapCidOptions): Promise<SwapCidResponse>;\n\n\t/**\n\t * Get swap history\n\t */\n\tswapHistory(options: SwapHistoryOptions): Promise<SwapCidResponse[]>;\n}\n\n/**\n * Create Pinata 1.x Legacy Adapter\n *\n * @param pinner - Pinner client instance\n * @param config - Pinata configuration\n * @returns PinataLegacyAdapter\n */\nexport function pinataLegacyAdapter(\n\tpinner: Pinner,\n\tconfig?: PinataConfig,\n): PinataLegacyAdapter {\n\treturn {\n\t\t/**\n\t\t * Pin a file to IPFS\n\t\t */\n\t\tasync pinFileToIPFS(\n\t\t\tfile: File,\n\t\t\toptions?: UploadOptions,\n\t\t): Promise<UploadResponse> {\n\t\t\tconst result = await pinner.uploadAndWait(file, {\n\t\t\t\tname: options?.metadata?.name,\n\t\t\t\tkeyvalues: options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\tif (!result.cid) {\n\t\t\t\tthrow new Error(\"Upload result has no CID yet — use waitForOperation() to poll for the CID\");\n\t\t\t}\n\n\t\t\treturn createUploadResponse({ cid: result.cid, size: result.size, createdAt: result.createdAt }, file.name);\n\t\t},\n\n\t\t/**\n\t\t * Pin JSON data to IPFS\n\t\t */\n\t\tasync pinJSONToIPFS(\n\t\t\tdata: any,\n\t\t\toptions?: UploadOptions,\n\t\t): Promise<UploadResponse> {\n\t\t\t// Convert JSON to File\n\t\t\tconst jsonString = JSON.stringify(data);\n\t\t\tconst file = new File(\n\t\t\t\t[jsonString],\n\t\t\t\toptions?.metadata?.name || \"data.json\",\n\t\t\t\t{ type: \"application/json\" },\n\t\t\t);\n\n\t\t\tconst result = await pinner.uploadAndWait(file, {\n\t\t\t\tname: options?.metadata?.name,\n\t\t\t\tkeyvalues: options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\tif (!result.cid) {\n\t\t\t\tthrow new Error(\"Upload result has no CID yet — use waitForOperation() to poll for the CID\");\n\t\t\t}\n\n\t\t\treturn createUploadResponse({ cid: result.cid, size: result.size, createdAt: result.createdAt }, file.name);\n\t\t},\n\n\t\t/**\n\t\t * Pin content by CID\n\t\t */\n\t\tasync pinByHash(\n\t\t\tcid: string,\n\t\t\toptions?: UploadOptions,\n\t\t): Promise<UploadResponse> {\n\t\t\tconst cidObj = parseCID(cid);\n\t\t\tconst generator = await pinner.pinByHash(cidObj, {\n\t\t\t\tname: options?.metadata?.name,\n\t\t\t\tmetadata: options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\tfor await (const _ of generator) {\n\t\t\t\t// Wait for pin to complete\n\t\t\t}\n\n\t\t\tconst pin = await pinner.getPinStatus(cidObj);\n\t\t\treturn createUploadResponse(\n\t\t\t\t{\n\t\t\t\t\tcid: pin.cid.toString(),\n\t\t\t\t\tsize: pin.size || 0,\n\t\t\t\t\tcreatedAt: pin.created,\n\t\t\t\t},\n\t\t\t\tpin.name || \"\",\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * List pinned files\n\t\t */\n\t\tasync pinList(query?: FileListQuery): Promise<FileListResponse> {\n\t\t\tconst pins = await pinner.listPins({\n\t\t\t\tlimit: query?.limit,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tfiles: pins.map(createFileListItem),\n\t\t\t\tnext_page_token: \"\",\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Unpin content\n\t\t */\n\t\tasync unpin(cid: string): Promise<{ message: string }> {\n\t\t\tawait pinner.unpin(cid);\n\t\t\treturn { message: `Unpinned ${cid}` };\n\t\t},\n\n\t\t/**\n\t\t * Update pin metadata\n\t\t */\n\t\tasync hashMetadata(\n\t\t\tcid: string,\n\t\t\tmetadata: Record<string, string>,\n\t\t): Promise<{ message: string }> {\n\t\t\tawait pinner.setPinMetadata(cid, metadata);\n\t\t\treturn { message: `Updated metadata for ${cid}` };\n\t\t},\n\n\t\t/**\n\t\t * Create signed URL (not fully supported in Pinner)\n\t\t * Returns a gateway URL instead\n\t\t */\n\t\tasync createSignedURL(options: SignedUrlOptions): Promise<string> {\n\t\t\t// Pinner doesn't support signed URLs for private files\n\t\t\t// Return a gateway URL as fallback\n\t\t\tconst gateway = config?.pinataGateway || DEFAULT_GATEWAY;\n\t\t\treturn `${gateway}/ipfs/${options.cid}`;\n\t\t},\n\n\t\t/**\n\t\t * Get pin jobs\n\t\t */\n\t\tasync pinJobs(query?: PinJobQuery): Promise<PinJobResponse> {\n\t\t\tconst pins = await pinner.listPins({\n\t\t\t\tlimit: query?.limit,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\trows: pins.map(createPinJobItem),\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Get top usage analytics (not supported in Pinner)\n\t\t * Returns empty data\n\t\t */\n\t\tasync topUsageAnalytics(\n\t\t\tquery: TopAnalyticsQuery,\n\t\t): Promise<TopAnalyticsResponse> {\n\t\t\t// Pinner doesn't support analytics\n\t\t\treturn {\n\t\t\t\tdata: [],\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Get date interval analytics (not supported in Pinner)\n\t\t * Returns empty data\n\t\t */\n\t\tasync dateIntervalAnalytics(\n\t\t\tquery: TimeIntervalAnalyticsQuery,\n\t\t): Promise<TimeIntervalAnalyticsResponse> {\n\t\t\t// Pinner doesn't support analytics\n\t\t\treturn {\n\t\t\t\ttotal_requests: 0,\n\t\t\t\ttotal_bandwidth: 0,\n\t\t\t\ttime_periods: [],\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Swap CID (not supported in Pinner)\n\t\t * Returns error\n\t\t */\n\t\tasync swapCid(options: SwapCidOptions): Promise<SwapCidResponse> {\n\t\t\tnotSupported(\"Swap CID\");\n\t\t},\n\n\t\t/**\n\t\t * Get swap history (not supported in Pinner)\n\t\t * Returns empty array\n\t\t */\n\t\tasync swapHistory(options: SwapHistoryOptions): Promise<SwapCidResponse[]> {\n\t\t\t// Pinner doesn't support swaps\n\t\t\treturn [];\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;AA+GA,SAAgB,oBACf,QACA,QACsB;AACtB,QAAO;;;;EAIN,MAAM,cACL,MACA,SAC0B;GAC1B,MAAM,SAAS,MAAM,OAAO,cAAc,MAAM;IAC/C,MAAM,SAAS,UAAU;IACzB,WAAW,SAAS,UAAU;IAC9B,CAAC;AAEF,OAAI,CAAC,OAAO,IACX,OAAM,IAAI,MAAM,4EAA4E;AAG7F,UAAO,qBAAqB;IAAE,KAAK,OAAO;IAAK,MAAM,OAAO;IAAM,WAAW,OAAO;IAAW,EAAE,KAAK,KAAK;;;;;EAM5G,MAAM,cACL,MACA,SAC0B;GAE1B,MAAM,aAAa,KAAK,UAAU,KAAK;GACvC,MAAM,OAAO,IAAI,KAChB,CAAC,WAAW,EACZ,SAAS,UAAU,QAAQ,aAC3B,EAAE,MAAM,oBAAoB,CAC5B;GAED,MAAM,SAAS,MAAM,OAAO,cAAc,MAAM;IAC/C,MAAM,SAAS,UAAU;IACzB,WAAW,SAAS,UAAU;IAC9B,CAAC;AAEF,OAAI,CAAC,OAAO,IACX,OAAM,IAAI,MAAM,4EAA4E;AAG7F,UAAO,qBAAqB;IAAE,KAAK,OAAO;IAAK,MAAM,OAAO;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
|
|
@@ -226,6 +226,7 @@ var PublicUploadImpl = class {
|
|
|
226
226
|
name: name || options?.metadata?.name,
|
|
227
227
|
keyvalues: keyvalues || options?.metadata?.keyvalues
|
|
228
228
|
});
|
|
229
|
+
if (!result.cid) throw new Error("Upload result has no CID yet — use waitForOperation() to poll for the CID");
|
|
229
230
|
return {
|
|
230
231
|
id: result.cid,
|
|
231
232
|
name: file.name,
|
|
@@ -247,6 +248,7 @@ var PublicUploadImpl = class {
|
|
|
247
248
|
name: name || options?.metadata?.name,
|
|
248
249
|
keyvalues: keyvalues || options?.metadata?.keyvalues
|
|
249
250
|
})).result;
|
|
251
|
+
if (!result.cid) throw new Error("Upload result has no CID yet — use waitForOperation() to poll for the CID");
|
|
250
252
|
return {
|
|
251
253
|
id: result.cid,
|
|
252
254
|
name: name || options?.metadata?.name || "directory",
|
|
@@ -273,6 +275,7 @@ var PublicUploadImpl = class {
|
|
|
273
275
|
name: name || options?.metadata?.name,
|
|
274
276
|
keyvalues: keyvalues || options?.metadata?.keyvalues
|
|
275
277
|
});
|
|
278
|
+
if (!result.cid) throw new Error("Upload result has no CID yet — use waitForOperation() to poll for the CID");
|
|
276
279
|
return {
|
|
277
280
|
id: result.cid,
|
|
278
281
|
name: file.name,
|
|
@@ -301,6 +304,7 @@ var PublicUploadImpl = class {
|
|
|
301
304
|
name: name || options?.metadata?.name,
|
|
302
305
|
keyvalues: keyvalues || options?.metadata?.keyvalues
|
|
303
306
|
});
|
|
307
|
+
if (!result.cid) throw new Error("Upload result has no CID yet — use waitForOperation() to poll for the CID");
|
|
304
308
|
return {
|
|
305
309
|
id: result.cid,
|
|
306
310
|
name: file.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","names":[],"sources":["../../../../../src/adapters/pinata/v2/adapter.ts"],"sourcesContent":["/**\n * Pinata SDK 2.x Adapter Implementation\n * Provides compatibility with Pinata SDK 2.x API\n *\n * Source: https://github.com/PinataCloud/pinata/commit/cdc0c06116aaadaf7c4b287a2673cd23b6ba1125\n * - src/core/pinataSDK.ts\n * - src/core/types/index.ts\n * - src/core/classes/index.ts\n *\n * Copyright © 2024 Pinata Cloud Technologies\n * Type definitions and API interfaces adapted from Pinata SDK for compatibility.\n * Original Pinata SDK: https://github.com/PinataCloud/pinata\n */\n\nimport type { Pinner } from \"@/pinner\";\nimport type {\n\tPinataConfig,\n\tUploadResponse,\n\tUploadOptions,\n\tUploadCIDOptions,\n\tPinByCIDResponse,\n\tSignedUploadUrlOptions,\n\tFileListItem,\n\tFileListQuery,\n\tFileListResponse,\n\tUpdateFileOptions,\n\tDeleteResponse,\n\tPinQueueQuery,\n\tPinQueueResponse,\n\tSwapCidOptions,\n\tSwapCidResponse,\n\tSwapHistoryOptions,\n\tAccessLinkOptions,\n\tGroupOptions,\n\tUpdateGroupOptions,\n\tGetGroupOptions,\n\tGroupResponseItem,\n\tGroupCIDOptions,\n\tUpdateGroupFilesResponse,\n\tTopAnalyticsQuery,\n\tTopAnalyticsResponse,\n\tTimeIntervalAnalyticsQuery,\n\tTimeIntervalAnalyticsResponse,\n} from \"./types\";\nimport type {\n\tPinataAdapter,\n\tPublicUpload,\n\tPrivateUpload,\n\tPublicFiles,\n\tPrivateFiles,\n\tPublicGateways,\n\tPrivateGateways,\n\tPublicGroups,\n\tPrivateGroups,\n\tAnalytics,\n\tUploadBuilder,\n\tFilterFiles,\n\tFilterQueue,\n\tFilterGroups,\n} from \"./adapter-interface\";\nimport { parseCID, notSupported } from \"../shared/utils\";\nimport { DEFAULT_GATEWAY } from \"@/types/constants\";\n\n/**\n * Implementation of UploadBuilder\n */\nclass UploadBuilderImpl<TResult> implements UploadBuilder<TResult> {\n\tprivate _name?: string;\n\tprivate _keyvalues?: Record<string, string>;\n\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate executeFn: (name?: string, keyvalues?: Record<string, string>) => Promise<TResult>,\n\t) {}\n\n\tname(name: string): this {\n\t\tthis._name = name;\n\t\treturn this;\n\t}\n\n\tkeyvalues(keyvalues: Record<string, string>): this {\n\t\tthis._keyvalues = keyvalues;\n\t\treturn this;\n\t}\n\n\tasync execute(): Promise<TResult> {\n\t\treturn this.executeFn(this._name, this._keyvalues);\n\t}\n}\n\n/**\n * Implementation of FilterFiles\n */\nclass FilterFilesImpl implements FilterFiles {\n\tprivate query: FileListQuery = {};\n\tprivate currentPageToken: string | undefined;\n\tprivate privacy: \"public\" | \"private\";\n\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivacy: \"public\" | \"private\",\n\t) {\n\t\tthis.privacy = privacy;\n\t}\n\n\tname(name: string): FilterFiles {\n\t\tthis.query.name = name;\n\t\treturn this;\n\t}\n\n\tgroup(group: string): FilterFiles {\n\t\tthis.query.group = group;\n\t\treturn this;\n\t}\n\n\tcid(cid: string): FilterFiles {\n\t\tthis.query.cid = cid;\n\t\treturn this;\n\t}\n\n\tmimeType(mimeType: string): FilterFiles {\n\t\tthis.query.mimeType = mimeType;\n\t\treturn this;\n\t}\n\n\torder(order: \"ASC\" | \"DESC\"): FilterFiles {\n\t\tthis.query.order = order;\n\t\treturn this;\n\t}\n\n\tlimit(limit: number): FilterFiles {\n\t\tthis.query.limit = limit;\n\t\treturn this;\n\t}\n\n\tcidPending(cidPending: boolean): FilterFiles {\n\t\tthis.query.cidPending = cidPending;\n\t\treturn this;\n\t}\n\n\tkeyvalues(keyvalues: Record<string, string>): FilterFiles {\n\t\tthis.query.metadata = keyvalues;\n\t\treturn this;\n\t}\n\n\tnoGroup(noGroup: boolean): FilterFiles {\n\t\tthis.query.noGroup = noGroup;\n\t\treturn this;\n\t}\n\n\tpageToken(pageToken: string): FilterFiles {\n\t\tthis.query.pageToken = Number.parseInt(pageToken, 10);\n\t\treturn this;\n\t}\n\n\tthen(\n\t\tonfulfilled?: ((value: FileListResponse) => any) | null,\n\t\tonrejected?: ((reason: any) => any) | null,\n\t): Promise<any> {\n\t\treturn this.fetchPage().then(onfulfilled, onrejected);\n\t}\n\n\tprivate async fetchPage(): Promise<FileListResponse> {\n\t\tconst pins = await this.pinner.listPins({\n\t\t\tlimit: this.query.limit,\n\t\t});\n\n\t\treturn {\n\t\t\tfiles: pins.map((pin) => ({\n\t\t\t\tid: pin.cid.toString(),\n\t\t\t\tname: pin.name || null,\n\t\t\t\tcid: pin.cid.toString(),\n\t\t\t\tsize: pin.size || 0,\n\t\t\t\tnumber_of_files: 1,\n\t\t\t\tmime_type: \"application/octet-stream\",\n\t\t\t\tkeyvalues: pin.metadata || {},\n\t\t\t\tgroup_id: null,\n\t\t\t\tcreated_at: pin.created.toISOString(),\n\t\t\t})),\n\t\t\tnext_page_token: this.currentPageToken || \"\",\n\t\t};\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncGenerator<FileListItem, void, unknown> {\n\t\twhile (true) {\n\t\t\tconst items = await this.fetchPage();\n\t\t\tfor (const item of items.files) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t\tif (!this.currentPageToken) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync all(): Promise<FileListItem[]> {\n\t\tconst allItems: FileListItem[] = [];\n\t\tfor await (const item of this) {\n\t\t\tallItems.push(item);\n\t\t}\n\t\treturn allItems;\n\t}\n}\n\n/**\n * Implementation of FilterQueue\n */\nclass FilterQueueImpl implements FilterQueue {\n\tprivate query: PinQueueQuery = {};\n\tprivate currentPageToken: string | undefined;\n\n\tconstructor(private pinner: Pinner) {}\n\n\tcid(cid: string): FilterQueue {\n\t\tthis.query.cid = cid;\n\t\treturn this;\n\t}\n\n\tstatus(\n\t\tstatus:\n\t\t\t| \"prechecking\"\n\t\t\t| \"retrieving\"\n\t\t\t| \"expired\"\n\t\t\t| \"backfilled\"\n\t\t\t| \"over_free_limit\"\n\t\t\t| \"over_max_size\"\n\t\t\t| \"invalid_object\"\n\t\t\t| \"bad_host_node\",\n\t): FilterQueue {\n\t\tthis.query.status = status;\n\t\treturn this;\n\t}\n\n\tpageLimit(limit: number): FilterQueue {\n\t\tthis.query.limit = limit;\n\t\treturn this;\n\t}\n\n\tpageToken(pageToken: string): FilterQueue {\n\t\tthis.query.pageToken = pageToken;\n\t\treturn this;\n\t}\n\n\tsort(sort: \"ASC\" | \"DSC\"): FilterQueue {\n\t\tthis.query.sort = sort;\n\t\treturn this;\n\t}\n\n\tthen(\n\t\tonfulfilled?: ((value: PinQueueResponse) => any) | null,\n\t\tonrejected?: ((reason: any) => any) | null,\n\t): Promise<any> {\n\t\treturn this.fetchPage().then(onfulfilled, onrejected);\n\t}\n\n\tprivate async fetchPage(): Promise<PinQueueResponse> {\n\t\tconst pins = await this.pinner.listPins({\n\t\t\tlimit: this.query.limit,\n\t\t});\n\n\t\treturn {\n\t\t\tjobs: pins.map((pin) => ({\n\t\t\t\tid: pin.cid.toString(),\n\t\t\t\tcid: pin.cid.toString(),\n\t\t\t\tdate_queued: pin.created.toISOString(),\n\t\t\t\tname: pin.name || \"\",\n\t\t\t\tstatus: pin.status || \"pinned\",\n\t\t\t\tkeyvalues: pin.metadata || {},\n\t\t\t\thost_nodes: [],\n\t\t\t\tpin_policy: {\n\t\t\t\t\tregions: [],\n\t\t\t\t\tversion: 1,\n\t\t\t\t},\n\t\t\t})),\n\t\t\tnext_page_token: this.currentPageToken || \"\",\n\t\t};\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncGenerator<\n\t\timport(\"./types\").PinQueueItem,\n\t\tvoid,\n\t\tunknown\n\t> {\n\t\twhile (true) {\n\t\t\tconst items = await this.fetchPage();\n\t\t\tfor (const item of items.jobs) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t\tif (!this.currentPageToken) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync all(): Promise<import(\"./types\").PinQueueItem[]> {\n\t\tconst allItems: import(\"./types\").PinQueueItem[] = [];\n\t\tfor await (const item of this) {\n\t\t\tallItems.push(item);\n\t\t}\n\t\treturn allItems;\n\t}\n}\n\n/**\n * Implementation of FilterGroups\n */\nclass FilterGroupsImpl implements FilterGroups {\n\tprivate currentPageToken: string | undefined;\n\tprivate privacy: \"public\" | \"private\";\n\n\tconstructor(private pinner: Pinner, privacy: \"public\" | \"private\") {\n\t\tthis.privacy = privacy;\n\t}\n\n\tname(name: string): FilterGroups {\n\t\t// Pinner doesn't support groups, return empty\n\t\treturn this;\n\t}\n\n\tlimit(limit: number): FilterGroups {\n\t\treturn this;\n\t}\n\n\tpageToken(pageToken: string): FilterGroups {\n\t\tthis.currentPageToken = pageToken;\n\t\treturn this;\n\t}\n\n\tisPublic(isPublic: boolean): FilterGroups {\n\t\treturn this;\n\t}\n\n\tthen(\n\t\tonfulfilled?: ((value: import(\"./types\").GroupListResponse) => any) | null,\n\t\tonrejected?: ((reason: any) => any) | null,\n\t): Promise<any> {\n\t\treturn this.fetchPage().then(onfulfilled, onrejected);\n\t}\n\n\tprivate async fetchPage(): Promise<import(\"./types\").GroupListResponse> {\n\t\t// Pinner doesn't support groups\n\t\treturn {\n\t\t\tgroups: [],\n\t\t\tnext_page_token: this.currentPageToken || \"\",\n\t\t};\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncGenerator<GroupResponseItem, void, unknown> {\n\t\tconst items = await this.fetchPage();\n\t\tfor (const item of items.groups) {\n\t\t\tyield item;\n\t\t}\n\t}\n\n\tasync all(): Promise<GroupResponseItem[]> {\n\t\tconst allItems: GroupResponseItem[] = [];\n\t\tfor await (const item of this) {\n\t\t\tallItems.push(item);\n\t\t}\n\t\treturn allItems;\n\t}\n}\n\n/**\n * Implementation of PublicUpload\n */\nclass PublicUploadImpl implements PublicUpload {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tfile(file: File, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async (name, keyvalues) => {\n\t\t\tconst result = await this.pinner.uploadAndWait(file, {\n\t\t\t\tname: name || options?.metadata?.name,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tid: result.cid,\n\t\t\t\tname: file.name,\n\t\t\t\tcid: result.cid,\n\t\t\t\tsize: result.size,\n\t\t\t\tcreated_at: result.createdAt.toISOString(),\n\t\t\t\tnumber_of_files: 1,\n\t\t\t\tmime_type: file.type || \"application/octet-stream\",\n\t\t\t\tgroup_id: null,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues || {},\n\t\t\t\tvectorized: false,\n\t\t\t\tnetwork: \"public\",\n\t\t\t};\n\t\t});\n\t}\n\n\tfileArray(\n\t\tfiles: File[],\n\t\toptions?: UploadOptions,\n\t): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async (name, keyvalues) => {\n\t\t\tconst operation = await this.pinner.uploadDirectory(files, {\n\t\t\t\tname: name || options?.metadata?.name,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues,\n\t\t\t});\n\t\t\tconst result = await operation.result;\n\n\t\t\treturn {\n\t\t\t\tid: result.cid,\n\t\t\t\tname: name || options?.metadata?.name || \"directory\",\n\t\t\t\tcid: result.cid,\n\t\t\t\tsize: result.size,\n\t\t\t\tcreated_at: result.createdAt.toISOString(),\n\t\t\t\tnumber_of_files: files.length,\n\t\t\t\tmime_type: \"application/octet-stream\",\n\t\t\t\tgroup_id: null,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues || {},\n\t\t\t\tvectorized: false,\n\t\t\t\tnetwork: \"public\",\n\t\t\t};\n\t\t});\n\t}\n\n\tbase64(\n\t\tbase64String: string,\n\t\toptions?: UploadOptions,\n\t): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async (name, keyvalues) => {\n\t\t\t// Convert base64 to file\n\t\t\tconst binaryString = atob(base64String);\n\t\t\tconst bytes = new Uint8Array(binaryString.length);\n\t\t\tfor (let i = 0; i < binaryString.length; i++) {\n\t\t\t\tbytes[i] = binaryString.charCodeAt(i);\n\t\t\t}\n\t\t\tconst blob = new Blob([bytes], {\n\t\t\t\ttype: \"application/octet-stream\",\n\t\t\t});\n\t\t\tconst file = new File(\n\t\t\t\t[blob],\n\t\t\t\tname || options?.metadata?.name || \"file.bin\",\n\t\t\t\t{ type: \"application/octet-stream\" },\n\t\t\t);\n\n\t\t\tconst result = await this.pinner.uploadAndWait(file, {\n\t\t\t\tname: name || options?.metadata?.name,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tid: result.cid,\n\t\t\t\tname: file.name,\n\t\t\t\tcid: result.cid,\n\t\t\t\tsize: result.size,\n\t\t\t\tcreated_at: result.createdAt.toISOString(),\n\t\t\t\tnumber_of_files: 1,\n\t\t\t\tmime_type: \"application/octet-stream\",\n\t\t\t\tgroup_id: null,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues || {},\n\t\t\t\tvectorized: false,\n\t\t\t\tnetwork: \"public\",\n\t\t\t};\n\t\t});\n\t}\n\n\turl(url: string, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"URL upload\");\n\t\t});\n\t}\n\n\tjson(data: object, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async (name, keyvalues) => {\n\t\t\tconst jsonString = JSON.stringify(data);\n\t\t\tconst file = new File(\n\t\t\t\t[jsonString],\n\t\t\t\tname || options?.metadata?.name || \"data.json\",\n\t\t\t\t{ type: \"application/json\" },\n\t\t\t);\n\n\t\t\tconst result = await this.pinner.uploadAndWait(file, {\n\t\t\t\tname: name || options?.metadata?.name,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tid: result.cid,\n\t\t\t\tname: file.name,\n\t\t\t\tcid: result.cid,\n\t\t\t\tsize: result.size,\n\t\t\t\tcreated_at: result.createdAt.toISOString(),\n\t\t\t\tnumber_of_files: 1,\n\t\t\t\tmime_type: \"application/json\",\n\t\t\t\tgroup_id: null,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues || {},\n\t\t\t\tvectorized: false,\n\t\t\t\tnetwork: \"public\",\n\t\t\t};\n\t\t});\n\t}\n\n\tcid(cid: string, options?: UploadCIDOptions): UploadBuilder<PinByCIDResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tconst cidObj = parseCID(cid);\n\t\t\tconst generator = await this.pinner.pinByHash(cidObj, {\n\t\t\t\tname: options?.metadata?.name,\n\t\t\t\tmetadata: options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\tfor await (const _ of generator) {\n\t\t\t\t// Wait for pin to complete\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tid: cid,\n\t\t\t\tcid: cid,\n\t\t\t\tdate_queued: new Date().toISOString(),\n\t\t\t\tname: options?.metadata?.name || \"\",\n\t\t\t\tstatus: \"pinned\",\n\t\t\t\tkeyvalues: options?.metadata?.keyvalues || null,\n\t\t\t\thost_nodes: null,\n\t\t\t\tgroup_id: options?.groupId || null,\n\t\t\t};\n\t\t});\n\t}\n\n\tasync createSignedURL(\n\t\toptions: SignedUploadUrlOptions,\n\t): Promise<string> {\n\t\tnotSupported(\"Signed upload URLs\");\n\t}\n}\n\n/**\n * Implementation of PrivateUpload\n */\nclass PrivateUploadImpl implements PrivateUpload {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tfile(file: File, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tfileArray(\n\t\tfiles: File[],\n\t\toptions?: UploadOptions,\n\t): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tbase64(\n\t\tbase64String: string,\n\t\toptions?: UploadOptions,\n\t): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\turl(url: string, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tjson(data: object, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tcid(cid: string, options?: UploadCIDOptions): UploadBuilder<PinByCIDResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tasync createSignedURL(\n\t\toptions: SignedUploadUrlOptions,\n\t): Promise<string> {\n\t\tnotSupported(\"Private upload\");\n\t}\n}\n\n/**\n * Implementation of PublicFiles\n */\nclass PublicFilesImpl implements PublicFiles {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tlist(): FilterFiles {\n\t\treturn new FilterFilesImpl(this.pinner, \"public\");\n\t}\n\n\tasync get(id: string): Promise<FileListItem> {\n\t\tconst cidObj = parseCID(id);\n\t\tconst pin = await this.pinner.getPinStatus(cidObj);\n\n\t\treturn {\n\t\t\tid: pin.cid.toString(),\n\t\t\tname: pin.name || null,\n\t\t\tcid: pin.cid.toString(),\n\t\t\tsize: pin.size || 0,\n\t\t\tnumber_of_files: 1,\n\t\t\tmime_type: \"application/octet-stream\",\n\t\t\tkeyvalues: pin.metadata || {},\n\t\t\tgroup_id: null,\n\t\t\tcreated_at: pin.created.toISOString(),\n\t\t};\n\t}\n\n\tasync delete(files: string[]): Promise<DeleteResponse[]> {\n\t\tconst results: DeleteResponse[] = [];\n\t\tfor (const file of files) {\n\t\t\tawait this.pinner.unpin(file);\n\t\t\tresults.push({ id: file, status: \"deleted\" });\n\t\t}\n\t\treturn results;\n\t}\n\n\tasync update(options: UpdateFileOptions): Promise<FileListItem> {\n\t\tawait this.pinner.setPinMetadata(options.id, options.keyvalues || {});\n\n\t\tconst pin = await this.pinner.getPinStatus(parseCID(options.id));\n\t\treturn {\n\t\t\tid: pin.cid.toString(),\n\t\t\tname: pin.name || null,\n\t\t\tcid: pin.cid.toString(),\n\t\t\tsize: pin.size || 0,\n\t\t\tnumber_of_files: 1,\n\t\t\tmime_type: \"application/octet-stream\",\n\t\t\tkeyvalues: pin.metadata || {},\n\t\t\tgroup_id: null,\n\t\t\tcreated_at: pin.created.toISOString(),\n\t\t};\n\t}\n\n\tasync addSwap(options: SwapCidOptions): Promise<SwapCidResponse> {\n\t\tnotSupported(\"Swap CID\");\n\t}\n\n\tasync getSwapHistory(\n\t\toptions: SwapHistoryOptions,\n\t): Promise<SwapCidResponse[]> {\n\t\treturn [];\n\t}\n\n\tasync deleteSwap(cid: string): Promise<string> {\n\t\tnotSupported(\"Swap CID\");\n\t}\n\n\tqueue(): FilterQueue {\n\t\treturn new FilterQueueImpl(this.pinner);\n\t}\n\n\tasync deletePinRequest(requestId: string): Promise<string> {\n\t\t// Delete pin by request ID (not CID)\n\t\tawait this.pinner.unpinByRequestId(requestId);\n\t\treturn requestId;\n\t}\n}\n\n/**\n * Implementation of PrivateFiles\n */\nclass PrivateFilesImpl implements PrivateFiles {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tlist(): FilterFiles {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync get(id: string): Promise<FileListItem> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync delete(files: string[]): Promise<DeleteResponse[]> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync update(options: UpdateFileOptions): Promise<FileListItem> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync addSwap(options: SwapCidOptions): Promise<SwapCidResponse> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync getSwapHistory(\n\t\toptions: SwapHistoryOptions,\n\t): Promise<SwapCidResponse[]> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync deleteSwap(cid: string): Promise<string> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tqueue(): FilterQueue {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync deletePinRequest(requestId: string): Promise<string> {\n\t\tnotSupported(\"Private files\");\n\t}\n}\n\n/**\n * Implementation of PublicGateways\n */\nclass PublicGatewaysImpl implements PublicGateways {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tget(cid: string): any {\n\t\t// Return an object that can be used to fetch CID\n\t\treturn {\n\t\t\tcid,\n\t\t\tgateway: this.config?.pinataGateway || DEFAULT_GATEWAY,\n\t\t\turl: `${this.config?.pinataGateway || DEFAULT_GATEWAY}/ipfs/${cid}`,\n\t\t};\n\t}\n\n\tasync convert(\n\t\turl: string,\n\t\tgatewayPrefix?: string,\n\t): Promise<string> {\n\t\t// Convert IPFS URL to gateway URL\n\t\tconst gateway = gatewayPrefix || this.config?.pinataGateway || DEFAULT_GATEWAY;\n\t\treturn url.replace(\"ipfs://\", `${gateway}/ipfs/`);\n\t}\n}\n\n/**\n * Implementation of PrivateGateways\n */\nclass PrivateGatewaysImpl implements PrivateGateways {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tget(cid: string): any {\n\t\tnotSupported(\"Private gateways\");\n\t}\n\n\tcreateAccessLink(options: AccessLinkOptions): any {\n\t\tnotSupported(\"Private gateways\");\n\t}\n}\n\n/**\n * Implementation of PublicGroups\n */\nclass PublicGroupsImpl implements PublicGroups {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tasync create(options: GroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tlist(): FilterGroups {\n\t\treturn new FilterGroupsImpl(this.pinner, \"public\");\n\t}\n\n\tasync get(options: GetGroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tasync addFiles(\n\t\toptions: GroupCIDOptions,\n\t): Promise<UpdateGroupFilesResponse[]> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tasync removeFiles(\n\t\toptions: GroupCIDOptions,\n\t): Promise<UpdateGroupFilesResponse[]> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tasync update(options: UpdateGroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tasync delete(options: GetGroupOptions): Promise<string> {\n\t\tnotSupported(\"Groups\");\n\t}\n}\n\n/**\n * Implementation of PrivateGroups\n */\nclass PrivateGroupsImpl implements PrivateGroups {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tasync create(options: GroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tlist(): FilterGroups {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync get(options: GetGroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync addFiles(\n\t\toptions: GroupCIDOptions,\n\t): Promise<UpdateGroupFilesResponse[]> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync removeFiles(\n\t\toptions: GroupCIDOptions,\n\t): Promise<UpdateGroupFilesResponse[]> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync update(options: UpdateGroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync delete(options: GetGroupOptions): Promise<string> {\n\t\tnotSupported(\"Private groups\");\n\t}\n}\n\n/**\n * Implementation of Analytics\n */\nclass AnalyticsImpl implements Analytics {\n\tasync requests(query: TopAnalyticsQuery): Promise<TopAnalyticsResponse> {\n\t\t// Pinner doesn't support analytics\n\t\treturn {\n\t\t\tdata: [],\n\t\t};\n\t}\n\n\tasync bandwidth(\n\t\tquery: TimeIntervalAnalyticsQuery,\n\t): Promise<TimeIntervalAnalyticsResponse> {\n\t\t// Pinner doesn't support analytics\n\t\treturn {\n\t\t\ttotal_requests: 0,\n\t\t\ttotal_bandwidth: 0,\n\t\t\ttime_periods: [],\n\t\t};\n\t}\n}\n\n/**\n * Create Pinata Adapter\n *\n * @param pinner - Pinner client instance\n * @param config - Pinata configuration\n * @returns PinataAdapter\n */\nexport function pinataAdapter(\n\tpinner: Pinner,\n\tconfig?: PinataConfig,\n): PinataAdapter {\n\tconst effectiveConfig: PinataConfig = config || {};\n\n\treturn {\n\t\tconfig: effectiveConfig,\n\t\tupdateConfig(newConfig: PinataConfig): void {\n\t\t\tObject.assign(effectiveConfig, newConfig);\n\t\t},\n\n\t\tupload: {\n\t\t\tpublic: new PublicUploadImpl(pinner, effectiveConfig),\n\t\t\tprivate: new PrivateUploadImpl(pinner, effectiveConfig),\n\t\t},\n\n\t\tfiles: {\n\t\t\tpublic: new PublicFilesImpl(pinner, effectiveConfig),\n\t\t\tprivate: new PrivateFilesImpl(pinner, effectiveConfig),\n\t\t},\n\n\t\tgateways: {\n\t\t\tpublic: new PublicGatewaysImpl(pinner, effectiveConfig),\n\t\t\tprivate: new PrivateGatewaysImpl(pinner, effectiveConfig),\n\t\t},\n\n\t\tgroups: {\n\t\t\tpublic: new PublicGroupsImpl(pinner, effectiveConfig),\n\t\t\tprivate: new PrivateGroupsImpl(pinner, effectiveConfig),\n\t\t},\n\n\t\tanalytics: new AnalyticsImpl(),\n\t};\n}\n\n// Re-export interface\nexport type { PinataAdapter } from \"./adapter-interface\";\n"],"mappings":";;;;;;;AAkEA,IAAM,oBAAN,MAAmE;CAClE,AAAQ;CACR,AAAQ;CA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EAFO;EACA;;CAGT,MAAM,OAAO,SAAmD;AAC/D,eAAa,iBAAiB;;CAG/B,OAAqB;AACpB,eAAa,iBAAiB;;CAG/B,MAAM,IAAI,SAAsD;AAC/D,eAAa,iBAAiB;;CAG/B,MAAM,SACL,SACsC;AACtC,eAAa,iBAAiB;;CAG/B,MAAM,YACL,SACsC;AACtC,eAAa,iBAAiB;;CAG/B,MAAM,OAAO,SAAyD;AACrE,eAAa,iBAAiB;;CAG/B,MAAM,OAAO,SAA2C;AACvD,eAAa,iBAAiB;;;;;;AAOhC,IAAM,gBAAN,MAAyC;CACxC,MAAM,SAAS,OAAyD;AAEvE,SAAO,EACN,MAAM,EAAE,EACR;;CAGF,MAAM,UACL,OACyC;AAEzC,SAAO;GACN,gBAAgB;GAChB,iBAAiB;GACjB,cAAc,EAAE;GAChB;;;;;;;;;;AAWH,SAAgB,cACf,QACA,QACgB;CAChB,MAAM,kBAAgC,UAAU,EAAE;AAElD,QAAO;EACN,QAAQ;EACR,aAAa,WAA+B;AAC3C,UAAO,OAAO,iBAAiB,UAAU;;EAG1C,QAAQ;GACP,QAAQ,IAAI,iBAAiB,QAAQ,gBAAgB;GACrD,SAAS,IAAI,kBAAkB,QAAQ,gBAAgB;GACvD;EAED,OAAO;GACN,QAAQ,IAAI,gBAAgB,QAAQ,gBAAgB;GACpD,SAAS,IAAI,iBAAiB,QAAQ,gBAAgB;GACtD;EAED,UAAU;GACT,QAAQ,IAAI,mBAAmB,QAAQ,gBAAgB;GACvD,SAAS,IAAI,oBAAoB,QAAQ,gBAAgB;GACzD;EAED,QAAQ;GACP,QAAQ,IAAI,iBAAiB,QAAQ,gBAAgB;GACrD,SAAS,IAAI,kBAAkB,QAAQ,gBAAgB;GACvD;EAED,WAAW,IAAI,eAAe;EAC9B"}
|
|
1
|
+
{"version":3,"file":"adapter.js","names":[],"sources":["../../../../../src/adapters/pinata/v2/adapter.ts"],"sourcesContent":["/**\n * Pinata SDK 2.x Adapter Implementation\n * Provides compatibility with Pinata SDK 2.x API\n *\n * Source: https://github.com/PinataCloud/pinata/commit/cdc0c06116aaadaf7c4b287a2673cd23b6ba1125\n * - src/core/pinataSDK.ts\n * - src/core/types/index.ts\n * - src/core/classes/index.ts\n *\n * Copyright © 2024 Pinata Cloud Technologies\n * Type definitions and API interfaces adapted from Pinata SDK for compatibility.\n * Original Pinata SDK: https://github.com/PinataCloud/pinata\n */\n\nimport type { Pinner } from \"@/pinner\";\nimport type {\n\tPinataConfig,\n\tUploadResponse,\n\tUploadOptions,\n\tUploadCIDOptions,\n\tPinByCIDResponse,\n\tSignedUploadUrlOptions,\n\tFileListItem,\n\tFileListQuery,\n\tFileListResponse,\n\tUpdateFileOptions,\n\tDeleteResponse,\n\tPinQueueQuery,\n\tPinQueueResponse,\n\tSwapCidOptions,\n\tSwapCidResponse,\n\tSwapHistoryOptions,\n\tAccessLinkOptions,\n\tGroupOptions,\n\tUpdateGroupOptions,\n\tGetGroupOptions,\n\tGroupResponseItem,\n\tGroupCIDOptions,\n\tUpdateGroupFilesResponse,\n\tTopAnalyticsQuery,\n\tTopAnalyticsResponse,\n\tTimeIntervalAnalyticsQuery,\n\tTimeIntervalAnalyticsResponse,\n} from \"./types\";\nimport type {\n\tPinataAdapter,\n\tPublicUpload,\n\tPrivateUpload,\n\tPublicFiles,\n\tPrivateFiles,\n\tPublicGateways,\n\tPrivateGateways,\n\tPublicGroups,\n\tPrivateGroups,\n\tAnalytics,\n\tUploadBuilder,\n\tFilterFiles,\n\tFilterQueue,\n\tFilterGroups,\n} from \"./adapter-interface\";\nimport { parseCID, notSupported } from \"../shared/utils\";\nimport { DEFAULT_GATEWAY } from \"@/types/constants\";\n\n/**\n * Implementation of UploadBuilder\n */\nclass UploadBuilderImpl<TResult> implements UploadBuilder<TResult> {\n\tprivate _name?: string;\n\tprivate _keyvalues?: Record<string, string>;\n\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate executeFn: (name?: string, keyvalues?: Record<string, string>) => Promise<TResult>,\n\t) {}\n\n\tname(name: string): this {\n\t\tthis._name = name;\n\t\treturn this;\n\t}\n\n\tkeyvalues(keyvalues: Record<string, string>): this {\n\t\tthis._keyvalues = keyvalues;\n\t\treturn this;\n\t}\n\n\tasync execute(): Promise<TResult> {\n\t\treturn this.executeFn(this._name, this._keyvalues);\n\t}\n}\n\n/**\n * Implementation of FilterFiles\n */\nclass FilterFilesImpl implements FilterFiles {\n\tprivate query: FileListQuery = {};\n\tprivate currentPageToken: string | undefined;\n\tprivate privacy: \"public\" | \"private\";\n\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivacy: \"public\" | \"private\",\n\t) {\n\t\tthis.privacy = privacy;\n\t}\n\n\tname(name: string): FilterFiles {\n\t\tthis.query.name = name;\n\t\treturn this;\n\t}\n\n\tgroup(group: string): FilterFiles {\n\t\tthis.query.group = group;\n\t\treturn this;\n\t}\n\n\tcid(cid: string): FilterFiles {\n\t\tthis.query.cid = cid;\n\t\treturn this;\n\t}\n\n\tmimeType(mimeType: string): FilterFiles {\n\t\tthis.query.mimeType = mimeType;\n\t\treturn this;\n\t}\n\n\torder(order: \"ASC\" | \"DESC\"): FilterFiles {\n\t\tthis.query.order = order;\n\t\treturn this;\n\t}\n\n\tlimit(limit: number): FilterFiles {\n\t\tthis.query.limit = limit;\n\t\treturn this;\n\t}\n\n\tcidPending(cidPending: boolean): FilterFiles {\n\t\tthis.query.cidPending = cidPending;\n\t\treturn this;\n\t}\n\n\tkeyvalues(keyvalues: Record<string, string>): FilterFiles {\n\t\tthis.query.metadata = keyvalues;\n\t\treturn this;\n\t}\n\n\tnoGroup(noGroup: boolean): FilterFiles {\n\t\tthis.query.noGroup = noGroup;\n\t\treturn this;\n\t}\n\n\tpageToken(pageToken: string): FilterFiles {\n\t\tthis.query.pageToken = Number.parseInt(pageToken, 10);\n\t\treturn this;\n\t}\n\n\tthen(\n\t\tonfulfilled?: ((value: FileListResponse) => any) | null,\n\t\tonrejected?: ((reason: any) => any) | null,\n\t): Promise<any> {\n\t\treturn this.fetchPage().then(onfulfilled, onrejected);\n\t}\n\n\tprivate async fetchPage(): Promise<FileListResponse> {\n\t\tconst pins = await this.pinner.listPins({\n\t\t\tlimit: this.query.limit,\n\t\t});\n\n\t\treturn {\n\t\t\tfiles: pins.map((pin) => ({\n\t\t\t\tid: pin.cid.toString(),\n\t\t\t\tname: pin.name || null,\n\t\t\t\tcid: pin.cid.toString(),\n\t\t\t\tsize: pin.size || 0,\n\t\t\t\tnumber_of_files: 1,\n\t\t\t\tmime_type: \"application/octet-stream\",\n\t\t\t\tkeyvalues: pin.metadata || {},\n\t\t\t\tgroup_id: null,\n\t\t\t\tcreated_at: pin.created.toISOString(),\n\t\t\t})),\n\t\t\tnext_page_token: this.currentPageToken || \"\",\n\t\t};\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncGenerator<FileListItem, void, unknown> {\n\t\twhile (true) {\n\t\t\tconst items = await this.fetchPage();\n\t\t\tfor (const item of items.files) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t\tif (!this.currentPageToken) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync all(): Promise<FileListItem[]> {\n\t\tconst allItems: FileListItem[] = [];\n\t\tfor await (const item of this) {\n\t\t\tallItems.push(item);\n\t\t}\n\t\treturn allItems;\n\t}\n}\n\n/**\n * Implementation of FilterQueue\n */\nclass FilterQueueImpl implements FilterQueue {\n\tprivate query: PinQueueQuery = {};\n\tprivate currentPageToken: string | undefined;\n\n\tconstructor(private pinner: Pinner) {}\n\n\tcid(cid: string): FilterQueue {\n\t\tthis.query.cid = cid;\n\t\treturn this;\n\t}\n\n\tstatus(\n\t\tstatus:\n\t\t\t| \"prechecking\"\n\t\t\t| \"retrieving\"\n\t\t\t| \"expired\"\n\t\t\t| \"backfilled\"\n\t\t\t| \"over_free_limit\"\n\t\t\t| \"over_max_size\"\n\t\t\t| \"invalid_object\"\n\t\t\t| \"bad_host_node\",\n\t): FilterQueue {\n\t\tthis.query.status = status;\n\t\treturn this;\n\t}\n\n\tpageLimit(limit: number): FilterQueue {\n\t\tthis.query.limit = limit;\n\t\treturn this;\n\t}\n\n\tpageToken(pageToken: string): FilterQueue {\n\t\tthis.query.pageToken = pageToken;\n\t\treturn this;\n\t}\n\n\tsort(sort: \"ASC\" | \"DSC\"): FilterQueue {\n\t\tthis.query.sort = sort;\n\t\treturn this;\n\t}\n\n\tthen(\n\t\tonfulfilled?: ((value: PinQueueResponse) => any) | null,\n\t\tonrejected?: ((reason: any) => any) | null,\n\t): Promise<any> {\n\t\treturn this.fetchPage().then(onfulfilled, onrejected);\n\t}\n\n\tprivate async fetchPage(): Promise<PinQueueResponse> {\n\t\tconst pins = await this.pinner.listPins({\n\t\t\tlimit: this.query.limit,\n\t\t});\n\n\t\treturn {\n\t\t\tjobs: pins.map((pin) => ({\n\t\t\t\tid: pin.cid.toString(),\n\t\t\t\tcid: pin.cid.toString(),\n\t\t\t\tdate_queued: pin.created.toISOString(),\n\t\t\t\tname: pin.name || \"\",\n\t\t\t\tstatus: pin.status || \"pinned\",\n\t\t\t\tkeyvalues: pin.metadata || {},\n\t\t\t\thost_nodes: [],\n\t\t\t\tpin_policy: {\n\t\t\t\t\tregions: [],\n\t\t\t\t\tversion: 1,\n\t\t\t\t},\n\t\t\t})),\n\t\t\tnext_page_token: this.currentPageToken || \"\",\n\t\t};\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncGenerator<\n\t\timport(\"./types\").PinQueueItem,\n\t\tvoid,\n\t\tunknown\n\t> {\n\t\twhile (true) {\n\t\t\tconst items = await this.fetchPage();\n\t\t\tfor (const item of items.jobs) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t\tif (!this.currentPageToken) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync all(): Promise<import(\"./types\").PinQueueItem[]> {\n\t\tconst allItems: import(\"./types\").PinQueueItem[] = [];\n\t\tfor await (const item of this) {\n\t\t\tallItems.push(item);\n\t\t}\n\t\treturn allItems;\n\t}\n}\n\n/**\n * Implementation of FilterGroups\n */\nclass FilterGroupsImpl implements FilterGroups {\n\tprivate currentPageToken: string | undefined;\n\tprivate privacy: \"public\" | \"private\";\n\n\tconstructor(private pinner: Pinner, privacy: \"public\" | \"private\") {\n\t\tthis.privacy = privacy;\n\t}\n\n\tname(name: string): FilterGroups {\n\t\t// Pinner doesn't support groups, return empty\n\t\treturn this;\n\t}\n\n\tlimit(limit: number): FilterGroups {\n\t\treturn this;\n\t}\n\n\tpageToken(pageToken: string): FilterGroups {\n\t\tthis.currentPageToken = pageToken;\n\t\treturn this;\n\t}\n\n\tisPublic(isPublic: boolean): FilterGroups {\n\t\treturn this;\n\t}\n\n\tthen(\n\t\tonfulfilled?: ((value: import(\"./types\").GroupListResponse) => any) | null,\n\t\tonrejected?: ((reason: any) => any) | null,\n\t): Promise<any> {\n\t\treturn this.fetchPage().then(onfulfilled, onrejected);\n\t}\n\n\tprivate async fetchPage(): Promise<import(\"./types\").GroupListResponse> {\n\t\t// Pinner doesn't support groups\n\t\treturn {\n\t\t\tgroups: [],\n\t\t\tnext_page_token: this.currentPageToken || \"\",\n\t\t};\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncGenerator<GroupResponseItem, void, unknown> {\n\t\tconst items = await this.fetchPage();\n\t\tfor (const item of items.groups) {\n\t\t\tyield item;\n\t\t}\n\t}\n\n\tasync all(): Promise<GroupResponseItem[]> {\n\t\tconst allItems: GroupResponseItem[] = [];\n\t\tfor await (const item of this) {\n\t\t\tallItems.push(item);\n\t\t}\n\t\treturn allItems;\n\t}\n}\n\n/**\n * Implementation of PublicUpload\n */\nclass PublicUploadImpl implements PublicUpload {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tfile(file: File, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async (name, keyvalues) => {\n\t\t\tconst result = await this.pinner.uploadAndWait(file, {\n\t\t\t\tname: name || options?.metadata?.name,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\tif (!result.cid) {\n\t\t\t\tthrow new Error(\"Upload result has no CID yet — use waitForOperation() to poll for the CID\");\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tid: result.cid,\n\t\t\t\tname: file.name,\n\t\t\t\tcid: result.cid,\n\t\t\t\tsize: result.size,\n\t\t\t\tcreated_at: result.createdAt.toISOString(),\n\t\t\t\tnumber_of_files: 1,\n\t\t\t\tmime_type: file.type || \"application/octet-stream\",\n\t\t\t\tgroup_id: null,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues || {},\n\t\t\t\tvectorized: false,\n\t\t\t\tnetwork: \"public\",\n\t\t\t};\n\t\t});\n\t}\n\n\tfileArray(\n\t\tfiles: File[],\n\t\toptions?: UploadOptions,\n\t): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async (name, keyvalues) => {\n\t\t\tconst operation = await this.pinner.uploadDirectory(files, {\n\t\t\t\tname: name || options?.metadata?.name,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues,\n\t\t\t});\n\t\t\tconst result = await operation.result;\n\n\t\t\tif (!result.cid) {\n\t\t\t\tthrow new Error(\"Upload result has no CID yet — use waitForOperation() to poll for the CID\");\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tid: result.cid,\n\t\t\t\tname: name || options?.metadata?.name || \"directory\",\n\t\t\t\tcid: result.cid,\n\t\t\t\tsize: result.size,\n\t\t\t\tcreated_at: result.createdAt.toISOString(),\n\t\t\t\tnumber_of_files: files.length,\n\t\t\t\tmime_type: \"application/octet-stream\",\n\t\t\t\tgroup_id: null,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues || {},\n\t\t\t\tvectorized: false,\n\t\t\t\tnetwork: \"public\",\n\t\t\t};\n\t\t});\n\t}\n\n\tbase64(\n\t\tbase64String: string,\n\t\toptions?: UploadOptions,\n\t): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async (name, keyvalues) => {\n\t\t\t// Convert base64 to file\n\t\t\tconst binaryString = atob(base64String);\n\t\t\tconst bytes = new Uint8Array(binaryString.length);\n\t\t\tfor (let i = 0; i < binaryString.length; i++) {\n\t\t\t\tbytes[i] = binaryString.charCodeAt(i);\n\t\t\t}\n\t\t\tconst blob = new Blob([bytes], {\n\t\t\t\ttype: \"application/octet-stream\",\n\t\t\t});\n\t\t\tconst file = new File(\n\t\t\t\t[blob],\n\t\t\t\tname || options?.metadata?.name || \"file.bin\",\n\t\t\t\t{ type: \"application/octet-stream\" },\n\t\t\t);\n\n\t\t\tconst result = await this.pinner.uploadAndWait(file, {\n\t\t\t\tname: name || options?.metadata?.name,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\tif (!result.cid) {\n\t\t\t\tthrow new Error(\"Upload result has no CID yet — use waitForOperation() to poll for the CID\");\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tid: result.cid,\n\t\t\t\tname: file.name,\n\t\t\t\tcid: result.cid,\n\t\t\t\tsize: result.size,\n\t\t\t\tcreated_at: result.createdAt.toISOString(),\n\t\t\t\tnumber_of_files: 1,\n\t\t\t\tmime_type: \"application/octet-stream\",\n\t\t\t\tgroup_id: null,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues || {},\n\t\t\t\tvectorized: false,\n\t\t\t\tnetwork: \"public\",\n\t\t\t};\n\t\t});\n\t}\n\n\turl(url: string, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"URL upload\");\n\t\t});\n\t}\n\n\tjson(data: object, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async (name, keyvalues) => {\n\t\t\tconst jsonString = JSON.stringify(data);\n\t\t\tconst file = new File(\n\t\t\t\t[jsonString],\n\t\t\t\tname || options?.metadata?.name || \"data.json\",\n\t\t\t\t{ type: \"application/json\" },\n\t\t\t);\n\n\t\t\tconst result = await this.pinner.uploadAndWait(file, {\n\t\t\t\tname: name || options?.metadata?.name,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\tif (!result.cid) {\n\t\t\t\tthrow new Error(\"Upload result has no CID yet — use waitForOperation() to poll for the CID\");\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tid: result.cid,\n\t\t\t\tname: file.name,\n\t\t\t\tcid: result.cid,\n\t\t\t\tsize: result.size,\n\t\t\t\tcreated_at: result.createdAt.toISOString(),\n\t\t\t\tnumber_of_files: 1,\n\t\t\t\tmime_type: \"application/json\",\n\t\t\t\tgroup_id: null,\n\t\t\t\tkeyvalues: keyvalues || options?.metadata?.keyvalues || {},\n\t\t\t\tvectorized: false,\n\t\t\t\tnetwork: \"public\",\n\t\t\t};\n\t\t});\n\t}\n\n\tcid(cid: string, options?: UploadCIDOptions): UploadBuilder<PinByCIDResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tconst cidObj = parseCID(cid);\n\t\t\tconst generator = await this.pinner.pinByHash(cidObj, {\n\t\t\t\tname: options?.metadata?.name,\n\t\t\t\tmetadata: options?.metadata?.keyvalues,\n\t\t\t});\n\n\t\t\tfor await (const _ of generator) {\n\t\t\t\t// Wait for pin to complete\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tid: cid,\n\t\t\t\tcid: cid,\n\t\t\t\tdate_queued: new Date().toISOString(),\n\t\t\t\tname: options?.metadata?.name || \"\",\n\t\t\t\tstatus: \"pinned\",\n\t\t\t\tkeyvalues: options?.metadata?.keyvalues || null,\n\t\t\t\thost_nodes: null,\n\t\t\t\tgroup_id: options?.groupId || null,\n\t\t\t};\n\t\t});\n\t}\n\n\tasync createSignedURL(\n\t\toptions: SignedUploadUrlOptions,\n\t): Promise<string> {\n\t\tnotSupported(\"Signed upload URLs\");\n\t}\n}\n\n/**\n * Implementation of PrivateUpload\n */\nclass PrivateUploadImpl implements PrivateUpload {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tfile(file: File, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tfileArray(\n\t\tfiles: File[],\n\t\toptions?: UploadOptions,\n\t): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tbase64(\n\t\tbase64String: string,\n\t\toptions?: UploadOptions,\n\t): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\turl(url: string, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tjson(data: object, options?: UploadOptions): UploadBuilder<UploadResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tcid(cid: string, options?: UploadCIDOptions): UploadBuilder<PinByCIDResponse> {\n\t\treturn new UploadBuilderImpl(this.pinner, async () => {\n\t\t\tnotSupported(\"Private upload\");\n\t\t});\n\t}\n\n\tasync createSignedURL(\n\t\toptions: SignedUploadUrlOptions,\n\t): Promise<string> {\n\t\tnotSupported(\"Private upload\");\n\t}\n}\n\n/**\n * Implementation of PublicFiles\n */\nclass PublicFilesImpl implements PublicFiles {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tlist(): FilterFiles {\n\t\treturn new FilterFilesImpl(this.pinner, \"public\");\n\t}\n\n\tasync get(id: string): Promise<FileListItem> {\n\t\tconst cidObj = parseCID(id);\n\t\tconst pin = await this.pinner.getPinStatus(cidObj);\n\n\t\treturn {\n\t\t\tid: pin.cid.toString(),\n\t\t\tname: pin.name || null,\n\t\t\tcid: pin.cid.toString(),\n\t\t\tsize: pin.size || 0,\n\t\t\tnumber_of_files: 1,\n\t\t\tmime_type: \"application/octet-stream\",\n\t\t\tkeyvalues: pin.metadata || {},\n\t\t\tgroup_id: null,\n\t\t\tcreated_at: pin.created.toISOString(),\n\t\t};\n\t}\n\n\tasync delete(files: string[]): Promise<DeleteResponse[]> {\n\t\tconst results: DeleteResponse[] = [];\n\t\tfor (const file of files) {\n\t\t\tawait this.pinner.unpin(file);\n\t\t\tresults.push({ id: file, status: \"deleted\" });\n\t\t}\n\t\treturn results;\n\t}\n\n\tasync update(options: UpdateFileOptions): Promise<FileListItem> {\n\t\tawait this.pinner.setPinMetadata(options.id, options.keyvalues || {});\n\n\t\tconst pin = await this.pinner.getPinStatus(parseCID(options.id));\n\t\treturn {\n\t\t\tid: pin.cid.toString(),\n\t\t\tname: pin.name || null,\n\t\t\tcid: pin.cid.toString(),\n\t\t\tsize: pin.size || 0,\n\t\t\tnumber_of_files: 1,\n\t\t\tmime_type: \"application/octet-stream\",\n\t\t\tkeyvalues: pin.metadata || {},\n\t\t\tgroup_id: null,\n\t\t\tcreated_at: pin.created.toISOString(),\n\t\t};\n\t}\n\n\tasync addSwap(options: SwapCidOptions): Promise<SwapCidResponse> {\n\t\tnotSupported(\"Swap CID\");\n\t}\n\n\tasync getSwapHistory(\n\t\toptions: SwapHistoryOptions,\n\t): Promise<SwapCidResponse[]> {\n\t\treturn [];\n\t}\n\n\tasync deleteSwap(cid: string): Promise<string> {\n\t\tnotSupported(\"Swap CID\");\n\t}\n\n\tqueue(): FilterQueue {\n\t\treturn new FilterQueueImpl(this.pinner);\n\t}\n\n\tasync deletePinRequest(requestId: string): Promise<string> {\n\t\t// Delete pin by request ID (not CID)\n\t\tawait this.pinner.unpinByRequestId(requestId);\n\t\treturn requestId;\n\t}\n}\n\n/**\n * Implementation of PrivateFiles\n */\nclass PrivateFilesImpl implements PrivateFiles {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tlist(): FilterFiles {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync get(id: string): Promise<FileListItem> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync delete(files: string[]): Promise<DeleteResponse[]> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync update(options: UpdateFileOptions): Promise<FileListItem> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync addSwap(options: SwapCidOptions): Promise<SwapCidResponse> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync getSwapHistory(\n\t\toptions: SwapHistoryOptions,\n\t): Promise<SwapCidResponse[]> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync deleteSwap(cid: string): Promise<string> {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tqueue(): FilterQueue {\n\t\tnotSupported(\"Private files\");\n\t}\n\n\tasync deletePinRequest(requestId: string): Promise<string> {\n\t\tnotSupported(\"Private files\");\n\t}\n}\n\n/**\n * Implementation of PublicGateways\n */\nclass PublicGatewaysImpl implements PublicGateways {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tget(cid: string): any {\n\t\t// Return an object that can be used to fetch CID\n\t\treturn {\n\t\t\tcid,\n\t\t\tgateway: this.config?.pinataGateway || DEFAULT_GATEWAY,\n\t\t\turl: `${this.config?.pinataGateway || DEFAULT_GATEWAY}/ipfs/${cid}`,\n\t\t};\n\t}\n\n\tasync convert(\n\t\turl: string,\n\t\tgatewayPrefix?: string,\n\t): Promise<string> {\n\t\t// Convert IPFS URL to gateway URL\n\t\tconst gateway = gatewayPrefix || this.config?.pinataGateway || DEFAULT_GATEWAY;\n\t\treturn url.replace(\"ipfs://\", `${gateway}/ipfs/`);\n\t}\n}\n\n/**\n * Implementation of PrivateGateways\n */\nclass PrivateGatewaysImpl implements PrivateGateways {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tget(cid: string): any {\n\t\tnotSupported(\"Private gateways\");\n\t}\n\n\tcreateAccessLink(options: AccessLinkOptions): any {\n\t\tnotSupported(\"Private gateways\");\n\t}\n}\n\n/**\n * Implementation of PublicGroups\n */\nclass PublicGroupsImpl implements PublicGroups {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tasync create(options: GroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tlist(): FilterGroups {\n\t\treturn new FilterGroupsImpl(this.pinner, \"public\");\n\t}\n\n\tasync get(options: GetGroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tasync addFiles(\n\t\toptions: GroupCIDOptions,\n\t): Promise<UpdateGroupFilesResponse[]> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tasync removeFiles(\n\t\toptions: GroupCIDOptions,\n\t): Promise<UpdateGroupFilesResponse[]> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tasync update(options: UpdateGroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Groups\");\n\t}\n\n\tasync delete(options: GetGroupOptions): Promise<string> {\n\t\tnotSupported(\"Groups\");\n\t}\n}\n\n/**\n * Implementation of PrivateGroups\n */\nclass PrivateGroupsImpl implements PrivateGroups {\n\tconstructor(\n\t\tprivate pinner: Pinner,\n\t\tprivate config?: PinataConfig,\n\t) {}\n\n\tasync create(options: GroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tlist(): FilterGroups {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync get(options: GetGroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync addFiles(\n\t\toptions: GroupCIDOptions,\n\t): Promise<UpdateGroupFilesResponse[]> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync removeFiles(\n\t\toptions: GroupCIDOptions,\n\t): Promise<UpdateGroupFilesResponse[]> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync update(options: UpdateGroupOptions): Promise<GroupResponseItem> {\n\t\tnotSupported(\"Private groups\");\n\t}\n\n\tasync delete(options: GetGroupOptions): Promise<string> {\n\t\tnotSupported(\"Private groups\");\n\t}\n}\n\n/**\n * Implementation of Analytics\n */\nclass AnalyticsImpl implements Analytics {\n\tasync requests(query: TopAnalyticsQuery): Promise<TopAnalyticsResponse> {\n\t\t// Pinner doesn't support analytics\n\t\treturn {\n\t\t\tdata: [],\n\t\t};\n\t}\n\n\tasync bandwidth(\n\t\tquery: TimeIntervalAnalyticsQuery,\n\t): Promise<TimeIntervalAnalyticsResponse> {\n\t\t// Pinner doesn't support analytics\n\t\treturn {\n\t\t\ttotal_requests: 0,\n\t\t\ttotal_bandwidth: 0,\n\t\t\ttime_periods: [],\n\t\t};\n\t}\n}\n\n/**\n * Create Pinata Adapter\n *\n * @param pinner - Pinner client instance\n * @param config - Pinata configuration\n * @returns PinataAdapter\n */\nexport function pinataAdapter(\n\tpinner: Pinner,\n\tconfig?: PinataConfig,\n): PinataAdapter {\n\tconst effectiveConfig: PinataConfig = config || {};\n\n\treturn {\n\t\tconfig: effectiveConfig,\n\t\tupdateConfig(newConfig: PinataConfig): void {\n\t\t\tObject.assign(effectiveConfig, newConfig);\n\t\t},\n\n\t\tupload: {\n\t\t\tpublic: new PublicUploadImpl(pinner, effectiveConfig),\n\t\t\tprivate: new PrivateUploadImpl(pinner, effectiveConfig),\n\t\t},\n\n\t\tfiles: {\n\t\t\tpublic: new PublicFilesImpl(pinner, effectiveConfig),\n\t\t\tprivate: new PrivateFilesImpl(pinner, effectiveConfig),\n\t\t},\n\n\t\tgateways: {\n\t\t\tpublic: new PublicGatewaysImpl(pinner, effectiveConfig),\n\t\t\tprivate: new PrivateGatewaysImpl(pinner, effectiveConfig),\n\t\t},\n\n\t\tgroups: {\n\t\t\tpublic: new PublicGroupsImpl(pinner, effectiveConfig),\n\t\t\tprivate: new PrivateGroupsImpl(pinner, effectiveConfig),\n\t\t},\n\n\t\tanalytics: new AnalyticsImpl(),\n\t};\n}\n\n// Re-export interface\nexport type { PinataAdapter } from \"./adapter-interface\";\n"],"mappings":";;;;;;;AAkEA,IAAM,oBAAN,MAAmE;CAClE,AAAQ;CACR,AAAQ;CAER,YACC,AAAQ,QACR,AAAQ,WACP;EAFO;EACA;;CAGT,KAAK,MAAoB;AACxB,OAAK,QAAQ;AACb,SAAO;;CAGR,UAAU,WAAyC;AAClD,OAAK,aAAa;AAClB,SAAO;;CAGR,MAAM,UAA4B;AACjC,SAAO,KAAK,UAAU,KAAK,OAAO,KAAK,WAAW;;;;;;AAOpD,IAAM,kBAAN,MAA6C;CAC5C,AAAQ,QAAuB,EAAE;CACjC,AAAQ;CACR,AAAQ;CAER,YACC,AAAQ,QACR,SACC;EAFO;AAGR,OAAK,UAAU;;CAGhB,KAAK,MAA2B;AAC/B,OAAK,MAAM,OAAO;AAClB,SAAO;;CAGR,MAAM,OAA4B;AACjC,OAAK,MAAM,QAAQ;AACnB,SAAO;;CAGR,IAAI,KAA0B;AAC7B,OAAK,MAAM,MAAM;AACjB,SAAO;;CAGR,SAAS,UAA+B;AACvC,OAAK,MAAM,WAAW;AACtB,SAAO;;CAGR,MAAM,OAAoC;AACzC,OAAK,MAAM,QAAQ;AACnB,SAAO;;CAGR,MAAM,OAA4B;AACjC,OAAK,MAAM,QAAQ;AACnB,SAAO;;CAGR,WAAW,YAAkC;AAC5C,OAAK,MAAM,aAAa;AACxB,SAAO;;CAGR,UAAU,WAAgD;AACzD,OAAK,MAAM,WAAW;AACtB,SAAO;;C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;AAElD,QAAO;EACN,QAAQ;EACR,aAAa,WAA+B;AAC3C,UAAO,OAAO,iBAAiB,UAAU;;EAG1C,QAAQ;GACP,QAAQ,IAAI,iBAAiB,QAAQ,gBAAgB;GACrD,SAAS,IAAI,kBAAkB,QAAQ,gBAAgB;GACvD;EAED,OAAO;GACN,QAAQ,IAAI,gBAAgB,QAAQ,gBAAgB;GACpD,SAAS,IAAI,iBAAiB,QAAQ,gBAAgB;GACtD;EAED,UAAU;GACT,QAAQ,IAAI,mBAAmB,QAAQ,gBAAgB;GACvD,SAAS,IAAI,oBAAoB,QAAQ,gBAAgB;GACzD;EAED,QAAQ;GACP,QAAQ,IAAI,iBAAiB,QAAQ,gBAAgB;GACrD,SAAS,IAAI,kBAAkB,QAAQ,gBAAgB;GACvD;EAED,WAAW,IAAI,eAAe;EAC9B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BlockMetaResponse } from "../schemas/blockMetaResponse.js";
|
|
2
2
|
import { ErrorResponse } from "../schemas/errorResponse.js";
|
|
3
3
|
import { InfoResponse } from "../schemas/infoResponse.js";
|
|
4
|
+
import { PostUploadResponse } from "../schemas/postUploadResponse.js";
|
|
5
|
+
import { UploadResultResponse } from "../schemas/uploadResultResponse.js";
|
|
4
6
|
import * as _$msw from "msw";
|
|
5
7
|
import { RequestHandlerOptions, http } from "msw";
|
|
6
8
|
|
|
@@ -8,15 +10,18 @@ import { RequestHandlerOptions, http } from "msw";
|
|
|
8
10
|
declare const getGetApiBlockMetaCidResponseMock: (overrideResponse?: Partial<Extract<BlockMetaResponse, object>>) => BlockMetaResponse;
|
|
9
11
|
declare const getPostApiBlockMetaBatchResponseMock: (overrideResponse?: Partial<Extract<ErrorResponse, object>>) => ErrorResponse;
|
|
10
12
|
declare const getGetApiInfoResponseMock: (overrideResponse?: Partial<Extract<InfoResponse, object>>) => InfoResponse;
|
|
13
|
+
declare const getPostApiUploadResponseMock: (overrideResponse?: Partial<Extract<PostUploadResponse, object>>) => PostUploadResponse;
|
|
14
|
+
declare const getGetApiUploadResultIdentifierResponseMock: (overrideResponse?: Partial<Extract<UploadResultResponse, object>>) => UploadResultResponse;
|
|
11
15
|
declare const getGetIpfsCidResponseMock: (overrideResponse?: Partial<Extract<ErrorResponse, object>>) => ErrorResponse;
|
|
12
16
|
declare const getHeadIpfsCidResponseMock: (overrideResponse?: Partial<Extract<ErrorResponse, object>>) => ErrorResponse;
|
|
13
17
|
declare const getGetApiBlockMetaCidMockHandler: (overrideResponse?: BlockMetaResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<BlockMetaResponse> | BlockMetaResponse), options?: RequestHandlerOptions) => _$msw.HttpHandler;
|
|
14
18
|
declare const getPostApiBlockMetaBatchMockHandler: (overrideResponse?: ErrorResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<ErrorResponse> | ErrorResponse), options?: RequestHandlerOptions) => _$msw.HttpHandler;
|
|
15
19
|
declare const getGetApiInfoMockHandler: (overrideResponse?: InfoResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<InfoResponse> | InfoResponse), options?: RequestHandlerOptions) => _$msw.HttpHandler;
|
|
16
|
-
declare const getPostApiUploadMockHandler: (overrideResponse?:
|
|
20
|
+
declare const getPostApiUploadMockHandler: (overrideResponse?: PostUploadResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<PostUploadResponse> | PostUploadResponse), options?: RequestHandlerOptions) => _$msw.HttpHandler;
|
|
21
|
+
declare const getGetApiUploadResultIdentifierMockHandler: (overrideResponse?: UploadResultResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<UploadResultResponse> | UploadResultResponse), options?: RequestHandlerOptions) => _$msw.HttpHandler;
|
|
17
22
|
declare const getGetIpfsCidMockHandler: (overrideResponse?: ErrorResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<ErrorResponse> | ErrorResponse), options?: RequestHandlerOptions) => _$msw.HttpHandler;
|
|
18
23
|
declare const getHeadIpfsCidMockHandler: (overrideResponse?: ErrorResponse | ((info: Parameters<Parameters<typeof http.head>[1]>[0]) => Promise<ErrorResponse> | ErrorResponse), options?: RequestHandlerOptions) => _$msw.HttpHandler;
|
|
19
24
|
declare const getContentMock: () => _$msw.HttpHandler[];
|
|
20
25
|
//#endregion
|
|
21
|
-
export { getContentMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiUploadMockHandler };
|
|
26
|
+
export { getContentMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetApiUploadResultIdentifierMockHandler, getGetApiUploadResultIdentifierResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiUploadMockHandler, getPostApiUploadResponseMock };
|
|
22
27
|
//# sourceMappingURL=content.msw.d.ts.map
|
|
@@ -82,6 +82,28 @@ const getGetApiInfoResponseMock = (overrideResponse = {}) => ({
|
|
|
82
82
|
} }),
|
|
83
83
|
...overrideResponse
|
|
84
84
|
});
|
|
85
|
+
const getPostApiUploadResponseMock = (overrideResponse = {}) => ({
|
|
86
|
+
CID: faker.string.alpha({ length: {
|
|
87
|
+
min: 10,
|
|
88
|
+
max: 20
|
|
89
|
+
} }),
|
|
90
|
+
...overrideResponse
|
|
91
|
+
});
|
|
92
|
+
const getGetApiUploadResultIdentifierResponseMock = (overrideResponse = {}) => ({
|
|
93
|
+
cid: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
94
|
+
min: 10,
|
|
95
|
+
max: 20
|
|
96
|
+
} }), void 0]),
|
|
97
|
+
error: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
98
|
+
min: 10,
|
|
99
|
+
max: 20
|
|
100
|
+
} }), void 0]),
|
|
101
|
+
status: faker.string.alpha({ length: {
|
|
102
|
+
min: 10,
|
|
103
|
+
max: 20
|
|
104
|
+
} }),
|
|
105
|
+
...overrideResponse
|
|
106
|
+
});
|
|
85
107
|
const getGetIpfsCidResponseMock = (overrideResponse = {}) => ({
|
|
86
108
|
error: faker.string.alpha({ length: {
|
|
87
109
|
min: 10,
|
|
@@ -117,8 +139,13 @@ const getGetApiInfoMockHandler = (overrideResponse, options) => {
|
|
|
117
139
|
const getPostApiUploadMockHandler = (overrideResponse, options) => {
|
|
118
140
|
return http.post("*/api/upload", async (info) => {
|
|
119
141
|
await delay(0);
|
|
120
|
-
|
|
121
|
-
|
|
142
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getPostApiUploadResponseMock(), { status: 200 });
|
|
143
|
+
}, options);
|
|
144
|
+
};
|
|
145
|
+
const getGetApiUploadResultIdentifierMockHandler = (overrideResponse, options) => {
|
|
146
|
+
return http.get("*/api/upload/result/:identifier", async (info) => {
|
|
147
|
+
await delay(0);
|
|
148
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getGetApiUploadResultIdentifierResponseMock(), { status: 200 });
|
|
122
149
|
}, options);
|
|
123
150
|
};
|
|
124
151
|
const getGetIpfsCidMockHandler = (overrideResponse, options) => {
|
|
@@ -138,10 +165,11 @@ const getContentMock = () => [
|
|
|
138
165
|
getPostApiBlockMetaBatchMockHandler(),
|
|
139
166
|
getGetApiInfoMockHandler(),
|
|
140
167
|
getPostApiUploadMockHandler(),
|
|
168
|
+
getGetApiUploadResultIdentifierMockHandler(),
|
|
141
169
|
getGetIpfsCidMockHandler(),
|
|
142
170
|
getHeadIpfsCidMockHandler()
|
|
143
171
|
];
|
|
144
172
|
|
|
145
173
|
//#endregion
|
|
146
|
-
export { getContentMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiUploadMockHandler };
|
|
174
|
+
export { getContentMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetApiUploadResultIdentifierMockHandler, getGetApiUploadResultIdentifierResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiUploadMockHandler, getPostApiUploadResponseMock };
|
|
147
175
|
//# sourceMappingURL=content.msw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.msw.js","names":[],"sources":["../../../../../src/api/generated/content/content.msw.ts"],"sourcesContent":["/**\n * Generated by orval v8.10.0 🍺\n * Do not edit manually.\n * Portal IPFS Plugin API\n *\n## Portal IPFS Plugin API\n\nA comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.\n\n### IPFS Pinning Service API Compatibility\n\nThis API is fully compatible with the [IPFS Pinning Service API specification](https://github.com/ipfs/pinning-services-api-spec), an implementation-agnostic API standard for pinning service providers. This ensures interoperability with existing IPFS pinning clients and tools.\n\n### Features\n\n- **Pinning**: Add, list, update, and remove pinned content\n- **Content**: Upload files, retrieve IPFS content, and manage metadata\n- **IPNS**: Manage IPNS keys and publish content\n- **Files**: Browse and manage pinned files with directory navigation\n- **Websites**: Create and manage website hosting with DNS and SSL automation\n\n### Authentication\n\nAll API endpoints require authentication using JWT tokens obtained from the Portal authentication service.\n\n### Rate Limiting\n\nAPI requests are rate-limited based on user account tier. See Portal documentation for current limits.\n\n### Documentation\n\nFor detailed API usage examples and integration guides, visit the Portal documentation website.\n\n * OpenAPI spec version: 1.0.0\n */\nimport {\n faker\n} from '@faker-js/faker';\n\nimport {\n HttpResponse,\n delay,\n http\n} from 'msw';\nimport type {\n RequestHandlerOptions\n} from 'msw';\n\nimport type {\n BlockMetaResponse,\n ErrorResponse,\n InfoResponse\n} from '../schemas';\n\n\nexport const getGetApiBlockMetaCidResponseMock = (overrideResponse: Partial<Extract<BlockMetaResponse, object>> = {}): BlockMetaResponse => ({block_size: faker.number.int(), child_cid: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => (faker.string.alpha({length: {min: 10, max: 20}}))), name: faker.string.alpha({length: {min: 10, max: 20}}), type: faker.number.int(), unixfs_size: faker.number.int(), ...overrideResponse})\n\nexport const getPostApiBlockMetaBatchResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetApiInfoResponseMock = (overrideResponse: Partial<Extract<InfoResponse, object>> = {}): InfoResponse => ({announcement_addresses: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => (faker.string.alpha({length: {min: 10, max: 20}}))), connection_addresses: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => (faker.string.alpha({length: {min: 10, max: 20}}))), peer_id: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetIpfsCidResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getHeadIpfsCidResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\n\nexport const getGetApiBlockMetaCidMockHandler = (overrideResponse?: BlockMetaResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<BlockMetaResponse> | BlockMetaResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/block/meta/:cid', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiBlockMetaCidResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiBlockMetaBatchMockHandler = (overrideResponse?: ErrorResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<ErrorResponse> | ErrorResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/block/meta/batch', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostApiBlockMetaBatchResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiInfoMockHandler = (overrideResponse?: InfoResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<InfoResponse> | InfoResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/info', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiInfoResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiUploadMockHandler = (overrideResponse?: void | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<void> | void), options?: RequestHandlerOptions) => {\n return http.post('*/api/upload', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n if (typeof overrideResponse === 'function') {await overrideResponse(info); }\n\n return new HttpResponse(null,\n { status: 200\n })\n }, options)\n}\n\nexport const getGetIpfsCidMockHandler = (overrideResponse?: ErrorResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<ErrorResponse> | ErrorResponse), options?: RequestHandlerOptions) => {\n return http.get('*/ipfs/:cid', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetIpfsCidResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getHeadIpfsCidMockHandler = (overrideResponse?: ErrorResponse | ((info: Parameters<Parameters<typeof http.head>[1]>[0]) => Promise<ErrorResponse> | ErrorResponse), options?: RequestHandlerOptions) => {\n return http.head('*/ipfs/:cid', async (info: Parameters<Parameters<typeof http.head>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getHeadIpfsCidResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getContentMock = () => [\n getGetApiBlockMetaCidMockHandler(),\n getPostApiBlockMetaBatchMockHandler(),\n getGetApiInfoMockHandler(),\n getPostApiUploadMockHandler(),\n getGetIpfsCidMockHandler(),\n getHeadIpfsCidMockHandler()\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAa,qCAAqC,mBAAgE,EAAE,MAAyB;CAAC,YAAY,MAAM,OAAO,KAAK;CAAE,WAAW,MAAM,KAAK,EAAE,QAAQ,MAAM,OAAO,IAAI;EAAC,KAAK;EAAG,KAAK;EAAG,CAAC,EAAE,GAAG,GAAG,MAAM,IAAI,EAAE,CAAC,UAAW,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC,CAAE;CAAE,MAAM,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC;CAAE,MAAM,MAAM,OAAO,KA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qB,SAC3C,OAAO,qBAAqB,aAAa,MAAM,iBAAiB,KAAK,GAAG,mBACzE,4BAA4B,EAC5B,EAAE,QAAQ,KACT,CAAC;IACH,QAAQ;;AAEb,MAAa,uBAAuB;CAClC,kCAAkC;CAClC,qCAAqC;CACrC,0BAA0B;CAC1B,6BAA6B;CAC7B,0BAA0B;CAC1B,2BAA2B;CAC5B"}
|
|
1
|
+
{"version":3,"file":"content.msw.js","names":[],"sources":["../../../../../src/api/generated/content/content.msw.ts"],"sourcesContent":["/**\n * Generated by orval v8.10.0 🍺\n * Do not edit manually.\n * Portal IPFS Plugin API\n *\n## Portal IPFS Plugin API\n\nA comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.\n\n### IPFS Pinning Service API Compatibility\n\nThis API is fully compatible with the [IPFS Pinning Service API specification](https://github.com/ipfs/pinning-services-api-spec), an implementation-agnostic API standard for pinning service providers. This ensures interoperability with existing IPFS pinning clients and tools.\n\n### Features\n\n- **Pinning**: Add, list, update, and remove pinned content\n- **Content**: Upload files, retrieve IPFS content, and manage metadata\n- **IPNS**: Manage IPNS keys and publish content\n- **Files**: Browse and manage pinned files with directory navigation\n- **Websites**: Create and manage website hosting with DNS and SSL automation\n\n### Authentication\n\nAll API endpoints require authentication using JWT tokens obtained from the Portal authentication service.\n\n### Rate Limiting\n\nAPI requests are rate-limited based on user account tier. See Portal documentation for current limits.\n\n### Documentation\n\nFor detailed API usage examples and integration guides, visit the Portal documentation website.\n\n * OpenAPI spec version: 1.0.0\n */\nimport {\n faker\n} from '@faker-js/faker';\n\nimport {\n HttpResponse,\n delay,\n http\n} from 'msw';\nimport type {\n RequestHandlerOptions\n} from 'msw';\n\nimport type {\n BlockMetaResponse,\n ErrorResponse,\n InfoResponse,\n PostUploadResponse,\n UploadResultResponse\n} from '../schemas';\n\n\nexport const getGetApiBlockMetaCidResponseMock = (overrideResponse: Partial<Extract<BlockMetaResponse, object>> = {}): BlockMetaResponse => ({block_size: faker.number.int(), child_cid: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => (faker.string.alpha({length: {min: 10, max: 20}}))), name: faker.string.alpha({length: {min: 10, max: 20}}), type: faker.number.int(), unixfs_size: faker.number.int(), ...overrideResponse})\n\nexport const getPostApiBlockMetaBatchResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetApiInfoResponseMock = (overrideResponse: Partial<Extract<InfoResponse, object>> = {}): InfoResponse => ({announcement_addresses: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => (faker.string.alpha({length: {min: 10, max: 20}}))), connection_addresses: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => (faker.string.alpha({length: {min: 10, max: 20}}))), peer_id: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getPostApiUploadResponseMock = (overrideResponse: Partial<Extract<PostUploadResponse, object>> = {}): PostUploadResponse => ({CID: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetApiUploadResultIdentifierResponseMock = (overrideResponse: Partial<Extract<UploadResultResponse, object>> = {}): UploadResultResponse => ({cid: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), error: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), status: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetIpfsCidResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getHeadIpfsCidResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\n\nexport const getGetApiBlockMetaCidMockHandler = (overrideResponse?: BlockMetaResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<BlockMetaResponse> | BlockMetaResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/block/meta/:cid', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiBlockMetaCidResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiBlockMetaBatchMockHandler = (overrideResponse?: ErrorResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<ErrorResponse> | ErrorResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/block/meta/batch', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostApiBlockMetaBatchResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiInfoMockHandler = (overrideResponse?: InfoResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<InfoResponse> | InfoResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/info', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiInfoResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiUploadMockHandler = (overrideResponse?: PostUploadResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<PostUploadResponse> | PostUploadResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/upload', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostApiUploadResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiUploadResultIdentifierMockHandler = (overrideResponse?: UploadResultResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<UploadResultResponse> | UploadResultResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/upload/result/:identifier', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiUploadResultIdentifierResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetIpfsCidMockHandler = (overrideResponse?: ErrorResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<ErrorResponse> | ErrorResponse), options?: RequestHandlerOptions) => {\n return http.get('*/ipfs/:cid', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetIpfsCidResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getHeadIpfsCidMockHandler = (overrideResponse?: ErrorResponse | ((info: Parameters<Parameters<typeof http.head>[1]>[0]) => Promise<ErrorResponse> | ErrorResponse), options?: RequestHandlerOptions) => {\n return http.head('*/ipfs/:cid', async (info: Parameters<Parameters<typeof http.head>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getHeadIpfsCidResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getContentMock = () => [\n getGetApiBlockMetaCidMockHandler(),\n getPostApiBlockMetaBatchMockHandler(),\n getGetApiInfoMockHandler(),\n getPostApiUploadMockHandler(),\n getGetApiUploadResultIdentifierMockHandler(),\n getGetIpfsCidMockHandler(),\n getHeadIpfsCidMockHandler()\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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a,KAAK,qBAAqB,SAC3C,OAAO,qBAAqB,aAAa,MAAM,iBAAiB,KAAK,GAAG,mBACzE,4BAA4B,EAC5B,EAAE,QAAQ,KACT,CAAC;IACH,QAAQ;;AAEb,MAAa,uBAAuB;CAClC,kCAAkC;CAClC,qCAAqC;CACrC,0BAA0B;CAC1B,6BAA6B;CAC7B,4CAA4C;CAC5C,0BAA0B;CAC1B,2BAA2B;CAC5B"}
|
|
@@ -84,6 +84,10 @@ const getPostInternalWebsitesDomainSslStatusResponseMock = (overrideResponse = {
|
|
|
84
84
|
} }),
|
|
85
85
|
updated: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
86
86
|
validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
87
|
+
validation_record_host: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
88
|
+
min: 10,
|
|
89
|
+
max: 20
|
|
90
|
+
} }), void 0]),
|
|
87
91
|
validation_token: faker.string.alpha({ length: {
|
|
88
92
|
min: 10,
|
|
89
93
|
max: 20
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.msw.js","names":[],"sources":["../../../../../src/api/generated/internal/internal.msw.ts"],"sourcesContent":["/**\n * Generated by orval v8.10.0 🍺\n * Do not edit manually.\n * Portal IPFS Plugin API\n *\n## Portal IPFS Plugin API\n\nA comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.\n\n### IPFS Pinning Service API Compatibility\n\nThis API is fully compatible with the [IPFS Pinning Service API specification](https://github.com/ipfs/pinning-services-api-spec), an implementation-agnostic API standard for pinning service providers. This ensures interoperability with existing IPFS pinning clients and tools.\n\n### Features\n\n- **Pinning**: Add, list, update, and remove pinned content\n- **Content**: Upload files, retrieve IPFS content, and manage metadata\n- **IPNS**: Manage IPNS keys and publish content\n- **Files**: Browse and manage pinned files with directory navigation\n- **Websites**: Create and manage website hosting with DNS and SSL automation\n\n### Authentication\n\nAll API endpoints require authentication using JWT tokens obtained from the Portal authentication service.\n\n### Rate Limiting\n\nAPI requests are rate-limited based on user account tier. See Portal documentation for current limits.\n\n### Documentation\n\nFor detailed API usage examples and integration guides, visit the Portal documentation website.\n\n * OpenAPI spec version: 1.0.0\n */\nimport {\n faker\n} from '@faker-js/faker';\n\nimport {\n HttpResponse,\n delay,\n http\n} from 'msw';\nimport type {\n RequestHandlerOptions\n} from 'msw';\n\nimport type {\n WebsiteResponse\n} from '../schemas';\n\n\nexport const getPostInternalWebsitesDomainSslStatusResponseMock = (overrideResponse: Partial<Extract<WebsiteResponse, object>> = {}): WebsiteResponse => ({active_cid: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), created: faker.date.past().toISOString().slice(0, 19) + 'Z', dns_hosting_enabled: faker.datatype.boolean(), dns_zone_id: faker.helpers.arrayElement([faker.number.int(), undefined]), domain: faker.string.alpha({length: {min: 10, max: 20}}), expired: faker.datatype.boolean(), gateway_domain: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), id: faker.number.int(), ipns_key_id: faker.helpers.arrayElement([faker.number.int(), undefined]), is_subdomain: faker.datatype.boolean(), last_checked_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), ssl: faker.helpers.arrayElement([{error: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), issued_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), last_updated_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), status: faker.string.alpha({length: {min: 10, max: 20}})}, undefined]), status: faker.string.alpha({length: {min: 10, max: 20}}), target_hash: faker.string.alpha({length: {min: 10, max: 20}}), target_type: faker.string.alpha({length: {min: 10, max: 20}}), updated: faker.date.past().toISOString().slice(0, 19) + 'Z', validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), validation_token: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\n\nexport const getPostInternalWebsitesDomainSslStatusMockHandler = (overrideResponse?: WebsiteResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<WebsiteResponse> | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.post('*/internal/websites/:domain/ssl-status', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostInternalWebsitesDomainSslStatusResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getInternalMock = () => [\n getPostInternalWebsitesDomainSslStatusMockHandler()\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAa,sDAAsD,mBAA8D,EAAE,MAAuB;CAAC,YAAY,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC,EAAE,OAAU,CAAC;CAAE,SAAS,MAAM,KAAK,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG;CAAK,qBAAqB,MAAM,SAAS,SAAS;CAAE,aAAa,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,KAAK,EAAE,OAAU,CAAC;CAAE,QAAQ,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC;CAAE,SAAS,MAAM,SAAS,SAAS;CAAE,gBAAgB,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC,EAAE,OAAU,CAAC;CAAE,IAAI,MAAM,OAAO,KAAK;CAAE,aAAa,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,KAAK,EAAE,OAAU,CAAC;CAAE,cAAc,MAAM,SAAS,SAAS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../../../src/api/generated/internal/internal.msw.ts"],"sourcesContent":["/**\n * Generated by orval v8.10.0 🍺\n * Do not edit manually.\n * Portal IPFS Plugin API\n *\n## Portal IPFS Plugin API\n\nA comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.\n\n### IPFS Pinning Service API Compatibility\n\nThis API is fully compatible with the [IPFS Pinning Service API specification](https://github.com/ipfs/pinning-services-api-spec), an implementation-agnostic API standard for pinning service providers. This ensures interoperability with existing IPFS pinning clients and tools.\n\n### Features\n\n- **Pinning**: Add, list, update, and remove pinned content\n- **Content**: Upload files, retrieve IPFS content, and manage metadata\n- **IPNS**: Manage IPNS keys and publish content\n- **Files**: Browse and manage pinned files with directory navigation\n- **Websites**: Create and manage website hosting with DNS and SSL automation\n\n### Authentication\n\nAll API endpoints require authentication using JWT tokens obtained from the Portal authentication service.\n\n### Rate Limiting\n\nAPI requests are rate-limited based on user account tier. See Portal documentation for current limits.\n\n### Documentation\n\nFor detailed API usage examples and integration guides, visit the Portal documentation website.\n\n * OpenAPI spec version: 1.0.0\n */\nimport {\n faker\n} from '@faker-js/faker';\n\nimport {\n HttpResponse,\n delay,\n http\n} from 'msw';\nimport type {\n RequestHandlerOptions\n} from 'msw';\n\nimport type {\n WebsiteResponse\n} from '../schemas';\n\n\nexport const getPostInternalWebsitesDomainSslStatusResponseMock = (overrideResponse: Partial<Extract<WebsiteResponse, object>> = {}): WebsiteResponse => ({active_cid: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), created: faker.date.past().toISOString().slice(0, 19) + 'Z', dns_hosting_enabled: faker.datatype.boolean(), dns_zone_id: faker.helpers.arrayElement([faker.number.int(), undefined]), domain: faker.string.alpha({length: {min: 10, max: 20}}), expired: faker.datatype.boolean(), gateway_domain: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), id: faker.number.int(), ipns_key_id: faker.helpers.arrayElement([faker.number.int(), undefined]), is_subdomain: faker.datatype.boolean(), last_checked_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), ssl: faker.helpers.arrayElement([{error: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), issued_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), last_updated_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), status: faker.string.alpha({length: {min: 10, max: 20}})}, undefined]), status: faker.string.alpha({length: {min: 10, max: 20}}), target_hash: faker.string.alpha({length: {min: 10, max: 20}}), target_type: faker.string.alpha({length: {min: 10, max: 20}}), updated: faker.date.past().toISOString().slice(0, 19) + 'Z', validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), validation_record_host: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), validation_token: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\n\nexport const getPostInternalWebsitesDomainSslStatusMockHandler = (overrideResponse?: WebsiteResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<WebsiteResponse> | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.post('*/internal/websites/:domain/ssl-status', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostInternalWebsitesDomainSslStatusResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getInternalMock = () => [\n getPostInternalWebsitesDomainSslStatusMockHandler()\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAa,sDAAsD,mBAA8D,EAAE,MAAuB;CAAC,YAAY,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC,EAAE,OAAU,CA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Q;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC;CAAE,aAAa,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC;CAAE,aAAa,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC;CAAE,SAAS,MAAM,KAAK,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG;CAAK,uBAAuB,MAAM,QAAQ,aAAa,CAAC,MAAM,KAAK,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG,KAAK,OAAU,CAAC;CAAE,wBAAwB,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC,EAAE,OAAU,CAAC;CAAE,kBAAkB,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC;CAAE,GAAG;CAAiB;AAG90D,MAAa,qDAAqD,kBAA6I,YAAoC;AACjP,QAAO,KAAK,KAAK,0CAA0C,OAAO,SAAyD;AAAC,QAAM,MAAM,EAAE;AAGxI,SAAO,aAAa,KAAK,qBAAqB,SAC3C,OAAO,qBAAqB,aAAa,MAAM,iBAAiB,KAAK,GAAG,mBACzE,oDAAoD,EACpD,EAAE,QAAQ,KACT,CAAC;IACH,QAAQ;;AAEb,MAAa,wBAAwB,CACnC,mDAAmD,CACpD"}
|
|
@@ -48,6 +48,7 @@ const getGetApiIpnsKeysResponseMock = (overrideResponse = {}) => ({
|
|
|
48
48
|
min: 10,
|
|
49
49
|
max: 20
|
|
50
50
|
} }),
|
|
51
|
+
last_published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
51
52
|
name: faker.string.alpha({ length: {
|
|
52
53
|
min: 10,
|
|
53
54
|
max: 20
|
|
@@ -55,7 +56,11 @@ const getGetApiIpnsKeysResponseMock = (overrideResponse = {}) => ({
|
|
|
55
56
|
peer_id: faker.string.alpha({ length: {
|
|
56
57
|
min: 10,
|
|
57
58
|
max: 20
|
|
58
|
-
} })
|
|
59
|
+
} }),
|
|
60
|
+
value: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
61
|
+
min: 10,
|
|
62
|
+
max: 20
|
|
63
|
+
} }), void 0])
|
|
59
64
|
})),
|
|
60
65
|
total: faker.number.int(),
|
|
61
66
|
...overrideResponse
|
|
@@ -73,6 +78,7 @@ const getPostApiIpnsKeysResponseMock = (overrideResponse = {}) => faker.helpers.
|
|
|
73
78
|
min: 10,
|
|
74
79
|
max: 20
|
|
75
80
|
} }),
|
|
81
|
+
last_published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
76
82
|
name: faker.string.alpha({ length: {
|
|
77
83
|
min: 10,
|
|
78
84
|
max: 20
|
|
@@ -81,6 +87,10 @@ const getPostApiIpnsKeysResponseMock = (overrideResponse = {}) => faker.helpers.
|
|
|
81
87
|
min: 10,
|
|
82
88
|
max: 20
|
|
83
89
|
} }),
|
|
90
|
+
value: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
91
|
+
min: 10,
|
|
92
|
+
max: 20
|
|
93
|
+
} }), void 0]),
|
|
84
94
|
...overrideResponse
|
|
85
95
|
}]);
|
|
86
96
|
const getDeleteApiIpnsKeysIdResponseMock = (overrideResponse = {}) => ({
|
|
@@ -97,6 +107,7 @@ const getGetApiIpnsKeysIdResponseMock = (overrideResponse = {}) => ({
|
|
|
97
107
|
min: 10,
|
|
98
108
|
max: 20
|
|
99
109
|
} }),
|
|
110
|
+
last_published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
100
111
|
name: faker.string.alpha({ length: {
|
|
101
112
|
min: 10,
|
|
102
113
|
max: 20
|
|
@@ -105,6 +116,10 @@ const getGetApiIpnsKeysIdResponseMock = (overrideResponse = {}) => ({
|
|
|
105
116
|
min: 10,
|
|
106
117
|
max: 20
|
|
107
118
|
} }),
|
|
119
|
+
value: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
120
|
+
min: 10,
|
|
121
|
+
max: 20
|
|
122
|
+
} }), void 0]),
|
|
108
123
|
...overrideResponse
|
|
109
124
|
});
|
|
110
125
|
const getPostApiIpnsKeysIdRepublishResponseMock = (overrideResponse = {}) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ipns.msw.js","names":[],"sources":["../../../../../src/api/generated/ipns/ipns.msw.ts"],"sourcesContent":["/**\n * Generated by orval v8.10.0 🍺\n * Do not edit manually.\n * Portal IPFS Plugin API\n *\n## Portal IPFS Plugin API\n\nA comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.\n\n### IPFS Pinning Service API Compatibility\n\nThis API is fully compatible with the [IPFS Pinning Service API specification](https://github.com/ipfs/pinning-services-api-spec), an implementation-agnostic API standard for pinning service providers. This ensures interoperability with existing IPFS pinning clients and tools.\n\n### Features\n\n- **Pinning**: Add, list, update, and remove pinned content\n- **Content**: Upload files, retrieve IPFS content, and manage metadata\n- **IPNS**: Manage IPNS keys and publish content\n- **Files**: Browse and manage pinned files with directory navigation\n- **Websites**: Create and manage website hosting with DNS and SSL automation\n\n### Authentication\n\nAll API endpoints require authentication using JWT tokens obtained from the Portal authentication service.\n\n### Rate Limiting\n\nAPI requests are rate-limited based on user account tier. See Portal documentation for current limits.\n\n### Documentation\n\nFor detailed API usage examples and integration guides, visit the Portal documentation website.\n\n * OpenAPI spec version: 1.0.0\n */\nimport {\n faker\n} from '@faker-js/faker';\n\nimport {\n HttpResponse,\n delay,\n http\n} from 'msw';\nimport type {\n RequestHandlerOptions\n} from 'msw';\n\nimport type {\n ErrorResponse,\n IPNSKeyListResponseResponse,\n IPNSKeyResponse,\n IPNSPublishResponse,\n IPNSRepublishResponse,\n IPNSResolveResponse\n} from '../schemas';\n\n\nexport const getGetApiIpnsKeysResponseMock = (overrideResponse: Partial<Extract<IPNSKeyListResponseResponse, object>> = {}): IPNSKeyListResponseResponse => ({data: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({created: faker.date.past().toISOString().slice(0, 19) + 'Z', id: faker.number.int(), ipns_name: faker.string.alpha({length: {min: 10, max: 20}}), name: faker.string.alpha({length: {min: 10, max: 20}}), peer_id: faker.string.alpha({length: {min: 10, max: 20}})})), total: faker.number.int(), ...overrideResponse})\n\nexport const getPostApiIpnsKeysResponseMock = (overrideResponse: Partial<Extract<ErrorResponse | IPNSKeyResponse, object>> = {}): ErrorResponse | IPNSKeyResponse => (faker.helpers.arrayElement([{error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse}, {created: faker.date.past().toISOString().slice(0, 19) + 'Z', id: faker.number.int(), ipns_name: faker.string.alpha({length: {min: 10, max: 20}}), name: faker.string.alpha({length: {min: 10, max: 20}}), peer_id: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse}]))\n\nexport const getDeleteApiIpnsKeysIdResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetApiIpnsKeysIdResponseMock = (overrideResponse: Partial<Extract<IPNSKeyResponse, object>> = {}): IPNSKeyResponse => ({created: faker.date.past().toISOString().slice(0, 19) + 'Z', id: faker.number.int(), ipns_name: faker.string.alpha({length: {min: 10, max: 20}}), name: faker.string.alpha({length: {min: 10, max: 20}}), peer_id: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getPostApiIpnsKeysIdRepublishResponseMock = (overrideResponse: Partial<Extract<IPNSRepublishResponse, object>> = {}): IPNSRepublishResponse => ({count: faker.number.int(), message: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getPostApiIpnsPublishResponseMock = (overrideResponse: Partial<Extract<IPNSPublishResponse, object>> = {}): IPNSPublishResponse => ({name: faker.string.alpha({length: {min: 10, max: 20}}), published: faker.date.past().toISOString().slice(0, 19) + 'Z', sequence: faker.number.int(), validity: faker.date.past().toISOString().slice(0, 19) + 'Z', value: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetApiIpnsResolveNameResponseMock = (overrideResponse: Partial<Extract<IPNSResolveResponse, object>> = {}): IPNSResolveResponse => ({expired: faker.datatype.boolean(), expires: faker.date.past().toISOString().slice(0, 19) + 'Z', name: faker.string.alpha({length: {min: 10, max: 20}}), path: faker.string.alpha({length: {min: 10, max: 20}}), sequence: faker.number.int(), value: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\n\nexport const getGetApiIpnsKeysMockHandler = (overrideResponse?: IPNSKeyListResponseResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<IPNSKeyListResponseResponse> | IPNSKeyListResponseResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/ipns/keys', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiIpnsKeysResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiIpnsKeysMockHandler = (overrideResponse?: ErrorResponse | IPNSKeyResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<ErrorResponse | IPNSKeyResponse> | ErrorResponse | IPNSKeyResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/ipns/keys', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostApiIpnsKeysResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getDeleteApiIpnsKeysIdMockHandler = (overrideResponse?: ErrorResponse | void | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Promise<ErrorResponse | void> | ErrorResponse | void), options?: RequestHandlerOptions) => {\n return http.delete('*/api/ipns/keys/:id', async (info: Parameters<Parameters<typeof http.delete>[1]>[0]) => {await delay(0);\n\n const resolvedBody = overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getDeleteApiIpnsKeysIdResponseMock();\n return resolvedBody === undefined\n ? new HttpResponse(null, { status: 204 })\n : HttpResponse.json(resolvedBody, { status: 200 })\n }, options)\n}\n\nexport const getGetApiIpnsKeysIdMockHandler = (overrideResponse?: IPNSKeyResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<IPNSKeyResponse> | IPNSKeyResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/ipns/keys/:id', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiIpnsKeysIdResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiIpnsKeysIdRepublishMockHandler = (overrideResponse?: IPNSRepublishResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<IPNSRepublishResponse> | IPNSRepublishResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/ipns/keys/:id/republish', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostApiIpnsKeysIdRepublishResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiIpnsPublishMockHandler = (overrideResponse?: IPNSPublishResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<IPNSPublishResponse> | IPNSPublishResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/ipns/publish', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostApiIpnsPublishResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiIpnsResolveNameMockHandler = (overrideResponse?: IPNSResolveResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<IPNSResolveResponse> | IPNSResolveResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/ipns/resolve/:name', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiIpnsResolveNameResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getIpnsMock = () => [\n getGetApiIpnsKeysMockHandler(),\n getPostApiIpnsKeysMockHandler(),\n getDeleteApiIpnsKeysIdMockHandler(),\n getGetApiIpnsKeysIdMockHandler(),\n getPostApiIpnsKeysIdRepublishMockHandler(),\n getPostApiIpnsPublishMockHandler(),\n getGetApiIpnsResolveNameMockHandler()\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAa,iCAAiC,mBAA0E,EAAE,MAAmC;CAAC,MAAM,MAAM,KAAK,EAAE,QAAQ,MAAM,OAAO,IAAI;EAAC,KAAK;EAAG,KAAK;EAAG,CAAC,EAAE,GAAG,GAAG,MAAM,IAAI,EAAE,CAAC,WAAW;EAAC,SAAS,MAAM,KAAK,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG;EAAK,IAAI,MAAM,OAAO,KAAK;EAAE,WAAW,MAAM,OAAO,MAAM,EAAC,QAAQ;GAAC,KAAK;GAAI,KAAK;GAAG,EAAC,CAAC;EAAE,MAAM,MAAM,OAAO,MAAM,EAAC,QAAQ;GAAC,KAAK;GAAI,KAAK;GAAG,EAAC,CAAC;EAAE,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AyJ,YAAoC;AAC5O,QAAO,KAAK,KAAK,sBAAsB,OAAO,SAAyD;AAAC,QAAM,MAAM,EAAE;AAGpH,SAAO,aAAa,KAAK,qBAAqB,SAC3C,OAAO,qBAAqB,aAAa,MAAM,iBAAiB,KAAK,GAAG,mBACzE,mCAAmC,EACnC,EAAE,QAAQ,KACT,CAAC;IACH,QAAQ;;AAGb,MAAa,uCAAuC,kBAAwJ,YAAoC;AAC9O,QAAO,KAAK,IAAI,4BAA4B,OAAO,SAAwD;AAAC,QAAM,MAAM,EAAE;AAGxH,SAAO,aAAa,KAAK,qBAAqB,SAC3C,OAAO,qBAAqB,aAAa,MAAM,iBAAiB,KAAK,GAAG,mBACzE,sCAAsC,EACtC,EAAE,QAAQ,KACT,CAAC;IACH,QAAQ;;AAEb,MAAa,oBAAoB;CAC/B,8BAA8B;CAC9B,+BAA+B;CAC/B,mCAAmC;CACnC,gCAAgC;CAChC,0CAA0C;CAC1C,kCAAkC;CAClC,qCAAqC;CACtC"}
|
|
1
|
+
{"version":3,"file":"ipns.msw.js","names":[],"sources":["../../../../../src/api/generated/ipns/ipns.msw.ts"],"sourcesContent":["/**\n * Generated by orval v8.10.0 🍺\n * Do not edit manually.\n * Portal IPFS Plugin API\n *\n## Portal IPFS Plugin API\n\nA comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.\n\n### IPFS Pinning Service API Compatibility\n\nThis API is fully compatible with the [IPFS Pinning Service API specification](https://github.com/ipfs/pinning-services-api-spec), an implementation-agnostic API standard for pinning service providers. This ensures interoperability with existing IPFS pinning clients and tools.\n\n### Features\n\n- **Pinning**: Add, list, update, and remove pinned content\n- **Content**: Upload files, retrieve IPFS content, and manage metadata\n- **IPNS**: Manage IPNS keys and publish content\n- **Files**: Browse and manage pinned files with directory navigation\n- **Websites**: Create and manage website hosting with DNS and SSL automation\n\n### Authentication\n\nAll API endpoints require authentication using JWT tokens obtained from the Portal authentication service.\n\n### Rate Limiting\n\nAPI requests are rate-limited based on user account tier. See Portal documentation for current limits.\n\n### Documentation\n\nFor detailed API usage examples and integration guides, visit the Portal documentation website.\n\n * OpenAPI spec version: 1.0.0\n */\nimport {\n faker\n} from '@faker-js/faker';\n\nimport {\n HttpResponse,\n delay,\n http\n} from 'msw';\nimport type {\n RequestHandlerOptions\n} from 'msw';\n\nimport type {\n ErrorResponse,\n IPNSKeyListResponseResponse,\n IPNSKeyResponse,\n IPNSPublishResponse,\n IPNSRepublishResponse,\n IPNSResolveResponse\n} from '../schemas';\n\n\nexport const getGetApiIpnsKeysResponseMock = (overrideResponse: Partial<Extract<IPNSKeyListResponseResponse, object>> = {}): IPNSKeyListResponseResponse => ({data: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({created: faker.date.past().toISOString().slice(0, 19) + 'Z', id: faker.number.int(), ipns_name: faker.string.alpha({length: {min: 10, max: 20}}), last_published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), name: faker.string.alpha({length: {min: 10, max: 20}}), peer_id: faker.string.alpha({length: {min: 10, max: 20}}), value: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined])})), total: faker.number.int(), ...overrideResponse})\n\nexport const getPostApiIpnsKeysResponseMock = (overrideResponse: Partial<Extract<ErrorResponse | IPNSKeyResponse, object>> = {}): ErrorResponse | IPNSKeyResponse => (faker.helpers.arrayElement([{error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse}, {created: faker.date.past().toISOString().slice(0, 19) + 'Z', id: faker.number.int(), ipns_name: faker.string.alpha({length: {min: 10, max: 20}}), last_published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), name: faker.string.alpha({length: {min: 10, max: 20}}), peer_id: faker.string.alpha({length: {min: 10, max: 20}}), value: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), ...overrideResponse}]))\n\nexport const getDeleteApiIpnsKeysIdResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetApiIpnsKeysIdResponseMock = (overrideResponse: Partial<Extract<IPNSKeyResponse, object>> = {}): IPNSKeyResponse => ({created: faker.date.past().toISOString().slice(0, 19) + 'Z', id: faker.number.int(), ipns_name: faker.string.alpha({length: {min: 10, max: 20}}), last_published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), name: faker.string.alpha({length: {min: 10, max: 20}}), peer_id: faker.string.alpha({length: {min: 10, max: 20}}), value: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), ...overrideResponse})\n\nexport const getPostApiIpnsKeysIdRepublishResponseMock = (overrideResponse: Partial<Extract<IPNSRepublishResponse, object>> = {}): IPNSRepublishResponse => ({count: faker.number.int(), message: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getPostApiIpnsPublishResponseMock = (overrideResponse: Partial<Extract<IPNSPublishResponse, object>> = {}): IPNSPublishResponse => ({name: faker.string.alpha({length: {min: 10, max: 20}}), published: faker.date.past().toISOString().slice(0, 19) + 'Z', sequence: faker.number.int(), validity: faker.date.past().toISOString().slice(0, 19) + 'Z', value: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetApiIpnsResolveNameResponseMock = (overrideResponse: Partial<Extract<IPNSResolveResponse, object>> = {}): IPNSResolveResponse => ({expired: faker.datatype.boolean(), expires: faker.date.past().toISOString().slice(0, 19) + 'Z', name: faker.string.alpha({length: {min: 10, max: 20}}), path: faker.string.alpha({length: {min: 10, max: 20}}), sequence: faker.number.int(), value: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\n\nexport const getGetApiIpnsKeysMockHandler = (overrideResponse?: IPNSKeyListResponseResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<IPNSKeyListResponseResponse> | IPNSKeyListResponseResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/ipns/keys', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiIpnsKeysResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiIpnsKeysMockHandler = (overrideResponse?: ErrorResponse | IPNSKeyResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<ErrorResponse | IPNSKeyResponse> | ErrorResponse | IPNSKeyResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/ipns/keys', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostApiIpnsKeysResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getDeleteApiIpnsKeysIdMockHandler = (overrideResponse?: ErrorResponse | void | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Promise<ErrorResponse | void> | ErrorResponse | void), options?: RequestHandlerOptions) => {\n return http.delete('*/api/ipns/keys/:id', async (info: Parameters<Parameters<typeof http.delete>[1]>[0]) => {await delay(0);\n\n const resolvedBody = overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getDeleteApiIpnsKeysIdResponseMock();\n return resolvedBody === undefined\n ? new HttpResponse(null, { status: 204 })\n : HttpResponse.json(resolvedBody, { status: 200 })\n }, options)\n}\n\nexport const getGetApiIpnsKeysIdMockHandler = (overrideResponse?: IPNSKeyResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<IPNSKeyResponse> | IPNSKeyResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/ipns/keys/:id', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiIpnsKeysIdResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiIpnsKeysIdRepublishMockHandler = (overrideResponse?: IPNSRepublishResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<IPNSRepublishResponse> | IPNSRepublishResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/ipns/keys/:id/republish', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostApiIpnsKeysIdRepublishResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiIpnsPublishMockHandler = (overrideResponse?: IPNSPublishResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<IPNSPublishResponse> | IPNSPublishResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/ipns/publish', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostApiIpnsPublishResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiIpnsResolveNameMockHandler = (overrideResponse?: IPNSResolveResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<IPNSResolveResponse> | IPNSResolveResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/ipns/resolve/:name', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getGetApiIpnsResolveNameResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getIpnsMock = () => [\n getGetApiIpnsKeysMockHandler(),\n getPostApiIpnsKeysMockHandler(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