@3dverse/api 0.8.6 → 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/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
@@ -1028,7 +1044,8 @@ function getRunningSessions({
1028
1044
  function createSession({
1029
1045
  scene_id,
1030
1046
  renderer_version,
1031
- is_transient = false
1047
+ is_transient = false,
1048
+ options
1032
1049
  }, headers) {
1033
1050
  return axiosInstance({
1034
1051
  method: "post",
@@ -1036,7 +1053,8 @@ function createSession({
1036
1053
  data: {
1037
1054
  scene_id,
1038
1055
  renderer_version,
1039
- is_transient
1056
+ is_transient,
1057
+ options
1040
1058
  },
1041
1059
  headers
1042
1060
  });
@@ -1184,21 +1202,6 @@ function shouldRetryRequest(error) {
1184
1202
  }
1185
1203
  }
1186
1204
  installInterceptors();
1187
- function uploadSourceFiles({
1188
- folder_id,
1189
- body,
1190
- onUploadProgress
1191
- }) {
1192
- return axiosInstance({
1193
- method: "post",
1194
- url: `/folders/${folder_id}/source-files`,
1195
- headers: {
1196
- "Content-Type": "multipart/form-data"
1197
- },
1198
- data: body,
1199
- onUploadProgress
1200
- });
1201
- }
1202
1205
  // Annotate the CommonJS export names for ESM import in node:
1203
1206
  0 && (module.exports = {
1204
1207
  ApiError,