@lumeweb/pinner 0.1.4 → 0.1.6
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/api/generated/content/content.msw.d.ts +8 -0
- package/dist/esm/api/generated/content/content.msw.js +147 -0
- package/dist/esm/api/generated/content/content.msw.js.map +1 -0
- package/dist/esm/api/generated/dns/dns.msw.d.ts +8 -0
- package/dist/esm/api/generated/dns/dns.msw.js +413 -0
- package/dist/esm/api/generated/dns/dns.msw.js.map +1 -0
- package/dist/esm/api/generated/files/files.msw.d.ts +8 -0
- package/dist/esm/api/generated/files/files.msw.js +150 -0
- package/dist/esm/api/generated/files/files.msw.js.map +1 -0
- package/dist/esm/api/generated/gateway/gateway.msw.d.ts +8 -0
- package/dist/esm/api/generated/gateway/gateway.msw.js +91 -0
- package/dist/esm/api/generated/gateway/gateway.msw.js.map +1 -0
- package/dist/esm/api/generated/index.msw.d.ts +10 -0
- package/dist/esm/api/generated/index.msw.js +11 -0
- package/dist/esm/api/generated/internal/internal.msw.d.ts +8 -0
- package/dist/esm/api/generated/internal/internal.msw.js +103 -0
- package/dist/esm/api/generated/internal/internal.msw.js.map +1 -0
- package/dist/esm/api/generated/ipns/ipns.msw.d.ts +8 -0
- package/dist/esm/api/generated/ipns/ipns.msw.js +205 -0
- package/dist/esm/api/generated/ipns/ipns.msw.js.map +1 -0
- package/dist/esm/api/generated/pinning/pinning.msw.d.ts +8 -0
- package/dist/esm/api/generated/pinning/pinning.msw.js +282 -0
- package/dist/esm/api/generated/pinning/pinning.msw.js.map +1 -0
- package/dist/esm/api/generated/schemas/iPNSRepublishResponse.d.ts +43 -0
- package/dist/esm/api/generated/schemas/websiteItem.d.ts +3 -0
- package/dist/esm/api/generated/schemas/websiteResponse.d.ts +3 -0
- package/dist/esm/api/generated/schemas/websiteValidateResponse.d.ts +1 -0
- package/dist/esm/api/generated/tus/tus.msw.d.ts +8 -0
- package/dist/esm/api/generated/tus/tus.msw.js +98 -0
- package/dist/esm/api/generated/tus/tus.msw.js.map +1 -0
- package/dist/esm/api/generated/websites/websites.msw.d.ts +8 -0
- package/dist/esm/api/generated/websites/websites.msw.js +417 -0
- package/dist/esm/api/generated/websites/websites.msw.js.map +1 -0
- package/dist/esm/api/ipns.d.ts +3 -2
- package/dist/esm/api/ipns.js +2 -3
- package/dist/esm/api/ipns.js.map +1 -1
- package/dist/esm/api/websites.d.ts +12 -2
- package/dist/esm/api/websites.js +19 -1
- package/dist/esm/api/websites.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/package.json +8 -3
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { faker } from "@faker-js/faker";
|
|
2
|
+
import { HttpResponse, delay, http } from "msw";
|
|
3
|
+
|
|
4
|
+
//#region src/api/generated/files/files.msw.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generated by orval v8.10.0 🍺
|
|
7
|
+
* Do not edit manually.
|
|
8
|
+
* Portal IPFS Plugin API
|
|
9
|
+
*
|
|
10
|
+
## Portal IPFS Plugin API
|
|
11
|
+
|
|
12
|
+
A comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.
|
|
13
|
+
|
|
14
|
+
### IPFS Pinning Service API Compatibility
|
|
15
|
+
|
|
16
|
+
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.
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **Pinning**: Add, list, update, and remove pinned content
|
|
21
|
+
- **Content**: Upload files, retrieve IPFS content, and manage metadata
|
|
22
|
+
- **IPNS**: Manage IPNS keys and publish content
|
|
23
|
+
- **Files**: Browse and manage pinned files with directory navigation
|
|
24
|
+
- **Websites**: Create and manage website hosting with DNS and SSL automation
|
|
25
|
+
|
|
26
|
+
### Authentication
|
|
27
|
+
|
|
28
|
+
All API endpoints require authentication using JWT tokens obtained from the Portal authentication service.
|
|
29
|
+
|
|
30
|
+
### Rate Limiting
|
|
31
|
+
|
|
32
|
+
API requests are rate-limited based on user account tier. See Portal documentation for current limits.
|
|
33
|
+
|
|
34
|
+
### Documentation
|
|
35
|
+
|
|
36
|
+
For detailed API usage examples and integration guides, visit the Portal documentation website.
|
|
37
|
+
|
|
38
|
+
* OpenAPI spec version: 1.0.0
|
|
39
|
+
*/
|
|
40
|
+
const getGetApiFilesResponseMock = (overrideResponse = {}) => ({
|
|
41
|
+
data: Array.from({ length: faker.number.int({
|
|
42
|
+
min: 1,
|
|
43
|
+
max: 10
|
|
44
|
+
}) }, (_, i) => i + 1).map(() => ({
|
|
45
|
+
cid: faker.string.alpha({ length: {
|
|
46
|
+
min: 10,
|
|
47
|
+
max: 20
|
|
48
|
+
} }),
|
|
49
|
+
created: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
50
|
+
depth: faker.number.int(),
|
|
51
|
+
is_directory: faker.datatype.boolean(),
|
|
52
|
+
name: faker.string.alpha({ length: {
|
|
53
|
+
min: 10,
|
|
54
|
+
max: 20
|
|
55
|
+
} }),
|
|
56
|
+
path: faker.string.alpha({ length: {
|
|
57
|
+
min: 10,
|
|
58
|
+
max: 20
|
|
59
|
+
} }),
|
|
60
|
+
size: faker.number.int(),
|
|
61
|
+
type: faker.number.int(),
|
|
62
|
+
unpinnable: faker.datatype.boolean(),
|
|
63
|
+
updated: faker.date.past().toISOString().slice(0, 19) + "Z"
|
|
64
|
+
})),
|
|
65
|
+
total: faker.number.int(),
|
|
66
|
+
...overrideResponse
|
|
67
|
+
});
|
|
68
|
+
const getGetApiFilesBreadcrumbsResponseMock = (overrideResponse = {}) => ({
|
|
69
|
+
data: Array.from({ length: faker.number.int({
|
|
70
|
+
min: 1,
|
|
71
|
+
max: 10
|
|
72
|
+
}) }, (_, i) => i + 1).map(() => ({
|
|
73
|
+
cid: faker.string.alpha({ length: {
|
|
74
|
+
min: 10,
|
|
75
|
+
max: 20
|
|
76
|
+
} }),
|
|
77
|
+
created: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
78
|
+
depth: faker.number.int(),
|
|
79
|
+
is_directory: faker.datatype.boolean(),
|
|
80
|
+
name: faker.string.alpha({ length: {
|
|
81
|
+
min: 10,
|
|
82
|
+
max: 20
|
|
83
|
+
} }),
|
|
84
|
+
path: faker.string.alpha({ length: {
|
|
85
|
+
min: 10,
|
|
86
|
+
max: 20
|
|
87
|
+
} }),
|
|
88
|
+
size: faker.number.int(),
|
|
89
|
+
type: faker.number.int(),
|
|
90
|
+
unpinnable: faker.datatype.boolean(),
|
|
91
|
+
updated: faker.date.past().toISOString().slice(0, 19) + "Z"
|
|
92
|
+
})),
|
|
93
|
+
total: faker.number.int(),
|
|
94
|
+
...overrideResponse
|
|
95
|
+
});
|
|
96
|
+
const getGetApiFilesDirectoryResponseMock = (overrideResponse = {}) => ({
|
|
97
|
+
data: Array.from({ length: faker.number.int({
|
|
98
|
+
min: 1,
|
|
99
|
+
max: 10
|
|
100
|
+
}) }, (_, i) => i + 1).map(() => ({
|
|
101
|
+
cid: faker.string.alpha({ length: {
|
|
102
|
+
min: 10,
|
|
103
|
+
max: 20
|
|
104
|
+
} }),
|
|
105
|
+
created: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
106
|
+
depth: faker.number.int(),
|
|
107
|
+
is_directory: faker.datatype.boolean(),
|
|
108
|
+
name: faker.string.alpha({ length: {
|
|
109
|
+
min: 10,
|
|
110
|
+
max: 20
|
|
111
|
+
} }),
|
|
112
|
+
path: faker.string.alpha({ length: {
|
|
113
|
+
min: 10,
|
|
114
|
+
max: 20
|
|
115
|
+
} }),
|
|
116
|
+
size: faker.number.int(),
|
|
117
|
+
type: faker.number.int(),
|
|
118
|
+
unpinnable: faker.datatype.boolean(),
|
|
119
|
+
updated: faker.date.past().toISOString().slice(0, 19) + "Z"
|
|
120
|
+
})),
|
|
121
|
+
total: faker.number.int(),
|
|
122
|
+
...overrideResponse
|
|
123
|
+
});
|
|
124
|
+
const getGetApiFilesMockHandler = (overrideResponse, options) => {
|
|
125
|
+
return http.get("*/api/files", async (info) => {
|
|
126
|
+
await delay(0);
|
|
127
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getGetApiFilesResponseMock(), { status: 200 });
|
|
128
|
+
}, options);
|
|
129
|
+
};
|
|
130
|
+
const getGetApiFilesBreadcrumbsMockHandler = (overrideResponse, options) => {
|
|
131
|
+
return http.get("*/api/files/breadcrumbs", async (info) => {
|
|
132
|
+
await delay(0);
|
|
133
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getGetApiFilesBreadcrumbsResponseMock(), { status: 200 });
|
|
134
|
+
}, options);
|
|
135
|
+
};
|
|
136
|
+
const getGetApiFilesDirectoryMockHandler = (overrideResponse, options) => {
|
|
137
|
+
return http.get("*/api/files/directory", async (info) => {
|
|
138
|
+
await delay(0);
|
|
139
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getGetApiFilesDirectoryResponseMock(), { status: 200 });
|
|
140
|
+
}, options);
|
|
141
|
+
};
|
|
142
|
+
const getFilesMock = () => [
|
|
143
|
+
getGetApiFilesMockHandler(),
|
|
144
|
+
getGetApiFilesBreadcrumbsMockHandler(),
|
|
145
|
+
getGetApiFilesDirectoryMockHandler()
|
|
146
|
+
];
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
export { getFilesMock };
|
|
150
|
+
//# sourceMappingURL=files.msw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.msw.js","names":[],"sources":["../../../../../src/api/generated/files/files.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 FileManagerItemResponse\n} from '../schemas';\n\n\nexport const getGetApiFilesResponseMock = (overrideResponse: Partial<Extract<FileManagerItemResponse, object>> = {}): FileManagerItemResponse => ({data: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({cid: faker.string.alpha({length: {min: 10, max: 20}}), created: faker.date.past().toISOString().slice(0, 19) + 'Z', depth: faker.number.int(), is_directory: faker.datatype.boolean(), name: faker.string.alpha({length: {min: 10, max: 20}}), path: faker.string.alpha({length: {min: 10, max: 20}}), size: faker.number.int(), type: faker.number.int(), unpinnable: faker.datatype.boolean(), updated: faker.date.past().toISOString().slice(0, 19) + 'Z'})), total: faker.number.int(), ...overrideResponse})\n\nexport const getGetApiFilesBreadcrumbsResponseMock = (overrideResponse: Partial<Extract<FileManagerItemResponse, object>> = {}): FileManagerItemResponse => ({data: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({cid: faker.string.alpha({length: {min: 10, max: 20}}), created: faker.date.past().toISOString().slice(0, 19) + 'Z', depth: faker.number.int(), is_directory: faker.datatype.boolean(), name: faker.string.alpha({length: {min: 10, max: 20}}), path: faker.string.alpha({length: {min: 10, max: 20}}), size: faker.number.int(), type: faker.number.int(), unpinnable: faker.datatype.boolean(), updated: faker.date.past().toISOString().slice(0, 19) + 'Z'})), total: faker.number.int(), ...overrideResponse})\n\nexport const getGetApiFilesDirectoryResponseMock = (overrideResponse: Partial<Extract<FileManagerItemResponse, object>> = {}): FileManagerItemResponse => ({data: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({cid: faker.string.alpha({length: {min: 10, max: 20}}), created: faker.date.past().toISOString().slice(0, 19) + 'Z', depth: faker.number.int(), is_directory: faker.datatype.boolean(), name: faker.string.alpha({length: {min: 10, max: 20}}), path: faker.string.alpha({length: {min: 10, max: 20}}), size: faker.number.int(), type: faker.number.int(), unpinnable: faker.datatype.boolean(), updated: faker.date.past().toISOString().slice(0, 19) + 'Z'})), total: faker.number.int(), ...overrideResponse})\n\n\nexport const getGetApiFilesMockHandler = (overrideResponse?: FileManagerItemResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<FileManagerItemResponse> | FileManagerItemResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/files', 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 : getGetApiFilesResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiFilesBreadcrumbsMockHandler = (overrideResponse?: FileManagerItemResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<FileManagerItemResponse> | FileManagerItemResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/files/breadcrumbs', 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 : getGetApiFilesBreadcrumbsResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetApiFilesDirectoryMockHandler = (overrideResponse?: FileManagerItemResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<FileManagerItemResponse> | FileManagerItemResponse), options?: RequestHandlerOptions) => {\n return http.get('*/api/files/directory', 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 : getGetApiFilesDirectoryResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getFilesMock = () => [\n getGetApiFilesMockHandler(),\n getGetApiFilesBreadcrumbsMockHandler(),\n getGetApiFilesDirectoryMockHandler()\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAa,8BAA8B,mBAAsE,EAAE,MAA+B;CAAC,MAAM,MAAM,KAAK,EAAE,QAAQ,MAAM,OAAO,IAAI;EAAC,KAAK;EAAG,KAAK;EAAG,CAAC,EAAE,GAAG,GAAG,MAAM,IAAI,EAAE,CAAC,WAAW;EAAC,KAAK,MAAM,OAAO,MAAM,EAAC,QAAQ;GAAC,KAAK;GAAI,KAAK;GAAG,EAAC,CAAC;EAAE,SAAS,MAAM,KAAK,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG;EAAK,OAAO,MAAM,OAAO,KAAK;EAAE,cAAc,MAAM,SAAS,SAAS;EAAE,MAAM,MAAM,OAAO,MAAM,EAAC,QAAQ;GAAC,KAAK;GAAI,KAAK;GAAG,EAAC,CAAC;EAAE,MAAM,MAAM,OAAO,MAAM,EAAC,QAAQ;GAAC,KAAK;GAAI,KAAK;GAAG,EAAC,CAAC;EAAE,MAAM,MAAM,OAAO,KAAK;EAAE,MAAM,MAAM,OAAO,KAAK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,qCAAqC,EACrC,EAAE,QAAQ,KACT,CAAC;IACH,QAAQ;;AAEb,MAAa,qBAAqB;CAChC,2BAA2B;CAC3B,sCAAsC;CACtC,oCAAoC;CACrC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { faker } from "@faker-js/faker";
|
|
2
|
+
import { HttpResponse, delay, http } from "msw";
|
|
3
|
+
|
|
4
|
+
//#region src/api/generated/gateway/gateway.msw.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generated by orval v8.10.0 🍺
|
|
7
|
+
* Do not edit manually.
|
|
8
|
+
* Portal IPFS Plugin API
|
|
9
|
+
*
|
|
10
|
+
## Portal IPFS Plugin API
|
|
11
|
+
|
|
12
|
+
A comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.
|
|
13
|
+
|
|
14
|
+
### IPFS Pinning Service API Compatibility
|
|
15
|
+
|
|
16
|
+
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.
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **Pinning**: Add, list, update, and remove pinned content
|
|
21
|
+
- **Content**: Upload files, retrieve IPFS content, and manage metadata
|
|
22
|
+
- **IPNS**: Manage IPNS keys and publish content
|
|
23
|
+
- **Files**: Browse and manage pinned files with directory navigation
|
|
24
|
+
- **Websites**: Create and manage website hosting with DNS and SSL automation
|
|
25
|
+
|
|
26
|
+
### Authentication
|
|
27
|
+
|
|
28
|
+
All API endpoints require authentication using JWT tokens obtained from the Portal authentication service.
|
|
29
|
+
|
|
30
|
+
### Rate Limiting
|
|
31
|
+
|
|
32
|
+
API requests are rate-limited based on user account tier. See Portal documentation for current limits.
|
|
33
|
+
|
|
34
|
+
### Documentation
|
|
35
|
+
|
|
36
|
+
For detailed API usage examples and integration guides, visit the Portal documentation website.
|
|
37
|
+
|
|
38
|
+
* OpenAPI spec version: 1.0.0
|
|
39
|
+
*/
|
|
40
|
+
const getGetInternalWebsitesDomainResponseMock = (overrideResponse = {}) => ({
|
|
41
|
+
domain: faker.string.alpha({ length: {
|
|
42
|
+
min: 10,
|
|
43
|
+
max: 20
|
|
44
|
+
} }),
|
|
45
|
+
status: faker.string.alpha({ length: {
|
|
46
|
+
min: 10,
|
|
47
|
+
max: 20
|
|
48
|
+
} }),
|
|
49
|
+
target_hash: faker.string.alpha({ length: {
|
|
50
|
+
min: 10,
|
|
51
|
+
max: 20
|
|
52
|
+
} }),
|
|
53
|
+
target_type: faker.string.alpha({ length: {
|
|
54
|
+
min: 10,
|
|
55
|
+
max: 20
|
|
56
|
+
} }),
|
|
57
|
+
...overrideResponse
|
|
58
|
+
});
|
|
59
|
+
const getGetInternalWebsitesDomainStatusResponseMock = (overrideResponse = {}) => ({
|
|
60
|
+
domain: faker.string.alpha({ length: {
|
|
61
|
+
min: 10,
|
|
62
|
+
max: 20
|
|
63
|
+
} }),
|
|
64
|
+
is_broken: faker.datatype.boolean(),
|
|
65
|
+
last_checked: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
66
|
+
min: 10,
|
|
67
|
+
max: 20
|
|
68
|
+
} }), void 0]),
|
|
69
|
+
status: faker.string.alpha({ length: {
|
|
70
|
+
min: 10,
|
|
71
|
+
max: 20
|
|
72
|
+
} }),
|
|
73
|
+
...overrideResponse
|
|
74
|
+
});
|
|
75
|
+
const getGetInternalWebsitesDomainMockHandler = (overrideResponse, options) => {
|
|
76
|
+
return http.get("*/internal/websites/:domain", async (info) => {
|
|
77
|
+
await delay(0);
|
|
78
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getGetInternalWebsitesDomainResponseMock(), { status: 200 });
|
|
79
|
+
}, options);
|
|
80
|
+
};
|
|
81
|
+
const getGetInternalWebsitesDomainStatusMockHandler = (overrideResponse, options) => {
|
|
82
|
+
return http.get("*/internal/websites/:domain/status", async (info) => {
|
|
83
|
+
await delay(0);
|
|
84
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getGetInternalWebsitesDomainStatusResponseMock(), { status: 200 });
|
|
85
|
+
}, options);
|
|
86
|
+
};
|
|
87
|
+
const getGatewayMock = () => [getGetInternalWebsitesDomainMockHandler(), getGetInternalWebsitesDomainStatusMockHandler()];
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { getGatewayMock };
|
|
91
|
+
//# sourceMappingURL=gateway.msw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.msw.js","names":[],"sources":["../../../../../src/api/generated/gateway/gateway.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 GatewayWebsiteResponse,\n GatewayWebsiteStatusResponse\n} from '../schemas';\n\n\nexport const getGetInternalWebsitesDomainResponseMock = (overrideResponse: Partial<Extract<GatewayWebsiteResponse, object>> = {}): GatewayWebsiteResponse => ({domain: faker.string.alpha({length: {min: 10, max: 20}}), 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}}), ...overrideResponse})\n\nexport const getGetInternalWebsitesDomainStatusResponseMock = (overrideResponse: Partial<Extract<GatewayWebsiteStatusResponse, object>> = {}): GatewayWebsiteStatusResponse => ({domain: faker.string.alpha({length: {min: 10, max: 20}}), is_broken: faker.datatype.boolean(), last_checked: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), status: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\n\nexport const getGetInternalWebsitesDomainMockHandler = (overrideResponse?: GatewayWebsiteResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<GatewayWebsiteResponse> | GatewayWebsiteResponse), options?: RequestHandlerOptions) => {\n return http.get('*/internal/websites/:domain', 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 : getGetInternalWebsitesDomainResponseMock(),\n { status: 200\n })\n }, options)\n}\n\nexport const getGetInternalWebsitesDomainStatusMockHandler = (overrideResponse?: GatewayWebsiteStatusResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<GatewayWebsiteStatusResponse> | GatewayWebsiteStatusResponse), options?: RequestHandlerOptions) => {\n return http.get('*/internal/websites/:domain/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 : getGetInternalWebsitesDomainStatusResponseMock(),\n { status: 200\n })\n }, options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oC;AACnR,QAAO,KAAK,IAAI,sCAAsC,OAAO,SAAwD;AAAC,QAAM,MAAM,EAAE;AAGlI,SAAO,aAAa,KAAK,qBAAqB,SAC3C,OAAO,qBAAqB,aAAa,MAAM,iBAAiB,KAAK,GAAG,mBACzE,gDAAgD,EAChD,EAAE,QAAQ,KACT,CAAC;IACH,QAAQ;;AAEb,MAAa,uBAAuB,CAClC,yCAAyC,EACzC,+CAA+C,CAChD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getContentMock } from "./content/content.msw.js";
|
|
2
|
+
import { getDnsMock } from "./dns/dns.msw.js";
|
|
3
|
+
import { getFilesMock } from "./files/files.msw.js";
|
|
4
|
+
import { getIpnsMock } from "./ipns/ipns.msw.js";
|
|
5
|
+
import { getTusMock } from "./tus/tus.msw.js";
|
|
6
|
+
import { getWebsitesMock } from "./websites/websites.msw.js";
|
|
7
|
+
import { getGatewayMock } from "./gateway/gateway.msw.js";
|
|
8
|
+
import { getInternalMock } from "./internal/internal.msw.js";
|
|
9
|
+
import { getPinningMock } from "./pinning/pinning.msw.js";
|
|
10
|
+
export { getContentMock, getDnsMock, getFilesMock, getGatewayMock, getInternalMock, getIpnsMock, getPinningMock, getTusMock, getWebsitesMock };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getContentMock } from "./content/content.msw.js";
|
|
2
|
+
import { getDnsMock } from "./dns/dns.msw.js";
|
|
3
|
+
import { getFilesMock } from "./files/files.msw.js";
|
|
4
|
+
import { getIpnsMock } from "./ipns/ipns.msw.js";
|
|
5
|
+
import { getTusMock } from "./tus/tus.msw.js";
|
|
6
|
+
import { getWebsitesMock } from "./websites/websites.msw.js";
|
|
7
|
+
import { getGatewayMock } from "./gateway/gateway.msw.js";
|
|
8
|
+
import { getInternalMock } from "./internal/internal.msw.js";
|
|
9
|
+
import { getPinningMock } from "./pinning/pinning.msw.js";
|
|
10
|
+
|
|
11
|
+
export { getContentMock, getDnsMock, getFilesMock, getGatewayMock, getInternalMock, getIpnsMock, getPinningMock, getTusMock, getWebsitesMock };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _$msw from "msw";
|
|
2
|
+
import { http } from "msw";
|
|
3
|
+
|
|
4
|
+
//#region src/api/generated/internal/internal.msw.d.ts
|
|
5
|
+
declare const getInternalMock: () => _$msw.HttpHandler[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { getInternalMock };
|
|
8
|
+
//# sourceMappingURL=internal.msw.d.ts.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { faker } from "@faker-js/faker";
|
|
2
|
+
import { HttpResponse, delay, http } from "msw";
|
|
3
|
+
|
|
4
|
+
//#region src/api/generated/internal/internal.msw.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generated by orval v8.10.0 🍺
|
|
7
|
+
* Do not edit manually.
|
|
8
|
+
* Portal IPFS Plugin API
|
|
9
|
+
*
|
|
10
|
+
## Portal IPFS Plugin API
|
|
11
|
+
|
|
12
|
+
A comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.
|
|
13
|
+
|
|
14
|
+
### IPFS Pinning Service API Compatibility
|
|
15
|
+
|
|
16
|
+
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.
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **Pinning**: Add, list, update, and remove pinned content
|
|
21
|
+
- **Content**: Upload files, retrieve IPFS content, and manage metadata
|
|
22
|
+
- **IPNS**: Manage IPNS keys and publish content
|
|
23
|
+
- **Files**: Browse and manage pinned files with directory navigation
|
|
24
|
+
- **Websites**: Create and manage website hosting with DNS and SSL automation
|
|
25
|
+
|
|
26
|
+
### Authentication
|
|
27
|
+
|
|
28
|
+
All API endpoints require authentication using JWT tokens obtained from the Portal authentication service.
|
|
29
|
+
|
|
30
|
+
### Rate Limiting
|
|
31
|
+
|
|
32
|
+
API requests are rate-limited based on user account tier. See Portal documentation for current limits.
|
|
33
|
+
|
|
34
|
+
### Documentation
|
|
35
|
+
|
|
36
|
+
For detailed API usage examples and integration guides, visit the Portal documentation website.
|
|
37
|
+
|
|
38
|
+
* OpenAPI spec version: 1.0.0
|
|
39
|
+
*/
|
|
40
|
+
const getPostInternalWebsitesDomainSslStatusResponseMock = (overrideResponse = {}) => ({
|
|
41
|
+
active_cid: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
42
|
+
min: 10,
|
|
43
|
+
max: 20
|
|
44
|
+
} }), void 0]),
|
|
45
|
+
created: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
46
|
+
dns_hosting_enabled: faker.datatype.boolean(),
|
|
47
|
+
dns_zone_id: faker.helpers.arrayElement([faker.number.int(), void 0]),
|
|
48
|
+
domain: faker.string.alpha({ length: {
|
|
49
|
+
min: 10,
|
|
50
|
+
max: 20
|
|
51
|
+
} }),
|
|
52
|
+
expired: faker.datatype.boolean(),
|
|
53
|
+
gateway_domain: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
54
|
+
min: 10,
|
|
55
|
+
max: 20
|
|
56
|
+
} }), void 0]),
|
|
57
|
+
id: faker.number.int(),
|
|
58
|
+
ipns_key_id: faker.helpers.arrayElement([faker.number.int(), void 0]),
|
|
59
|
+
is_subdomain: faker.datatype.boolean(),
|
|
60
|
+
last_checked_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
61
|
+
ssl: faker.helpers.arrayElement([{
|
|
62
|
+
error: faker.helpers.arrayElement([faker.string.alpha({ length: {
|
|
63
|
+
min: 10,
|
|
64
|
+
max: 20
|
|
65
|
+
} }), void 0]),
|
|
66
|
+
issued_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
67
|
+
last_updated_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
68
|
+
status: faker.string.alpha({ length: {
|
|
69
|
+
min: 10,
|
|
70
|
+
max: 20
|
|
71
|
+
} })
|
|
72
|
+
}, void 0]),
|
|
73
|
+
status: faker.string.alpha({ length: {
|
|
74
|
+
min: 10,
|
|
75
|
+
max: 20
|
|
76
|
+
} }),
|
|
77
|
+
target_hash: faker.string.alpha({ length: {
|
|
78
|
+
min: 10,
|
|
79
|
+
max: 20
|
|
80
|
+
} }),
|
|
81
|
+
target_type: faker.string.alpha({ length: {
|
|
82
|
+
min: 10,
|
|
83
|
+
max: 20
|
|
84
|
+
} }),
|
|
85
|
+
updated: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
86
|
+
validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + "Z", void 0]),
|
|
87
|
+
validation_token: faker.string.alpha({ length: {
|
|
88
|
+
min: 10,
|
|
89
|
+
max: 20
|
|
90
|
+
} }),
|
|
91
|
+
...overrideResponse
|
|
92
|
+
});
|
|
93
|
+
const getPostInternalWebsitesDomainSslStatusMockHandler = (overrideResponse, options) => {
|
|
94
|
+
return http.post("*/internal/websites/:domain/ssl-status", async (info) => {
|
|
95
|
+
await delay(0);
|
|
96
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getPostInternalWebsitesDomainSslStatusResponseMock(), { status: 200 });
|
|
97
|
+
}, options);
|
|
98
|
+
};
|
|
99
|
+
const getInternalMock = () => [getPostInternalWebsitesDomainSslStatusMockHandler()];
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
export { getInternalMock };
|
|
103
|
+
//# sourceMappingURL=internal.msw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.msw.js","names":[],"sources":["../../../../../src/api/generated/internal/internal.msw.ts"],"sourcesContent":["/**\n * Generated by orval v8.10.0 🍺\n * Do not edit manually.\n * Portal IPFS Plugin API\n *\n## Portal IPFS Plugin API\n\nA comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.\n\n### IPFS Pinning Service API Compatibility\n\nThis API is fully compatible with the [IPFS Pinning Service API specification](https://github.com/ipfs/pinning-services-api-spec), an implementation-agnostic API standard for pinning service providers. This ensures interoperability with existing IPFS pinning clients and tools.\n\n### Features\n\n- **Pinning**: Add, list, update, and remove pinned content\n- **Content**: Upload files, retrieve IPFS content, and manage metadata\n- **IPNS**: Manage IPNS keys and publish content\n- **Files**: Browse and manage pinned files with directory navigation\n- **Websites**: Create and manage website hosting with DNS and SSL automation\n\n### Authentication\n\nAll API endpoints require authentication using JWT tokens obtained from the Portal authentication service.\n\n### Rate Limiting\n\nAPI requests are rate-limited based on user account tier. See Portal documentation for current limits.\n\n### Documentation\n\nFor detailed API usage examples and integration guides, visit the Portal documentation website.\n\n * OpenAPI spec version: 1.0.0\n */\nimport {\n faker\n} from '@faker-js/faker';\n\nimport {\n HttpResponse,\n delay,\n http\n} from 'msw';\nimport type {\n RequestHandlerOptions\n} from 'msw';\n\nimport type {\n WebsiteResponse\n} from '../schemas';\n\n\nexport const getPostInternalWebsitesDomainSslStatusResponseMock = (overrideResponse: Partial<Extract<WebsiteResponse, object>> = {}): WebsiteResponse => ({active_cid: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), created: faker.date.past().toISOString().slice(0, 19) + 'Z', dns_hosting_enabled: faker.datatype.boolean(), dns_zone_id: faker.helpers.arrayElement([faker.number.int(), undefined]), domain: faker.string.alpha({length: {min: 10, max: 20}}), expired: faker.datatype.boolean(), gateway_domain: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), id: faker.number.int(), ipns_key_id: faker.helpers.arrayElement([faker.number.int(), undefined]), is_subdomain: faker.datatype.boolean(), last_checked_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), ssl: faker.helpers.arrayElement([{error: faker.helpers.arrayElement([faker.string.alpha({length: {min: 10, max: 20}}), undefined]), issued_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), last_updated_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), status: faker.string.alpha({length: {min: 10, max: 20}})}, undefined]), status: faker.string.alpha({length: {min: 10, max: 20}}), target_hash: faker.string.alpha({length: {min: 10, max: 20}}), target_type: faker.string.alpha({length: {min: 10, max: 20}}), updated: faker.date.past().toISOString().slice(0, 19) + 'Z', validation_expires_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z', undefined]), validation_token: faker.string.alpha({length: {min: 10, max: 20}}), ...overrideResponse})\n\n\nexport const getPostInternalWebsitesDomainSslStatusMockHandler = (overrideResponse?: WebsiteResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<WebsiteResponse> | WebsiteResponse), options?: RequestHandlerOptions) => {\n return http.post('*/internal/websites/:domain/ssl-status', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {await delay(0);\n\n\n return HttpResponse.json(overrideResponse !== undefined\n ? (typeof overrideResponse === \"function\" ? await overrideResponse(info) : overrideResponse)\n : getPostInternalWebsitesDomainSslStatusResponseMock(),\n { status: 200\n })\n }, options)\n}\nexport const getInternalMock = () => [\n getPostInternalWebsitesDomainSslStatusMockHandler()\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAa,sDAAsD,mBAA8D,EAAE,MAAuB;CAAC,YAAY,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC,EAAE,OAAU,CAAC;CAAE,SAAS,MAAM,KAAK,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG;CAAK,qBAAqB,MAAM,SAAS,SAAS;CAAE,aAAa,MAAM,QAAQ,aAAa,CAAC,MAAM,OAAO,KAAK,EAAE,OAAU,CAAC;CAAE,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AAI,KAAK;EAAG,EAAC,CAAC;CAAE,SAAS,MAAM,KAAK,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG;CAAK,uBAAuB,MAAM,QAAQ,aAAa,CAAC,MAAM,KAAK,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG,KAAK,OAAU,CAAC;CAAE,kBAAkB,MAAM,OAAO,MAAM,EAAC,QAAQ;EAAC,KAAK;EAAI,KAAK;EAAG,EAAC,CAAC;CAAE,GAAG;CAAiB;AAG3tD,MAAa,qDAAqD,kBAA6I,YAAoC;AACjP,QAAO,KAAK,KAAK,0CAA0C,OAAO,SAAyD;AAAC,QAAM,MAAM,EAAE;AAGxI,SAAO,aAAa,KAAK,qBAAqB,SAC3C,OAAO,qBAAqB,aAAa,MAAM,iBAAiB,KAAK,GAAG,mBACzE,oDAAoD,EACpD,EAAE,QAAQ,KACT,CAAC;IACH,QAAQ;;AAEb,MAAa,wBAAwB,CACnC,mDAAmD,CACpD"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { faker } from "@faker-js/faker";
|
|
2
|
+
import { HttpResponse, delay, http } from "msw";
|
|
3
|
+
|
|
4
|
+
//#region src/api/generated/ipns/ipns.msw.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generated by orval v8.10.0 🍺
|
|
7
|
+
* Do not edit manually.
|
|
8
|
+
* Portal IPFS Plugin API
|
|
9
|
+
*
|
|
10
|
+
## Portal IPFS Plugin API
|
|
11
|
+
|
|
12
|
+
A comprehensive API for IPFS content management, including pinning services, file operations, IPNS key management, and website hosting.
|
|
13
|
+
|
|
14
|
+
### IPFS Pinning Service API Compatibility
|
|
15
|
+
|
|
16
|
+
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.
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **Pinning**: Add, list, update, and remove pinned content
|
|
21
|
+
- **Content**: Upload files, retrieve IPFS content, and manage metadata
|
|
22
|
+
- **IPNS**: Manage IPNS keys and publish content
|
|
23
|
+
- **Files**: Browse and manage pinned files with directory navigation
|
|
24
|
+
- **Websites**: Create and manage website hosting with DNS and SSL automation
|
|
25
|
+
|
|
26
|
+
### Authentication
|
|
27
|
+
|
|
28
|
+
All API endpoints require authentication using JWT tokens obtained from the Portal authentication service.
|
|
29
|
+
|
|
30
|
+
### Rate Limiting
|
|
31
|
+
|
|
32
|
+
API requests are rate-limited based on user account tier. See Portal documentation for current limits.
|
|
33
|
+
|
|
34
|
+
### Documentation
|
|
35
|
+
|
|
36
|
+
For detailed API usage examples and integration guides, visit the Portal documentation website.
|
|
37
|
+
|
|
38
|
+
* OpenAPI spec version: 1.0.0
|
|
39
|
+
*/
|
|
40
|
+
const getGetApiIpnsKeysResponseMock = (overrideResponse = {}) => ({
|
|
41
|
+
data: Array.from({ length: faker.number.int({
|
|
42
|
+
min: 1,
|
|
43
|
+
max: 10
|
|
44
|
+
}) }, (_, i) => i + 1).map(() => ({
|
|
45
|
+
created: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
46
|
+
id: faker.number.int(),
|
|
47
|
+
ipns_name: faker.string.alpha({ length: {
|
|
48
|
+
min: 10,
|
|
49
|
+
max: 20
|
|
50
|
+
} }),
|
|
51
|
+
name: faker.string.alpha({ length: {
|
|
52
|
+
min: 10,
|
|
53
|
+
max: 20
|
|
54
|
+
} }),
|
|
55
|
+
peer_id: faker.string.alpha({ length: {
|
|
56
|
+
min: 10,
|
|
57
|
+
max: 20
|
|
58
|
+
} })
|
|
59
|
+
})),
|
|
60
|
+
total: faker.number.int(),
|
|
61
|
+
...overrideResponse
|
|
62
|
+
});
|
|
63
|
+
const getPostApiIpnsKeysResponseMock = (overrideResponse = {}) => faker.helpers.arrayElement([{
|
|
64
|
+
error: faker.string.alpha({ length: {
|
|
65
|
+
min: 10,
|
|
66
|
+
max: 20
|
|
67
|
+
} }),
|
|
68
|
+
...overrideResponse
|
|
69
|
+
}, {
|
|
70
|
+
created: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
71
|
+
id: faker.number.int(),
|
|
72
|
+
ipns_name: faker.string.alpha({ length: {
|
|
73
|
+
min: 10,
|
|
74
|
+
max: 20
|
|
75
|
+
} }),
|
|
76
|
+
name: faker.string.alpha({ length: {
|
|
77
|
+
min: 10,
|
|
78
|
+
max: 20
|
|
79
|
+
} }),
|
|
80
|
+
peer_id: faker.string.alpha({ length: {
|
|
81
|
+
min: 10,
|
|
82
|
+
max: 20
|
|
83
|
+
} }),
|
|
84
|
+
...overrideResponse
|
|
85
|
+
}]);
|
|
86
|
+
const getDeleteApiIpnsKeysIdResponseMock = (overrideResponse = {}) => ({
|
|
87
|
+
error: faker.string.alpha({ length: {
|
|
88
|
+
min: 10,
|
|
89
|
+
max: 20
|
|
90
|
+
} }),
|
|
91
|
+
...overrideResponse
|
|
92
|
+
});
|
|
93
|
+
const getGetApiIpnsKeysIdResponseMock = (overrideResponse = {}) => ({
|
|
94
|
+
created: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
95
|
+
id: faker.number.int(),
|
|
96
|
+
ipns_name: faker.string.alpha({ length: {
|
|
97
|
+
min: 10,
|
|
98
|
+
max: 20
|
|
99
|
+
} }),
|
|
100
|
+
name: faker.string.alpha({ length: {
|
|
101
|
+
min: 10,
|
|
102
|
+
max: 20
|
|
103
|
+
} }),
|
|
104
|
+
peer_id: faker.string.alpha({ length: {
|
|
105
|
+
min: 10,
|
|
106
|
+
max: 20
|
|
107
|
+
} }),
|
|
108
|
+
...overrideResponse
|
|
109
|
+
});
|
|
110
|
+
const getPostApiIpnsKeysIdRepublishResponseMock = (overrideResponse = {}) => ({
|
|
111
|
+
count: faker.number.int(),
|
|
112
|
+
message: faker.string.alpha({ length: {
|
|
113
|
+
min: 10,
|
|
114
|
+
max: 20
|
|
115
|
+
} }),
|
|
116
|
+
...overrideResponse
|
|
117
|
+
});
|
|
118
|
+
const getPostApiIpnsPublishResponseMock = (overrideResponse = {}) => ({
|
|
119
|
+
name: faker.string.alpha({ length: {
|
|
120
|
+
min: 10,
|
|
121
|
+
max: 20
|
|
122
|
+
} }),
|
|
123
|
+
published: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
124
|
+
sequence: faker.number.int(),
|
|
125
|
+
validity: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
126
|
+
value: faker.string.alpha({ length: {
|
|
127
|
+
min: 10,
|
|
128
|
+
max: 20
|
|
129
|
+
} }),
|
|
130
|
+
...overrideResponse
|
|
131
|
+
});
|
|
132
|
+
const getGetApiIpnsResolveNameResponseMock = (overrideResponse = {}) => ({
|
|
133
|
+
expired: faker.datatype.boolean(),
|
|
134
|
+
expires: faker.date.past().toISOString().slice(0, 19) + "Z",
|
|
135
|
+
name: faker.string.alpha({ length: {
|
|
136
|
+
min: 10,
|
|
137
|
+
max: 20
|
|
138
|
+
} }),
|
|
139
|
+
path: faker.string.alpha({ length: {
|
|
140
|
+
min: 10,
|
|
141
|
+
max: 20
|
|
142
|
+
} }),
|
|
143
|
+
sequence: faker.number.int(),
|
|
144
|
+
value: faker.string.alpha({ length: {
|
|
145
|
+
min: 10,
|
|
146
|
+
max: 20
|
|
147
|
+
} }),
|
|
148
|
+
...overrideResponse
|
|
149
|
+
});
|
|
150
|
+
const getGetApiIpnsKeysMockHandler = (overrideResponse, options) => {
|
|
151
|
+
return http.get("*/api/ipns/keys", async (info) => {
|
|
152
|
+
await delay(0);
|
|
153
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getGetApiIpnsKeysResponseMock(), { status: 200 });
|
|
154
|
+
}, options);
|
|
155
|
+
};
|
|
156
|
+
const getPostApiIpnsKeysMockHandler = (overrideResponse, options) => {
|
|
157
|
+
return http.post("*/api/ipns/keys", async (info) => {
|
|
158
|
+
await delay(0);
|
|
159
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getPostApiIpnsKeysResponseMock(), { status: 200 });
|
|
160
|
+
}, options);
|
|
161
|
+
};
|
|
162
|
+
const getDeleteApiIpnsKeysIdMockHandler = (overrideResponse, options) => {
|
|
163
|
+
return http.delete("*/api/ipns/keys/:id", async (info) => {
|
|
164
|
+
await delay(0);
|
|
165
|
+
const resolvedBody = overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getDeleteApiIpnsKeysIdResponseMock();
|
|
166
|
+
return resolvedBody === void 0 ? new HttpResponse(null, { status: 204 }) : HttpResponse.json(resolvedBody, { status: 200 });
|
|
167
|
+
}, options);
|
|
168
|
+
};
|
|
169
|
+
const getGetApiIpnsKeysIdMockHandler = (overrideResponse, options) => {
|
|
170
|
+
return http.get("*/api/ipns/keys/:id", async (info) => {
|
|
171
|
+
await delay(0);
|
|
172
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getGetApiIpnsKeysIdResponseMock(), { status: 200 });
|
|
173
|
+
}, options);
|
|
174
|
+
};
|
|
175
|
+
const getPostApiIpnsKeysIdRepublishMockHandler = (overrideResponse, options) => {
|
|
176
|
+
return http.post("*/api/ipns/keys/:id/republish", async (info) => {
|
|
177
|
+
await delay(0);
|
|
178
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getPostApiIpnsKeysIdRepublishResponseMock(), { status: 200 });
|
|
179
|
+
}, options);
|
|
180
|
+
};
|
|
181
|
+
const getPostApiIpnsPublishMockHandler = (overrideResponse, options) => {
|
|
182
|
+
return http.post("*/api/ipns/publish", async (info) => {
|
|
183
|
+
await delay(0);
|
|
184
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getPostApiIpnsPublishResponseMock(), { status: 200 });
|
|
185
|
+
}, options);
|
|
186
|
+
};
|
|
187
|
+
const getGetApiIpnsResolveNameMockHandler = (overrideResponse, options) => {
|
|
188
|
+
return http.get("*/api/ipns/resolve/:name", async (info) => {
|
|
189
|
+
await delay(0);
|
|
190
|
+
return HttpResponse.json(overrideResponse !== void 0 ? typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse : getGetApiIpnsResolveNameResponseMock(), { status: 200 });
|
|
191
|
+
}, options);
|
|
192
|
+
};
|
|
193
|
+
const getIpnsMock = () => [
|
|
194
|
+
getGetApiIpnsKeysMockHandler(),
|
|
195
|
+
getPostApiIpnsKeysMockHandler(),
|
|
196
|
+
getDeleteApiIpnsKeysIdMockHandler(),
|
|
197
|
+
getGetApiIpnsKeysIdMockHandler(),
|
|
198
|
+
getPostApiIpnsKeysIdRepublishMockHandler(),
|
|
199
|
+
getPostApiIpnsPublishMockHandler(),
|
|
200
|
+
getGetApiIpnsResolveNameMockHandler()
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
//#endregion
|
|
204
|
+
export { getIpnsMock };
|
|
205
|
+
//# sourceMappingURL=ipns.msw.js.map
|