@bytescale/sdk 1.0.0-alpha.2 → 1.0.0-alpha.3
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/dist/browser/cjs/{_96d8.main.js → _70b2.main.js} +2 -2
- package/dist/browser/cjs/{_9d47.main.js → _7392.main.js} +2 -2
- package/dist/browser/cjs/main.js +499 -1863
- package/dist/node/cjs/main.js +497 -1861
- package/dist/node/esm/main.mjs +499 -1910
- package/dist/types/generated/apis/FileApi.d.ts +98 -0
- package/dist/types/{gen → generated}/apis/FolderApi.d.ts +8 -36
- package/dist/types/{gen → generated}/apis/JobApi.d.ts +4 -16
- package/dist/types/{gen → generated}/apis/UploadApi.d.ts +6 -26
- package/dist/types/{gen → generated}/models/index.d.ts +41 -201
- package/dist/types/{gen → generated}/runtime.d.ts +8 -78
- package/dist/types/index.d.ts +2 -2
- package/dist/types/{utils → uploads}/NodeUtils.d.ts +1 -1
- package/dist/types/{utils → uploads}/UploadManager.d.ts +4 -4
- package/dist/types/{utils/Model.d.ts → uploads/UploadModel.d.ts} +1 -1
- package/dist/types/{utils → uploads}/index.d.ts +1 -1
- package/package.json +1 -1
- package/tests/ChunkedStream.test.ts +1 -1
- package/tests/UploadManager.test.ts +3 -3
- package/dist/types/gen/apis/FileApi.d.ts +0 -135
- /package/dist/types/{gen → generated}/apis/index.d.ts +0 -0
- /package/dist/types/{gen → generated}/index.d.ts +0 -0
- /package/dist/types/{utils → uploads}/ChunkedStream.d.ts +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - Browser 'Blob', e.g. 'new Blob([JSON.stringify({someValue: 42})], {type: "application/json"})'
|
|
6
6
|
* - Browser 'File', e.g. from a <input type="file" onchange="...">
|
|
7
7
|
*/
|
|
8
|
-
import { BeginMultipartUploadRequest } from "../
|
|
8
|
+
import { BeginMultipartUploadRequest } from "../generated";
|
|
9
9
|
import { ChunkedStream } from "./ChunkedStream";
|
|
10
10
|
export interface BlobLike {
|
|
11
11
|
readonly name?: string;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BytescaleApiClientConfig, FileApi, UploadManager } from "../src";
|
|
2
2
|
import fetch from "node-fetch";
|
|
3
3
|
import * as buffer from "buffer";
|
|
4
4
|
import { createRandomStreamFactory } from "./utils/RandomStream";
|
|
@@ -15,10 +15,10 @@ if (process.env.BYTESCALE_ACCOUNT_ID === undefined) {
|
|
|
15
15
|
}
|
|
16
16
|
const accountId = process.env.BYTESCALE_ACCOUNT_ID;
|
|
17
17
|
|
|
18
|
-
const configuration =
|
|
18
|
+
const configuration: BytescaleApiClientConfig = {
|
|
19
19
|
fetchApi: fetch as any,
|
|
20
20
|
apiKey: process.env.BYTESCALE_SECRET_API_KEY // e.g. "secret_xxxxx"
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
|
|
23
23
|
const uploadManager = new UploadManager(configuration);
|
|
24
24
|
const fileApi = new FileApi(configuration);
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @bytescale/bytescale-api
|
|
3
|
-
* Bytescale API
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 2.0.0
|
|
6
|
-
* Contact: hello@bytescale.com
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
|
-
import * as runtime from "../runtime";
|
|
13
|
-
import type { AsyncResponse, CopyFileBatchRequest, CopyFileRequest, CopyFileResponse, DeleteFileBatchRequest, FileDetails, ProcessFileAndSaveRequest, ProcessFileAndSaveResponse } from "../models";
|
|
14
|
-
export interface CopyFileOperationParams {
|
|
15
|
-
accountId: string;
|
|
16
|
-
copyFileRequest: CopyFileRequest;
|
|
17
|
-
}
|
|
18
|
-
export interface CopyFileBatchOperationParams {
|
|
19
|
-
accountId: string;
|
|
20
|
-
copyFileBatchRequest: CopyFileBatchRequest;
|
|
21
|
-
}
|
|
22
|
-
export interface DeleteFileParams {
|
|
23
|
-
accountId: string;
|
|
24
|
-
filePath: string;
|
|
25
|
-
}
|
|
26
|
-
export interface DeleteFileBatchOperationParams {
|
|
27
|
-
accountId: string;
|
|
28
|
-
deleteFileBatchRequest: DeleteFileBatchRequest;
|
|
29
|
-
}
|
|
30
|
-
export interface DownloadFileParams {
|
|
31
|
-
accountId: string;
|
|
32
|
-
filePath: string;
|
|
33
|
-
cache?: boolean;
|
|
34
|
-
cacheTtl?: number;
|
|
35
|
-
version?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface GetFileDetailsParams {
|
|
38
|
-
accountId: string;
|
|
39
|
-
filePath: string;
|
|
40
|
-
}
|
|
41
|
-
export interface ProcessFileParams {
|
|
42
|
-
accountId: string;
|
|
43
|
-
filePath: string;
|
|
44
|
-
transformation: string;
|
|
45
|
-
artifact?: string;
|
|
46
|
-
cache?: boolean;
|
|
47
|
-
cachePerm?: ProcessFileCachePermEnum;
|
|
48
|
-
cacheTtl?: number;
|
|
49
|
-
large?: boolean;
|
|
50
|
-
version?: string;
|
|
51
|
-
}
|
|
52
|
-
export interface ProcessFileAndSaveOperationParams {
|
|
53
|
-
accountId: string;
|
|
54
|
-
filePath: string;
|
|
55
|
-
transformation: string;
|
|
56
|
-
processFileAndSaveRequest: ProcessFileAndSaveRequest;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
export declare class FileApi extends runtime.BaseAPI {
|
|
62
|
-
/**
|
|
63
|
-
* Copies a file synchronously.
|
|
64
|
-
*/
|
|
65
|
-
private copyFileWithHttpInfo;
|
|
66
|
-
/**
|
|
67
|
-
* Copies a file synchronously.
|
|
68
|
-
*/
|
|
69
|
-
copyFile(requestParameters: CopyFileOperationParams, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CopyFileResponse>;
|
|
70
|
-
/**
|
|
71
|
-
* Copies multiple files asynchronously.
|
|
72
|
-
*/
|
|
73
|
-
private copyFileBatchWithHttpInfo;
|
|
74
|
-
/**
|
|
75
|
-
* Copies multiple files asynchronously.
|
|
76
|
-
*/
|
|
77
|
-
copyFileBatch(requestParameters: CopyFileBatchOperationParams, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AsyncResponse>;
|
|
78
|
-
/**
|
|
79
|
-
* Deletes a file synchronously.
|
|
80
|
-
*/
|
|
81
|
-
private deleteFileWithHttpInfo;
|
|
82
|
-
/**
|
|
83
|
-
* Deletes a file synchronously.
|
|
84
|
-
*/
|
|
85
|
-
deleteFile(requestParameters: DeleteFileParams, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
86
|
-
/**
|
|
87
|
-
* Deletes multiple files asynchronously.
|
|
88
|
-
*/
|
|
89
|
-
private deleteFileBatchWithHttpInfo;
|
|
90
|
-
/**
|
|
91
|
-
* Deletes multiple files asynchronously.
|
|
92
|
-
*/
|
|
93
|
-
deleteFileBatch(requestParameters: DeleteFileBatchOperationParams, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AsyncResponse>;
|
|
94
|
-
/**
|
|
95
|
-
* Downloads a file in its original/unprocessed state.
|
|
96
|
-
*/
|
|
97
|
-
private downloadFileWithHttpInfo;
|
|
98
|
-
/**
|
|
99
|
-
* Downloads a file in its original/unprocessed state.
|
|
100
|
-
*/
|
|
101
|
-
downloadFile(requestParameters: DownloadFileParams, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.BinaryResult>;
|
|
102
|
-
/**
|
|
103
|
-
* Gets the full details (e.g. metadata, tags, etc.) for a file.
|
|
104
|
-
*/
|
|
105
|
-
private getFileDetailsWithHttpInfo;
|
|
106
|
-
/**
|
|
107
|
-
* Gets the full details (e.g. metadata, tags, etc.) for a file.
|
|
108
|
-
*/
|
|
109
|
-
getFileDetails(requestParameters: GetFileDetailsParams, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileDetails>;
|
|
110
|
-
/**
|
|
111
|
-
* Processes a file and returns the result.
|
|
112
|
-
*/
|
|
113
|
-
private processFileWithHttpInfo;
|
|
114
|
-
/**
|
|
115
|
-
* Processes a file and returns the result.
|
|
116
|
-
*/
|
|
117
|
-
processFile(requestParameters: ProcessFileParams, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.BinaryResult>;
|
|
118
|
-
/**
|
|
119
|
-
* Processes a file and saves the result.
|
|
120
|
-
*/
|
|
121
|
-
private processFileAndSaveWithHttpInfo;
|
|
122
|
-
/**
|
|
123
|
-
* Processes a file and saves the result.
|
|
124
|
-
*/
|
|
125
|
-
processFileAndSave(requestParameters: ProcessFileAndSaveOperationParams, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProcessFileAndSaveResponse>;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* @export
|
|
129
|
-
*/
|
|
130
|
-
export declare const ProcessFileCachePermEnum: {
|
|
131
|
-
readonly Auto: "auto";
|
|
132
|
-
readonly False: "false";
|
|
133
|
-
readonly True: "true";
|
|
134
|
-
};
|
|
135
|
-
export declare type ProcessFileCachePermEnum = typeof ProcessFileCachePermEnum[keyof typeof ProcessFileCachePermEnum];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|