diskio-api 1.2.0 → 1.2.2

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
@@ -49,37 +49,12 @@ export declare class DiskioAPIClient {
49
49
  };
50
50
  };
51
51
  }> | undefined, `${string}/${string}`>>;
52
- upload(files: File[]): Promise<import("openapi-fetch").FetchResponse<{
53
- parameters: {
54
- query?: never;
55
- header?: never;
56
- path?: never;
57
- cookie?: never;
58
- };
59
- requestBody: {
60
- content: {
61
- "multipart/form-data": {
62
- files: string[];
63
- };
64
- };
65
- };
66
- responses: {
67
- 200: {
68
- headers: {
69
- [name: string]: unknown;
70
- };
71
- content: {
72
- "application/json": components["schemas"]["response.model"] & {
73
- response: string[];
74
- };
75
- };
76
- };
77
- };
78
- }, {
79
- body: {
80
- files: any;
81
- };
82
- }, `${string}/${string}`>>;
52
+ upload(files: (File | Blob)[]): Promise<({
53
+ code: number;
54
+ timestamp: number;
55
+ } & {
56
+ response: string[];
57
+ }) | undefined>;
83
58
  download(name: string, type?: 'arrayBuffer' | 'stream'): Promise<ArrayBuffer | ReadableStream<Uint8Array> | null | undefined>;
84
59
  delete(name: string): Promise<import("openapi-fetch").FetchResponse<{
85
60
  parameters: {
package/cjs/index.js CHANGED
@@ -29,8 +29,11 @@ class DiskioAPIClient {
29
29
  healthCheck() {
30
30
  return this.client.GET('/health-check');
31
31
  }
32
- upload(files) {
33
- return this.client.POST('/diskio', { body: { files: files } });
32
+ async upload(files) {
33
+ const formData = new FormData();
34
+ files.forEach((file) => formData.append('files', file));
35
+ const response = this.client.POST('/diskio', { body: formData });
36
+ return response.data;
34
37
  }
35
38
  async download(name, type = 'arrayBuffer') {
36
39
  const response = this.client.GET('/diskio/{name}', { params: { path: { name } }, parseAs: type });
package/mjs/index.d.ts CHANGED
@@ -49,37 +49,12 @@ export declare class DiskioAPIClient {
49
49
  };
50
50
  };
51
51
  }> | undefined, `${string}/${string}`>>;
52
- upload(files: File[]): Promise<import("openapi-fetch").FetchResponse<{
53
- parameters: {
54
- query?: never;
55
- header?: never;
56
- path?: never;
57
- cookie?: never;
58
- };
59
- requestBody: {
60
- content: {
61
- "multipart/form-data": {
62
- files: string[];
63
- };
64
- };
65
- };
66
- responses: {
67
- 200: {
68
- headers: {
69
- [name: string]: unknown;
70
- };
71
- content: {
72
- "application/json": components["schemas"]["response.model"] & {
73
- response: string[];
74
- };
75
- };
76
- };
77
- };
78
- }, {
79
- body: {
80
- files: any;
81
- };
82
- }, `${string}/${string}`>>;
52
+ upload(files: (File | Blob)[]): Promise<({
53
+ code: number;
54
+ timestamp: number;
55
+ } & {
56
+ response: string[];
57
+ }) | undefined>;
83
58
  download(name: string, type?: 'arrayBuffer' | 'stream'): Promise<ArrayBuffer | ReadableStream<Uint8Array> | null | undefined>;
84
59
  delete(name: string): Promise<import("openapi-fetch").FetchResponse<{
85
60
  parameters: {
package/mjs/index.js CHANGED
@@ -23,8 +23,11 @@ export class DiskioAPIClient {
23
23
  healthCheck() {
24
24
  return this.client.GET('/health-check');
25
25
  }
26
- upload(files) {
27
- return this.client.POST('/diskio', { body: { files: files } });
26
+ async upload(files) {
27
+ const formData = new FormData();
28
+ files.forEach((file) => formData.append('files', file));
29
+ const response = await this.client.POST('/diskio', { body: formData });
30
+ return response.data;
28
31
  }
29
32
  async download(name, type = 'arrayBuffer') {
30
33
  const response = await this.client.GET('/diskio/{name}', { params: { path: { name } }, parseAs: type });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diskio-api",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "An API Client for diskio-server",
5
5
  "type": "module",
6
6
  "main": "cjs/index.js",
@@ -37,6 +37,6 @@
37
37
  "api"
38
38
  ],
39
39
  "dependencies": {
40
- "openapi-fetch": "^0.12.0"
40
+ "openapi-fetch": "^0.13.0"
41
41
  }
42
42
  }