@data-loom/storage-js 0.2.1-alpha.2 → 0.2.1-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/main/lib/errors.d.ts +3 -1
- package/dist/main/lib/errors.d.ts.map +1 -1
- package/dist/main/lib/errors.js +11 -3
- package/dist/main/lib/errors.js.map +1 -1
- package/dist/main/lib/fetch.d.ts.map +1 -1
- package/dist/main/lib/fetch.js +11 -0
- package/dist/main/lib/fetch.js.map +1 -1
- package/dist/main/lib/helpers.d.ts +1 -0
- package/dist/main/lib/helpers.d.ts.map +1 -1
- package/dist/main/lib/helpers.js +12 -1
- package/dist/main/lib/helpers.js.map +1 -1
- package/dist/main/lib/types.d.ts +2 -2
- package/dist/main/lib/types.d.ts.map +1 -1
- package/dist/main/packages/StorageFileApi.d.ts +1 -128
- package/dist/main/packages/StorageFileApi.d.ts.map +1 -1
- package/dist/main/packages/StorageFileApi.js +18 -257
- package/dist/main/packages/StorageFileApi.js.map +1 -1
- package/dist/module/lib/errors.d.ts +3 -1
- package/dist/module/lib/errors.d.ts.map +1 -1
- package/dist/module/lib/errors.js +7 -1
- package/dist/module/lib/errors.js.map +1 -1
- package/dist/module/lib/fetch.d.ts.map +1 -1
- package/dist/module/lib/fetch.js +12 -1
- package/dist/module/lib/fetch.js.map +1 -1
- package/dist/module/lib/helpers.d.ts +1 -0
- package/dist/module/lib/helpers.d.ts.map +1 -1
- package/dist/module/lib/helpers.js +10 -0
- package/dist/module/lib/helpers.js.map +1 -1
- package/dist/module/lib/types.d.ts +2 -2
- package/dist/module/lib/types.d.ts.map +1 -1
- package/dist/module/packages/StorageFileApi.d.ts +1 -128
- package/dist/module/packages/StorageFileApi.d.ts.map +1 -1
- package/dist/module/packages/StorageFileApi.js +21 -260
- package/dist/module/packages/StorageFileApi.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
1
|
import { StorageError } from '../lib/errors';
|
|
5
2
|
import { Fetch } from '../lib/fetch';
|
|
6
|
-
import { FileObject, FileOptions, SearchOptions,
|
|
3
|
+
import { FileObject, FileOptions, SearchOptions, FileBody } from '../lib/types';
|
|
7
4
|
export default class StorageFileApi {
|
|
8
5
|
protected url: string;
|
|
9
6
|
protected headers: {
|
|
@@ -39,91 +36,6 @@ export default class StorageFileApi {
|
|
|
39
36
|
data: null;
|
|
40
37
|
error: StorageError;
|
|
41
38
|
}>;
|
|
42
|
-
/**
|
|
43
|
-
* Upload a file with a token generated from `createSignedUploadUrl`.
|
|
44
|
-
* @param path The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
|
|
45
|
-
* @param token The token generated from `createSignedUploadUrl`
|
|
46
|
-
* @param fileBody The body of the file to be stored in the bucket.
|
|
47
|
-
*/
|
|
48
|
-
uploadToSignedUrl(path: string, token: string, fileBody: FileBody, fileOptions?: FileOptions): Promise<{
|
|
49
|
-
data: {
|
|
50
|
-
path: string;
|
|
51
|
-
fullPath: any;
|
|
52
|
-
};
|
|
53
|
-
error: null;
|
|
54
|
-
} | {
|
|
55
|
-
data: null;
|
|
56
|
-
error: StorageError;
|
|
57
|
-
}>;
|
|
58
|
-
/**
|
|
59
|
-
* Creates a signed upload URL.
|
|
60
|
-
* Signed upload URLs can be used to upload files to the bucket without further authentication.
|
|
61
|
-
* They are valid for 2 hours.
|
|
62
|
-
* @param path The file path, including the current file name. For example `folder/image.png`.
|
|
63
|
-
* @param options.upsert If set to true, allows the file to be overwritten if it already exists.
|
|
64
|
-
*/
|
|
65
|
-
createSignedUploadUrl(path: string, options?: {
|
|
66
|
-
upsert: boolean;
|
|
67
|
-
}): Promise<{
|
|
68
|
-
data: {
|
|
69
|
-
signedUrl: string;
|
|
70
|
-
token: string;
|
|
71
|
-
path: string;
|
|
72
|
-
};
|
|
73
|
-
error: null;
|
|
74
|
-
} | {
|
|
75
|
-
data: null;
|
|
76
|
-
error: StorageError;
|
|
77
|
-
}>;
|
|
78
|
-
/**
|
|
79
|
-
* Replaces an existing file at the specified path with a new one.
|
|
80
|
-
*
|
|
81
|
-
* @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to update.
|
|
82
|
-
* @param fileBody The body of the file to be stored in the bucket.
|
|
83
|
-
*/
|
|
84
|
-
update(path: string, fileBody: ArrayBuffer | ArrayBufferView | Blob | Buffer | File | NodeJS.ReadableStream | ReadableStream<Uint8Array> | URLSearchParams | string, fileOptions?: FileOptions): Promise<{
|
|
85
|
-
data: {
|
|
86
|
-
id: string;
|
|
87
|
-
path: string;
|
|
88
|
-
fullPath: string;
|
|
89
|
-
};
|
|
90
|
-
error: null;
|
|
91
|
-
} | {
|
|
92
|
-
data: null;
|
|
93
|
-
error: StorageError;
|
|
94
|
-
}>;
|
|
95
|
-
/**
|
|
96
|
-
* Moves an existing file to a new path in the same bucket.
|
|
97
|
-
*
|
|
98
|
-
* @param fromPath The original file path, including the current file name. For example `folder/image.png`.
|
|
99
|
-
* @param toPath The new file path, including the new file name. For example `folder/image-new.png`.
|
|
100
|
-
* @param options The destination options.
|
|
101
|
-
*/
|
|
102
|
-
move(fromPath: string, toPath: string, options?: DestinationOptions): Promise<{
|
|
103
|
-
data: {
|
|
104
|
-
message: string;
|
|
105
|
-
};
|
|
106
|
-
error: null;
|
|
107
|
-
} | {
|
|
108
|
-
data: null;
|
|
109
|
-
error: StorageError;
|
|
110
|
-
}>;
|
|
111
|
-
/**
|
|
112
|
-
* Copies an existing file to a new path in the same bucket.
|
|
113
|
-
*
|
|
114
|
-
* @param fromPath The original file path, including the current file name. For example `folder/image.png`.
|
|
115
|
-
* @param toPath The new file path, including the new file name. For example `folder/image-copy.png`.
|
|
116
|
-
* @param options The destination options.
|
|
117
|
-
*/
|
|
118
|
-
copy(fromPath: string, toPath: string, options?: DestinationOptions): Promise<{
|
|
119
|
-
data: {
|
|
120
|
-
path: string;
|
|
121
|
-
};
|
|
122
|
-
error: null;
|
|
123
|
-
} | {
|
|
124
|
-
data: null;
|
|
125
|
-
error: StorageError;
|
|
126
|
-
}>;
|
|
127
39
|
/**
|
|
128
40
|
* Creates a signed URL. Use a signed URL to share a file for a fixed amount of time.
|
|
129
41
|
*
|
|
@@ -172,44 +84,6 @@ export default class StorageFileApi {
|
|
|
172
84
|
data: null;
|
|
173
85
|
error: StorageError;
|
|
174
86
|
}>;
|
|
175
|
-
/**
|
|
176
|
-
* Retrieves the details of an existing file.
|
|
177
|
-
* @param path
|
|
178
|
-
*/
|
|
179
|
-
info(path: string): Promise<{
|
|
180
|
-
data: Camelize<FileObjectV2>;
|
|
181
|
-
error: null;
|
|
182
|
-
} | {
|
|
183
|
-
data: null;
|
|
184
|
-
error: StorageError;
|
|
185
|
-
}>;
|
|
186
|
-
/**
|
|
187
|
-
* Checks the existence of a file.
|
|
188
|
-
* @param path
|
|
189
|
-
*/
|
|
190
|
-
exists(path: string): Promise<{
|
|
191
|
-
data: boolean;
|
|
192
|
-
error: null;
|
|
193
|
-
} | {
|
|
194
|
-
data: boolean;
|
|
195
|
-
error: StorageError;
|
|
196
|
-
}>;
|
|
197
|
-
/**
|
|
198
|
-
* A simple convenience function to get the URL for an asset in a public bucket. If you do not want to use this function, you can construct the public URL by concatenating the bucket URL with the path to the asset.
|
|
199
|
-
* This function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.
|
|
200
|
-
*
|
|
201
|
-
* @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.
|
|
202
|
-
* @param options.download Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
203
|
-
* @param options.transform Transform the asset before serving it to the client.
|
|
204
|
-
*/
|
|
205
|
-
getPublicUrl(path: string, options?: {
|
|
206
|
-
download?: string | boolean;
|
|
207
|
-
transform?: TransformOptions;
|
|
208
|
-
}): {
|
|
209
|
-
data: {
|
|
210
|
-
publicUrl: string;
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
87
|
/**
|
|
214
88
|
* Deletes files within the same bucket
|
|
215
89
|
*
|
|
@@ -238,6 +112,5 @@ export default class StorageFileApi {
|
|
|
238
112
|
toBase64(data: string): string;
|
|
239
113
|
private _getFinalPath;
|
|
240
114
|
private _removeEmptyFolders;
|
|
241
|
-
private transformOptsToQueryString;
|
|
242
115
|
}
|
|
243
116
|
//# sourceMappingURL=StorageFileApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageFileApi.d.ts","sourceRoot":"","sources":["../../../src/packages/StorageFileApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StorageFileApi.d.ts","sourceRoot":"","sources":["../../../src/packages/StorageFileApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAsC,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,KAAK,EAA0B,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAiB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAe/F,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC7C,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAGrB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAO,EACvC,QAAQ,CAAC,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,KAAK;IAQf;;;;;;OAMG;YACW,cAAc;IAgF5B;;;;;OAKG;IACG,MAAM,CACV,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QA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KAAK,EAAE,IAAI,CAAC;KACb,GACD;QACE,IAAI,EAAE,IAAI,CAAC;QACX,KAAK,EAAE,YAAY,CAAC;KACrB,CACJ;IAkBD;;;;OAIG;IACG,IAAI,CACR,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CACN;QACE,IAAI,EAAE,UAAU,EAAE,CAAC;QACnB,KAAK,EAAE,IAAI,CAAC;KACb,GACD;QACE,IAAI,EAAE,IAAI,CAAC;QACX,KAAK,EAAE,YAAY,CAAC;KACrB,CACJ;IAgBD,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAItD,QAAQ,CAAC,IAAI,EAAE,MAAM;IAOrB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,mBAAmB;CAG5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isStorageError, StorageError, StorageUnknownError,
|
|
2
|
-
import { get,
|
|
3
|
-
import {
|
|
1
|
+
import { isStorageError, StorageError, StorageUnknownError, isCustomError } from '../lib/errors';
|
|
2
|
+
import { get, post, put, remove } from '../lib/fetch';
|
|
3
|
+
import { resolveFetch, getUpdateFileSize, toValidExpiresIn } from '../lib/helpers';
|
|
4
4
|
const DEFAULT_SEARCH_OPTIONS = {
|
|
5
5
|
limit: 100,
|
|
6
6
|
offset: 0,
|
|
@@ -10,8 +10,6 @@ const DEFAULT_SEARCH_OPTIONS = {
|
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
const DEFAULT_FILE_OPTIONS = {
|
|
13
|
-
// cacheControl: '3600',
|
|
14
|
-
// contentType: 'text/plain;charset=UTF-8',
|
|
15
13
|
upsert: false,
|
|
16
14
|
};
|
|
17
15
|
export default class StorageFileApi {
|
|
@@ -40,7 +38,7 @@ export default class StorageFileApi {
|
|
|
40
38
|
};
|
|
41
39
|
const cleanPath = this._removeEmptyFolders(path);
|
|
42
40
|
const _path = this._getFinalPath(cleanPath);
|
|
43
|
-
const res = await post(this.fetch, `${this.url}/object/${
|
|
41
|
+
const res = await post(this.fetch, `${this.url}/object/${_path}`, preUploadBody, headers);
|
|
44
42
|
const { upload_id, upload_url } = (_b = res === null || res === void 0 ? void 0 : res.data) !== null && _b !== void 0 ? _b : {};
|
|
45
43
|
if (upload_url && upload_id) {
|
|
46
44
|
const tosHeaders = {};
|
|
@@ -58,12 +56,6 @@ export default class StorageFileApi {
|
|
|
58
56
|
upload_id,
|
|
59
57
|
etag,
|
|
60
58
|
});
|
|
61
|
-
if (isErrorReturned(callbackRes)) {
|
|
62
|
-
return {
|
|
63
|
-
data: null,
|
|
64
|
-
error: callbackRes,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
59
|
return {
|
|
68
60
|
data: callbackRes.data,
|
|
69
61
|
error: null,
|
|
@@ -77,8 +69,8 @@ export default class StorageFileApi {
|
|
|
77
69
|
}
|
|
78
70
|
}
|
|
79
71
|
catch (error) {
|
|
80
|
-
if (isStorageError(error)) {
|
|
81
|
-
return { data: null, error };
|
|
72
|
+
if (isCustomError(error) || isStorageError(error)) {
|
|
73
|
+
return { data: null, error: error };
|
|
82
74
|
}
|
|
83
75
|
return { data: null, error: new StorageUnknownError('upload file error', error) };
|
|
84
76
|
}
|
|
@@ -92,134 +84,6 @@ export default class StorageFileApi {
|
|
|
92
84
|
async upload(path, fileBody, fileOptions) {
|
|
93
85
|
return this.uploadOrUpdate(path, fileBody, fileOptions);
|
|
94
86
|
}
|
|
95
|
-
/**
|
|
96
|
-
* Upload a file with a token generated from `createSignedUploadUrl`.
|
|
97
|
-
* @param path The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
|
|
98
|
-
* @param token The token generated from `createSignedUploadUrl`
|
|
99
|
-
* @param fileBody The body of the file to be stored in the bucket.
|
|
100
|
-
*/
|
|
101
|
-
async uploadToSignedUrl(path, token, fileBody, fileOptions) {
|
|
102
|
-
const cleanPath = this._removeEmptyFolders(path);
|
|
103
|
-
const _path = this._getFinalPath(cleanPath);
|
|
104
|
-
const url = new URL(this.url + `/object/upload/sign/${_path}`);
|
|
105
|
-
url.searchParams.set('token', token);
|
|
106
|
-
try {
|
|
107
|
-
let body;
|
|
108
|
-
const options = Object.assign({ upsert: DEFAULT_FILE_OPTIONS.upsert }, fileOptions);
|
|
109
|
-
const headers = Object.assign({}, this.headers);
|
|
110
|
-
if (typeof Blob !== 'undefined' && fileBody instanceof Blob) {
|
|
111
|
-
body = new FormData();
|
|
112
|
-
body.append('cacheControl', options.cacheControl);
|
|
113
|
-
body.append('', fileBody);
|
|
114
|
-
}
|
|
115
|
-
else if (typeof FormData !== 'undefined' && fileBody instanceof FormData) {
|
|
116
|
-
body = fileBody;
|
|
117
|
-
body.append('cacheControl', options.cacheControl);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
body = fileBody;
|
|
121
|
-
headers['cache-control'] = `max-age=${options.cacheControl}`;
|
|
122
|
-
headers['content-type'] = options.contentType;
|
|
123
|
-
}
|
|
124
|
-
const data = await put(this.fetch, url.toString(), body, { headers });
|
|
125
|
-
return {
|
|
126
|
-
data: { path: cleanPath, fullPath: data.Key },
|
|
127
|
-
error: null,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
catch (error) {
|
|
131
|
-
if (isStorageError(error)) {
|
|
132
|
-
return { data: null, error };
|
|
133
|
-
}
|
|
134
|
-
return { data: null, error: new StorageUnknownError('upload file error', error) };
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Creates a signed upload URL.
|
|
139
|
-
* Signed upload URLs can be used to upload files to the bucket without further authentication.
|
|
140
|
-
* They are valid for 2 hours.
|
|
141
|
-
* @param path The file path, including the current file name. For example `folder/image.png`.
|
|
142
|
-
* @param options.upsert If set to true, allows the file to be overwritten if it already exists.
|
|
143
|
-
*/
|
|
144
|
-
async createSignedUploadUrl(path, options) {
|
|
145
|
-
try {
|
|
146
|
-
let _path = this._getFinalPath(path);
|
|
147
|
-
const headers = Object.assign({}, this.headers);
|
|
148
|
-
// if (options?.upsert) {
|
|
149
|
-
// headers['x-upsert'] = 'true';
|
|
150
|
-
// }
|
|
151
|
-
const data = await post(this.fetch, `${this.url}/object/upload/sign/${_path}`, {}, { headers });
|
|
152
|
-
const url = new URL(this.url + data.url);
|
|
153
|
-
const token = url.searchParams.get('token');
|
|
154
|
-
if (!token) {
|
|
155
|
-
throw new StorageError('No token returned by API');
|
|
156
|
-
}
|
|
157
|
-
return { data: { signedUrl: url.toString(), path, token }, error: null };
|
|
158
|
-
}
|
|
159
|
-
catch (error) {
|
|
160
|
-
if (isStorageError(error)) {
|
|
161
|
-
return { data: null, error };
|
|
162
|
-
}
|
|
163
|
-
throw error;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Replaces an existing file at the specified path with a new one.
|
|
168
|
-
*
|
|
169
|
-
* @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to update.
|
|
170
|
-
* @param fileBody The body of the file to be stored in the bucket.
|
|
171
|
-
*/
|
|
172
|
-
async update(path, fileBody, fileOptions) {
|
|
173
|
-
return this.uploadOrUpdate(path, fileBody, fileOptions);
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Moves an existing file to a new path in the same bucket.
|
|
177
|
-
*
|
|
178
|
-
* @param fromPath The original file path, including the current file name. For example `folder/image.png`.
|
|
179
|
-
* @param toPath The new file path, including the new file name. For example `folder/image-new.png`.
|
|
180
|
-
* @param options The destination options.
|
|
181
|
-
*/
|
|
182
|
-
async move(fromPath, toPath, options) {
|
|
183
|
-
try {
|
|
184
|
-
const data = await post(this.fetch, `${this.url}/object/move`, {
|
|
185
|
-
bucketId: this.bucketId,
|
|
186
|
-
sourceKey: fromPath,
|
|
187
|
-
destinationKey: toPath,
|
|
188
|
-
destinationBucket: options === null || options === void 0 ? void 0 : options.destinationBucket,
|
|
189
|
-
}, { headers: this.headers });
|
|
190
|
-
return { data, error: null };
|
|
191
|
-
}
|
|
192
|
-
catch (error) {
|
|
193
|
-
if (isStorageError(error)) {
|
|
194
|
-
return { data: null, error };
|
|
195
|
-
}
|
|
196
|
-
throw error;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Copies an existing file to a new path in the same bucket.
|
|
201
|
-
*
|
|
202
|
-
* @param fromPath The original file path, including the current file name. For example `folder/image.png`.
|
|
203
|
-
* @param toPath The new file path, including the new file name. For example `folder/image-copy.png`.
|
|
204
|
-
* @param options The destination options.
|
|
205
|
-
*/
|
|
206
|
-
async copy(fromPath, toPath, options) {
|
|
207
|
-
try {
|
|
208
|
-
const data = await post(this.fetch, `${this.url}/object/copy`, {
|
|
209
|
-
bucketId: this.bucketId,
|
|
210
|
-
sourceKey: fromPath,
|
|
211
|
-
destinationKey: toPath,
|
|
212
|
-
destinationBucket: options === null || options === void 0 ? void 0 : options.destinationBucket,
|
|
213
|
-
}, { headers: this.headers });
|
|
214
|
-
return { data: { path: data.Key }, error: null };
|
|
215
|
-
}
|
|
216
|
-
catch (error) {
|
|
217
|
-
if (isStorageError(error)) {
|
|
218
|
-
return { data: null, error };
|
|
219
|
-
}
|
|
220
|
-
throw error;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
87
|
/**
|
|
224
88
|
* Creates a signed URL. Use a signed URL to share a file for a fixed amount of time.
|
|
225
89
|
*
|
|
@@ -231,20 +95,14 @@ export default class StorageFileApi {
|
|
|
231
95
|
async createSignedUrl(path, expiresIn) {
|
|
232
96
|
try {
|
|
233
97
|
let _path = this._getFinalPath(path);
|
|
234
|
-
const res = await post(this.fetch, `${this.url}/object/sign/${_path}`, { expires_in: expiresIn }, { headers: this.headers });
|
|
235
|
-
if (isErrorReturned(res)) {
|
|
236
|
-
return {
|
|
237
|
-
data: null,
|
|
238
|
-
error: res,
|
|
239
|
-
};
|
|
240
|
-
}
|
|
98
|
+
const res = await post(this.fetch, `${this.url}/object/sign/${_path}`, { expires_in: toValidExpiresIn(expiresIn) }, { headers: this.headers });
|
|
241
99
|
return { data: res.data, error: null };
|
|
242
100
|
}
|
|
243
101
|
catch (error) {
|
|
244
|
-
if (isStorageError(error)) {
|
|
245
|
-
return { data: null, error };
|
|
102
|
+
if (isCustomError(error) || isStorageError(error)) {
|
|
103
|
+
return { data: null, error: error };
|
|
246
104
|
}
|
|
247
|
-
|
|
105
|
+
return { data: null, error: new StorageUnknownError('create signed url error', error) };
|
|
248
106
|
}
|
|
249
107
|
}
|
|
250
108
|
/**
|
|
@@ -256,23 +114,17 @@ export default class StorageFileApi {
|
|
|
256
114
|
*/
|
|
257
115
|
async createSignedUrls(paths, expiresIn) {
|
|
258
116
|
try {
|
|
259
|
-
const res = await post(this.fetch, `${this.url}/object/sign/${this.bucketId}`, { expires_in: expiresIn, paths }, { headers: this.headers });
|
|
260
|
-
if (isErrorReturned(res)) {
|
|
261
|
-
return {
|
|
262
|
-
data: null,
|
|
263
|
-
error: res,
|
|
264
|
-
};
|
|
265
|
-
}
|
|
117
|
+
const res = await post(this.fetch, `${this.url}/object/sign/${this.bucketId}`, { expires_in: toValidExpiresIn(expiresIn), paths }, { headers: this.headers });
|
|
266
118
|
return {
|
|
267
119
|
data: res.data,
|
|
268
120
|
error: null,
|
|
269
121
|
};
|
|
270
122
|
}
|
|
271
123
|
catch (error) {
|
|
272
|
-
if (isStorageError(error)) {
|
|
273
|
-
return { data: null, error };
|
|
124
|
+
if (isCustomError(error) || isStorageError(error)) {
|
|
125
|
+
return { data: null, error: error };
|
|
274
126
|
}
|
|
275
|
-
|
|
127
|
+
return { data: null, error: new StorageUnknownError('create signed urls error', error) };
|
|
276
128
|
}
|
|
277
129
|
}
|
|
278
130
|
/**
|
|
@@ -300,84 +152,12 @@ export default class StorageFileApi {
|
|
|
300
152
|
return { data: resBody, error: null };
|
|
301
153
|
}
|
|
302
154
|
catch (error) {
|
|
303
|
-
if (isStorageError(error)) {
|
|
304
|
-
return { data: null, error };
|
|
155
|
+
if (isCustomError(error) || isStorageError(error)) {
|
|
156
|
+
return { data: null, error: error };
|
|
305
157
|
}
|
|
306
158
|
return { data: null, error: new StorageUnknownError('download file error', error) };
|
|
307
159
|
}
|
|
308
160
|
}
|
|
309
|
-
/**
|
|
310
|
-
* Retrieves the details of an existing file.
|
|
311
|
-
* @param path
|
|
312
|
-
*/
|
|
313
|
-
async info(path) {
|
|
314
|
-
const _path = this._getFinalPath(path);
|
|
315
|
-
try {
|
|
316
|
-
const data = await get(this.fetch, `${this.url}/object/info/${_path}`, {
|
|
317
|
-
headers: this.headers,
|
|
318
|
-
});
|
|
319
|
-
return { data: recursiveToCamel(data), error: null };
|
|
320
|
-
}
|
|
321
|
-
catch (error) {
|
|
322
|
-
if (isStorageError(error)) {
|
|
323
|
-
return { data: null, error };
|
|
324
|
-
}
|
|
325
|
-
throw error;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Checks the existence of a file.
|
|
330
|
-
* @param path
|
|
331
|
-
*/
|
|
332
|
-
async exists(path) {
|
|
333
|
-
const _path = this._getFinalPath(path);
|
|
334
|
-
try {
|
|
335
|
-
await head(this.fetch, `${this.url}/object/${_path}`, {
|
|
336
|
-
headers: this.headers,
|
|
337
|
-
});
|
|
338
|
-
return { data: true, error: null };
|
|
339
|
-
}
|
|
340
|
-
catch (error) {
|
|
341
|
-
if (isStorageError(error) && error instanceof StorageUnknownError) {
|
|
342
|
-
const originalError = error.originalError;
|
|
343
|
-
if ([400, 404].includes(originalError === null || originalError === void 0 ? void 0 : originalError.status)) {
|
|
344
|
-
return { data: false, error };
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
throw error;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* A simple convenience function to get the URL for an asset in a public bucket. If you do not want to use this function, you can construct the public URL by concatenating the bucket URL with the path to the asset.
|
|
352
|
-
* This function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.
|
|
353
|
-
*
|
|
354
|
-
* @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.
|
|
355
|
-
* @param options.download Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
356
|
-
* @param options.transform Transform the asset before serving it to the client.
|
|
357
|
-
*/
|
|
358
|
-
getPublicUrl(path, options) {
|
|
359
|
-
const _path = this._getFinalPath(path);
|
|
360
|
-
const _queryString = [];
|
|
361
|
-
const downloadQueryParam = (options === null || options === void 0 ? void 0 : options.download)
|
|
362
|
-
? `download=${options.download === true ? '' : options.download}`
|
|
363
|
-
: '';
|
|
364
|
-
if (downloadQueryParam !== '') {
|
|
365
|
-
_queryString.push(downloadQueryParam);
|
|
366
|
-
}
|
|
367
|
-
const wantsTransformation = typeof (options === null || options === void 0 ? void 0 : options.transform) !== 'undefined';
|
|
368
|
-
const renderPath = wantsTransformation ? 'render/image' : 'object';
|
|
369
|
-
const transformationQuery = this.transformOptsToQueryString((options === null || options === void 0 ? void 0 : options.transform) || {});
|
|
370
|
-
if (transformationQuery !== '') {
|
|
371
|
-
_queryString.push(transformationQuery);
|
|
372
|
-
}
|
|
373
|
-
let queryString = _queryString.join('&');
|
|
374
|
-
if (queryString !== '') {
|
|
375
|
-
queryString = `?${queryString}`;
|
|
376
|
-
}
|
|
377
|
-
return {
|
|
378
|
-
data: { publicUrl: encodeURI(`${this.url}/${renderPath}/public/${_path}${queryString}`) },
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
161
|
/**
|
|
382
162
|
* Deletes files within the same bucket
|
|
383
163
|
*
|
|
@@ -389,8 +169,8 @@ export default class StorageFileApi {
|
|
|
389
169
|
return { data: res.data, error: null };
|
|
390
170
|
}
|
|
391
171
|
catch (error) {
|
|
392
|
-
if (isStorageError(error)) {
|
|
393
|
-
return { data: null, error };
|
|
172
|
+
if (isCustomError(error) || isStorageError(error)) {
|
|
173
|
+
return { data: null, error: error };
|
|
394
174
|
}
|
|
395
175
|
return { data: null, error: new StorageUnknownError('remove file error', error) };
|
|
396
176
|
}
|
|
@@ -409,10 +189,10 @@ export default class StorageFileApi {
|
|
|
409
189
|
return { data: res.data, error: null };
|
|
410
190
|
}
|
|
411
191
|
catch (error) {
|
|
412
|
-
if (isStorageError(error)) {
|
|
413
|
-
return { data: null, error };
|
|
192
|
+
if (isCustomError(error) || isStorageError(error)) {
|
|
193
|
+
return { data: null, error: error };
|
|
414
194
|
}
|
|
415
|
-
|
|
195
|
+
return { data: null, error: new StorageUnknownError('list file error', error) };
|
|
416
196
|
}
|
|
417
197
|
}
|
|
418
198
|
encodeMetadata(metadata) {
|
|
@@ -430,24 +210,5 @@ export default class StorageFileApi {
|
|
|
430
210
|
_removeEmptyFolders(path) {
|
|
431
211
|
return path.replace(/^\/|\/$/g, '').replace(/\/+/g, '/');
|
|
432
212
|
}
|
|
433
|
-
transformOptsToQueryString(transform) {
|
|
434
|
-
const params = [];
|
|
435
|
-
if (transform.width) {
|
|
436
|
-
params.push(`width=${transform.width}`);
|
|
437
|
-
}
|
|
438
|
-
if (transform.height) {
|
|
439
|
-
params.push(`height=${transform.height}`);
|
|
440
|
-
}
|
|
441
|
-
if (transform.resize) {
|
|
442
|
-
params.push(`resize=${transform.resize}`);
|
|
443
|
-
}
|
|
444
|
-
if (transform.format) {
|
|
445
|
-
params.push(`format=${transform.format}`);
|
|
446
|
-
}
|
|
447
|
-
if (transform.quality) {
|
|
448
|
-
params.push(`quality=${transform.quality}`);
|
|
449
|
-
}
|
|
450
|
-
return params.join('&');
|
|
451
|
-
}
|
|
452
213
|
}
|
|
453
214
|
//# sourceMappingURL=StorageFileApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageFileApi.js","sourceRoot":"","sources":["../../../src/packages/StorageFileApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CA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xD,CAAC;IAEO,mBAAmB,CAAC,IAAY;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@data-loom/storage-js",
|
|
3
|
-
"version": "0.2.1-alpha.
|
|
3
|
+
"version": "0.2.1-alpha.3",
|
|
4
4
|
"description": "Dataloom service",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"service",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"test:types:watch": "run-s build && tsd --files 'test/**/*.test-d.ts' --watch"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@data-loom/node-fetch": "0.2.1-alpha.
|
|
36
|
+
"@data-loom/node-fetch": "0.2.1-alpha.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/jest": "^26.0.13",
|