diskio-api 1.4.0 → 1.5.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 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'): Promise<ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined>;
99
+ download(uuid: string, type?: 'arrayBuffer' | 'stream'): Promise<{
100
+ size: string | null;
101
+ stream: ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined;
102
+ }>;
100
103
  delete(uuid: string): Promise<import("openapi-fetch").FetchResponse<{
101
104
  parameters: {
102
105
  query?: never;
package/cjs/index.js CHANGED
@@ -40,7 +40,8 @@ class DiskioAPIClient {
40
40
  }
41
41
  async download(uuid, type = 'arrayBuffer') {
42
42
  const response = this.client.GET('/diskio/{uuid}', { params: { path: { uuid } }, parseAs: type });
43
- return response.data;
43
+ const size = response.response.headers.get('Content-Length');
44
+ return { size, stream: response.data };
44
45
  }
45
46
  delete(uuid) {
46
47
  return this.client.DELETE('/diskio/{uuid}', { params: { path: { uuid } } });
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'): Promise<ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined>;
99
+ download(uuid: string, type?: 'arrayBuffer' | 'stream'): Promise<{
100
+ size: string | null;
101
+ stream: ArrayBuffer | ReadableStream<Uint8Array<ArrayBuffer>> | null | undefined;
102
+ }>;
100
103
  delete(uuid: string): Promise<import("openapi-fetch").FetchResponse<{
101
104
  parameters: {
102
105
  query?: never;
package/mjs/index.js CHANGED
@@ -34,7 +34,8 @@ export class DiskioAPIClient {
34
34
  }
35
35
  async download(uuid, type = 'arrayBuffer') {
36
36
  const response = await this.client.GET('/diskio/{uuid}', { params: { path: { uuid } }, parseAs: type });
37
- return response.data;
37
+ const size = response.response.headers.get('Content-Length');
38
+ return { size, stream: response.data };
38
39
  }
39
40
  delete(uuid) {
40
41
  return this.client.DELETE('/diskio/{uuid}', { params: { path: { uuid } } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diskio-api",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "An API Client for diskio-server",
5
5
  "type": "module",
6
6
  "main": "cjs/index.js",