@3dverse/api 0.9.0 → 0.10.1

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.js CHANGED
@@ -30,10 +30,30 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var index_exports = {};
31
31
  __export(index_exports, {
32
32
  ApiError: () => ApiError,
33
+ AssetSourceFileNotFound: () => AssetSourceFileNotFound,
34
+ ConversionTaskNotFound: () => ConversionTaskNotFound,
35
+ EnvironmentMismatch: () => EnvironmentMismatch,
36
+ InsufficientPermissions: () => InsufficientPermissions,
37
+ InsufficientSecurityScope: () => InsufficientSecurityScope,
38
+ InvalidApiKey: () => InvalidApiKey,
39
+ InvalidAuthorization: () => InvalidAuthorization,
40
+ InvalidGuestToken: () => InvalidGuestToken,
41
+ InvalidMaterial: () => InvalidMaterial,
42
+ InvalidRequest: () => InvalidRequest,
43
+ InvalidTokenTtl: () => InvalidTokenTtl,
44
+ MissingAuthorizationHeader: () => MissingAuthorizationHeader,
45
+ NoFileUploaded: () => NoFileUploaded,
46
+ ServiceErrorResponse: () => ServiceErrorResponse,
47
+ Unauthorized: () => Unauthorized,
33
48
  UnexpectedServiceError: () => UnexpectedServiceError,
49
+ UploadAborted: () => UploadAborted,
50
+ UploadTaskNotFound: () => UploadTaskNotFound,
51
+ UploadedPayloadTooLarge: () => UploadedPayloadTooLarge,
34
52
  axiosInstance: () => axiosInstance,
53
+ confirmDuplicationRequest: () => confirmDuplicationRequest,
35
54
  createAsset: () => createAsset,
36
55
  createCubemap: () => createCubemap,
56
+ createDuplicationRequest: () => createDuplicationRequest,
37
57
  createEntity: () => createEntity,
38
58
  createFolder: () => createFolder,
39
59
  createGroup: () => createGroup,
@@ -47,12 +67,12 @@ __export(index_exports, {
47
67
  deleteGroup: () => deleteGroup,
48
68
  deleteSourceFiles: () => deleteSourceFiles,
49
69
  deleteUser: () => deleteUser,
50
- downloadSourceFile: () => downloadSourceFile,
70
+ discardDuplicationRequest: () => discardDuplicationRequest,
71
+ errorOf: () => errorOf,
51
72
  exportAsset: () => exportAsset,
52
73
  generateGuestToken: () => generateGuestToken,
53
74
  generateUserToken: () => generateUserToken,
54
75
  getAssetCode: () => getAssetCode,
55
- getAssetCustomTypes: () => getAssetCustomTypes,
56
76
  getAssetDependencies: () => getAssetDependencies,
57
77
  getAssetDescription: () => getAssetDescription,
58
78
  getAssetDetails: () => getAssetDetails,
@@ -67,6 +87,7 @@ __export(index_exports, {
67
87
  getClient: () => getClient,
68
88
  getConversionTaskMetadata: () => getConversionTaskMetadata,
69
89
  getCurrentUser: () => getCurrentUser,
90
+ getDuplicationRequest: () => getDuplicationRequest,
70
91
  getEntity: () => getEntity,
71
92
  getFolderAssets: () => getFolderAssets,
72
93
  getFolderInfo: () => getFolderInfo,
@@ -95,6 +116,7 @@ __export(index_exports, {
95
116
  kickClientFromSession: () => kickClientFromSession,
96
117
  killSession: () => killSession,
97
118
  listAssets: () => listAssets,
119
+ listDuplicationRequests: () => listDuplicationRequests,
98
120
  listFolderAccesses: () => listFolderAccesses,
99
121
  listFolderSubFolders: () => listFolderSubFolders,
100
122
  listFolders: () => listFolders,
@@ -115,6 +137,7 @@ __export(index_exports, {
115
137
  setUserToken: () => setUserToken,
116
138
  updateAssetDescription: () => updateAssetDescription,
117
139
  updateAssetGraph: () => updateAssetGraph,
140
+ updateDuplicationRequest: () => updateDuplicationRequest,
118
141
  updateEntity: () => updateEntity,
119
142
  updateFolder: () => updateFolder,
120
143
  updateGroupDescription: () => updateGroupDescription,
@@ -128,12 +151,198 @@ var import_axios_retry = __toESM(require("axios-retry"));
128
151
 
129
152
  // _prebuild/wrapper.ts
130
153
  var import_axios = __toESM(require("axios"));
154
+ var ServiceErrorResponse = class extends Error {
155
+ errorCode;
156
+ httpCode;
157
+ serviceError;
158
+ constructor(errorCode, httpCode, message, serviceError) {
159
+ super(message);
160
+ Object.defineProperty(this, "message", {
161
+ value: message,
162
+ enumerable: true,
163
+ writable: true,
164
+ configurable: true
165
+ });
166
+ this.errorCode = errorCode;
167
+ this.httpCode = httpCode;
168
+ this.serviceError = serviceError;
169
+ }
170
+ };
171
+ function optionalBody(body) {
172
+ return Object.values(body).some((value) => value !== void 0) ? body : void 0;
173
+ }
174
+ function multipartBody(fields, files) {
175
+ const form = new FormData();
176
+ for (const [name, value] of Object.entries(fields)) {
177
+ if (value !== void 0) {
178
+ form.append(name, typeof value === "string" ? value : JSON.stringify(value));
179
+ }
180
+ }
181
+ for (const [name, value] of Object.entries(files)) {
182
+ for (const file of value === void 0 ? [] : Array.isArray(value) ? value : [value]) {
183
+ form.append(name, file);
184
+ }
185
+ }
186
+ return form;
187
+ }
188
+ function plainHeaders(headers) {
189
+ return headers instanceof import_axios.AxiosHeaders ? headers.toJSON() : { ...headers };
190
+ }
131
191
  var axiosInstance = import_axios.default.create({
132
- baseURL: "https://api.3dverse.com/app/v1"
192
+ baseURL: "https://api.3dverse.com/app/v1",
193
+ paramsSerializer: { indexes: null }
133
194
  });
134
195
  function setBaseURL(baseURL) {
135
196
  axiosInstance.defaults.baseURL = baseURL;
136
197
  }
198
+ var AssetSourceFileNotFound = class extends ServiceErrorResponse {
199
+ static ERROR_CODE = 1018;
200
+ constructor(serviceError) {
201
+ super(1018, 404, "The asset was imported from no source file", serviceError);
202
+ Object.assign(this, serviceError);
203
+ }
204
+ };
205
+ var InsufficientPermissions = class extends ServiceErrorResponse {
206
+ static ERROR_CODE = 1002;
207
+ constructor(serviceError) {
208
+ super(1002, 403, "Insufficient permissions", serviceError);
209
+ Object.assign(this, serviceError);
210
+ }
211
+ };
212
+ var InvalidAuthorization = class extends ServiceErrorResponse {
213
+ static ERROR_CODE = 1003;
214
+ constructor(serviceError) {
215
+ super(1003, 403, "This operation is not allowed with this kind of token", serviceError);
216
+ Object.assign(this, serviceError);
217
+ }
218
+ };
219
+ var InsufficientSecurityScope = class extends ServiceErrorResponse {
220
+ static ERROR_CODE = 1004;
221
+ constructor(serviceError) {
222
+ super(1004, 403, "This operation is not permitted with the scope of this token", serviceError);
223
+ Object.assign(this, serviceError);
224
+ }
225
+ };
226
+ var Unauthorized = class extends ServiceErrorResponse {
227
+ static ERROR_CODE = 1005;
228
+ constructor(serviceError) {
229
+ super(1005, 401, "Invalid or expired token", serviceError);
230
+ Object.assign(this, serviceError);
231
+ }
232
+ };
233
+ var EnvironmentMismatch = class extends ServiceErrorResponse {
234
+ static ERROR_CODE = 1006;
235
+ constructor(serviceError) {
236
+ super(1006, 403, "User is not part of the current environment", serviceError);
237
+ Object.assign(this, serviceError);
238
+ }
239
+ };
240
+ var MissingAuthorizationHeader = class extends ServiceErrorResponse {
241
+ static ERROR_CODE = 1011;
242
+ constructor(serviceError) {
243
+ super(1011, 401, "Missing api key or user token", serviceError);
244
+ Object.assign(this, serviceError);
245
+ }
246
+ };
247
+ var InvalidApiKey = class extends ServiceErrorResponse {
248
+ static ERROR_CODE = 1012;
249
+ constructor(serviceError) {
250
+ super(1012, 401, "Invalid api key", serviceError);
251
+ Object.assign(this, serviceError);
252
+ }
253
+ };
254
+ var InvalidGuestToken = class extends ServiceErrorResponse {
255
+ static ERROR_CODE = 1016;
256
+ constructor(serviceError) {
257
+ super(1016, 403, "You are not allowed to use this guest token for this session", serviceError);
258
+ Object.assign(this, serviceError);
259
+ }
260
+ };
261
+ var InvalidTokenTtl = class extends ServiceErrorResponse {
262
+ static ERROR_CODE = 1017;
263
+ constructor(serviceError) {
264
+ super(1017, 400, "The time to live of a user token is a duration from 1 minute to 14 days", serviceError);
265
+ Object.assign(this, serviceError);
266
+ }
267
+ };
268
+ var UploadedPayloadTooLarge = class extends ServiceErrorResponse {
269
+ static ERROR_CODE = 1007;
270
+ constructor(serviceError) {
271
+ super(1007, 413, "Upload payload size exceeds the maximum allowed", serviceError);
272
+ Object.assign(this, serviceError);
273
+ }
274
+ };
275
+ var NoFileUploaded = class extends ServiceErrorResponse {
276
+ static ERROR_CODE = 1008;
277
+ constructor(serviceError) {
278
+ super(1008, 422, "No file uploaded", serviceError);
279
+ Object.assign(this, serviceError);
280
+ }
281
+ };
282
+ var UploadAborted = class extends ServiceErrorResponse {
283
+ static ERROR_CODE = 1009;
284
+ constructor(serviceError) {
285
+ super(1009, 422, "Upload aborted", serviceError);
286
+ Object.assign(this, serviceError);
287
+ }
288
+ };
289
+ var UploadTaskNotFound = class extends ServiceErrorResponse {
290
+ static ERROR_CODE = 1010;
291
+ constructor(serviceError) {
292
+ super(1010, 404, "Upload task not found", serviceError);
293
+ Object.assign(this, serviceError);
294
+ }
295
+ };
296
+ var InvalidMaterial = class extends ServiceErrorResponse {
297
+ static ERROR_CODE = 1013;
298
+ constructor(serviceError) {
299
+ super(1013, 400, "Some of the asset ids are not materials", serviceError);
300
+ Object.assign(this, serviceError);
301
+ }
302
+ };
303
+ var InvalidRequest = class extends ServiceErrorResponse {
304
+ static ERROR_CODE = 1014;
305
+ constructor(serviceError) {
306
+ super(1014, 400, "Invalid request", serviceError);
307
+ Object.assign(this, serviceError);
308
+ }
309
+ };
310
+ var ConversionTaskNotFound = class extends ServiceErrorResponse {
311
+ static ERROR_CODE = 1015;
312
+ constructor(serviceError) {
313
+ super(1015, 404, "Conversion task not found", serviceError);
314
+ Object.assign(this, serviceError);
315
+ }
316
+ };
317
+ var declaredErrors = {
318
+ 1018: AssetSourceFileNotFound,
319
+ 1002: InsufficientPermissions,
320
+ 1003: InvalidAuthorization,
321
+ 1004: InsufficientSecurityScope,
322
+ 1005: Unauthorized,
323
+ 1006: EnvironmentMismatch,
324
+ 1011: MissingAuthorizationHeader,
325
+ 1012: InvalidApiKey,
326
+ 1016: InvalidGuestToken,
327
+ 1017: InvalidTokenTtl,
328
+ 1007: UploadedPayloadTooLarge,
329
+ 1008: NoFileUploaded,
330
+ 1009: UploadAborted,
331
+ 1010: UploadTaskNotFound,
332
+ 1013: InvalidMaterial,
333
+ 1014: InvalidRequest,
334
+ 1015: ConversionTaskNotFound
335
+ };
336
+ function errorOf(error) {
337
+ if (Object.values(declaredErrors).some((declared2) => error instanceof declared2)) {
338
+ return error;
339
+ }
340
+ const failure = error;
341
+ const serviceError = failure?.serviceError ?? failure?.response?.data?.error;
342
+ const errorCode = serviceError?.errorCode;
343
+ const declared = typeof errorCode === "number" ? declaredErrors[errorCode] : void 0;
344
+ return declared ? new declared(serviceError) : void 0;
345
+ }
137
346
  function listUsers({
138
347
  offset = 0,
139
348
  limit = 10
@@ -172,7 +381,7 @@ function getUser({
172
381
  }, headers) {
173
382
  return axiosInstance({
174
383
  method: "get",
175
- url: "/users/" + user_id,
384
+ url: "/users/" + encodeURIComponent(user_id),
176
385
  headers
177
386
  });
178
387
  }
@@ -182,7 +391,7 @@ function updateUser({
182
391
  }, headers) {
183
392
  return axiosInstance({
184
393
  method: "patch",
185
- url: "/users/" + user_id,
394
+ url: "/users/" + encodeURIComponent(user_id),
186
395
  data: {
187
396
  username
188
397
  },
@@ -194,7 +403,7 @@ function deleteUser({
194
403
  }, headers) {
195
404
  return axiosInstance({
196
405
  method: "delete",
197
- url: "/users/" + user_id,
406
+ url: "/users/" + encodeURIComponent(user_id),
198
407
  headers
199
408
  });
200
409
  }
@@ -205,7 +414,7 @@ function generateUserToken({
205
414
  }, headers) {
206
415
  return axiosInstance({
207
416
  method: "post",
208
- url: "/users/" + user_id + "/tokens",
417
+ url: "/users/" + encodeURIComponent(user_id) + "/tokens",
209
418
  data: {
210
419
  scope,
211
420
  ttl
@@ -218,7 +427,7 @@ function getUserGroups({
218
427
  }, headers) {
219
428
  return axiosInstance({
220
429
  method: "get",
221
- url: "/users/" + user_id + "/groups",
430
+ url: "/users/" + encodeURIComponent(user_id) + "/groups",
222
431
  headers
223
432
  });
224
433
  }
@@ -229,7 +438,7 @@ function getUserUploadTasks({
229
438
  }, headers) {
230
439
  return axiosInstance({
231
440
  method: "get",
232
- url: "/users/" + user_id + "/upload-tasks",
441
+ url: "/users/" + encodeURIComponent(user_id) + "/upload-tasks",
233
442
  params: {
234
443
  offset,
235
444
  limit
@@ -258,7 +467,7 @@ function getGroup({
258
467
  }, headers) {
259
468
  return axiosInstance({
260
469
  method: "get",
261
- url: "/groups/" + group_id,
470
+ url: "/groups/" + encodeURIComponent(group_id),
262
471
  headers
263
472
  });
264
473
  }
@@ -269,7 +478,7 @@ function updateGroupDescription({
269
478
  }, headers) {
270
479
  return axiosInstance({
271
480
  method: "patch",
272
- url: "/groups/" + group_id,
481
+ url: "/groups/" + encodeURIComponent(group_id),
273
482
  data: {
274
483
  name,
275
484
  description
@@ -282,7 +491,7 @@ function deleteGroup({
282
491
  }, headers) {
283
492
  return axiosInstance({
284
493
  method: "delete",
285
- url: "/groups/" + group_id,
494
+ url: "/groups/" + encodeURIComponent(group_id),
286
495
  headers
287
496
  });
288
497
  }
@@ -295,7 +504,7 @@ function grantMemberAccessToGroup({
295
504
  }, headers) {
296
505
  return axiosInstance({
297
506
  method: "put",
298
- url: "/groups/" + group_id + "/members/" + member_type + "/" + member_id,
507
+ url: "/groups/" + encodeURIComponent(group_id) + "/members/" + encodeURIComponent(member_type) + "/" + encodeURIComponent(member_id),
299
508
  data: {
300
509
  group_access,
301
510
  folder_access
@@ -310,7 +519,7 @@ function revokeMemberAccessToGroup({
310
519
  }, headers) {
311
520
  return axiosInstance({
312
521
  method: "delete",
313
- url: "/groups/" + group_id + "/members/" + member_type + "/" + member_id,
522
+ url: "/groups/" + encodeURIComponent(group_id) + "/members/" + encodeURIComponent(member_type) + "/" + encodeURIComponent(member_id),
314
523
  headers
315
524
  });
316
525
  }
@@ -347,7 +556,7 @@ function getFolderInfo({
347
556
  }, headers) {
348
557
  return axiosInstance({
349
558
  method: "get",
350
- url: "/folders/" + folder_id,
559
+ url: "/folders/" + encodeURIComponent(folder_id),
351
560
  headers
352
561
  });
353
562
  }
@@ -357,7 +566,7 @@ function moveFolders({
357
566
  }, headers) {
358
567
  return axiosInstance({
359
568
  method: "put",
360
- url: "/folders/" + folder_id,
569
+ url: "/folders/" + encodeURIComponent(folder_id),
361
570
  data: folder_ids,
362
571
  headers
363
572
  });
@@ -368,7 +577,7 @@ function updateFolder({
368
577
  }, headers) {
369
578
  return axiosInstance({
370
579
  method: "patch",
371
- url: "/folders/" + folder_id,
580
+ url: "/folders/" + encodeURIComponent(folder_id),
372
581
  data: {
373
582
  name
374
583
  },
@@ -380,7 +589,7 @@ function deleteFolder({
380
589
  }, headers) {
381
590
  return axiosInstance({
382
591
  method: "delete",
383
- url: "/folders/" + folder_id,
592
+ url: "/folders/" + encodeURIComponent(folder_id),
384
593
  headers
385
594
  });
386
595
  }
@@ -389,7 +598,7 @@ function listFolderAccesses({
389
598
  }, headers) {
390
599
  return axiosInstance({
391
600
  method: "get",
392
- url: "/folders/" + folder_id + "/access",
601
+ url: "/folders/" + encodeURIComponent(folder_id) + "/access",
393
602
  headers
394
603
  });
395
604
  }
@@ -401,7 +610,7 @@ function grantMemberAccessToFolder({
401
610
  }, headers) {
402
611
  return axiosInstance({
403
612
  method: "put",
404
- url: "/folders/" + folder_id + "/access/" + member_type + "/" + member_id,
613
+ url: "/folders/" + encodeURIComponent(folder_id) + "/access/" + encodeURIComponent(member_type) + "/" + encodeURIComponent(member_id),
405
614
  data: {
406
615
  access
407
616
  },
@@ -415,7 +624,7 @@ function revokeMemberAccessToFolder({
415
624
  }, headers) {
416
625
  return axiosInstance({
417
626
  method: "delete",
418
- url: "/folders/" + folder_id + "/access/" + member_type + "/" + member_id,
627
+ url: "/folders/" + encodeURIComponent(folder_id) + "/access/" + encodeURIComponent(member_type) + "/" + encodeURIComponent(member_id),
419
628
  headers
420
629
  });
421
630
  }
@@ -426,7 +635,7 @@ function createSubfolder({
426
635
  }, headers) {
427
636
  return axiosInstance({
428
637
  method: "post",
429
- url: "/folders/" + folder_id + "/folders",
638
+ url: "/folders/" + encodeURIComponent(folder_id) + "/folders",
430
639
  data: {
431
640
  name,
432
641
  subfolders
@@ -439,22 +648,36 @@ function listFolderSubFolders({
439
648
  }, headers) {
440
649
  return axiosInstance({
441
650
  method: "get",
442
- url: "/folders/" + folder_id + "/folders",
651
+ url: "/folders/" + encodeURIComponent(folder_id) + "/folders",
443
652
  headers
444
653
  });
445
654
  }
446
655
  function uploadSourceFiles({
447
656
  folder_id,
448
- body
657
+ files,
658
+ task_name,
659
+ conversion_pipeline = "auto-detect",
660
+ source_files,
661
+ options
449
662
  }, onUploadProgress, headers) {
450
663
  return axiosInstance({
451
664
  method: "post",
452
- url: "/folders/" + folder_id + "/source-files",
453
- data: body,
665
+ url: "/folders/" + encodeURIComponent(folder_id) + "/source-files",
666
+ data: multipartBody(
667
+ {
668
+ task_name,
669
+ conversion_pipeline,
670
+ source_files,
671
+ options
672
+ },
673
+ {
674
+ files
675
+ }
676
+ ),
454
677
  onUploadProgress,
455
678
  headers: {
456
679
  "Content-Type": "multipart/form-data",
457
- ...headers?.toJSON()
680
+ ...plainHeaders(headers)
458
681
  }
459
682
  });
460
683
  }
@@ -466,7 +689,7 @@ function getSourceFilesInFolder({
466
689
  }, headers) {
467
690
  return axiosInstance({
468
691
  method: "get",
469
- url: "/folders/" + folder_id + "/source-files",
692
+ url: "/folders/" + encodeURIComponent(folder_id) + "/source-files",
470
693
  params: {
471
694
  offset,
472
695
  limit,
@@ -484,7 +707,7 @@ function moveSourceFiles({
484
707
  }, headers) {
485
708
  return axiosInstance({
486
709
  method: "put",
487
- url: "/folders/" + folder_id + "/source-files",
710
+ url: "/folders/" + encodeURIComponent(folder_id) + "/source-files",
488
711
  data: source_file_ids,
489
712
  headers
490
713
  });
@@ -496,7 +719,7 @@ function getUploadTasksInFolder({
496
719
  }, headers) {
497
720
  return axiosInstance({
498
721
  method: "get",
499
- url: "/folders/" + folder_id + "/upload-tasks",
722
+ url: "/folders/" + encodeURIComponent(folder_id) + "/upload-tasks",
500
723
  params: {
501
724
  offset,
502
725
  limit
@@ -513,7 +736,7 @@ function getFolderAssets({
513
736
  }, headers) {
514
737
  return axiosInstance({
515
738
  method: "get",
516
- url: "/folders/" + folder_id + "/assets",
739
+ url: "/folders/" + encodeURIComponent(folder_id) + "/assets",
517
740
  params: {
518
741
  offset,
519
742
  limit,
@@ -522,9 +745,7 @@ function getFolderAssets({
522
745
  },
523
746
  headers
524
747
  }).then((response) => {
525
- response.headers["x-assets-count"] = JSON.parse(
526
- response.headers["x-assets-count"]
527
- );
748
+ response.headers["x-assets-count"] = JSON.parse(response.headers["x-assets-count"]);
528
749
  return response;
529
750
  });
530
751
  }
@@ -534,7 +755,7 @@ function createAsset({
534
755
  }, headers) {
535
756
  return axiosInstance({
536
757
  method: "post",
537
- url: "/folders/" + folder_id + "/assets",
758
+ url: "/folders/" + encodeURIComponent(folder_id) + "/assets",
538
759
  data: asset_creation_options,
539
760
  headers
540
761
  });
@@ -545,21 +766,21 @@ function moveAssets({
545
766
  }, headers) {
546
767
  return axiosInstance({
547
768
  method: "put",
548
- url: "/folders/" + folder_id + "/assets",
769
+ url: "/folders/" + encodeURIComponent(folder_id) + "/assets",
549
770
  data: asset_ids,
550
771
  headers
551
772
  });
552
773
  }
553
774
  function createMaterial({
554
775
  folder_id,
555
- dataJson,
556
- isDoubleSided,
776
+ dataJson = {},
777
+ isDoubleSided = false,
557
778
  name,
558
- shaderRef
779
+ shaderRef = "00000000-0000-0000-0000-000000000000"
559
780
  }, headers) {
560
781
  return axiosInstance({
561
782
  method: "post",
562
- url: "/folders/" + folder_id + "/assets/materials",
783
+ url: "/folders/" + encodeURIComponent(folder_id) + "/assets/materials",
563
784
  data: {
564
785
  dataJson,
565
786
  isDoubleSided,
@@ -571,12 +792,19 @@ function createMaterial({
571
792
  }
572
793
  function createCubemap({
573
794
  folder_id,
574
- faces,
795
+ faces = [
796
+ "00000000-0000-0000-0000-000000000000",
797
+ "00000000-0000-0000-0000-000000000000",
798
+ "00000000-0000-0000-0000-000000000000",
799
+ "00000000-0000-0000-0000-000000000000",
800
+ "00000000-0000-0000-0000-000000000000",
801
+ "00000000-0000-0000-0000-000000000000"
802
+ ],
575
803
  name
576
804
  }, headers) {
577
805
  return axiosInstance({
578
806
  method: "post",
579
- url: "/folders/" + folder_id + "/assets/cubemaps",
807
+ url: "/folders/" + encodeURIComponent(folder_id) + "/assets/cubemaps",
580
808
  data: {
581
809
  faces,
582
810
  name
@@ -589,7 +817,83 @@ function getSessionsInFolder({
589
817
  }, headers) {
590
818
  return axiosInstance({
591
819
  method: "get",
592
- url: "/folders/" + folder_id + "/sessions",
820
+ url: "/folders/" + encodeURIComponent(folder_id) + "/sessions",
821
+ headers
822
+ });
823
+ }
824
+ function createDuplicationRequest({
825
+ assets,
826
+ options
827
+ }, headers) {
828
+ return axiosInstance({
829
+ method: "post",
830
+ url: "/duplication-requests",
831
+ data: {
832
+ assets,
833
+ options
834
+ },
835
+ headers
836
+ });
837
+ }
838
+ function listDuplicationRequests({
839
+ offset = 0,
840
+ limit = 10,
841
+ states,
842
+ mine = false
843
+ }, headers) {
844
+ return axiosInstance({
845
+ method: "get",
846
+ url: "/duplication-requests",
847
+ params: {
848
+ offset,
849
+ limit,
850
+ states,
851
+ mine
852
+ },
853
+ headers
854
+ });
855
+ }
856
+ function getDuplicationRequest({
857
+ duplication_request_id
858
+ }, headers) {
859
+ return axiosInstance({
860
+ method: "get",
861
+ url: "/duplication-requests/" + encodeURIComponent(duplication_request_id),
862
+ headers
863
+ });
864
+ }
865
+ function updateDuplicationRequest({
866
+ duplication_request_id,
867
+ assets,
868
+ folders_by_type,
869
+ dependencies_folders
870
+ }, headers) {
871
+ return axiosInstance({
872
+ method: "patch",
873
+ url: "/duplication-requests/" + encodeURIComponent(duplication_request_id),
874
+ data: {
875
+ assets,
876
+ folders_by_type,
877
+ dependencies_folders
878
+ },
879
+ headers
880
+ });
881
+ }
882
+ function discardDuplicationRequest({
883
+ duplication_request_id
884
+ }, headers) {
885
+ return axiosInstance({
886
+ method: "delete",
887
+ url: "/duplication-requests/" + encodeURIComponent(duplication_request_id),
888
+ headers
889
+ });
890
+ }
891
+ function confirmDuplicationRequest({
892
+ duplication_request_id
893
+ }, headers) {
894
+ return axiosInstance({
895
+ method: "post",
896
+ url: "/duplication-requests/" + encodeURIComponent(duplication_request_id) + "/confirm",
593
897
  headers
594
898
  });
595
899
  }
@@ -633,22 +937,12 @@ function getSupportedSourceFileFormats(headers) {
633
937
  headers
634
938
  });
635
939
  }
636
- function downloadSourceFile({
637
- source_file_id
638
- }, headers, responseType) {
639
- return axiosInstance({
640
- method: "get",
641
- url: "/source-files/" + source_file_id,
642
- headers,
643
- responseType: responseType || "arraybuffer"
644
- });
645
- }
646
940
  function getSourceFileDetails({
647
941
  source_file_id
648
942
  }, headers) {
649
943
  return axiosInstance({
650
944
  method: "get",
651
- url: "/source-files/" + source_file_id + "/details",
945
+ url: "/source-files/" + encodeURIComponent(source_file_id) + "/details",
652
946
  headers
653
947
  });
654
948
  }
@@ -658,7 +952,7 @@ function updateSourceFileDetails({
658
952
  }, headers) {
659
953
  return axiosInstance({
660
954
  method: "patch",
661
- url: "/source-files/" + source_file_id + "/details",
955
+ url: "/source-files/" + encodeURIComponent(source_file_id) + "/details",
662
956
  data: {
663
957
  name
664
958
  },
@@ -670,7 +964,7 @@ function getSourceFileAssets({
670
964
  }, headers) {
671
965
  return axiosInstance({
672
966
  method: "get",
673
- url: "/source-files/" + source_file_id + "/assets",
967
+ url: "/source-files/" + encodeURIComponent(source_file_id) + "/assets",
674
968
  headers
675
969
  });
676
970
  }
@@ -693,7 +987,7 @@ function getUploadTask({
693
987
  }, headers) {
694
988
  return axiosInstance({
695
989
  method: "get",
696
- url: "/upload-tasks/" + upload_task_id,
990
+ url: "/upload-tasks/" + encodeURIComponent(upload_task_id),
697
991
  headers
698
992
  });
699
993
  }
@@ -703,7 +997,7 @@ function getConversionTaskMetadata({
703
997
  }, headers, responseType) {
704
998
  return axiosInstance({
705
999
  method: "get",
706
- url: "/conversion_tasks/" + conversion_task_id + "/metadata/" + filename,
1000
+ url: "/conversion_tasks/" + encodeURIComponent(conversion_task_id) + "/metadata/" + encodeURIComponent(filename),
707
1001
  headers,
708
1002
  responseType: responseType || "arraybuffer"
709
1003
  });
@@ -733,7 +1027,7 @@ function getPipeline({
733
1027
  }, headers) {
734
1028
  return axiosInstance({
735
1029
  method: "get",
736
- url: "/pipelines/" + pipeline_id,
1030
+ url: "/pipelines/" + encodeURIComponent(pipeline_id),
737
1031
  headers
738
1032
  });
739
1033
  }
@@ -769,7 +1063,7 @@ function deleteAsset({
769
1063
  }, headers) {
770
1064
  return axiosInstance({
771
1065
  method: "delete",
772
- url: "/assets/" + asset_container + "/" + asset_id,
1066
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id),
773
1067
  headers
774
1068
  });
775
1069
  }
@@ -779,7 +1073,7 @@ function getAssetSourceFile({
779
1073
  }, headers) {
780
1074
  return axiosInstance({
781
1075
  method: "get",
782
- url: "/assets/" + asset_container + "/" + asset_id + "/source-file",
1076
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/source-file",
783
1077
  headers
784
1078
  });
785
1079
  }
@@ -789,7 +1083,7 @@ function getAssetDetails({
789
1083
  }, headers) {
790
1084
  return axiosInstance({
791
1085
  method: "get",
792
- url: "/assets/" + asset_container + "/" + asset_id + "/details",
1086
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/details",
793
1087
  headers
794
1088
  });
795
1089
  }
@@ -799,7 +1093,7 @@ function getAssetFolder({
799
1093
  }, headers) {
800
1094
  return axiosInstance({
801
1095
  method: "get",
802
- url: "/assets/" + asset_container + "/" + asset_id + "/folder",
1096
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/folder",
803
1097
  headers
804
1098
  });
805
1099
  }
@@ -814,7 +1108,7 @@ function getAssetDependencies({
814
1108
  }, headers) {
815
1109
  return axiosInstance({
816
1110
  method: "get",
817
- url: "/assets/" + asset_container + "/" + asset_id + "/dependencies",
1111
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/dependencies",
818
1112
  params: {
819
1113
  offset,
820
1114
  limit,
@@ -834,7 +1128,7 @@ function getAssetReferences({
834
1128
  }, headers) {
835
1129
  return axiosInstance({
836
1130
  method: "get",
837
- url: "/assets/" + asset_container + "/" + asset_id + "/references",
1131
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/references",
838
1132
  params: {
839
1133
  offset,
840
1134
  limit,
@@ -849,7 +1143,7 @@ function getAssetDescription({
849
1143
  }, headers) {
850
1144
  return axiosInstance({
851
1145
  method: "get",
852
- url: "/assets/" + asset_container + "/" + asset_id + "/description",
1146
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/description",
853
1147
  headers
854
1148
  });
855
1149
  }
@@ -860,7 +1154,7 @@ function updateAssetDescription({
860
1154
  }, headers) {
861
1155
  return axiosInstance({
862
1156
  method: "put",
863
- url: "/assets/" + asset_container + "/" + asset_id + "/description",
1157
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/description",
864
1158
  data: asset_description,
865
1159
  headers
866
1160
  });
@@ -872,7 +1166,7 @@ function renameAsset({
872
1166
  }, headers) {
873
1167
  return axiosInstance({
874
1168
  method: "patch",
875
- url: "/assets/" + asset_container + "/" + asset_id + "/description",
1169
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/description",
876
1170
  data: {
877
1171
  name
878
1172
  },
@@ -886,7 +1180,7 @@ function getAssetPayload({
886
1180
  }, headers, responseType) {
887
1181
  return axiosInstance({
888
1182
  method: "get",
889
- url: "/assets/" + asset_container_with_payload + "/" + asset_id + "/payload",
1183
+ url: "/assets/" + encodeURIComponent(asset_container_with_payload) + "/" + encodeURIComponent(asset_id) + "/payload",
890
1184
  params: {
891
1185
  sub_resource
892
1186
  },
@@ -900,7 +1194,7 @@ function getAssetGraph({
900
1194
  }, headers) {
901
1195
  return axiosInstance({
902
1196
  method: "get",
903
- url: "/assets/" + asset_container_with_graph + "/" + asset_id + "/graph",
1197
+ url: "/assets/" + encodeURIComponent(asset_container_with_graph) + "/" + encodeURIComponent(asset_id) + "/graph",
904
1198
  headers
905
1199
  });
906
1200
  }
@@ -911,7 +1205,7 @@ function updateAssetGraph({
911
1205
  }, headers) {
912
1206
  return axiosInstance({
913
1207
  method: "put",
914
- url: "/assets/" + asset_container_with_graph + "/" + asset_id + "/graph",
1208
+ url: "/assets/" + encodeURIComponent(asset_container_with_graph) + "/" + encodeURIComponent(asset_id) + "/graph",
915
1209
  data: asset_graph,
916
1210
  headers
917
1211
  });
@@ -922,7 +1216,7 @@ function getAssetHistory({
922
1216
  }, headers) {
923
1217
  return axiosInstance({
924
1218
  method: "get",
925
- url: "/assets/" + asset_container + "/" + asset_id + "/history",
1219
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/history",
926
1220
  headers
927
1221
  });
928
1222
  }
@@ -932,7 +1226,7 @@ function getAssetMeta({
932
1226
  }, headers) {
933
1227
  return axiosInstance({
934
1228
  method: "get",
935
- url: "/assets/" + asset_container + "/" + asset_id + "/meta",
1229
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/meta",
936
1230
  headers
937
1231
  });
938
1232
  }
@@ -942,7 +1236,7 @@ function getAssetCode({
942
1236
  }, headers) {
943
1237
  return axiosInstance({
944
1238
  method: "get",
945
- url: "/assets/" + asset_container_with_code + "/" + asset_id + "/code",
1239
+ url: "/assets/" + encodeURIComponent(asset_container_with_code) + "/" + encodeURIComponent(asset_id) + "/code",
946
1240
  headers,
947
1241
  responseType: "text"
948
1242
  });
@@ -955,7 +1249,7 @@ function getAssetThumbnail({
955
1249
  }, headers, responseType) {
956
1250
  return axiosInstance({
957
1251
  method: "get",
958
- url: "/assets/" + asset_container + "/" + asset_id + "/thumbnail",
1252
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/thumbnail",
959
1253
  params: {
960
1254
  size,
961
1255
  default_url
@@ -971,32 +1265,22 @@ function setAssetThumbnail({
971
1265
  }, contentType, headers) {
972
1266
  return axiosInstance({
973
1267
  method: "put",
974
- url: "/assets/" + asset_container + "/" + asset_id + "/thumbnail",
1268
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/thumbnail",
975
1269
  data: body,
976
1270
  maxRedirects: 0,
977
1271
  headers: {
978
1272
  "Content-Type": contentType,
979
- ...headers?.toJSON()
1273
+ ...plainHeaders(headers)
980
1274
  }
981
1275
  });
982
1276
  }
983
- function getAssetCustomTypes({
984
- asset_container_with_custom_types,
985
- asset_id
986
- }, headers) {
987
- return axiosInstance({
988
- method: "get",
989
- url: "/assets/" + asset_container_with_custom_types + "/" + asset_id + "/custom-types",
990
- headers
991
- });
992
- }
993
1277
  function packageAsset({
994
1278
  asset_container,
995
1279
  asset_id
996
1280
  }, headers, responseType) {
997
1281
  return axiosInstance({
998
1282
  method: "get",
999
- url: "/assets/" + asset_container + "/" + asset_id + "/package",
1283
+ url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/package",
1000
1284
  headers,
1001
1285
  responseType: responseType || "arraybuffer"
1002
1286
  });
@@ -1007,16 +1291,15 @@ function exportAsset({
1007
1291
  format,
1008
1292
  scale = 1,
1009
1293
  sub_mesh_index
1010
- }, headers, responseType) {
1294
+ }, headers) {
1011
1295
  return axiosInstance({
1012
1296
  method: "get",
1013
- url: "/assets/" + asset_container_exportable + "/" + asset_id + "/exports/" + format,
1297
+ url: "/assets/" + encodeURIComponent(asset_container_exportable) + "/" + encodeURIComponent(asset_id) + "/exports/" + encodeURIComponent(format),
1014
1298
  params: {
1015
1299
  scale,
1016
1300
  sub_mesh_index
1017
1301
  },
1018
- headers,
1019
- responseType: responseType || "arraybuffer"
1302
+ headers
1020
1303
  });
1021
1304
  }
1022
1305
  function getSceneSessions({
@@ -1024,7 +1307,7 @@ function getSceneSessions({
1024
1307
  }, headers) {
1025
1308
  return axiosInstance({
1026
1309
  method: "get",
1027
- url: "/assets/scenes/" + scene_id + "/sessions",
1310
+ url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/sessions",
1028
1311
  headers
1029
1312
  });
1030
1313
  }
@@ -1033,18 +1316,116 @@ function getSceneAABB({
1033
1316
  }, headers) {
1034
1317
  return axiosInstance({
1035
1318
  method: "get",
1036
- url: "/assets/scenes/" + scene_id + "/aabb",
1319
+ url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/aabb",
1037
1320
  headers
1038
1321
  });
1039
1322
  }
1040
1323
  function createEntity({
1041
1324
  scene_id,
1042
- entity_components
1325
+ animation_controller,
1326
+ animation_sequence_controller,
1327
+ bone,
1328
+ box_geometry,
1329
+ camera,
1330
+ capsule_geometry,
1331
+ character_controller,
1332
+ collision_geometry_ref,
1333
+ constraint,
1334
+ constraint_actuator,
1335
+ culling_geometry,
1336
+ custom_lens,
1337
+ cylinder_geometry,
1338
+ debug_name,
1339
+ decal_projector,
1340
+ environment,
1341
+ joint,
1342
+ label,
1343
+ lineage,
1344
+ local_aabb,
1345
+ local_transform,
1346
+ material,
1347
+ material_ref,
1348
+ measure,
1349
+ mesh_ref,
1350
+ morph_targets,
1351
+ orthographic_lens,
1352
+ overrider,
1353
+ perspective_lens,
1354
+ physics_material,
1355
+ plane_geometry,
1356
+ point_cloud_ref,
1357
+ point_light,
1358
+ reflection_probe,
1359
+ rigid_body,
1360
+ scene_ref,
1361
+ script_element,
1362
+ script_map,
1363
+ shadow_caster,
1364
+ skeleton_ref,
1365
+ sound_ref,
1366
+ sphere_geometry,
1367
+ spline,
1368
+ spot_light,
1369
+ tags,
1370
+ vehicle_controller,
1371
+ volume_filter,
1372
+ volume_material_ref,
1373
+ volume_ref
1043
1374
  }, headers) {
1044
1375
  return axiosInstance({
1045
1376
  method: "post",
1046
- url: "/assets/scenes/" + scene_id + "/entities",
1047
- data: entity_components,
1377
+ url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/entities",
1378
+ data: {
1379
+ animation_controller,
1380
+ animation_sequence_controller,
1381
+ bone,
1382
+ box_geometry,
1383
+ camera,
1384
+ capsule_geometry,
1385
+ character_controller,
1386
+ collision_geometry_ref,
1387
+ constraint,
1388
+ constraint_actuator,
1389
+ culling_geometry,
1390
+ custom_lens,
1391
+ cylinder_geometry,
1392
+ debug_name,
1393
+ decal_projector,
1394
+ environment,
1395
+ joint,
1396
+ label,
1397
+ lineage,
1398
+ local_aabb,
1399
+ local_transform,
1400
+ material,
1401
+ material_ref,
1402
+ measure,
1403
+ mesh_ref,
1404
+ morph_targets,
1405
+ orthographic_lens,
1406
+ overrider,
1407
+ perspective_lens,
1408
+ physics_material,
1409
+ plane_geometry,
1410
+ point_cloud_ref,
1411
+ point_light,
1412
+ reflection_probe,
1413
+ rigid_body,
1414
+ scene_ref,
1415
+ script_element,
1416
+ script_map,
1417
+ shadow_caster,
1418
+ skeleton_ref,
1419
+ sound_ref,
1420
+ sphere_geometry,
1421
+ spline,
1422
+ spot_light,
1423
+ tags,
1424
+ vehicle_controller,
1425
+ volume_filter,
1426
+ volume_material_ref,
1427
+ volume_ref
1428
+ },
1048
1429
  headers
1049
1430
  });
1050
1431
  }
@@ -1055,7 +1436,7 @@ function getEntity({
1055
1436
  }, headers) {
1056
1437
  return axiosInstance({
1057
1438
  method: "get",
1058
- url: "/assets/scenes/" + scene_id + "/entities/" + entity_id,
1439
+ url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/entities/" + encodeURIComponent(entity_id),
1059
1440
  params: {
1060
1441
  compute_global_transform
1061
1442
  },
@@ -1065,12 +1446,110 @@ function getEntity({
1065
1446
  function updateEntity({
1066
1447
  scene_id,
1067
1448
  entity_id,
1068
- entity_components
1449
+ animation_controller,
1450
+ animation_sequence_controller,
1451
+ bone,
1452
+ box_geometry,
1453
+ camera,
1454
+ capsule_geometry,
1455
+ character_controller,
1456
+ collision_geometry_ref,
1457
+ constraint,
1458
+ constraint_actuator,
1459
+ culling_geometry,
1460
+ custom_lens,
1461
+ cylinder_geometry,
1462
+ debug_name,
1463
+ decal_projector,
1464
+ environment,
1465
+ joint,
1466
+ label,
1467
+ lineage,
1468
+ local_aabb,
1469
+ local_transform,
1470
+ material,
1471
+ material_ref,
1472
+ measure,
1473
+ mesh_ref,
1474
+ morph_targets,
1475
+ orthographic_lens,
1476
+ overrider,
1477
+ perspective_lens,
1478
+ physics_material,
1479
+ plane_geometry,
1480
+ point_cloud_ref,
1481
+ point_light,
1482
+ reflection_probe,
1483
+ rigid_body,
1484
+ scene_ref,
1485
+ script_element,
1486
+ script_map,
1487
+ shadow_caster,
1488
+ skeleton_ref,
1489
+ sound_ref,
1490
+ sphere_geometry,
1491
+ spline,
1492
+ spot_light,
1493
+ tags,
1494
+ vehicle_controller,
1495
+ volume_filter,
1496
+ volume_material_ref,
1497
+ volume_ref
1069
1498
  }, headers) {
1070
1499
  return axiosInstance({
1071
1500
  method: "patch",
1072
- url: "/assets/scenes/" + scene_id + "/entities/" + entity_id,
1073
- data: entity_components,
1501
+ url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/entities/" + encodeURIComponent(entity_id),
1502
+ data: {
1503
+ animation_controller,
1504
+ animation_sequence_controller,
1505
+ bone,
1506
+ box_geometry,
1507
+ camera,
1508
+ capsule_geometry,
1509
+ character_controller,
1510
+ collision_geometry_ref,
1511
+ constraint,
1512
+ constraint_actuator,
1513
+ culling_geometry,
1514
+ custom_lens,
1515
+ cylinder_geometry,
1516
+ debug_name,
1517
+ decal_projector,
1518
+ environment,
1519
+ joint,
1520
+ label,
1521
+ lineage,
1522
+ local_aabb,
1523
+ local_transform,
1524
+ material,
1525
+ material_ref,
1526
+ measure,
1527
+ mesh_ref,
1528
+ morph_targets,
1529
+ orthographic_lens,
1530
+ overrider,
1531
+ perspective_lens,
1532
+ physics_material,
1533
+ plane_geometry,
1534
+ point_cloud_ref,
1535
+ point_light,
1536
+ reflection_probe,
1537
+ rigid_body,
1538
+ scene_ref,
1539
+ script_element,
1540
+ script_map,
1541
+ shadow_caster,
1542
+ skeleton_ref,
1543
+ sound_ref,
1544
+ sphere_geometry,
1545
+ spline,
1546
+ spot_light,
1547
+ tags,
1548
+ vehicle_controller,
1549
+ volume_filter,
1550
+ volume_material_ref,
1551
+ volume_ref
1552
+ },
1074
1553
  headers
1075
1554
  });
1076
1555
  }
@@ -1080,7 +1559,7 @@ function deleteEntity({
1080
1559
  }, headers) {
1081
1560
  return axiosInstance({
1082
1561
  method: "delete",
1083
- url: "/assets/scenes/" + scene_id + "/entities/" + entity_id,
1562
+ url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/entities/" + encodeURIComponent(entity_id),
1084
1563
  headers
1085
1564
  });
1086
1565
  }
@@ -1089,7 +1568,7 @@ function getSceneSettings({
1089
1568
  }, headers) {
1090
1569
  return axiosInstance({
1091
1570
  method: "get",
1092
- url: "/assets/scenes/" + scene_id + "/settings",
1571
+ url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/settings",
1093
1572
  headers
1094
1573
  });
1095
1574
  }
@@ -1099,7 +1578,7 @@ function updateSceneSettings({
1099
1578
  }, headers) {
1100
1579
  return axiosInstance({
1101
1580
  method: "patch",
1102
- url: "/assets/scenes/" + scene_id + "/settings",
1581
+ url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/settings",
1103
1582
  data: body,
1104
1583
  headers
1105
1584
  });
@@ -1139,7 +1618,7 @@ function getSession({
1139
1618
  }, headers) {
1140
1619
  return axiosInstance({
1141
1620
  method: "get",
1142
- url: "/sessions/" + session_id,
1621
+ url: "/sessions/" + encodeURIComponent(session_id),
1143
1622
  headers
1144
1623
  });
1145
1624
  }
@@ -1148,7 +1627,7 @@ function killSession({
1148
1627
  }, headers) {
1149
1628
  return axiosInstance({
1150
1629
  method: "delete",
1151
- url: "/sessions/" + session_id,
1630
+ url: "/sessions/" + encodeURIComponent(session_id),
1152
1631
  headers
1153
1632
  });
1154
1633
  }
@@ -1158,10 +1637,10 @@ function joinSession({
1158
1637
  }, headers) {
1159
1638
  return axiosInstance({
1160
1639
  method: "post",
1161
- url: "/sessions/" + session_id + "/clients",
1162
- data: {
1640
+ url: "/sessions/" + encodeURIComponent(session_id) + "/clients",
1641
+ data: optionalBody({
1163
1642
  is_headless
1164
- },
1643
+ }),
1165
1644
  headers
1166
1645
  });
1167
1646
  }
@@ -1171,7 +1650,7 @@ function getClient({
1171
1650
  }, headers) {
1172
1651
  return axiosInstance({
1173
1652
  method: "get",
1174
- url: "/sessions/" + session_id + "/clients/" + client_id,
1653
+ url: "/sessions/" + encodeURIComponent(session_id) + "/clients/" + encodeURIComponent(client_id),
1175
1654
  headers
1176
1655
  });
1177
1656
  }
@@ -1181,7 +1660,7 @@ function kickClientFromSession({
1181
1660
  }, headers) {
1182
1661
  return axiosInstance({
1183
1662
  method: "delete",
1184
- url: "/sessions/" + session_id + "/clients/" + client_id,
1663
+ url: "/sessions/" + encodeURIComponent(session_id) + "/clients/" + encodeURIComponent(client_id),
1185
1664
  headers
1186
1665
  });
1187
1666
  }
@@ -1197,7 +1676,7 @@ function generateGuestToken({
1197
1676
  }, headers) {
1198
1677
  return axiosInstance({
1199
1678
  method: "post",
1200
- url: "/sessions/" + session_id + "/guests",
1679
+ url: "/sessions/" + encodeURIComponent(session_id) + "/guests",
1201
1680
  headers
1202
1681
  });
1203
1682
  }
@@ -1284,10 +1763,30 @@ installInterceptors();
1284
1763
  // Annotate the CommonJS export names for ESM import in node:
1285
1764
  0 && (module.exports = {
1286
1765
  ApiError,
1766
+ AssetSourceFileNotFound,
1767
+ ConversionTaskNotFound,
1768
+ EnvironmentMismatch,
1769
+ InsufficientPermissions,
1770
+ InsufficientSecurityScope,
1771
+ InvalidApiKey,
1772
+ InvalidAuthorization,
1773
+ InvalidGuestToken,
1774
+ InvalidMaterial,
1775
+ InvalidRequest,
1776
+ InvalidTokenTtl,
1777
+ MissingAuthorizationHeader,
1778
+ NoFileUploaded,
1779
+ ServiceErrorResponse,
1780
+ Unauthorized,
1287
1781
  UnexpectedServiceError,
1782
+ UploadAborted,
1783
+ UploadTaskNotFound,
1784
+ UploadedPayloadTooLarge,
1288
1785
  axiosInstance,
1786
+ confirmDuplicationRequest,
1289
1787
  createAsset,
1290
1788
  createCubemap,
1789
+ createDuplicationRequest,
1291
1790
  createEntity,
1292
1791
  createFolder,
1293
1792
  createGroup,
@@ -1301,12 +1800,12 @@ installInterceptors();
1301
1800
  deleteGroup,
1302
1801
  deleteSourceFiles,
1303
1802
  deleteUser,
1304
- downloadSourceFile,
1803
+ discardDuplicationRequest,
1804
+ errorOf,
1305
1805
  exportAsset,
1306
1806
  generateGuestToken,
1307
1807
  generateUserToken,
1308
1808
  getAssetCode,
1309
- getAssetCustomTypes,
1310
1809
  getAssetDependencies,
1311
1810
  getAssetDescription,
1312
1811
  getAssetDetails,
@@ -1321,6 +1820,7 @@ installInterceptors();
1321
1820
  getClient,
1322
1821
  getConversionTaskMetadata,
1323
1822
  getCurrentUser,
1823
+ getDuplicationRequest,
1324
1824
  getEntity,
1325
1825
  getFolderAssets,
1326
1826
  getFolderInfo,
@@ -1349,6 +1849,7 @@ installInterceptors();
1349
1849
  kickClientFromSession,
1350
1850
  killSession,
1351
1851
  listAssets,
1852
+ listDuplicationRequests,
1352
1853
  listFolderAccesses,
1353
1854
  listFolderSubFolders,
1354
1855
  listFolders,
@@ -1369,6 +1870,7 @@ installInterceptors();
1369
1870
  setUserToken,
1370
1871
  updateAssetDescription,
1371
1872
  updateAssetGraph,
1873
+ updateDuplicationRequest,
1372
1874
  updateEntity,
1373
1875
  updateFolder,
1374
1876
  updateGroupDescription,