diskio-api 1.5.0 → 1.6.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/cjs/index.d.ts +4 -1
- package/cjs/index.js +4 -2
- package/mjs/index.d.ts +4 -1
- package/mjs/index.js +4 -2
- package/openapi/specification.d.ts +4 -1
- package/openapi/specification.json +10 -0
- package/package.json +1 -1
package/cjs/index.d.ts
CHANGED
|
@@ -96,7 +96,10 @@ export declare class DiskioAPIClient {
|
|
|
96
96
|
} & {
|
|
97
97
|
response: string[];
|
|
98
98
|
}) | undefined>;
|
|
99
|
-
download(uuid: string, type?: 'arrayBuffer' | 'stream'
|
|
99
|
+
download(uuid: string, type?: 'arrayBuffer' | 'stream', range?: {
|
|
100
|
+
from: number;
|
|
101
|
+
to?: number;
|
|
102
|
+
}): Promise<{
|
|
100
103
|
size: string | null;
|
|
101
104
|
stream: ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined;
|
|
102
105
|
}>;
|
package/cjs/index.js
CHANGED
|
@@ -38,8 +38,10 @@ class DiskioAPIClient {
|
|
|
38
38
|
const response = this.client.POST('/diskio', { body: formData });
|
|
39
39
|
return response.data;
|
|
40
40
|
}
|
|
41
|
-
async download(uuid, type = 'arrayBuffer') {
|
|
42
|
-
|
|
41
|
+
async download(uuid, type = 'arrayBuffer', range) {
|
|
42
|
+
var _a;
|
|
43
|
+
const Range = range ? `bytes=${range.from}-${(_a = range.to) !== null && _a !== void 0 ? _a : ''}` : '';
|
|
44
|
+
const response = this.client.GET('/diskio/{uuid}', { params: { path: { uuid }, header: { Range } }, parseAs: type });
|
|
43
45
|
const size = response.response.headers.get('Content-Length');
|
|
44
46
|
return { size, stream: response.data };
|
|
45
47
|
}
|
package/mjs/index.d.ts
CHANGED
|
@@ -96,7 +96,10 @@ export declare class DiskioAPIClient {
|
|
|
96
96
|
} & {
|
|
97
97
|
response: string[];
|
|
98
98
|
}) | undefined>;
|
|
99
|
-
download(uuid: string, type?: 'arrayBuffer' | 'stream'
|
|
99
|
+
download(uuid: string, type?: 'arrayBuffer' | 'stream', range?: {
|
|
100
|
+
from: number;
|
|
101
|
+
to?: number;
|
|
102
|
+
}): Promise<{
|
|
100
103
|
size: string | null;
|
|
101
104
|
stream: ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined;
|
|
102
105
|
}>;
|
package/mjs/index.js
CHANGED
|
@@ -32,8 +32,10 @@ export class DiskioAPIClient {
|
|
|
32
32
|
const response = await this.client.POST('/diskio', { body: formData });
|
|
33
33
|
return response.data;
|
|
34
34
|
}
|
|
35
|
-
async download(uuid, type = 'arrayBuffer') {
|
|
36
|
-
|
|
35
|
+
async download(uuid, type = 'arrayBuffer', range) {
|
|
36
|
+
var _a;
|
|
37
|
+
const Range = range ? `bytes=${range.from}-${(_a = range.to) !== null && _a !== void 0 ? _a : ''}` : '';
|
|
38
|
+
const response = await this.client.GET('/diskio/{uuid}', { params: { path: { uuid }, header: { Range } }, parseAs: type });
|
|
37
39
|
const size = response.response.headers.get('Content-Length');
|
|
38
40
|
return { size, stream: response.data };
|
|
39
41
|
}
|
|
@@ -182,6 +182,16 @@
|
|
|
182
182
|
"type": "string",
|
|
183
183
|
"example": "7b1d2a45/1211/4517/b968/dbb6799aef6b/meme.mp4"
|
|
184
184
|
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "Range",
|
|
188
|
+
"in": "header",
|
|
189
|
+
"description": "Standard RFC 7233 range header",
|
|
190
|
+
"required": false,
|
|
191
|
+
"schema": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"example": "bytes=0-1024"
|
|
194
|
+
}
|
|
185
195
|
}
|
|
186
196
|
],
|
|
187
197
|
"responses": {
|