@3dverse/api 0.8.7 → 0.8.8
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/_prebuild/wrapper.d.ts +89 -89
- package/dist/index.d.ts +0 -6
- package/dist/index.js +17 -16
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +17 -16
- package/dist/index.mjs.map +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import { AxiosProgressEvent } from 'axios';
|
2
|
-
import { uploadSourceFiles as _uploadSourceFiles } from './_prebuild/wrapper';
|
3
1
|
export declare function setApiKey(apiKey: string): void;
|
4
2
|
export declare function setUserToken(userToken: string): void;
|
5
3
|
declare abstract class ServiceError extends Error {
|
@@ -17,7 +15,3 @@ export declare class UnexpectedServiceError extends ServiceError {
|
|
17
15
|
constructor(status: number, unexpectedError: unknown);
|
18
16
|
}
|
19
17
|
export * from './_prebuild/wrapper';
|
20
|
-
type UploadSourceFiles = typeof _uploadSourceFiles;
|
21
|
-
export declare function uploadSourceFiles({ folder_id, body, onUploadProgress, }: Parameters<UploadSourceFiles>[0] & {
|
22
|
-
onUploadProgress?: (e: AxiosProgressEvent) => void;
|
23
|
-
}): ReturnType<UploadSourceFiles>;
|
package/dist/index.js
CHANGED
@@ -429,6 +429,21 @@ function listFolderSubFolders({
|
|
429
429
|
headers
|
430
430
|
});
|
431
431
|
}
|
432
|
+
function uploadSourceFiles({
|
433
|
+
folder_id,
|
434
|
+
body
|
435
|
+
}, onUploadProgress, headers) {
|
436
|
+
return axiosInstance({
|
437
|
+
method: "post",
|
438
|
+
url: "/folders/" + folder_id + "/source-files",
|
439
|
+
data: body,
|
440
|
+
onUploadProgress,
|
441
|
+
headers: {
|
442
|
+
"Content-Type": "multipart/form-data",
|
443
|
+
...headers
|
444
|
+
}
|
445
|
+
});
|
446
|
+
}
|
432
447
|
function getSourceFilesInFolder({
|
433
448
|
folder_id,
|
434
449
|
offset = 0,
|
@@ -559,7 +574,7 @@ function importAssets({
|
|
559
574
|
folder_id,
|
560
575
|
overwrite = "never",
|
561
576
|
body
|
562
|
-
}, headers) {
|
577
|
+
}, onUploadProgress, headers) {
|
563
578
|
return axiosInstance({
|
564
579
|
method: "put",
|
565
580
|
url: "/folders/" + folder_id + "/packages",
|
@@ -568,6 +583,7 @@ function importAssets({
|
|
568
583
|
},
|
569
584
|
data: body,
|
570
585
|
maxRedirects: 0,
|
586
|
+
onUploadProgress,
|
571
587
|
headers: {
|
572
588
|
"Content-Type": "application/zip",
|
573
589
|
...headers
|
@@ -1186,21 +1202,6 @@ function shouldRetryRequest(error) {
|
|
1186
1202
|
}
|
1187
1203
|
}
|
1188
1204
|
installInterceptors();
|
1189
|
-
function uploadSourceFiles({
|
1190
|
-
folder_id,
|
1191
|
-
body,
|
1192
|
-
onUploadProgress
|
1193
|
-
}) {
|
1194
|
-
return axiosInstance({
|
1195
|
-
method: "post",
|
1196
|
-
url: `/folders/${folder_id}/source-files`,
|
1197
|
-
headers: {
|
1198
|
-
"Content-Type": "multipart/form-data"
|
1199
|
-
},
|
1200
|
-
data: body,
|
1201
|
-
onUploadProgress
|
1202
|
-
});
|
1203
|
-
}
|
1204
1205
|
// Annotate the CommonJS export names for ESM import in node:
|
1205
1206
|
0 && (module.exports = {
|
1206
1207
|
ApiError,
|