@lumeweb/pinner 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/car.js +2 -0
- package/dist/esm/upload/car.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 +4 -4
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//#region src/api/generated/schemas/postUploadResponse.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Generated by orval v8.10.0 🍺
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
* Portal IPFS Plugin API
|
|
6
|
+
*
|
|
7
|
+
## Portal IPFS Plugin API
|
|
8
|
+
|
|
9
|
+
A comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.
|
|
10
|
+
|
|
11
|
+
### IPFS Pinning Service API Compatibility
|
|
12
|
+
|
|
13
|
+
This 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.
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- **Pinning**: Add, list, update, and remove pinned content
|
|
18
|
+
- **Content**: Upload files, retrieve IPFS content, and manage metadata
|
|
19
|
+
- **IPNS**: Manage IPNS keys and publish content
|
|
20
|
+
- **Files**: Browse and manage pinned files with directory navigation
|
|
21
|
+
- **Websites**: Create and manage website hosting with DNS and SSL automation
|
|
22
|
+
|
|
23
|
+
### Authentication
|
|
24
|
+
|
|
25
|
+
All API endpoints require authentication using JWT tokens obtained from the Portal authentication service.
|
|
26
|
+
|
|
27
|
+
### Rate Limiting
|
|
28
|
+
|
|
29
|
+
API requests are rate-limited based on user account tier. See Portal documentation for current limits.
|
|
30
|
+
|
|
31
|
+
### Documentation
|
|
32
|
+
|
|
33
|
+
For detailed API usage examples and integration guides, visit the Portal documentation website.
|
|
34
|
+
|
|
35
|
+
* OpenAPI spec version: 1.0.0
|
|
36
|
+
*/
|
|
37
|
+
interface PostUploadResponse {
|
|
38
|
+
CID: string;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { PostUploadResponse };
|
|
42
|
+
//# sourceMappingURL=postUploadResponse.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/api/generated/schemas/uploadResultResponse.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Generated by orval v8.10.0 🍺
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
* Portal IPFS Plugin API
|
|
6
|
+
*
|
|
7
|
+
## Portal IPFS Plugin API
|
|
8
|
+
|
|
9
|
+
A comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.
|
|
10
|
+
|
|
11
|
+
### IPFS Pinning Service API Compatibility
|
|
12
|
+
|
|
13
|
+
This 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.
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- **Pinning**: Add, list, update, and remove pinned content
|
|
18
|
+
- **Content**: Upload files, retrieve IPFS content, and manage metadata
|
|
19
|
+
- **IPNS**: Manage IPNS keys and publish content
|
|
20
|
+
- **Files**: Browse and manage pinned files with directory navigation
|
|
21
|
+
- **Websites**: Create and manage website hosting with DNS and SSL automation
|
|
22
|
+
|
|
23
|
+
### Authentication
|
|
24
|
+
|
|
25
|
+
All API endpoints require authentication using JWT tokens obtained from the Portal authentication service.
|
|
26
|
+
|
|
27
|
+
### Rate Limiting
|
|
28
|
+
|
|
29
|
+
API requests are rate-limited based on user account tier. See Portal documentation for current limits.
|
|
30
|
+
|
|
31
|
+
### Documentation
|
|
32
|
+
|
|
33
|
+
For detailed API usage examples and integration guides, visit the Portal documentation website.
|
|
34
|
+
|
|
35
|
+
* OpenAPI spec version: 1.0.0
|
|
36
|
+
*/
|
|
37
|
+
interface UploadResultResponse {
|
|
38
|
+
cid?: string;
|
|
39
|
+
error?: string;
|
|
40
|
+
status: string;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { UploadResultResponse };
|
|
44
|
+
//# sourceMappingURL=uploadResultResponse.d.ts.map
|
|
@@ -88,6 +88,10 @@ const getGetApiWebsitesResponseMock = (overrideResponse = {}) => ({
|
|
|
88
88
|
} }),
|
|
89
89
|
updated: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
90
90
|
validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
91
|
+
validation_record_host: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
92
|
+
min: 10,
|
|
93
|
+
max: 20
|
|
94
|
+
} }), void 0]),
|
|
91
95
|
validation_token: faker.string.alpha({ length: {
|
|
92
96
|
min: 10,
|
|
93
97
|
max: 20
|
|
@@ -149,6 +153,10 @@ const getPostApiWebsitesResponseMock = (overrideResponse = {}) => faker.helpers.
|
|
|
149
153
|
} }),
|
|
150
154
|
updated: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
151
155
|
validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
156
|
+
validation_record_host: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
157
|
+
min: 10,
|
|
158
|
+
max: 20
|
|
159
|
+
} }), void 0]),
|
|
152
160
|
validation_token: faker.string.alpha({ length: {
|
|
153
161
|
min: 10,
|
|
154
162
|
max: 20
|
|
@@ -202,6 +210,10 @@ const getGetApiWebsitesDomainSslStatusResponseMock = (overrideResponse = {}) =>
|
|
|
202
210
|
} }),
|
|
203
211
|
updated: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
204
212
|
validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
213
|
+
validation_record_host: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
214
|
+
min: 10,
|
|
215
|
+
max: 20
|
|
216
|
+
} }), void 0]),
|
|
205
217
|
validation_token: faker.string.alpha({ length: {
|
|
206
218
|
min: 10,
|
|
207
219
|
max: 20
|
|
@@ -262,6 +274,10 @@ const getGetApiWebsitesIdResponseMock = (overrideResponse = {}) => ({
|
|
|
262
274
|
} }),
|
|
263
275
|
updated: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
264
276
|
validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
277
|
+
validation_record_host: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
278
|
+
min: 10,
|
|
279
|
+
max: 20
|
|
280
|
+
} }), void 0]),
|
|
265
281
|
validation_token: faker.string.alpha({ length: {
|
|
266
282
|
min: 10,
|
|
267
283
|
max: 20
|
|
@@ -315,6 +331,10 @@ const getPutApiWebsitesIdResponseMock = (overrideResponse = {}) => ({
|
|
|
315
331
|
} }),
|
|
316
332
|
updated: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
317
333
|
validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
334
|
+
validation_record_host: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
335
|
+
min: 10,
|
|
336
|
+
max: 20
|
|
337
|
+
} }), void 0]),
|
|
318
338
|
validation_token: faker.string.alpha({ length: {
|
|
319
339
|
min: 10,
|
|
320
340
|
max: 20
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websites.msw.js","names":[],"sources":["../../../../../src/api/generated/websites/websites.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 WebsiteConfigResponse,\n WebsiteItemResponse,\n WebsiteResponse,\n WebsiteValidateResponse\n} from '../schemas';\n\n\nexport const getGetApiWebsitesResponseMock = (overrideResponse: Partial<Extract<WebsiteItemResponse, object>> = {}): WebsiteItemResponse => ({data: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({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}})})), total: faker.number.int(), ...overrideResponse})\n\nexport const getPostApiWebsitesResponseMock = (overrideResponse: Partial<Extract<ErrorResponse | WebsiteResponse, object>> = {}): ErrorResponse | WebsiteResponse => (faker.helpers.arrayElement([{error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse}, {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\nexport const getGetApiWebsitesDomainSslStatusResponseMock = (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\nexport const getDeleteApiWebsitesIdResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetApiWebsitesIdResponseMock = (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\nexport const getPutApiWebsitesIdResponseMock = (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\nexport const getPostApiWebsitesIdValidateResponseMock = (overrideResponse: Partial<Extract<WebsiteValidateResponse, object>> = {}): WebsiteValidateResponse => ({domain: faker.string.alpha({length: {min: 10, max: 20}}), id: faker.number.int(), message: faker.string.alpha({length: {min: 10, max: 20}}), reason: faker.string.alpha({length: {min: 10, max: 20}}), valid: faker.datatype.boolean(), ...overrideResponse})\n\nexport const getGetApiWebsitesConfigResponseMock = (overrideResponse: Partial<Extract<WebsiteConfigResponse, object>> = {}): WebsiteConfigResponse => ({gateway_domain: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), nameservers: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => (faker.string.alpha({length: {min: 10, max: 20}}))), undefined]), ...overrideResponse})\n\n\nexport const getGetApiWebsitesMockHandler = (overrideResponse?: WebsiteItemResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<WebsiteItemResponse> | WebsiteItemResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/websites', 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 : getGetApiWebsitesResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiWebsitesMockHandler = (overrideResponse?: ErrorResponse | WebsiteResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<ErrorResponse | WebsiteResponse> | ErrorResponse | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/websites', 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 : getPostApiWebsitesResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiWebsitesDomainSslStatusMockHandler = (overrideResponse?: WebsiteResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<WebsiteResponse> | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/websites/:domain/ssl-status', 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 : getGetApiWebsitesDomainSslStatusResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getDeleteApiWebsitesIdMockHandler = (overrideResponse?: ErrorResponse | void | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Promise<ErrorResponse | void> | ErrorResponse | void), options?: RequestHandlerOptions) => {\n return http.delete('*/api/websites/: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 : getDeleteApiWebsitesIdResponseMock();\n return resolvedBody === undefined\n ? new HttpResponse(null, { status: 204 })\n : HttpResponse.json(resolvedBody, { status: 200 })\n }, options)\n}\n\nexport const getGetApiWebsitesIdMockHandler = (overrideResponse?: WebsiteResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<WebsiteResponse> | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/websites/: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 : getGetApiWebsitesIdResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPutApiWebsitesIdMockHandler = (overrideResponse?: WebsiteResponse | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Promise<WebsiteResponse> | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.put('*/api/websites/:id', async (info: Parameters<Parameters<typeof http.put>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPutApiWebsitesIdResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiWebsitesIdValidateMockHandler = (overrideResponse?: WebsiteValidateResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<WebsiteValidateResponse> | WebsiteValidateResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/websites/:id/validate', 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 : getPostApiWebsitesIdValidateResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiWebsitesConfigMockHandler = (overrideResponse?: WebsiteConfigResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<WebsiteConfigResponse> | WebsiteConfigResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/websites/config', 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 : getGetApiWebsitesConfigResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getWebsitesMock = () => [\n getGetApiWebsitesMockHandler(),\n getPostApiWebsitesMockHandler(),\n getGetApiWebsitesDomainSslStatusMockHandler(),\n getDeleteApiWebsitesIdMockHandler(),\n getGetApiWebsitesIdMockHandler(),\n getPutApiWebsitesIdMockHandler(),\n getPostApiWebsitesIdValidateMockHandler(),\n getGetApiWebsitesConfigMockHandler()\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAa,iCAAiC,mBAAkE,EAAE,MAA2B;CAAC,MAAM,MAAM,KAAK,EAAE,QAAQ,MAAM,OAAO,IAAI;EAAC,KAAK;EAAG,KAAK;EAAG,CAAC,EAAE,GAAG,GAAG,MAAM,IAAI,EAAE,CAAC,WAAW;EAAC,YAAY,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,MAAM,EAAC,QAAQ;GAAC,KAAK;GAAI,KAAK;GAAG,EAAC,CAAC,EAAE,OAAU,CAAC;EAAE,SAAS,MAAM,KAAK,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG;EAAK,qBAAqB,MAAM,SAAS,SAAS;EAAE,aAAa,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,KAAK,EAAE,OAAU,CAAC;EAAE,QAAQ,MAAM,OAAO,MAAM,EAAC,QAAQ;GAAC,KAAK;GAAI,KAAK;GAAG,EAAC,CAAC;EAAE,SAAS,MAAM,SAAS,SAAS;EAAE,gBAAgB,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,MAAM,EAAC,QAAQ;GAAC,KAA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AEb,MAAa,wBAAwB;CACnC,8BAA8B;CAC9B,+BAA+B;CAC/B,6CAA6C;CAC7C,mCAAmC;CACnC,gCAAgC;CAChC,gCAAgC;CAChC,yCAAyC;CACzC,oCAAoC;CACrC"}
|
|
1
|
+
{"version":3,"file":"websites.msw.js","names":[],"sources":["../../../../../src/api/generated/websites/websites.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 WebsiteConfigResponse,\n WebsiteItemResponse,\n WebsiteResponse,\n WebsiteValidateResponse\n} from '../schemas';\n\n\nexport const getGetApiWebsitesResponseMock = (overrideResponse: Partial<Extract<WebsiteItemResponse, object>> = {}): WebsiteItemResponse => ({data: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({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}})})), total: faker.number.int(), ...overrideResponse})\n\nexport const getPostApiWebsitesResponseMock = (overrideResponse: Partial<Extract<ErrorResponse | WebsiteResponse, object>> = {}): ErrorResponse | WebsiteResponse => (faker.helpers.arrayElement([{error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse}, {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\nexport const getGetApiWebsitesDomainSslStatusResponseMock = (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\nexport const getDeleteApiWebsitesIdResponseMock = (overrideResponse: Partial<Extract<ErrorResponse, object>> = {}): ErrorResponse => ({error: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\nexport const getGetApiWebsitesIdResponseMock = (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\nexport const getPutApiWebsitesIdResponseMock = (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\nexport const getPostApiWebsitesIdValidateResponseMock = (overrideResponse: Partial<Extract<WebsiteValidateResponse, object>> = {}): WebsiteValidateResponse => ({domain: faker.string.alpha({length: {min: 10, max: 20}}), id: faker.number.int(), message: faker.string.alpha({length: {min: 10, max: 20}}), reason: faker.string.alpha({length: {min: 10, max: 20}}), valid: faker.datatype.boolean(), ...overrideResponse})\n\nexport const getGetApiWebsitesConfigResponseMock = (overrideResponse: Partial<Extract<WebsiteConfigResponse, object>> = {}): WebsiteConfigResponse => ({gateway_domain: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), nameservers: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => (faker.string.alpha({length: {min: 10, max: 20}}))), undefined]), ...overrideResponse})\n\n\nexport const getGetApiWebsitesMockHandler = (overrideResponse?: WebsiteItemResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<WebsiteItemResponse> | WebsiteItemResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/websites', 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 : getGetApiWebsitesResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiWebsitesMockHandler = (overrideResponse?: ErrorResponse | WebsiteResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<ErrorResponse | WebsiteResponse> | ErrorResponse | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/websites', 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 : getPostApiWebsitesResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiWebsitesDomainSslStatusMockHandler = (overrideResponse?: WebsiteResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<WebsiteResponse> | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/websites/:domain/ssl-status', 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 : getGetApiWebsitesDomainSslStatusResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getDeleteApiWebsitesIdMockHandler = (overrideResponse?: ErrorResponse | void | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Promise<ErrorResponse | void> | ErrorResponse | void), options?: RequestHandlerOptions) => {\n return http.delete('*/api/websites/: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 : getDeleteApiWebsitesIdResponseMock();\n return resolvedBody === undefined\n ? new HttpResponse(null, { status: 204 })\n : HttpResponse.json(resolvedBody, { status: 200 })\n }, options)\n}\n\nexport const getGetApiWebsitesIdMockHandler = (overrideResponse?: WebsiteResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<WebsiteResponse> | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/websites/: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 : getGetApiWebsitesIdResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPutApiWebsitesIdMockHandler = (overrideResponse?: WebsiteResponse | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Promise<WebsiteResponse> | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.put('*/api/websites/:id', async (info: Parameters<Parameters<typeof http.put>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPutApiWebsitesIdResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getPostApiWebsitesIdValidateMockHandler = (overrideResponse?: WebsiteValidateResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<WebsiteValidateResponse> | WebsiteValidateResponse), options?: RequestHandlerOptions) => {\n return http.post('*/api/websites/:id/validate', 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 : getPostApiWebsitesIdValidateResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiWebsitesConfigMockHandler = (overrideResponse?: WebsiteConfigResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<WebsiteConfigResponse> | WebsiteConfigResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/websites/config', 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 : getGetApiWebsitesConfigResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getWebsitesMock = () => [\n getGetApiWebsitesMockHandler(),\n getPostApiWebsitesMockHandler(),\n getGetApiWebsitesDomainSslStatusMockHandler(),\n getDeleteApiWebsitesIdMockHandler(),\n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KACT,CAAC;IACH,QAAQ;;AAGb,MAAa,sCAAsC,kBAA8J,YAAoC;AACnP,QAAO,KAAK,IAAI,yBAAyB,OAAO,SAAwD;AAAC,QAAM,MAAM,EAAE;AAGrH,SAAO,aAAa,KAAK,qBAAqB,SAC3C,OAAO,qBAAqB,aAAa,MAAM,iBAAiB,KAAK,GAAG,mBACzE,qCAAqC,EACrC,EAAE,QAAQ,KACT,CAAC;IACH,QAAQ;;AAEb,MAAa,wBAAwB;CACnC,8BAA8B;CAC9B,+BAA+B;CAC/B,6CAA6C;CAC7C,mCAAmC;CACnC,gCAAgC;CAChC,gCAAgC;CAChC,yCAAyC;CACzC,oCAAoC;CACrC"}
|
package/dist/esm/api/mocks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getContentMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiUploadMockHandler } from "./generated/content/content.msw.js";
|
|
1
|
+
import { getContentMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetApiUploadResultIdentifierMockHandler, getGetApiUploadResultIdentifierResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiUploadMockHandler, getPostApiUploadResponseMock } from "./generated/content/content.msw.js";
|
|
2
2
|
import { getDeleteApiDnsZonesIdMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeResponseMock, getDeleteApiDnsZonesIdResponseMock, getDnsMock, getGetApiDnsZonesIdMockHandler, getGetApiDnsZonesIdRecordsMockHandler, getGetApiDnsZonesIdRecordsNameTypeMockHandler, getGetApiDnsZonesIdRecordsNameTypeResponseMock, getGetApiDnsZonesIdRecordsResponseMock, getGetApiDnsZonesIdResponseMock, getGetApiDnsZonesIdStatusMockHandler, getGetApiDnsZonesIdStatusResponseMock, getGetApiDnsZonesMockHandler, getGetApiDnsZonesResponseMock, getPostApiDnsZonesIdRecordsBulkDeleteMockHandler, getPostApiDnsZonesIdRecordsBulkDeleteResponseMock, getPostApiDnsZonesIdRecordsBulkMockHandler, getPostApiDnsZonesIdRecordsBulkResponseMock, getPostApiDnsZonesIdRecordsMockHandler, getPostApiDnsZonesIdRecordsResponseMock, getPostApiDnsZonesIdValidateMockHandler, getPostApiDnsZonesIdValidateResponseMock, getPostApiDnsZonesMockHandler, getPostApiDnsZonesResponseMock, getPutApiDnsZonesIdMockHandler, getPutApiDnsZonesIdRecordsNameTypeMockHandler, getPutApiDnsZonesIdRecordsNameTypeResponseMock, getPutApiDnsZonesIdResponseMock } from "./generated/dns/dns.msw.js";
|
|
3
3
|
import { getFilesMock, getGetApiFilesBreadcrumbsMockHandler, getGetApiFilesBreadcrumbsResponseMock, getGetApiFilesDirectoryMockHandler, getGetApiFilesDirectoryResponseMock, getGetApiFilesMockHandler, getGetApiFilesResponseMock } from "./generated/files/files.msw.js";
|
|
4
4
|
import { getGatewayMock, getGetInternalWebsitesDomainMockHandler, getGetInternalWebsitesDomainResponseMock, getGetInternalWebsitesDomainStatusMockHandler, getGetInternalWebsitesDomainStatusResponseMock } from "./generated/gateway/gateway.msw.js";
|
|
@@ -7,4 +7,4 @@ import { getDeleteApiIpnsKeysIdMockHandler, getDeleteApiIpnsKeysIdResponseMock,
|
|
|
7
7
|
import { getDeletePinsRequestidMockHandler, getDeletePinsRequestidResponseMock, getGetPinsMockHandler, getGetPinsRequestidMockHandler, getGetPinsRequestidResponseMock, getGetPinsResponseMock, getPinningMock, getPostPinsMockHandler, getPostPinsRequestidMockHandler, getPostPinsRequestidResponseMock, getPostPinsResponseMock } from "./generated/pinning/pinning.msw.js";
|
|
8
8
|
import { getDeleteApiUploadTusIdMockHandler, getDeleteApiUploadTusIdResponseMock, getHeadApiUploadTusIdMockHandler, getPatchApiUploadTusIdMockHandler, getPatchApiUploadTusIdResponseMock, getPostApiUploadTusMockHandler, getPostApiUploadTusResponseMock, getTusMock } from "./generated/tus/tus.msw.js";
|
|
9
9
|
import { getDeleteApiWebsitesIdMockHandler, getDeleteApiWebsitesIdResponseMock, getGetApiWebsitesConfigMockHandler, getGetApiWebsitesConfigResponseMock, getGetApiWebsitesDomainSslStatusMockHandler, getGetApiWebsitesDomainSslStatusResponseMock, getGetApiWebsitesIdMockHandler, getGetApiWebsitesIdResponseMock, getGetApiWebsitesMockHandler, getGetApiWebsitesResponseMock, getPostApiWebsitesIdValidateMockHandler, getPostApiWebsitesIdValidateResponseMock, getPostApiWebsitesMockHandler, getPostApiWebsitesResponseMock, getPutApiWebsitesIdMockHandler, getPutApiWebsitesIdResponseMock, getWebsitesMock } from "./generated/websites/websites.msw.js";
|
|
10
|
-
export { getContentMock, getDeleteApiDnsZonesIdMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeResponseMock, getDeleteApiDnsZonesIdResponseMock, getDeleteApiIpnsKeysIdMockHandler, getDeleteApiIpnsKeysIdResponseMock, getDeleteApiUploadTusIdMockHandler, getDeleteApiUploadTusIdResponseMock, getDeleteApiWebsitesIdMockHandler, getDeleteApiWebsitesIdResponseMock, getDeletePinsRequestidMockHandler, getDeletePinsRequestidResponseMock, getDnsMock, getFilesMock, getGatewayMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiDnsZonesIdMockHandler, getGetApiDnsZonesIdRecordsMockHandler, getGetApiDnsZonesIdRecordsNameTypeMockHandler, getGetApiDnsZonesIdRecordsNameTypeResponseMock, getGetApiDnsZonesIdRecordsResponseMock, getGetApiDnsZonesIdResponseMock, getGetApiDnsZonesIdStatusMockHandler, getGetApiDnsZonesIdStatusResponseMock, getGetApiDnsZonesMockHandler, getGetApiDnsZonesResponseMock, getGetApiFilesBreadcrumbsMockHandler, getGetApiFilesBreadcrumbsResponseMock, getGetApiFilesDirectoryMockHandler, getGetApiFilesDirectoryResponseMock, getGetApiFilesMockHandler, getGetApiFilesResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetApiIpnsKeysIdMockHandler, getGetApiIpnsKeysIdResponseMock, getGetApiIpnsKeysMockHandler, getGetApiIpnsKeysResponseMock, getGetApiIpnsResolveNameMockHandler, getGetApiIpnsResolveNameResponseMock, getGetApiWebsitesConfigMockHandler, getGetApiWebsitesConfigResponseMock, getGetApiWebsitesDomainSslStatusMockHandler, getGetApiWebsitesDomainSslStatusResponseMock, getGetApiWebsitesIdMockHandler, getGetApiWebsitesIdResponseMock, getGetApiWebsitesMockHandler, getGetApiWebsitesResponseMock, getGetInternalWebsitesDomainMockHandler, getGetInternalWebsitesDomainResponseMock, getGetInternalWebsitesDomainStatusMockHandler, getGetInternalWebsitesDomainStatusResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getGetPinsMockHandler, getGetPinsRequestidMockHandler, getGetPinsRequestidResponseMock, getGetPinsResponseMock, getHeadApiUploadTusIdMockHandler, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getInternalMock, getIpnsMock, getPatchApiUploadTusIdMockHandler, getPatchApiUploadTusIdResponseMock, getPinningMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiDnsZonesIdRecordsBulkDeleteMockHandler, getPostApiDnsZonesIdRecordsBulkDeleteResponseMock, getPostApiDnsZonesIdRecordsBulkMockHandler, getPostApiDnsZonesIdRecordsBulkResponseMock, getPostApiDnsZonesIdRecordsMockHandler, getPostApiDnsZonesIdRecordsResponseMock, getPostApiDnsZonesIdValidateMockHandler, getPostApiDnsZonesIdValidateResponseMock, getPostApiDnsZonesMockHandler, getPostApiDnsZonesResponseMock, getPostApiIpnsKeysIdRepublishMockHandler, getPostApiIpnsKeysIdRepublishResponseMock, getPostApiIpnsKeysMockHandler, getPostApiIpnsKeysResponseMock, getPostApiIpnsPublishMockHandler, getPostApiIpnsPublishResponseMock, getPostApiUploadMockHandler, getPostApiUploadTusMockHandler, getPostApiUploadTusResponseMock, getPostApiWebsitesIdValidateMockHandler, getPostApiWebsitesIdValidateResponseMock, getPostApiWebsitesMockHandler, getPostApiWebsitesResponseMock, getPostInternalWebsitesDomainSslStatusMockHandler, getPostInternalWebsitesDomainSslStatusResponseMock, getPostPinsMockHandler, getPostPinsRequestidMockHandler, getPostPinsRequestidResponseMock, getPostPinsResponseMock, getPutApiDnsZonesIdMockHandler, getPutApiDnsZonesIdRecordsNameTypeMockHandler, getPutApiDnsZonesIdRecordsNameTypeResponseMock, getPutApiDnsZonesIdResponseMock, getPutApiWebsitesIdMockHandler, getPutApiWebsitesIdResponseMock, getTusMock, getWebsitesMock };
|
|
10
|
+
export { getContentMock, getDeleteApiDnsZonesIdMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeResponseMock, getDeleteApiDnsZonesIdResponseMock, getDeleteApiIpnsKeysIdMockHandler, getDeleteApiIpnsKeysIdResponseMock, getDeleteApiUploadTusIdMockHandler, getDeleteApiUploadTusIdResponseMock, getDeleteApiWebsitesIdMockHandler, getDeleteApiWebsitesIdResponseMock, getDeletePinsRequestidMockHandler, getDeletePinsRequestidResponseMock, getDnsMock, getFilesMock, getGatewayMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiDnsZonesIdMockHandler, getGetApiDnsZonesIdRecordsMockHandler, getGetApiDnsZonesIdRecordsNameTypeMockHandler, getGetApiDnsZonesIdRecordsNameTypeResponseMock, getGetApiDnsZonesIdRecordsResponseMock, getGetApiDnsZonesIdResponseMock, getGetApiDnsZonesIdStatusMockHandler, getGetApiDnsZonesIdStatusResponseMock, getGetApiDnsZonesMockHandler, getGetApiDnsZonesResponseMock, getGetApiFilesBreadcrumbsMockHandler, getGetApiFilesBreadcrumbsResponseMock, getGetApiFilesDirectoryMockHandler, getGetApiFilesDirectoryResponseMock, getGetApiFilesMockHandler, getGetApiFilesResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetApiIpnsKeysIdMockHandler, getGetApiIpnsKeysIdResponseMock, getGetApiIpnsKeysMockHandler, getGetApiIpnsKeysResponseMock, getGetApiIpnsResolveNameMockHandler, getGetApiIpnsResolveNameResponseMock, getGetApiUploadResultIdentifierMockHandler, getGetApiUploadResultIdentifierResponseMock, getGetApiWebsitesConfigMockHandler, getGetApiWebsitesConfigResponseMock, getGetApiWebsitesDomainSslStatusMockHandler, getGetApiWebsitesDomainSslStatusResponseMock, getGetApiWebsitesIdMockHandler, getGetApiWebsitesIdResponseMock, getGetApiWebsitesMockHandler, getGetApiWebsitesResponseMock, getGetInternalWebsitesDomainMockHandler, getGetInternalWebsitesDomainResponseMock, getGetInternalWebsitesDomainStatusMockHandler, getGetInternalWebsitesDomainStatusResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getGetPinsMockHandler, getGetPinsRequestidMockHandler, getGetPinsRequestidResponseMock, getGetPinsResponseMock, getHeadApiUploadTusIdMockHandler, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getInternalMock, getIpnsMock, getPatchApiUploadTusIdMockHandler, getPatchApiUploadTusIdResponseMock, getPinningMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiDnsZonesIdRecordsBulkDeleteMockHandler, getPostApiDnsZonesIdRecordsBulkDeleteResponseMock, getPostApiDnsZonesIdRecordsBulkMockHandler, getPostApiDnsZonesIdRecordsBulkResponseMock, getPostApiDnsZonesIdRecordsMockHandler, getPostApiDnsZonesIdRecordsResponseMock, getPostApiDnsZonesIdValidateMockHandler, getPostApiDnsZonesIdValidateResponseMock, getPostApiDnsZonesMockHandler, getPostApiDnsZonesResponseMock, getPostApiIpnsKeysIdRepublishMockHandler, getPostApiIpnsKeysIdRepublishResponseMock, getPostApiIpnsKeysMockHandler, getPostApiIpnsKeysResponseMock, getPostApiIpnsPublishMockHandler, getPostApiIpnsPublishResponseMock, getPostApiUploadMockHandler, getPostApiUploadResponseMock, getPostApiUploadTusMockHandler, getPostApiUploadTusResponseMock, getPostApiWebsitesIdValidateMockHandler, getPostApiWebsitesIdValidateResponseMock, getPostApiWebsitesMockHandler, getPostApiWebsitesResponseMock, getPostInternalWebsitesDomainSslStatusMockHandler, getPostInternalWebsitesDomainSslStatusResponseMock, getPostPinsMockHandler, getPostPinsRequestidMockHandler, getPostPinsRequestidResponseMock, getPostPinsResponseMock, getPutApiDnsZonesIdMockHandler, getPutApiDnsZonesIdRecordsNameTypeMockHandler, getPutApiDnsZonesIdRecordsNameTypeResponseMock, getPutApiDnsZonesIdResponseMock, getPutApiWebsitesIdMockHandler, getPutApiWebsitesIdResponseMock, getTusMock, getWebsitesMock };
|
package/dist/esm/api/mocks.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getContentMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiUploadMockHandler } from "./generated/content/content.msw.js";
|
|
1
|
+
import { getContentMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetApiUploadResultIdentifierMockHandler, getGetApiUploadResultIdentifierResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiUploadMockHandler, getPostApiUploadResponseMock } from "./generated/content/content.msw.js";
|
|
2
2
|
import { getDeleteApiDnsZonesIdMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeResponseMock, getDeleteApiDnsZonesIdResponseMock, getDnsMock, getGetApiDnsZonesIdMockHandler, getGetApiDnsZonesIdRecordsMockHandler, getGetApiDnsZonesIdRecordsNameTypeMockHandler, getGetApiDnsZonesIdRecordsNameTypeResponseMock, getGetApiDnsZonesIdRecordsResponseMock, getGetApiDnsZonesIdResponseMock, getGetApiDnsZonesIdStatusMockHandler, getGetApiDnsZonesIdStatusResponseMock, getGetApiDnsZonesMockHandler, getGetApiDnsZonesResponseMock, getPostApiDnsZonesIdRecordsBulkDeleteMockHandler, getPostApiDnsZonesIdRecordsBulkDeleteResponseMock, getPostApiDnsZonesIdRecordsBulkMockHandler, getPostApiDnsZonesIdRecordsBulkResponseMock, getPostApiDnsZonesIdRecordsMockHandler, getPostApiDnsZonesIdRecordsResponseMock, getPostApiDnsZonesIdValidateMockHandler, getPostApiDnsZonesIdValidateResponseMock, getPostApiDnsZonesMockHandler, getPostApiDnsZonesResponseMock, getPutApiDnsZonesIdMockHandler, getPutApiDnsZonesIdRecordsNameTypeMockHandler, getPutApiDnsZonesIdRecordsNameTypeResponseMock, getPutApiDnsZonesIdResponseMock } from "./generated/dns/dns.msw.js";
|
|
3
3
|
import { getFilesMock, getGetApiFilesBreadcrumbsMockHandler, getGetApiFilesBreadcrumbsResponseMock, getGetApiFilesDirectoryMockHandler, getGetApiFilesDirectoryResponseMock, getGetApiFilesMockHandler, getGetApiFilesResponseMock } from "./generated/files/files.msw.js";
|
|
4
4
|
import { getGatewayMock, getGetInternalWebsitesDomainMockHandler, getGetInternalWebsitesDomainResponseMock, getGetInternalWebsitesDomainStatusMockHandler, getGetInternalWebsitesDomainStatusResponseMock } from "./generated/gateway/gateway.msw.js";
|
|
@@ -8,4 +8,4 @@ import { getDeletePinsRequestidMockHandler, getDeletePinsRequestidResponseMock,
|
|
|
8
8
|
import { getDeleteApiUploadTusIdMockHandler, getDeleteApiUploadTusIdResponseMock, getHeadApiUploadTusIdMockHandler, getPatchApiUploadTusIdMockHandler, getPatchApiUploadTusIdResponseMock, getPostApiUploadTusMockHandler, getPostApiUploadTusResponseMock, getTusMock } from "./generated/tus/tus.msw.js";
|
|
9
9
|
import { getDeleteApiWebsitesIdMockHandler, getDeleteApiWebsitesIdResponseMock, getGetApiWebsitesConfigMockHandler, getGetApiWebsitesConfigResponseMock, getGetApiWebsitesDomainSslStatusMockHandler, getGetApiWebsitesDomainSslStatusResponseMock, getGetApiWebsitesIdMockHandler, getGetApiWebsitesIdResponseMock, getGetApiWebsitesMockHandler, getGetApiWebsitesResponseMock, getPostApiWebsitesIdValidateMockHandler, getPostApiWebsitesIdValidateResponseMock, getPostApiWebsitesMockHandler, getPostApiWebsitesResponseMock, getPutApiWebsitesIdMockHandler, getPutApiWebsitesIdResponseMock, getWebsitesMock } from "./generated/websites/websites.msw.js";
|
|
10
10
|
|
|
11
|
-
export { getContentMock, getDeleteApiDnsZonesIdMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeResponseMock, getDeleteApiDnsZonesIdResponseMock, getDeleteApiIpnsKeysIdMockHandler, getDeleteApiIpnsKeysIdResponseMock, getDeleteApiUploadTusIdMockHandler, getDeleteApiUploadTusIdResponseMock, getDeleteApiWebsitesIdMockHandler, getDeleteApiWebsitesIdResponseMock, getDeletePinsRequestidMockHandler, getDeletePinsRequestidResponseMock, getDnsMock, getFilesMock, getGatewayMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiDnsZonesIdMockHandler, getGetApiDnsZonesIdRecordsMockHandler, getGetApiDnsZonesIdRecordsNameTypeMockHandler, getGetApiDnsZonesIdRecordsNameTypeResponseMock, getGetApiDnsZonesIdRecordsResponseMock, getGetApiDnsZonesIdResponseMock, getGetApiDnsZonesIdStatusMockHandler, getGetApiDnsZonesIdStatusResponseMock, getGetApiDnsZonesMockHandler, getGetApiDnsZonesResponseMock, getGetApiFilesBreadcrumbsMockHandler, getGetApiFilesBreadcrumbsResponseMock, getGetApiFilesDirectoryMockHandler, getGetApiFilesDirectoryResponseMock, getGetApiFilesMockHandler, getGetApiFilesResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetApiIpnsKeysIdMockHandler, getGetApiIpnsKeysIdResponseMock, getGetApiIpnsKeysMockHandler, getGetApiIpnsKeysResponseMock, getGetApiIpnsResolveNameMockHandler, getGetApiIpnsResolveNameResponseMock, getGetApiWebsitesConfigMockHandler, getGetApiWebsitesConfigResponseMock, getGetApiWebsitesDomainSslStatusMockHandler, getGetApiWebsitesDomainSslStatusResponseMock, getGetApiWebsitesIdMockHandler, getGetApiWebsitesIdResponseMock, getGetApiWebsitesMockHandler, getGetApiWebsitesResponseMock, getGetInternalWebsitesDomainMockHandler, getGetInternalWebsitesDomainResponseMock, getGetInternalWebsitesDomainStatusMockHandler, getGetInternalWebsitesDomainStatusResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getGetPinsMockHandler, getGetPinsRequestidMockHandler, getGetPinsRequestidResponseMock, getGetPinsResponseMock, getHeadApiUploadTusIdMockHandler, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getInternalMock, getIpnsMock, getPatchApiUploadTusIdMockHandler, getPatchApiUploadTusIdResponseMock, getPinningMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiDnsZonesIdRecordsBulkDeleteMockHandler, getPostApiDnsZonesIdRecordsBulkDeleteResponseMock, getPostApiDnsZonesIdRecordsBulkMockHandler, getPostApiDnsZonesIdRecordsBulkResponseMock, getPostApiDnsZonesIdRecordsMockHandler, getPostApiDnsZonesIdRecordsResponseMock, getPostApiDnsZonesIdValidateMockHandler, getPostApiDnsZonesIdValidateResponseMock, getPostApiDnsZonesMockHandler, getPostApiDnsZonesResponseMock, getPostApiIpnsKeysIdRepublishMockHandler, getPostApiIpnsKeysIdRepublishResponseMock, getPostApiIpnsKeysMockHandler, getPostApiIpnsKeysResponseMock, getPostApiIpnsPublishMockHandler, getPostApiIpnsPublishResponseMock, getPostApiUploadMockHandler, getPostApiUploadTusMockHandler, getPostApiUploadTusResponseMock, getPostApiWebsitesIdValidateMockHandler, getPostApiWebsitesIdValidateResponseMock, getPostApiWebsitesMockHandler, getPostApiWebsitesResponseMock, getPostInternalWebsitesDomainSslStatusMockHandler, getPostInternalWebsitesDomainSslStatusResponseMock, getPostPinsMockHandler, getPostPinsRequestidMockHandler, getPostPinsRequestidResponseMock, getPostPinsResponseMock, getPutApiDnsZonesIdMockHandler, getPutApiDnsZonesIdRecordsNameTypeMockHandler, getPutApiDnsZonesIdRecordsNameTypeResponseMock, getPutApiDnsZonesIdResponseMock, getPutApiWebsitesIdMockHandler, getPutApiWebsitesIdResponseMock, getTusMock, getWebsitesMock };
|
|
11
|
+
export { getContentMock, getDeleteApiDnsZonesIdMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeMockHandler, getDeleteApiDnsZonesIdRecordsNameTypeResponseMock, getDeleteApiDnsZonesIdResponseMock, getDeleteApiIpnsKeysIdMockHandler, getDeleteApiIpnsKeysIdResponseMock, getDeleteApiUploadTusIdMockHandler, getDeleteApiUploadTusIdResponseMock, getDeleteApiWebsitesIdMockHandler, getDeleteApiWebsitesIdResponseMock, getDeletePinsRequestidMockHandler, getDeletePinsRequestidResponseMock, getDnsMock, getFilesMock, getGatewayMock, getGetApiBlockMetaCidMockHandler, getGetApiBlockMetaCidResponseMock, getGetApiDnsZonesIdMockHandler, getGetApiDnsZonesIdRecordsMockHandler, getGetApiDnsZonesIdRecordsNameTypeMockHandler, getGetApiDnsZonesIdRecordsNameTypeResponseMock, getGetApiDnsZonesIdRecordsResponseMock, getGetApiDnsZonesIdResponseMock, getGetApiDnsZonesIdStatusMockHandler, getGetApiDnsZonesIdStatusResponseMock, getGetApiDnsZonesMockHandler, getGetApiDnsZonesResponseMock, getGetApiFilesBreadcrumbsMockHandler, getGetApiFilesBreadcrumbsResponseMock, getGetApiFilesDirectoryMockHandler, getGetApiFilesDirectoryResponseMock, getGetApiFilesMockHandler, getGetApiFilesResponseMock, getGetApiInfoMockHandler, getGetApiInfoResponseMock, getGetApiIpnsKeysIdMockHandler, getGetApiIpnsKeysIdResponseMock, getGetApiIpnsKeysMockHandler, getGetApiIpnsKeysResponseMock, getGetApiIpnsResolveNameMockHandler, getGetApiIpnsResolveNameResponseMock, getGetApiUploadResultIdentifierMockHandler, getGetApiUploadResultIdentifierResponseMock, getGetApiWebsitesConfigMockHandler, getGetApiWebsitesConfigResponseMock, getGetApiWebsitesDomainSslStatusMockHandler, getGetApiWebsitesDomainSslStatusResponseMock, getGetApiWebsitesIdMockHandler, getGetApiWebsitesIdResponseMock, getGetApiWebsitesMockHandler, getGetApiWebsitesResponseMock, getGetInternalWebsitesDomainMockHandler, getGetInternalWebsitesDomainResponseMock, getGetInternalWebsitesDomainStatusMockHandler, getGetInternalWebsitesDomainStatusResponseMock, getGetIpfsCidMockHandler, getGetIpfsCidResponseMock, getGetPinsMockHandler, getGetPinsRequestidMockHandler, getGetPinsRequestidResponseMock, getGetPinsResponseMock, getHeadApiUploadTusIdMockHandler, getHeadIpfsCidMockHandler, getHeadIpfsCidResponseMock, getInternalMock, getIpnsMock, getPatchApiUploadTusIdMockHandler, getPatchApiUploadTusIdResponseMock, getPinningMock, getPostApiBlockMetaBatchMockHandler, getPostApiBlockMetaBatchResponseMock, getPostApiDnsZonesIdRecordsBulkDeleteMockHandler, getPostApiDnsZonesIdRecordsBulkDeleteResponseMock, getPostApiDnsZonesIdRecordsBulkMockHandler, getPostApiDnsZonesIdRecordsBulkResponseMock, getPostApiDnsZonesIdRecordsMockHandler, getPostApiDnsZonesIdRecordsResponseMock, getPostApiDnsZonesIdValidateMockHandler, getPostApiDnsZonesIdValidateResponseMock, getPostApiDnsZonesMockHandler, getPostApiDnsZonesResponseMock, getPostApiIpnsKeysIdRepublishMockHandler, getPostApiIpnsKeysIdRepublishResponseMock, getPostApiIpnsKeysMockHandler, getPostApiIpnsKeysResponseMock, getPostApiIpnsPublishMockHandler, getPostApiIpnsPublishResponseMock, getPostApiUploadMockHandler, getPostApiUploadResponseMock, getPostApiUploadTusMockHandler, getPostApiUploadTusResponseMock, getPostApiWebsitesIdValidateMockHandler, getPostApiWebsitesIdValidateResponseMock, getPostApiWebsitesMockHandler, getPostApiWebsitesResponseMock, getPostInternalWebsitesDomainSslStatusMockHandler, getPostInternalWebsitesDomainSslStatusResponseMock, getPostPinsMockHandler, getPostPinsRequestidMockHandler, getPostPinsRequestidResponseMock, getPostPinsResponseMock, getPutApiDnsZonesIdMockHandler, getPutApiDnsZonesIdRecordsNameTypeMockHandler, getPutApiDnsZonesIdRecordsNameTypeResponseMock, getPutApiDnsZonesIdResponseMock, getPutApiWebsitesIdMockHandler, getPutApiWebsitesIdResponseMock, getTusMock, getWebsitesMock };
|
|
@@ -12,8 +12,10 @@ interface UploadResult {
|
|
|
12
12
|
id: string;
|
|
13
13
|
/**
|
|
14
14
|
* IPFS Content Identifier for the uploaded content.
|
|
15
|
+
* Undefined when the CID is not yet available (e.g. TUS uploads where
|
|
16
|
+
* the CID is assigned asynchronously — poll GET /api/upload/result/{id}).
|
|
15
17
|
*/
|
|
16
|
-
cid
|
|
18
|
+
cid?: string;
|
|
17
19
|
/**
|
|
18
20
|
* User-provided or auto-generated name for the content.
|
|
19
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","names":[],"sources":["../../../src/types/upload.ts"],"sourcesContent":["import type { OperationPollingOptions } from \"@lumeweb/portal-sdk\";\n\n/**\n * Symbol used to brand UploadResult for type checking\n */\nexport const UploadResultSymbol = Symbol(\"UploadResult\");\n\nexport interface UploadResult {\n /**\n * Unique identifier for this upload operation.\n */\n id: string;\n\n /**\n * IPFS Content Identifier for the uploaded content.\n */\n cid
|
|
1
|
+
{"version":3,"file":"upload.js","names":[],"sources":["../../../src/types/upload.ts"],"sourcesContent":["import type { OperationPollingOptions } from \"@lumeweb/portal-sdk\";\n\n/**\n * Symbol used to brand UploadResult for type checking\n */\nexport const UploadResultSymbol = Symbol(\"UploadResult\");\n\nexport interface UploadResult {\n /**\n * Unique identifier for this upload operation.\n */\n id: string;\n\n /**\n * IPFS Content Identifier for the uploaded content.\n * Undefined when the CID is not yet available (e.g. TUS uploads where\n * the CID is assigned asynchronously — poll GET /api/upload/result/{id}).\n */\n cid?: string;\n\n /**\n * User-provided or auto-generated name for the content.\n */\n name: string;\n\n /**\n * Total size in bytes.\n */\n size: number;\n\n /**\n * MIME type of the content.\n */\n mimeType: string;\n\n /**\n * ISO timestamp when content was created.\n */\n createdAt: Date;\n\n /**\n * Number of files (1 for single file, N for directory).\n */\n numberOfFiles: number;\n\n /**\n * Custom key-value metadata.\n */\n keyvalues?: Record<string, string>;\n\n /**\n * Whether this upload is a directory.\n */\n isDirectory?: boolean;\n\n /**\n * Whether this upload is already a valid CAR file.\n * If true, the upload system will skip CAR preprocessing and upload the file as-is.\n * Useful for passthrough of pre-generated CAR files.\n */\n isCarFile?: boolean;\n\n /**\n * Portal operation ID for tracking the pinning operation.\n * Can be used with waitForOperation() to wait for the operation to complete.\n */\n operationId?: number;\n\n /**\n * Symbol brand for type checking - used to identify UploadResult objects\n */\n [UploadResultSymbol]?: true;\n}\n\nexport type UploadInput = File | ReadableStream<Uint8Array>;\n\n/**\n * Type guard to check if a value is an UploadResult\n * Uses the UploadResultSymbol for reliable type checking\n */\nexport function isUploadResult(value: unknown): value is UploadResult {\n return (\n typeof value === \"object\" &&\n value !== null &&\n UploadResultSymbol in value &&\n value[UploadResultSymbol] === true\n );\n}\n\nexport interface UploadOptions {\n /**\n * Name for the uploaded content.\n */\n name?: string;\n\n /**\n * Custom key-value metadata.\n */\n keyvalues?: Record<string, string>;\n\n /**\n * Progress callback invoked during upload.\n */\n onProgress?: (progress: UploadProgress) => void;\n\n /**\n * Callback invoked when upload completes successfully.\n */\n onComplete?: (result: UploadResult) => void;\n\n /**\n * Callback invoked when upload fails.\n */\n onError?: (error: Error) => void;\n\n /**\n * AbortSignal for cancellation.\n */\n signal?: AbortSignal;\n\n /**\n * Optional size override for the upload input.\n * Useful for ReadableStream inputs where size detection is difficult.\n */\n size?: number;\n\n /**\n * Whether this upload is a directory.\n */\n isDirectory?: boolean;\n\n /**\n * Whether this upload is already a valid CAR file.\n * If true, the upload system will skip CAR preprocessing and upload the file as-is.\n * Useful for passthrough of pre-generated CAR files.\n */\n isCarFile?: boolean;\n\n /**\n * Whether to wait for the pinning operation to complete/fail.\n * When true, the upload will block until the operation reaches a settled state\n * (completed, failed, or error). Default is false (upload only).\n */\n waitForOperation?: boolean;\n\n /**\n * Polling options for waiting on operation completion.\n * Only used when waitForOperation is true.\n */\n operationPollingOptions?: OperationPollingOptions;\n}\n\nexport interface UploadProgress {\n /**\n * Percentage complete (0-100).\n */\n percentage: number;\n\n /**\n * Number of bytes uploaded.\n */\n bytesUploaded: number;\n\n /**\n * Total bytes to upload.\n */\n bytesTotal: number;\n\n /**\n * Upload speed in bytes per second.\n */\n speed?: number;\n\n /**\n * Estimated time remaining in seconds.\n */\n eta?: number;\n}\n\nexport interface UploadOperation {\n /**\n * Cancel the ongoing upload.\n */\n cancel(): void;\n\n /**\n * Pause the upload (TUS only).\n */\n pause(): void;\n\n /**\n * Resume a paused upload (TUS only).\n */\n resume(): void;\n\n /**\n * Promise that resolves when upload completes.\n */\n result: Promise<UploadResult>;\n\n /**\n * Current progress.\n */\n progress: Readonly<UploadProgress>;\n}\n\n/**\n * Builder interface for Pinner upload API.\n * Supports chaining name/keyvalues and returns UploadOperation with controls.\n */\nexport interface PinnerUploadBuilder {\n /**\n * Set the name for the upload.\n */\n name(name: string): this;\n\n /**\n * Set custom key-value metadata.\n */\n keyvalues(kv: Record<string, string>): this;\n\n /**\n * Whether to wait for the pinning operation to complete/fail.\n * When true, the upload will block until the operation reaches a settled state.\n */\n waitForOperation(wait: boolean): this;\n\n /**\n * Set polling options for waiting on operation completion.\n * Only used when waitForOperation is true.\n */\n operationPollingOptions(options: OperationPollingOptions): this;\n\n /**\n * Start the upload and return UploadOperation with controls.\n */\n pin(): Promise<UploadOperation>;\n}\n"],"mappings":";;;;AAKA,MAAa,qBAAqB,OAAO,eAAe;;;;;AA2ExD,SAAgB,eAAe,OAAuC;AACpE,QACE,OAAO,UAAU,YACjB,UAAU,QACV,sBAAsB,SACtB,MAAM,wBAAwB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UploadResultSymbol } from "../types/upload.js";
|
|
1
2
|
import { normalizeUploadInput } from "./normalize.js";
|
|
2
3
|
import { isNodeEnvironment } from "../utils/env.js";
|
|
3
4
|
import { fileToReadableStream, readableStreamToNodeStream } from "../utils/stream.js";
|
|
@@ -125,6 +126,32 @@ var BaseUploadHandler = class {
|
|
|
125
126
|
};
|
|
126
127
|
}
|
|
127
128
|
destroy() {}
|
|
129
|
+
mapUploadResponse(body, uploadId, overrides) {
|
|
130
|
+
if (body && typeof body === "object" && "CID" in body) {
|
|
131
|
+
const { CID } = body;
|
|
132
|
+
return {
|
|
133
|
+
id: uploadId,
|
|
134
|
+
cid: CID,
|
|
135
|
+
name: "",
|
|
136
|
+
size: 0,
|
|
137
|
+
mimeType: "",
|
|
138
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
139
|
+
numberOfFiles: 1,
|
|
140
|
+
[UploadResultSymbol]: true,
|
|
141
|
+
...overrides
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
id: uploadId,
|
|
146
|
+
name: "",
|
|
147
|
+
size: 0,
|
|
148
|
+
mimeType: "",
|
|
149
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
150
|
+
numberOfFiles: 1,
|
|
151
|
+
[UploadResultSymbol]: true,
|
|
152
|
+
...overrides
|
|
153
|
+
};
|
|
154
|
+
}
|
|
128
155
|
};
|
|
129
156
|
|
|
130
157
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-upload.js","names":["#setupUppyHandlers","#addFileToUppy","#startUpload","#createUploadOperation","#extractErrorMessage","#normalizeData","#normalizeDataForNode","#normalizeDataForBrowser"],"sources":["../../../src/upload/base-upload.ts"],"sourcesContent":["import Uppy from \"@uppy/core\";\nimport { default as defer } from \"p-defer\";\nimport type { Readable } from \"stream\";\n\nimport type { PinnerConfig } from \"../config\";\nimport type {\n UploadInput,\n UploadOperation,\n UploadOptions,\n UploadProgress,\n UploadResult,\n} from \"@/types/upload\";\nimport { normalizeUploadInput, type UploadInputObject } from \"./normalize\";\nimport {\n fileToReadableStream,\n readableStreamToNodeStream,\n} from \"@/utils/stream\";\nimport { isNodeEnvironment } from \"@/utils/env\";\nimport { UPLOAD_SOURCE_TUS, UPLOAD_SOURCE_XHR } from \"./constants\";\n\n// Node.js Readable stream with size property for Uppy compatibility\ntype NodeStreamWithSize = Readable & { size: number | null };\n\nexport abstract class BaseUploadHandler {\n protected config: Required<PinnerConfig>;\n\n constructor(config: PinnerConfig) {\n this.config = config as Required<PinnerConfig>;\n }\n\n async upload(\n input: UploadInput | UploadInputObject,\n options?: UploadOptions,\n ): Promise<UploadOperation> {\n const normalized = normalizeUploadInput(input, options);\n const uppy = new Uppy();\n const { fileId, resultPromise, progress } = this.#setupUppyHandlers(\n uppy,\n normalized,\n options,\n );\n\n await this.#addFileToUppy(uppy, normalized, normalized.size);\n this.#startUpload(uppy, options);\n\n return this.#createUploadOperation(uppy, fileId, resultPromise, progress);\n }\n\n #setupUppyHandlers(\n uppy: Uppy,\n normalized: { size: number },\n options?: UploadOptions,\n ): {\n fileId: string | null;\n resultPromise: Promise<UploadResult>;\n progress: UploadProgress;\n } {\n let fileId: string | null = null;\n let hasRejected = false;\n\n const progress: UploadProgress = {\n percentage: 0,\n bytesUploaded: 0,\n bytesTotal: normalized.size,\n };\n\n const {\n promise: resultPromise,\n resolve: resolveResult,\n reject: rejectResult,\n } = defer<UploadResult>();\n\n const handleError = (error: Error) => {\n if (hasRejected) return;\n hasRejected = true;\n options?.onError?.(error);\n rejectResult(error);\n };\n\n this.configurePlugin(uppy);\n\n uppy.on(\"progress\", (progressBytes) => {\n progress.bytesUploaded = progressBytes;\n progress.percentage = (progressBytes / progress.bytesTotal) * 100;\n options?.onProgress?.(progress);\n });\n\n uppy.on(\"upload-success\", (_file, result) => {\n if (hasRejected) return;\n const uploadResult = this.parseResult(result);\n options?.onComplete?.(uploadResult);\n resolveResult(uploadResult);\n });\n\n uppy.on(\"error\", (error) => {\n handleError(new Error(this.#extractErrorMessage(error)));\n });\n\n uppy.on(\"file-added\", (file) => {\n fileId = file.id;\n });\n\n return { fileId, resultPromise, progress };\n }\n\n #extractErrorMessage(error: unknown): string {\n let errorMessage = \"Upload fainormalizeDataled\";\n\n if (!error) return errorMessage;\n\n if (typeof error === \"string\") {\n errorMessage = error;\n } else if (error instanceof Error) {\n errorMessage = error.message;\n } else if ((error as any).message) {\n errorMessage = (error as any).message;\n } else if (\n (error as any).toString &&\n typeof (error as any).toString === \"function\"\n ) {\n errorMessage = (error as any).toString();\n }\n\n // Try to extract error from response (XHRUpload/TusPlugin)\n const errorObj = error as any;\n if (errorObj?.xhr?.response) {\n try {\n const response =\n typeof errorObj.xhr.response === \"string\"\n ? JSON.parse(errorObj.xhr.response)\n : errorObj.xhr.response;\n if (response.error) {\n errorMessage = response.error;\n } else if (response.message) {\n errorMessage = response.message;\n }\n } catch {\n // If parsing fails, use the original error message\n }\n }\n\n return errorMessage;\n }\n\n async #normalizeData(\n data: File | ReadableStream<Uint8Array>,\n ): Promise<File | ReadableStream<Uint8Array> | NodeStreamWithSize | Blob> {\n if (isNodeEnvironment()) {\n return this.#normalizeDataForNode(data);\n }\n return this.#normalizeDataForBrowser(data);\n }\n\n async #normalizeDataForBrowser(\n data: File | ReadableStream<Uint8Array>,\n ): Promise<File | Blob | ReadableStream<Uint8Array>> {\n // TUS plugin requires File, Blob, or Reader in browser\n if (this.getUploadSource() === UPLOAD_SOURCE_TUS) {\n if (data instanceof ReadableStream) {\n const { streamToBlobViaResponse } = await import(\"@/utils/stream\");\n return streamToBlobViaResponse(data);\n }\n return data;\n }\n\n // XHRUpload handles File/Blob directly\n return data;\n }\n\n async #normalizeDataForNode(\n data: File | ReadableStream<Uint8Array>,\n ): Promise<NodeStreamWithSize | File | Blob | ReadableStream<Uint8Array>> {\n // XHRUpload with formData: true requires Blob/File for FormData.append()\n // Do not convert to Node.js stream for XHRUpload\n if (this.getUploadSource() === UPLOAD_SOURCE_XHR) {\n return data;\n }\n\n // Convert File to ReadableStream without loading entire blob into memory\n if (data instanceof File) {\n const stream = fileToReadableStream(data);\n // Convert to Node.js stream for tus-js-client\n const nodeStream = await readableStreamToNodeStream(stream);\n return nodeStream as NodeStreamWithSize;\n }\n\n // In Node.js, convert ReadableStream to Node.js stream.Readable for tus-js-client's NodeFileReader\n if (data instanceof ReadableStream) {\n const nodeStream = await readableStreamToNodeStream(data);\n // Add size property to satisfy Uppy's type requirements\n return nodeStream as NodeStreamWithSize;\n }\n\n return data;\n }\n\n async #addFileToUppy(\n uppy: Uppy,\n normalized: {\n data: File | ReadableStream<Uint8Array>;\n name: string;\n type: string;\n },\n size?: number,\n ): Promise<void> {\n const fileData = await this.#normalizeData(normalized.data);\n const fileOptions = {\n source: this.getUploadSource(),\n name: normalized.name,\n type: normalized.type,\n data: fileData as any,\n };\n\n // Add file to Uppy first\n // Note: Uppy accepts any data type as it defers to the drivers\n const fileId = uppy.addFile(fileOptions);\n\n // Set TUS upload size if provided\n // In Node.js, streams need explicit size for tus-js-client\n // In browser, Uppy's TUS plugin may not derive size from Blob automatically\n if (\n this.getUploadSource() === UPLOAD_SOURCE_TUS &&\n size !== undefined &&\n size > 0\n ) {\n uppy.setFileState(fileId, {\n tus: { uploadSize: size },\n });\n }\n }\n\n #startUpload(uppy: Uppy, options?: UploadOptions): void {\n uppy.upload().catch((error) => {\n options?.onError?.(new Error(this.#extractErrorMessage(error)));\n });\n }\n\n #createUploadOperation(\n uppy: Uppy,\n fileId: string | null,\n resultPromise: Promise<UploadResult>,\n progress: UploadProgress,\n ): UploadOperation {\n return {\n cancel: () => {\n uppy.cancelAll();\n },\n pause: () => {\n if (fileId) {\n uppy.pauseResume(fileId);\n }\n },\n resume: () => {\n if (fileId) {\n uppy.pauseResume(fileId);\n }\n },\n result: resultPromise,\n progress: Object.freeze({ ...progress }),\n };\n }\n\n destroy(): void {\n // No-op since each upload creates its own Uppy instance\n }\n\n protected abstract configurePlugin(uppy: Uppy): void;\n protected abstract parseResult(result: unknown): UploadResult;\n protected abstract getUploadSource(): string;\n}\n"],"mappings":";;;;;;;;AAuBA,IAAsB,oBAAtB,MAAwC;CACtC,AAAU;CAEV,YAAY,QAAsB;AAChC,OAAK,SAAS;;CAGhB,MAAM,OACJ,OACA,SAC0B;EAC1B,MAAM,aAAa,qBAAqB,OAAO,QAAQ;EACvD,MAAM,OAAO,IAAI,MAAM;EACvB,MAAM,EAAE,QAAQ,eAAe,aAAa,MAAKA,kBAC/C,MACA,YACA,QACD;AAED,QAAM,MAAKC,cAAe,MAAM,YAAY,WAAW,KAAK;AAC5D,QAAKC,YAAa,MAAM,QAAQ;AAEhC,SAAO,MAAKC,sBAAuB,MAAM,QAAQ,eAAe,SAAS;;CAG3E,mBACE,MACA,YACA,SAKA;EACA,IAAI,SAAwB;EAC5B,IAAI,cAAc;EAElB,MAAM,WAA2B;GAC/B,YAAY;GACZ,eAAe;GACf,YAAY,WAAW;GACxB;EAED,MAAM,EACJ,SAAS,eACT,SAAS,eACT,QAAQ,iBACN,OAAqB;EAEzB,MAAM,eAAe,UAAiB;AACpC,OAAI,YAAa;AACjB,iBAAc;AACd,YAAS,UAAU,MAAM;AACzB,gBAAa,MAAM;;AAGrB,OAAK,gBAAgB,KAAK;AAE1B,OAAK,GA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AAMD,qBACJ,MACwE;AAGxE,MAAI,KAAK,iBAAiB,kBACxB,QAAO;AAIT,MAAI,gBAAgB,KAIlB,QAAO,MADkB,2BAFV,qBAAqB,KAEsB,CAAC;AAK7D,MAAI,gBAAgB,eAGlB,QAAO,MAFkB,2BAA2B,KAAK;AAK3D,SAAO;;CAGT,OAAML,cACJ,MACA,YAKA,MACe;EACf,MAAM,WAAW,MAAM,MAAKI,cAAe,WAAW,KAAK;EAC3D,MAAM,cAAc;GAClB,QAAQ,KAAK,iBAAiB;GAC9B,MAAM,WAAW;GACjB,MAAM,WAAW;GACjB,MAAM;GACP;EAID,MAAM,SAAS,KAAK,QAAQ,YAAY;AAKxC,MACE,KAAK,iBAAiB,qBACtB,SAAS,UACT,OAAO,EAEP,MAAK,aAAa,QAAQ,EACxB,KAAK,EAAE,YAAY,MAAM,EAC1B,CAAC;;CAIN,aAAa,MAAY,SAA+B;AACtD,OAAK,QAAQ,CAAC,OAAO,UAAU;AAC7B,YAAS,UAAU,IAAI,MAAM,MAAKD,oBAAqB,MAAM,CAAC,CAAC;IAC/D;;CAGJ,uBACE,MACA,QACA,eACA,UACiB;AACjB,SAAO;GACL,cAAc;AACZ,SAAK,WAAW;;GAElB,aAAa;AACX,QAAI,OACF,MAAK,YAAY,OAAO;;GAG5B,cAAc;AACZ,QAAI,OACF,MAAK,YAAY,OAAO;;GAG5B,QAAQ;GACR,UAAU,OAAO,OAAO,EAAE,GAAG,UAAU,CAAC;GACzC;;CAGH,UAAgB"}
|
|
1
|
+
{"version":3,"file":"base-upload.js","names":["#setupUppyHandlers","#addFileToUppy","#startUpload","#createUploadOperation","#extractErrorMessage","#normalizeData","#normalizeDataForNode","#normalizeDataForBrowser"],"sources":["../../../src/upload/base-upload.ts"],"sourcesContent":["import Uppy from \"@uppy/core\";\nimport { default as defer } from \"p-defer\";\nimport type { Readable } from \"stream\";\n\nimport type { PinnerConfig } from \"../config\";\nimport type {\n UploadInput,\n UploadOperation,\n UploadOptions,\n UploadProgress,\n UploadResult,\n} from \"@/types/upload\";\nimport { UploadResultSymbol } from \"@/types/upload\";\nimport type { PostUploadResponse } from \"@/api/generated/schemas\";\nimport { normalizeUploadInput, type UploadInputObject } from \"./normalize\";\nimport {\n fileToReadableStream,\n readableStreamToNodeStream,\n} from \"@/utils/stream\";\nimport { isNodeEnvironment } from \"@/utils/env\";\nimport { UPLOAD_SOURCE_TUS, UPLOAD_SOURCE_XHR } from \"./constants\";\n\n// Node.js Readable stream with size property for Uppy compatibility\ntype NodeStreamWithSize = Readable & { size: number | null };\n\nexport abstract class BaseUploadHandler {\n protected config: Required<PinnerConfig>;\n\n constructor(config: PinnerConfig) {\n this.config = config as Required<PinnerConfig>;\n }\n\n async upload(\n input: UploadInput | UploadInputObject,\n options?: UploadOptions,\n ): Promise<UploadOperation> {\n const normalized = normalizeUploadInput(input, options);\n const uppy = new Uppy();\n const { fileId, resultPromise, progress } = this.#setupUppyHandlers(\n uppy,\n normalized,\n options,\n );\n\n await this.#addFileToUppy(uppy, normalized, normalized.size);\n this.#startUpload(uppy, options);\n\n return this.#createUploadOperation(uppy, fileId, resultPromise, progress);\n }\n\n #setupUppyHandlers(\n uppy: Uppy,\n normalized: { size: number },\n options?: UploadOptions,\n ): {\n fileId: string | null;\n resultPromise: Promise<UploadResult>;\n progress: UploadProgress;\n } {\n let fileId: string | null = null;\n let hasRejected = false;\n\n const progress: UploadProgress = {\n percentage: 0,\n bytesUploaded: 0,\n bytesTotal: normalized.size,\n };\n\n const {\n promise: resultPromise,\n resolve: resolveResult,\n reject: rejectResult,\n } = defer<UploadResult>();\n\n const handleError = (error: Error) => {\n if (hasRejected) return;\n hasRejected = true;\n options?.onError?.(error);\n rejectResult(error);\n };\n\n this.configurePlugin(uppy);\n\n uppy.on(\"progress\", (progressBytes) => {\n progress.bytesUploaded = progressBytes;\n progress.percentage = (progressBytes / progress.bytesTotal) * 100;\n options?.onProgress?.(progress);\n });\n\n uppy.on(\"upload-success\", (_file, result) => {\n if (hasRejected) return;\n const uploadResult = this.parseResult(result);\n options?.onComplete?.(uploadResult);\n resolveResult(uploadResult);\n });\n\n uppy.on(\"error\", (error) => {\n handleError(new Error(this.#extractErrorMessage(error)));\n });\n\n uppy.on(\"file-added\", (file) => {\n fileId = file.id;\n });\n\n return { fileId, resultPromise, progress };\n }\n\n #extractErrorMessage(error: unknown): string {\n let errorMessage = \"Upload fainormalizeDataled\";\n\n if (!error) return errorMessage;\n\n if (typeof error === \"string\") {\n errorMessage = error;\n } else if (error instanceof Error) {\n errorMessage = error.message;\n } else if ((error as any).message) {\n errorMessage = (error as any).message;\n } else if (\n (error as any).toString &&\n typeof (error as any).toString === \"function\"\n ) {\n errorMessage = (error as any).toString();\n }\n\n // Try to extract error from response (XHRUpload/TusPlugin)\n const errorObj = error as any;\n if (errorObj?.xhr?.response) {\n try {\n const response =\n typeof errorObj.xhr.response === \"string\"\n ? JSON.parse(errorObj.xhr.response)\n : errorObj.xhr.response;\n if (response.error) {\n errorMessage = response.error;\n } else if (response.message) {\n errorMessage = response.message;\n }\n } catch {\n // If parsing fails, use the original error message\n }\n }\n\n return errorMessage;\n }\n\n async #normalizeData(\n data: File | ReadableStream<Uint8Array>,\n ): Promise<File | ReadableStream<Uint8Array> | NodeStreamWithSize | Blob> {\n if (isNodeEnvironment()) {\n return this.#normalizeDataForNode(data);\n }\n return this.#normalizeDataForBrowser(data);\n }\n\n async #normalizeDataForBrowser(\n data: File | ReadableStream<Uint8Array>,\n ): Promise<File | Blob | ReadableStream<Uint8Array>> {\n // TUS plugin requires File, Blob, or Reader in browser\n if (this.getUploadSource() === UPLOAD_SOURCE_TUS) {\n if (data instanceof ReadableStream) {\n const { streamToBlobViaResponse } = await import(\"@/utils/stream\");\n return streamToBlobViaResponse(data);\n }\n return data;\n }\n\n // XHRUpload handles File/Blob directly\n return data;\n }\n\n async #normalizeDataForNode(\n data: File | ReadableStream<Uint8Array>,\n ): Promise<NodeStreamWithSize | File | Blob | ReadableStream<Uint8Array>> {\n // XHRUpload with formData: true requires Blob/File for FormData.append()\n // Do not convert to Node.js stream for XHRUpload\n if (this.getUploadSource() === UPLOAD_SOURCE_XHR) {\n return data;\n }\n\n // Convert File to ReadableStream without loading entire blob into memory\n if (data instanceof File) {\n const stream = fileToReadableStream(data);\n // Convert to Node.js stream for tus-js-client\n const nodeStream = await readableStreamToNodeStream(stream);\n return nodeStream as NodeStreamWithSize;\n }\n\n // In Node.js, convert ReadableStream to Node.js stream.Readable for tus-js-client's NodeFileReader\n if (data instanceof ReadableStream) {\n const nodeStream = await readableStreamToNodeStream(data);\n // Add size property to satisfy Uppy's type requirements\n return nodeStream as NodeStreamWithSize;\n }\n\n return data;\n }\n\n async #addFileToUppy(\n uppy: Uppy,\n normalized: {\n data: File | ReadableStream<Uint8Array>;\n name: string;\n type: string;\n },\n size?: number,\n ): Promise<void> {\n const fileData = await this.#normalizeData(normalized.data);\n const fileOptions = {\n source: this.getUploadSource(),\n name: normalized.name,\n type: normalized.type,\n data: fileData as any,\n };\n\n // Add file to Uppy first\n // Note: Uppy accepts any data type as it defers to the drivers\n const fileId = uppy.addFile(fileOptions);\n\n // Set TUS upload size if provided\n // In Node.js, streams need explicit size for tus-js-client\n // In browser, Uppy's TUS plugin may not derive size from Blob automatically\n if (\n this.getUploadSource() === UPLOAD_SOURCE_TUS &&\n size !== undefined &&\n size > 0\n ) {\n uppy.setFileState(fileId, {\n tus: { uploadSize: size },\n });\n }\n }\n\n #startUpload(uppy: Uppy, options?: UploadOptions): void {\n uppy.upload().catch((error) => {\n options?.onError?.(new Error(this.#extractErrorMessage(error)));\n });\n }\n\n #createUploadOperation(\n uppy: Uppy,\n fileId: string | null,\n resultPromise: Promise<UploadResult>,\n progress: UploadProgress,\n ): UploadOperation {\n return {\n cancel: () => {\n uppy.cancelAll();\n },\n pause: () => {\n if (fileId) {\n uppy.pauseResume(fileId);\n }\n },\n resume: () => {\n if (fileId) {\n uppy.pauseResume(fileId);\n }\n },\n result: resultPromise,\n progress: Object.freeze({ ...progress }),\n };\n }\n\n destroy(): void {\n // No-op since each upload creates its own Uppy instance\n }\n\n protected abstract configurePlugin(uppy: Uppy): void;\n protected abstract parseResult(result: unknown): UploadResult;\n protected abstract getUploadSource(): string;\n\n protected mapUploadResponse(\n body: unknown,\n uploadId: string,\n overrides?: Partial<UploadResult>,\n ): UploadResult {\n if (body && typeof body === \"object\" && \"CID\" in body) {\n const { CID } = body as PostUploadResponse;\n return {\n id: uploadId,\n cid: CID,\n name: \"\",\n size: 0,\n mimeType: \"\",\n createdAt: new Date(),\n numberOfFiles: 1,\n [UploadResultSymbol]: true,\n ...overrides,\n };\n }\n\n return {\n id: uploadId,\n name: \"\",\n size: 0,\n mimeType: \"\",\n createdAt: new Date(),\n numberOfFiles: 1,\n [UploadResultSymbol]: true,\n ...overrides,\n };\n }\n}\n"],"mappings":";;;;;;;;;AAyBA,IAAsB,oBAAtB,MAAwC;CACtC,AAAU;CAEV,YAAY,QAAsB;AAChC,OAAK,SAAS;;CAGhB,MAAM,OACJ,OACA,SAC0B;EAC1B,MAAM,aAAa,qBAAqB,OAAO,QAAQ;EACvD,MAAM,OAAO,IAAI,MAAM;EACvB,MAAM,EAAE,QAAQ,eAAe,aAAa,MAAKA,kBAC/C,MACA,YACA,QACD;AAED,QAAM,MAAKC,cAAe,MAAM,YAAY,WAAW,KAAK;AAC5D,QAAKC,YAAa,MAAM,QAAQ;AAEhC,SAAO,MAAKC,sBAAuB,MAAM,QAAQ,eAAe,SAAS;;CAG3E,mBACE,MACA,YACA,SAKA;EACA,IAAI,SAAwB;EAC5B,IAAI,cAAc;EAElB,MAAM,WAA2B;GAC/B,YAAY;GACZ,eAAe;GACf,YAAY,WAAW;GACxB;EAED,MAAM,EACJ,SAAS,eACT,SAAS,eACT,QAAQ,iBACN,OAAqB;EAEzB,MAAM,eAAe,UAAiB;AACpC,OAAI,YAAa;AACjB,iBAAc;AACd,YAAS,UAAU,MAAM;AACzB,gBAAa,MAAM;;AAGrB,OAAK,gBAAgB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N,MAAM;GACN,UAAU;GACV,2BAAW,IAAI,MAAM;GACrB,eAAe;IACd,qBAAqB;GACtB,GAAG;GACJ"}
|
package/dist/esm/upload/car.js
CHANGED
|
@@ -79,6 +79,7 @@ async function preprocessToCar(input, options) {
|
|
|
79
79
|
files = [new File([streamBlob], options?.name || "upload", { type: streamBlob.type })];
|
|
80
80
|
} else if (Array.isArray(input)) files = input;
|
|
81
81
|
else files = [input];
|
|
82
|
+
const wrapWithDirectory = Array.isArray(input);
|
|
82
83
|
const heliaInstance = await getHelia();
|
|
83
84
|
const fs = unixfs(heliaInstance);
|
|
84
85
|
const c = car(heliaInstance);
|
|
@@ -89,6 +90,7 @@ async function preprocessToCar(input, options) {
|
|
|
89
90
|
for await (const result of fs.addAll(src, {
|
|
90
91
|
cidVersion: 1,
|
|
91
92
|
rawLeaves: false,
|
|
93
|
+
wrapWithDirectory,
|
|
92
94
|
signal: options?.signal,
|
|
93
95
|
onProgress(event) {
|
|
94
96
|
if (event.type === "blocks:put:blockstore:put") blocksCount++;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"car.js","names":["createUnstorageDatastore"],"sources":["../../../src/upload/car.ts"],"sourcesContent":["import { car } from \"@helia/car\";\nimport { createHeliaHTTP } from \"@helia/http\";\nimport { unixfs } from \"@helia/unixfs\";\nimport {\n createBlockstore,\n createDatastore as createUnstorageDatastore,\n} from \"@/blockstore\";\nimport type { CID } from \"multiformats/cid\";\nimport { CarReader } from \"@ipld/car\";\nimport type { Datastore } from \"interface-datastore\";\n\nimport {\n asyncGeneratorToReadableStream,\n calculateStreamSize,\n readableStreamToAsyncIterable,\n streamToBlob,\n} from \"@/utils/stream\";\nimport { FILE_EXTENSION_CAR, MIME_TYPE_CAR } from \"@/types/mime-types\";\n\nexport interface CarPreprocessOptions {\n name?: string;\n onProgress?: (percentage: number) => void;\n signal?: AbortSignal;\n}\n\nexport interface CarPreprocessResult {\n carStream: ReadableStream<Uint8Array>;\n rootCid: string;\n size: bigint;\n}\n\nexport interface CarConfig {\n /**\n * Custom datastore instance for Helia.\n * If provided, this datastore will be used directly without creating one from storage.\n * Highest priority - takes precedence over storage and datastoreName.\n */\n datastore?: Datastore;\n\n /**\n * Custom base name for Helia storage.\n * Passed as the `base` option to both blockstore and datastore storage instances.\n * Only used when datastore is not provided.\n * @default \"pinner-helia-data\"\n */\n datastoreName?: string;\n}\n\nlet helia: any = null;\nlet blockstore: any = null;\nlet datastore: any = null;\nlet config: CarConfig = {};\n\nexport function configureCar(carConfig: CarConfig) {\n config = carConfig;\n}\n\nasync function getHelia() {\n if (helia) return helia;\n\n const BlockstoreClass = createBlockstore();\n const DatastoreClass = createUnstorageDatastore();\n\n blockstore = new BlockstoreClass({\n prefix: \"pinner-helia-blocks\",\n base: config.datastoreName,\n });\n datastore =\n config.datastore ||\n new DatastoreClass({\n prefix: \"pinner-helia-data\",\n base: config.datastoreName,\n });\n\n helia = await createHeliaHTTP({\n blockstore,\n datastore,\n });\n\n return helia;\n}\n\nasync function cleanupHelia() {\n if (datastore?.close) {\n await datastore.close();\n }\n helia = null;\n blockstore = null;\n datastore = null;\n}\n\nasync function* fileSource(\n files: File[],\n onProgress?: (percentage: number) => void,\n signal?: AbortSignal,\n): AsyncGenerator<{\n content: AsyncIterable<Uint8Array> | undefined;\n path: string;\n}> {\n const seenDirs = new Set<string>();\n let totalBytes = 0n;\n let processedBytes = 0n;\n\n for (const file of files) {\n totalBytes += BigInt(file.size);\n }\n\n for (const file of files) {\n if (signal?.aborted) {\n throw new Error(\"Aborted\");\n }\n\n const fullPath = (file as any).webkitRelativePath ?? file.name;\n\n if (fullPath.includes(\"/.\")) {\n continue;\n }\n\n const parts = fullPath.split(\"/\").filter((part: string) => part.length > 0);\n\n for (let i = 1; i < parts.length; i++) {\n if (signal?.aborted) {\n throw new Error(\"Aborted\");\n }\n\n const dirPath = parts.slice(0, i).join(\"/\");\n\n if (!seenDirs.has(dirPath)) {\n seenDirs.add(dirPath);\n yield {\n content: (async function* () {})(),\n path: dirPath,\n };\n }\n }\n\n yield {\n content: readableStreamToAsyncIterable(file.stream()),\n path: fullPath,\n };\n\n if (onProgress && totalBytes > 0n) {\n processedBytes += BigInt(file.size);\n const progressPercent = Number((processedBytes * 100n) / totalBytes);\n onProgress(progressPercent);\n }\n }\n}\n\nexport async function preprocessToCar(\n input: File | ReadableStream<Uint8Array> | File[],\n options?: CarPreprocessOptions,\n): Promise<CarPreprocessResult> {\n let files: File[];\n\n if (input instanceof ReadableStream) {\n const [streamForSize, streamForFile] = input.tee();\n const size = await calculateStreamSize(streamForSize, options?.signal);\n const streamBlob = await streamToBlob(\n streamForFile,\n \"application/octet-stream\",\n );\n files = [\n new File([streamBlob], options?.name || \"upload\", {\n type: streamBlob.type,\n }),\n ];\n } else if (Array.isArray(input)) {\n files = input;\n } else {\n files = [input];\n }\n\n const heliaInstance = await getHelia();\n const fs = unixfs(heliaInstance);\n const c = car(heliaInstance);\n\n let rootCid: CID | undefined;\n let blocksCount = 0n;\n\n const src = fileSource(files, options?.onProgress, options?.signal);\n\n let hasFiles = false;\n for await (const result of fs.addAll(src, {\n cidVersion: 1,\n rawLeaves: false,\n signal: options?.signal,\n onProgress(event) {\n if (event.type === \"blocks:put:blockstore:put\") {\n blocksCount++;\n }\n },\n })) {\n if (options?.signal?.aborted) {\n throw new Error(\"Aborted\");\n }\n rootCid = result.cid;\n hasFiles = true;\n }\n\n if (!hasFiles || !rootCid) {\n throw new Error(\"No files to process\");\n }\n\n // c.export() now returns an async generator directly (was renamed from 'stream')\n const carAsyncGenerator = c.export(rootCid!, { signal: options?.signal });\n const carStream = asyncGeneratorToReadableStream(carAsyncGenerator);\n\n // Use stream tee to create two identical streams - one for size calculation, one for processing\n const [streamForSize, streamForProcessing] = carStream.tee();\n\n const size = await calculateStreamSize(streamForSize, options?.signal);\n\n return {\n carStream: streamForProcessing,\n rootCid: rootCid!.toString(),\n size,\n };\n}\n\nexport async function isCarFile(file: File): Promise<boolean> {\n if (file.type !== MIME_TYPE_CAR && !file.name.endsWith(FILE_EXTENSION_CAR)) {\n return false;\n }\n\n try {\n const iterable = readableStreamToAsyncIterable(file.stream());\n const reader = await CarReader.fromIterable(iterable);\n const roots = await reader.getRoots();\n return roots.length > 0;\n } catch {\n return false;\n }\n}\n\nexport async function destroyCarPreprocessor() {\n await cleanupHelia();\n}\n"],"mappings":";;;;;;;;;;AAgDA,IAAI,QAAa;AACjB,IAAI,aAAkB;AACtB,IAAI,YAAiB;AACrB,IAAI,SAAoB,EAAE;AAE1B,SAAgB,aAAa,WAAsB;AACjD,UAAS;;AAGX,eAAe,WAAW;AACxB,KAAI,MAAO,QAAO;CAElB,MAAM,kBAAkB,kBAAkB;CAC1C,MAAM,iBAAiBA,iBAA0B;AAEjD,cAAa,IAAI,gBAAgB;EAC/B,QAAQ;EACR,MAAM,OAAO;EACd,CAAC;AACF,aACE,OAAO,aACP,IAAI,eAAe;EACjB,QAAQ;EACR,MAAM,OAAO;EACd,CAAC;AAEJ,SAAQ,MAAM,gBAAgB;EAC5B;EACA;EACD,CAAC;AAEF,QAAO;;AAGT,eAAe,eAAe;AAC5B,KAAI,WAAW,MACb,OAAM,UAAU,OAAO;AAEzB,SAAQ;AACR,cAAa;AACb,aAAY;;AAGd,gBAAgB,WACd,OACA,YACA,QAIC;CACD,MAAM,2BAAW,IAAI,KAAa;CAClC,IAAI,aAAa;CACjB,IAAI,iBAAiB;AAErB,MAAK,MAAM,QAAQ,MACjB,eAAc,OAAO,KAAK,KAAK;AAGjC,MAAK,MAAM,QAAQ,OAAO;AACxB,MAAI,QAAQ,QACV,OAAM,IAAI,MAAM,UAAU;EAG5B,MAAM,WAAY,KAAa,sBAAsB,KAAK;AAE1D,MAAI,SAAS,SAAS,KAAK,CACzB;EAGF,MAAM,QAAQ,SAAS,MAAM,IAAI,CAAC,QAAQ,SAAiB,KAAK,SAAS,EAAE;AAE3E,OAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,OAAI,QAAQ,QACV,OAAM,IAAI,MAAM,UAAU;GAG5B,MAAM,UAAU,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI;AAE3C,OAAI,CAAC,SAAS,IAAI,QAAQ,EAAE;AAC1B,aAAS,IAAI,QAAQ;AACrB,UAAM;KACJ,UAAU,mBAAmB,KAAK;KAClC,MAAM;KACP;;;AAIL,QAAM;GACJ,SAAS,8BAA8B,KAAK,QAAQ,CAAC;GACrD,MAAM;GACP;AAED,MAAI,cAAc,aAAa,IAAI;AACjC,qBAAkB,OAAO,KAAK,KAAK;AAEnC,cADwB,OAAQ,iBAAiB,OAAQ,WAC/B,CAAC;;;;AAKjC,eAAsB,gBACpB,OACA,SAC8B;CAC9B,IAAI;AAEJ,KAAI,iBAAiB,gBAAgB;EACnC,MAAM,CAAC,eAAe,iBAAiB,MAAM,KAAK;AACrC,QAAM,oBAAoB,eAAe,SAAS,OAAO;EACtE,MAAM,aAAa,MAAM,aACvB,eACA,2BACD;AACD,UAAQ,CACN,IAAI,KAAK,CAAC,WAAW,EAAE,SAAS,QAAQ,UAAU,EAChD,MAAM,WAAW,MAClB,CAAC,CACH;YACQ,MAAM,QAAQ,MAAM,CAC7B,SAAQ;KAER,SAAQ,CAAC,MAAM;
|
|
1
|
+
{"version":3,"file":"car.js","names":["createUnstorageDatastore"],"sources":["../../../src/upload/car.ts"],"sourcesContent":["import { car } from \"@helia/car\";\nimport { createHeliaHTTP } from \"@helia/http\";\nimport { unixfs } from \"@helia/unixfs\";\nimport {\n createBlockstore,\n createDatastore as createUnstorageDatastore,\n} from \"@/blockstore\";\nimport type { CID } from \"multiformats/cid\";\nimport { CarReader } from \"@ipld/car\";\nimport type { Datastore } from \"interface-datastore\";\n\nimport {\n asyncGeneratorToReadableStream,\n calculateStreamSize,\n readableStreamToAsyncIterable,\n streamToBlob,\n} from \"@/utils/stream\";\nimport { FILE_EXTENSION_CAR, MIME_TYPE_CAR } from \"@/types/mime-types\";\n\nexport interface CarPreprocessOptions {\n name?: string;\n onProgress?: (percentage: number) => void;\n signal?: AbortSignal;\n}\n\nexport interface CarPreprocessResult {\n carStream: ReadableStream<Uint8Array>;\n rootCid: string;\n size: bigint;\n}\n\nexport interface CarConfig {\n /**\n * Custom datastore instance for Helia.\n * If provided, this datastore will be used directly without creating one from storage.\n * Highest priority - takes precedence over storage and datastoreName.\n */\n datastore?: Datastore;\n\n /**\n * Custom base name for Helia storage.\n * Passed as the `base` option to both blockstore and datastore storage instances.\n * Only used when datastore is not provided.\n * @default \"pinner-helia-data\"\n */\n datastoreName?: string;\n}\n\nlet helia: any = null;\nlet blockstore: any = null;\nlet datastore: any = null;\nlet config: CarConfig = {};\n\nexport function configureCar(carConfig: CarConfig) {\n config = carConfig;\n}\n\nasync function getHelia() {\n if (helia) return helia;\n\n const BlockstoreClass = createBlockstore();\n const DatastoreClass = createUnstorageDatastore();\n\n blockstore = new BlockstoreClass({\n prefix: \"pinner-helia-blocks\",\n base: config.datastoreName,\n });\n datastore =\n config.datastore ||\n new DatastoreClass({\n prefix: \"pinner-helia-data\",\n base: config.datastoreName,\n });\n\n helia = await createHeliaHTTP({\n blockstore,\n datastore,\n });\n\n return helia;\n}\n\nasync function cleanupHelia() {\n if (datastore?.close) {\n await datastore.close();\n }\n helia = null;\n blockstore = null;\n datastore = null;\n}\n\nasync function* fileSource(\n files: File[],\n onProgress?: (percentage: number) => void,\n signal?: AbortSignal,\n): AsyncGenerator<{\n content: AsyncIterable<Uint8Array> | undefined;\n path: string;\n}> {\n const seenDirs = new Set<string>();\n let totalBytes = 0n;\n let processedBytes = 0n;\n\n for (const file of files) {\n totalBytes += BigInt(file.size);\n }\n\n for (const file of files) {\n if (signal?.aborted) {\n throw new Error(\"Aborted\");\n }\n\n const fullPath = (file as any).webkitRelativePath ?? file.name;\n\n if (fullPath.includes(\"/.\")) {\n continue;\n }\n\n const parts = fullPath.split(\"/\").filter((part: string) => part.length > 0);\n\n for (let i = 1; i < parts.length; i++) {\n if (signal?.aborted) {\n throw new Error(\"Aborted\");\n }\n\n const dirPath = parts.slice(0, i).join(\"/\");\n\n if (!seenDirs.has(dirPath)) {\n seenDirs.add(dirPath);\n yield {\n content: (async function* () {})(),\n path: dirPath,\n };\n }\n }\n\n yield {\n content: readableStreamToAsyncIterable(file.stream()),\n path: fullPath,\n };\n\n if (onProgress && totalBytes > 0n) {\n processedBytes += BigInt(file.size);\n const progressPercent = Number((processedBytes * 100n) / totalBytes);\n onProgress(progressPercent);\n }\n }\n}\n\nexport async function preprocessToCar(\n input: File | ReadableStream<Uint8Array> | File[],\n options?: CarPreprocessOptions,\n): Promise<CarPreprocessResult> {\n let files: File[];\n\n if (input instanceof ReadableStream) {\n const [streamForSize, streamForFile] = input.tee();\n const size = await calculateStreamSize(streamForSize, options?.signal);\n const streamBlob = await streamToBlob(\n streamForFile,\n \"application/octet-stream\",\n );\n files = [\n new File([streamBlob], options?.name || \"upload\", {\n type: streamBlob.type,\n }),\n ];\n } else if (Array.isArray(input)) {\n files = input;\n } else {\n files = [input];\n }\n\n // wrapWithDirectory must be true for directory uploads (File[] input) so the\n // last addAll yield is the root directory CID, not a child file/subdirectory.\n // Single files don't need wrapping. Matches Go SDK wrapInDir behavior.\n const wrapWithDirectory = Array.isArray(input);\n\n const heliaInstance = await getHelia();\n const fs = unixfs(heliaInstance);\n const c = car(heliaInstance);\n\n let rootCid: CID | undefined;\n let blocksCount = 0n;\n\n const src = fileSource(files, options?.onProgress, options?.signal);\n\n let hasFiles = false;\n for await (const result of fs.addAll(src, {\n cidVersion: 1,\n rawLeaves: false,\n wrapWithDirectory,\n signal: options?.signal,\n onProgress(event) {\n if (event.type === \"blocks:put:blockstore:put\") {\n blocksCount++;\n }\n },\n })) {\n if (options?.signal?.aborted) {\n throw new Error(\"Aborted\");\n }\n rootCid = result.cid;\n hasFiles = true;\n }\n\n if (!hasFiles || !rootCid) {\n throw new Error(\"No files to process\");\n }\n\n // c.export() now returns an async generator directly (was renamed from 'stream')\n const carAsyncGenerator = c.export(rootCid!, { signal: options?.signal });\n const carStream = asyncGeneratorToReadableStream(carAsyncGenerator);\n\n // Use stream tee to create two identical streams - one for size calculation, one for processing\n const [streamForSize, streamForProcessing] = carStream.tee();\n\n const size = await calculateStreamSize(streamForSize, options?.signal);\n\n return {\n carStream: streamForProcessing,\n rootCid: rootCid!.toString(),\n size,\n };\n}\n\nexport async function isCarFile(file: File): Promise<boolean> {\n if (file.type !== MIME_TYPE_CAR && !file.name.endsWith(FILE_EXTENSION_CAR)) {\n return false;\n }\n\n try {\n const iterable = readableStreamToAsyncIterable(file.stream());\n const reader = await CarReader.fromIterable(iterable);\n const roots = await reader.getRoots();\n return roots.length > 0;\n } catch {\n return false;\n }\n}\n\nexport async function destroyCarPreprocessor() {\n await cleanupHelia();\n}\n"],"mappings":";;;;;;;;;;AAgDA,IAAI,QAAa;AACjB,IAAI,aAAkB;AACtB,IAAI,YAAiB;AACrB,IAAI,SAAoB,EAAE;AAE1B,SAAgB,aAAa,WAAsB;AACjD,UAAS;;AAGX,eAAe,WAAW;AACxB,KAAI,MAAO,QAAO;CAElB,MAAM,kBAAkB,kBAAkB;CAC1C,MAAM,iBAAiBA,iBAA0B;AAEjD,cAAa,IAAI,gBAAgB;EAC/B,QAAQ;EACR,MAAM,OAAO;EACd,CAAC;AACF,aACE,OAAO,aACP,IAAI,eAAe;EACjB,QAAQ;EACR,MAAM,OAAO;EACd,CAAC;AAEJ,SAAQ,MAAM,gBAAgB;EAC5B;EACA;EACD,CAAC;AAEF,QAAO;;AAGT,eAAe,eAAe;AAC5B,KAAI,WAAW,MACb,OAAM,UAAU,OAAO;AAEzB,SAAQ;AACR,cAAa;AACb,aAAY;;AAGd,gBAAgB,WACd,OACA,YACA,QAIC;CACD,MAAM,2BAAW,IAAI,KAAa;CAClC,IAAI,aAAa;CACjB,IAAI,iBAAiB;AAErB,MAAK,MAAM,QAAQ,MACjB,eAAc,OAAO,KAAK,KAAK;AAGjC,MAAK,MAAM,QAAQ,OAAO;AACxB,MAAI,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