diskio-api 1.6.0 → 1.7.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 +1 -0
- package/cjs/index.js +3 -2
- package/mjs/index.d.ts +1 -0
- package/mjs/index.js +3 -2
- package/package.json +1 -1
package/cjs/index.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ export declare class DiskioAPIClient {
|
|
|
102
102
|
}): Promise<{
|
|
103
103
|
size: string | null;
|
|
104
104
|
stream: ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined;
|
|
105
|
+
name: string | undefined;
|
|
105
106
|
}>;
|
|
106
107
|
delete(uuid: string): Promise<import("openapi-fetch").FetchResponse<{
|
|
107
108
|
parameters: {
|
package/cjs/index.js
CHANGED
|
@@ -39,11 +39,12 @@ class DiskioAPIClient {
|
|
|
39
39
|
return response.data;
|
|
40
40
|
}
|
|
41
41
|
async download(uuid, type = 'arrayBuffer', range) {
|
|
42
|
-
var _a;
|
|
42
|
+
var _a, _b;
|
|
43
43
|
const Range = range ? `bytes=${range.from}-${(_a = range.to) !== null && _a !== void 0 ? _a : ''}` : '';
|
|
44
44
|
const response = this.client.GET('/diskio/{uuid}', { params: { path: { uuid }, header: { Range } }, parseAs: type });
|
|
45
45
|
const size = response.response.headers.get('Content-Length');
|
|
46
|
-
|
|
46
|
+
const name = (_b = response.response.headers.get('Content-Disposition')) === null || _b === void 0 ? void 0 : _b.split('filename=')[1];
|
|
47
|
+
return { size, stream: response.data, name };
|
|
47
48
|
}
|
|
48
49
|
delete(uuid) {
|
|
49
50
|
return this.client.DELETE('/diskio/{uuid}', { params: { path: { uuid } } });
|
package/mjs/index.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ export declare class DiskioAPIClient {
|
|
|
102
102
|
}): Promise<{
|
|
103
103
|
size: string | null;
|
|
104
104
|
stream: ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined;
|
|
105
|
+
name: string | undefined;
|
|
105
106
|
}>;
|
|
106
107
|
delete(uuid: string): Promise<import("openapi-fetch").FetchResponse<{
|
|
107
108
|
parameters: {
|
package/mjs/index.js
CHANGED
|
@@ -33,11 +33,12 @@ export class DiskioAPIClient {
|
|
|
33
33
|
return response.data;
|
|
34
34
|
}
|
|
35
35
|
async download(uuid, type = 'arrayBuffer', range) {
|
|
36
|
-
var _a;
|
|
36
|
+
var _a, _b;
|
|
37
37
|
const Range = range ? `bytes=${range.from}-${(_a = range.to) !== null && _a !== void 0 ? _a : ''}` : '';
|
|
38
38
|
const response = await this.client.GET('/diskio/{uuid}', { params: { path: { uuid }, header: { Range } }, parseAs: type });
|
|
39
39
|
const size = response.response.headers.get('Content-Length');
|
|
40
|
-
|
|
40
|
+
const name = (_b = response.response.headers.get('Content-Disposition')) === null || _b === void 0 ? void 0 : _b.split('filename=')[1];
|
|
41
|
+
return { size, stream: response.data, name };
|
|
41
42
|
}
|
|
42
43
|
delete(uuid) {
|
|
43
44
|
return this.client.DELETE('/diskio/{uuid}', { params: { path: { uuid } } });
|