diskio-api 1.2.2 → 1.4.0
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/README.md +2 -2
- package/cjs/index.d.ts +45 -4
- package/cjs/index.js +7 -4
- package/mjs/index.d.ts +45 -4
- package/mjs/index.js +7 -4
- package/openapi/specification.d.ts +49 -4
- package/openapi/specification.json +83 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,8 +58,8 @@ console.log(response.data.response.diskio.size); // 10737418240
|
|
|
58
58
|
## Upload
|
|
59
59
|
```ts
|
|
60
60
|
const file: File = new File(['Hello world!'], 'hello.txt');
|
|
61
|
-
const response = await client.upload([ file ]);
|
|
62
|
-
const path = response
|
|
61
|
+
const { response } = await client.upload([ file ]);
|
|
62
|
+
const path = response[0];
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
## Download
|
package/cjs/index.d.ts
CHANGED
|
@@ -49,19 +49,60 @@ export declare class DiskioAPIClient {
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
}> | undefined, `${string}/${string}`>>;
|
|
52
|
+
files(): Promise<import("openapi-fetch").FetchResponse<{
|
|
53
|
+
parameters: {
|
|
54
|
+
query?: never;
|
|
55
|
+
header?: never;
|
|
56
|
+
path?: never;
|
|
57
|
+
cookie?: never;
|
|
58
|
+
};
|
|
59
|
+
requestBody?: never;
|
|
60
|
+
responses: {
|
|
61
|
+
200: {
|
|
62
|
+
headers: {
|
|
63
|
+
[name: string]: unknown;
|
|
64
|
+
};
|
|
65
|
+
content: {
|
|
66
|
+
"application/json": components["schemas"]["response.model"] & {
|
|
67
|
+
response: components["schemas"]["diskio-file.model"][];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}, import("openapi-fetch").FetchOptions<{
|
|
73
|
+
parameters: {
|
|
74
|
+
query?: never;
|
|
75
|
+
header?: never;
|
|
76
|
+
path?: never;
|
|
77
|
+
cookie?: never;
|
|
78
|
+
};
|
|
79
|
+
requestBody?: never;
|
|
80
|
+
responses: {
|
|
81
|
+
200: {
|
|
82
|
+
headers: {
|
|
83
|
+
[name: string]: unknown;
|
|
84
|
+
};
|
|
85
|
+
content: {
|
|
86
|
+
"application/json": components["schemas"]["response.model"] & {
|
|
87
|
+
response: components["schemas"]["diskio-file.model"][];
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}> | undefined, `${string}/${string}`>>;
|
|
52
93
|
upload(files: (File | Blob)[]): Promise<({
|
|
53
94
|
code: number;
|
|
54
95
|
timestamp: number;
|
|
55
96
|
} & {
|
|
56
97
|
response: string[];
|
|
57
98
|
}) | undefined>;
|
|
58
|
-
download(
|
|
59
|
-
delete(
|
|
99
|
+
download(uuid: string, type?: 'arrayBuffer' | 'stream'): Promise<ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined>;
|
|
100
|
+
delete(uuid: string): Promise<import("openapi-fetch").FetchResponse<{
|
|
60
101
|
parameters: {
|
|
61
102
|
query?: never;
|
|
62
103
|
header?: never;
|
|
63
104
|
path: {
|
|
64
|
-
|
|
105
|
+
uuid: string;
|
|
65
106
|
};
|
|
66
107
|
cookie?: never;
|
|
67
108
|
};
|
|
@@ -97,7 +138,7 @@ export declare class DiskioAPIClient {
|
|
|
97
138
|
}, {
|
|
98
139
|
params: {
|
|
99
140
|
path: {
|
|
100
|
-
|
|
141
|
+
uuid: string;
|
|
101
142
|
};
|
|
102
143
|
};
|
|
103
144
|
}, `${string}/${string}`>>;
|
package/cjs/index.js
CHANGED
|
@@ -29,18 +29,21 @@ class DiskioAPIClient {
|
|
|
29
29
|
healthCheck() {
|
|
30
30
|
return this.client.GET('/health-check');
|
|
31
31
|
}
|
|
32
|
+
async files() {
|
|
33
|
+
return this.client.GET('/diskio');
|
|
34
|
+
}
|
|
32
35
|
async upload(files) {
|
|
33
36
|
const formData = new FormData();
|
|
34
37
|
files.forEach((file) => formData.append('files', file));
|
|
35
38
|
const response = this.client.POST('/diskio', { body: formData });
|
|
36
39
|
return response.data;
|
|
37
40
|
}
|
|
38
|
-
async download(
|
|
39
|
-
const response = this.client.GET('/diskio/{
|
|
41
|
+
async download(uuid, type = 'arrayBuffer') {
|
|
42
|
+
const response = this.client.GET('/diskio/{uuid}', { params: { path: { uuid } }, parseAs: type });
|
|
40
43
|
return response.data;
|
|
41
44
|
}
|
|
42
|
-
delete(
|
|
43
|
-
return this.client.DELETE('/diskio/{
|
|
45
|
+
delete(uuid) {
|
|
46
|
+
return this.client.DELETE('/diskio/{uuid}', { params: { path: { uuid } } });
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
exports.DiskioAPIClient = DiskioAPIClient;
|
package/mjs/index.d.ts
CHANGED
|
@@ -49,19 +49,60 @@ export declare class DiskioAPIClient {
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
}> | undefined, `${string}/${string}`>>;
|
|
52
|
+
files(): Promise<import("openapi-fetch").FetchResponse<{
|
|
53
|
+
parameters: {
|
|
54
|
+
query?: never;
|
|
55
|
+
header?: never;
|
|
56
|
+
path?: never;
|
|
57
|
+
cookie?: never;
|
|
58
|
+
};
|
|
59
|
+
requestBody?: never;
|
|
60
|
+
responses: {
|
|
61
|
+
200: {
|
|
62
|
+
headers: {
|
|
63
|
+
[name: string]: unknown;
|
|
64
|
+
};
|
|
65
|
+
content: {
|
|
66
|
+
"application/json": components["schemas"]["response.model"] & {
|
|
67
|
+
response: components["schemas"]["diskio-file.model"][];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}, import("openapi-fetch").FetchOptions<{
|
|
73
|
+
parameters: {
|
|
74
|
+
query?: never;
|
|
75
|
+
header?: never;
|
|
76
|
+
path?: never;
|
|
77
|
+
cookie?: never;
|
|
78
|
+
};
|
|
79
|
+
requestBody?: never;
|
|
80
|
+
responses: {
|
|
81
|
+
200: {
|
|
82
|
+
headers: {
|
|
83
|
+
[name: string]: unknown;
|
|
84
|
+
};
|
|
85
|
+
content: {
|
|
86
|
+
"application/json": components["schemas"]["response.model"] & {
|
|
87
|
+
response: components["schemas"]["diskio-file.model"][];
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}> | undefined, `${string}/${string}`>>;
|
|
52
93
|
upload(files: (File | Blob)[]): Promise<({
|
|
53
94
|
code: number;
|
|
54
95
|
timestamp: number;
|
|
55
96
|
} & {
|
|
56
97
|
response: string[];
|
|
57
98
|
}) | undefined>;
|
|
58
|
-
download(
|
|
59
|
-
delete(
|
|
99
|
+
download(uuid: string, type?: 'arrayBuffer' | 'stream'): Promise<ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined>;
|
|
100
|
+
delete(uuid: string): Promise<import("openapi-fetch").FetchResponse<{
|
|
60
101
|
parameters: {
|
|
61
102
|
query?: never;
|
|
62
103
|
header?: never;
|
|
63
104
|
path: {
|
|
64
|
-
|
|
105
|
+
uuid: string;
|
|
65
106
|
};
|
|
66
107
|
cookie?: never;
|
|
67
108
|
};
|
|
@@ -97,7 +138,7 @@ export declare class DiskioAPIClient {
|
|
|
97
138
|
}, {
|
|
98
139
|
params: {
|
|
99
140
|
path: {
|
|
100
|
-
|
|
141
|
+
uuid: string;
|
|
101
142
|
};
|
|
102
143
|
};
|
|
103
144
|
}, `${string}/${string}`>>;
|
package/mjs/index.js
CHANGED
|
@@ -23,17 +23,20 @@ export class DiskioAPIClient {
|
|
|
23
23
|
healthCheck() {
|
|
24
24
|
return this.client.GET('/health-check');
|
|
25
25
|
}
|
|
26
|
+
async files() {
|
|
27
|
+
return this.client.GET('/diskio');
|
|
28
|
+
}
|
|
26
29
|
async upload(files) {
|
|
27
30
|
const formData = new FormData();
|
|
28
31
|
files.forEach((file) => formData.append('files', file));
|
|
29
32
|
const response = await this.client.POST('/diskio', { body: formData });
|
|
30
33
|
return response.data;
|
|
31
34
|
}
|
|
32
|
-
async download(
|
|
33
|
-
const response = await this.client.GET('/diskio/{
|
|
35
|
+
async download(uuid, type = 'arrayBuffer') {
|
|
36
|
+
const response = await this.client.GET('/diskio/{uuid}', { params: { path: { uuid } }, parseAs: type });
|
|
34
37
|
return response.data;
|
|
35
38
|
}
|
|
36
|
-
delete(
|
|
37
|
-
return this.client.DELETE('/diskio/{
|
|
39
|
+
delete(uuid) {
|
|
40
|
+
return this.client.DELETE('/diskio/{uuid}', { params: { path: { uuid } } });
|
|
38
41
|
}
|
|
39
42
|
}
|
|
@@ -49,7 +49,29 @@ export interface paths {
|
|
|
49
49
|
path?: never;
|
|
50
50
|
cookie?: never;
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
/** List files */
|
|
53
|
+
get: {
|
|
54
|
+
parameters: {
|
|
55
|
+
query?: never;
|
|
56
|
+
header?: never;
|
|
57
|
+
path?: never;
|
|
58
|
+
cookie?: never;
|
|
59
|
+
};
|
|
60
|
+
requestBody?: never;
|
|
61
|
+
responses: {
|
|
62
|
+
/** @description File names */
|
|
63
|
+
200: {
|
|
64
|
+
headers: {
|
|
65
|
+
[name: string]: unknown;
|
|
66
|
+
};
|
|
67
|
+
content: {
|
|
68
|
+
"application/json": components["schemas"]["response.model"] & {
|
|
69
|
+
response: components["schemas"]["diskio-file.model"][];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
53
75
|
put?: never;
|
|
54
76
|
/** Upload a file */
|
|
55
77
|
post: {
|
|
@@ -86,7 +108,7 @@ export interface paths {
|
|
|
86
108
|
patch?: never;
|
|
87
109
|
trace?: never;
|
|
88
110
|
};
|
|
89
|
-
"/diskio/{
|
|
111
|
+
"/diskio/{uuid}": {
|
|
90
112
|
parameters: {
|
|
91
113
|
query?: never;
|
|
92
114
|
header?: never;
|
|
@@ -99,7 +121,7 @@ export interface paths {
|
|
|
99
121
|
query?: never;
|
|
100
122
|
header?: never;
|
|
101
123
|
path: {
|
|
102
|
-
|
|
124
|
+
uuid: string;
|
|
103
125
|
};
|
|
104
126
|
cookie?: never;
|
|
105
127
|
};
|
|
@@ -148,7 +170,7 @@ export interface paths {
|
|
|
148
170
|
query?: never;
|
|
149
171
|
header?: never;
|
|
150
172
|
path: {
|
|
151
|
-
|
|
173
|
+
uuid: string;
|
|
152
174
|
};
|
|
153
175
|
cookie?: never;
|
|
154
176
|
};
|
|
@@ -206,6 +228,29 @@ export interface components {
|
|
|
206
228
|
/** @example 1707947871721 */
|
|
207
229
|
timestamp: number;
|
|
208
230
|
};
|
|
231
|
+
"diskio-file.model": {
|
|
232
|
+
/** Format: uuid */
|
|
233
|
+
uuid?: string;
|
|
234
|
+
/** Format: int64 */
|
|
235
|
+
createdAt?: number;
|
|
236
|
+
/** Format: int64 */
|
|
237
|
+
updatedAt?: number;
|
|
238
|
+
/**
|
|
239
|
+
* @description File name
|
|
240
|
+
* @example meme.mp4
|
|
241
|
+
*/
|
|
242
|
+
readonly name?: string;
|
|
243
|
+
/**
|
|
244
|
+
* @description File size on disk
|
|
245
|
+
* @example 123456
|
|
246
|
+
*/
|
|
247
|
+
readonly size?: number;
|
|
248
|
+
/**
|
|
249
|
+
* @description File size uploaded
|
|
250
|
+
* @example 123456
|
|
251
|
+
*/
|
|
252
|
+
readonly original?: number;
|
|
253
|
+
};
|
|
209
254
|
"not-found-response.model": components["schemas"]["response.model"] & {
|
|
210
255
|
/** @example Not found: Authorization header not found */
|
|
211
256
|
response: string;
|
|
@@ -63,6 +63,51 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"/diskio": {
|
|
66
|
+
"get": {
|
|
67
|
+
"tags": [
|
|
68
|
+
"DiskIO"
|
|
69
|
+
],
|
|
70
|
+
"summary": "List files",
|
|
71
|
+
"responses": {
|
|
72
|
+
"200": {
|
|
73
|
+
"description": "File names",
|
|
74
|
+
"content": {
|
|
75
|
+
"application/json": {
|
|
76
|
+
"schema": {
|
|
77
|
+
"example": {
|
|
78
|
+
"uuid": "08061086-9df6-40e9-8140-9301a0825c43",
|
|
79
|
+
"createdAt": 1766229486047,
|
|
80
|
+
"updatedAt": 1766229486047,
|
|
81
|
+
"name": "stardew-valley.apk",
|
|
82
|
+
"size": 288735310,
|
|
83
|
+
"original": 370984817
|
|
84
|
+
},
|
|
85
|
+
"allOf": [
|
|
86
|
+
{
|
|
87
|
+
"$ref": "#/components/schemas/response.model"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "object",
|
|
91
|
+
"required": [
|
|
92
|
+
"response"
|
|
93
|
+
],
|
|
94
|
+
"properties": {
|
|
95
|
+
"response": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"minItems": 0,
|
|
98
|
+
"items": {
|
|
99
|
+
"$ref": "#/components/schemas/diskio-file.model"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
66
111
|
"post": {
|
|
67
112
|
"tags": [
|
|
68
113
|
"DiskIO"
|
|
@@ -122,7 +167,7 @@
|
|
|
122
167
|
}
|
|
123
168
|
}
|
|
124
169
|
},
|
|
125
|
-
"/diskio/{
|
|
170
|
+
"/diskio/{uuid}": {
|
|
126
171
|
"get": {
|
|
127
172
|
"tags": [
|
|
128
173
|
"DiskIO"
|
|
@@ -130,7 +175,7 @@
|
|
|
130
175
|
"summary": "Download a file",
|
|
131
176
|
"parameters": [
|
|
132
177
|
{
|
|
133
|
-
"name": "
|
|
178
|
+
"name": "uuid",
|
|
134
179
|
"in": "path",
|
|
135
180
|
"required": true,
|
|
136
181
|
"schema": {
|
|
@@ -212,7 +257,7 @@
|
|
|
212
257
|
"summary": "Delete a file",
|
|
213
258
|
"parameters": [
|
|
214
259
|
{
|
|
215
|
-
"name": "
|
|
260
|
+
"name": "uuid",
|
|
216
261
|
"in": "path",
|
|
217
262
|
"required": true,
|
|
218
263
|
"schema": {
|
|
@@ -312,6 +357,41 @@
|
|
|
312
357
|
}
|
|
313
358
|
}
|
|
314
359
|
},
|
|
360
|
+
"diskio-file.model": {
|
|
361
|
+
"type": "object",
|
|
362
|
+
"properties": {
|
|
363
|
+
"uuid": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"format": "uuid"
|
|
366
|
+
},
|
|
367
|
+
"createdAt": {
|
|
368
|
+
"type": "integer",
|
|
369
|
+
"format": "int64"
|
|
370
|
+
},
|
|
371
|
+
"updatedAt": {
|
|
372
|
+
"type": "integer",
|
|
373
|
+
"format": "int64"
|
|
374
|
+
},
|
|
375
|
+
"name": {
|
|
376
|
+
"description": "File name",
|
|
377
|
+
"example": "meme.mp4",
|
|
378
|
+
"readOnly": true,
|
|
379
|
+
"type": "string"
|
|
380
|
+
},
|
|
381
|
+
"size": {
|
|
382
|
+
"description": "File size on disk",
|
|
383
|
+
"example": 123456,
|
|
384
|
+
"readOnly": true,
|
|
385
|
+
"type": "integer"
|
|
386
|
+
},
|
|
387
|
+
"original": {
|
|
388
|
+
"description": "File size uploaded",
|
|
389
|
+
"example": 123456,
|
|
390
|
+
"readOnly": true,
|
|
391
|
+
"type": "integer"
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
315
395
|
"not-found-response.model": {
|
|
316
396
|
"allOf": [
|
|
317
397
|
{
|