@3dverse/api 0.8.1 → 0.8.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/index.mjs CHANGED
@@ -12,96 +12,104 @@ function setBaseURL(baseURL) {
12
12
  function listUsers({
13
13
  offset = 0,
14
14
  limit = 10
15
- }) {
15
+ }, headers) {
16
16
  return axiosInstance({
17
17
  method: "get",
18
18
  url: "/users",
19
19
  params: {
20
20
  offset,
21
21
  limit
22
- }
22
+ },
23
+ headers
23
24
  });
24
25
  }
25
26
  function registerUser({
26
27
  username
27
- }) {
28
+ }, headers) {
28
29
  return axiosInstance({
29
30
  method: "post",
30
31
  url: "/users",
31
32
  data: {
32
33
  username
33
- }
34
+ },
35
+ headers
34
36
  });
35
37
  }
36
38
  function getUser({
37
39
  user_id
38
- }) {
40
+ }, headers) {
39
41
  return axiosInstance({
40
42
  method: "get",
41
- url: "/users/" + user_id
43
+ url: "/users/" + user_id,
44
+ headers
42
45
  });
43
46
  }
44
47
  function updateUser({
45
48
  user_id,
46
49
  username
47
- }) {
50
+ }, headers) {
48
51
  return axiosInstance({
49
52
  method: "patch",
50
53
  url: "/users/" + user_id,
51
54
  data: {
52
55
  username
53
- }
56
+ },
57
+ headers
54
58
  });
55
59
  }
56
60
  function deleteUser({
57
61
  user_id
58
- }) {
62
+ }, headers) {
59
63
  return axiosInstance({
60
64
  method: "delete",
61
- url: "/users/" + user_id
65
+ url: "/users/" + user_id,
66
+ headers
62
67
  });
63
68
  }
64
69
  function generateUserToken({
65
70
  user_id,
66
71
  scope,
67
72
  ttl = "1h"
68
- }) {
73
+ }, headers) {
69
74
  return axiosInstance({
70
75
  method: "post",
71
76
  url: "/users/" + user_id + "/tokens",
72
77
  data: {
73
78
  scope,
74
79
  ttl
75
- }
80
+ },
81
+ headers
76
82
  });
77
83
  }
78
84
  function getUserGroups({
79
85
  user_id
80
- }) {
86
+ }, headers) {
81
87
  return axiosInstance({
82
88
  method: "get",
83
- url: "/users/" + user_id + "/groups"
89
+ url: "/users/" + user_id + "/groups",
90
+ headers
84
91
  });
85
92
  }
86
93
  function getUserUploadTasks({
87
94
  user_id,
88
95
  offset = 0,
89
96
  limit = 10
90
- }) {
97
+ }, headers) {
91
98
  return axiosInstance({
92
99
  method: "get",
93
100
  url: "/users/" + user_id + "/upload-tasks",
94
101
  params: {
95
102
  offset,
96
103
  limit
97
- }
104
+ },
105
+ headers
98
106
  });
99
107
  }
100
108
  function createGroup({
101
109
  name,
102
110
  description,
103
111
  members
104
- }) {
112
+ }, headers) {
105
113
  return axiosInstance({
106
114
  method: "post",
107
115
  url: "/groups",
@@ -109,37 +117,41 @@ function createGroup({
109
117
  name,
110
118
  description,
111
119
  members
112
- }
120
+ },
121
+ headers
113
122
  });
114
123
  }
115
124
  function getGroup({
116
125
  group_id
117
- }) {
126
+ }, headers) {
118
127
  return axiosInstance({
119
128
  method: "get",
120
- url: "/groups/" + group_id
129
+ url: "/groups/" + group_id,
130
+ headers
121
131
  });
122
132
  }
123
133
  function updateGroupDescription({
124
134
  group_id,
125
135
  name,
126
136
  description
127
- }) {
137
+ }, headers) {
128
138
  return axiosInstance({
129
139
  method: "patch",
130
140
  url: "/groups/" + group_id,
131
141
  data: {
132
142
  name,
133
143
  description
134
- }
144
+ },
145
+ headers
135
146
  });
136
147
  }
137
148
  function deleteGroup({
138
149
  group_id
139
- }) {
150
+ }, headers) {
140
151
  return axiosInstance({
141
152
  method: "delete",
142
- url: "/groups/" + group_id
153
+ url: "/groups/" + group_id,
154
+ headers
143
155
  });
144
156
  }
145
157
  function grantMemberAccessToGroup({
@@ -148,96 +160,105 @@ function grantMemberAccessToGroup({
148
160
  member_id,
149
161
  group_access,
150
162
  folder_access
151
- }) {
163
+ }, headers) {
152
164
  return axiosInstance({
153
165
  method: "put",
154
166
  url: "/groups/" + group_id + "/members/" + member_type + "/" + member_id,
155
167
  data: {
156
168
  group_access,
157
169
  folder_access
158
- }
170
+ },
171
+ headers
159
172
  });
160
173
  }
161
174
  function revokeMemberAccessToGroup({
162
175
  group_id,
163
176
  member_type,
164
177
  member_id
165
- }) {
178
+ }, headers) {
166
179
  return axiosInstance({
167
180
  method: "delete",
168
- url: "/groups/" + group_id + "/members/" + member_type + "/" + member_id
181
+ url: "/groups/" + group_id + "/members/" + member_type + "/" + member_id,
182
+ headers
169
183
  });
170
184
  }
171
185
  function listFolders({
172
186
  offset = 0,
173
187
  limit = 10
174
- }) {
188
+ }, headers) {
175
189
  return axiosInstance({
176
190
  method: "get",
177
191
  url: "/folders",
178
192
  params: {
179
193
  offset,
180
194
  limit
181
- }
195
+ },
196
+ headers
182
197
  });
183
198
  }
184
199
  function createFolder({
185
200
  name,
186
201
  subfolders
187
- }) {
202
+ }, headers) {
188
203
  return axiosInstance({
189
204
  method: "post",
190
205
  url: "/folders",
191
206
  data: {
192
207
  name,
193
208
  subfolders
194
- }
209
+ },
210
+ headers
195
211
  });
196
212
  }
197
213
  function getFolderInfo({
198
214
  folder_id
199
- }) {
215
+ }, headers) {
200
216
  return axiosInstance({
201
217
  method: "get",
202
- url: "/folders/" + folder_id
218
+ url: "/folders/" + folder_id,
219
+ headers
203
220
  });
204
221
  }
205
222
  function moveFolders({
206
223
  folder_id,
207
224
  folder_ids
208
- }) {
225
+ }, headers) {
209
226
  return axiosInstance({
210
227
  method: "put",
211
228
  url: "/folders/" + folder_id,
212
- data: folder_ids
229
+ data: folder_ids,
230
+ headers
213
231
  });
214
232
  }
215
233
  function updateFolder({
216
234
  folder_id,
217
235
  name
218
- }) {
236
+ }, headers) {
219
237
  return axiosInstance({
220
238
  method: "patch",
221
239
  url: "/folders/" + folder_id,
222
240
  data: {
223
241
  name
224
- }
242
+ },
243
+ headers
225
244
  });
226
245
  }
227
246
  function deleteFolder({
228
247
  folder_id
229
- }) {
248
+ }, headers) {
230
249
  return axiosInstance({
231
250
  method: "delete",
232
- url: "/folders/" + folder_id
251
+ url: "/folders/" + folder_id,
252
+ headers
233
253
  });
234
254
  }
235
255
  function listFolderAccesses({
236
256
  folder_id
237
- }) {
257
+ }, headers) {
238
258
  return axiosInstance({
239
259
  method: "get",
240
- url: "/folders/" + folder_id + "/access"
260
+ url: "/folders/" + folder_id + "/access",
261
+ headers
241
262
  });
242
263
  }
243
264
  function grantMemberAccessToFolder({
@@ -245,45 +266,49 @@ function grantMemberAccessToFolder({
245
266
  member_type,
246
267
  member_id,
247
268
  access
248
- }) {
269
+ }, headers) {
249
270
  return axiosInstance({
250
271
  method: "put",
251
272
  url: "/folders/" + folder_id + "/access/" + member_type + "/" + member_id,
252
273
  data: {
253
274
  access
254
- }
275
+ },
276
+ headers
255
277
  });
256
278
  }
257
279
  function revokeMemberAccessToFolder({
258
280
  folder_id,
259
281
  member_type,
260
282
  member_id
261
- }) {
283
+ }, headers) {
262
284
  return axiosInstance({
263
285
  method: "delete",
264
- url: "/folders/" + folder_id + "/access/" + member_type + "/" + member_id
286
+ url: "/folders/" + folder_id + "/access/" + member_type + "/" + member_id,
287
+ headers
265
288
  });
266
289
  }
267
290
  function createSubfolder({
268
291
  folder_id,
269
292
  name,
270
293
  subfolders
271
- }) {
294
+ }, headers) {
272
295
  return axiosInstance({
273
296
  method: "post",
274
297
  url: "/folders/" + folder_id + "/folders",
275
298
  data: {
276
299
  name,
277
300
  subfolders
278
- }
301
+ },
302
+ headers
279
303
  });
280
304
  }
281
305
  function listFolderSubFolders({
282
306
  folder_id
283
- }) {
307
+ }, headers) {
284
308
  return axiosInstance({
285
309
  method: "get",
286
- url: "/folders/" + folder_id + "/folders"
310
+ url: "/folders/" + folder_id + "/folders",
311
+ headers
287
312
  });
288
313
  }
289
314
  function getSourceFilesInFolder({
@@ -291,7 +316,7 @@ function getSourceFilesInFolder({
291
316
  offset = 0,
292
317
  limit = 10,
293
318
  filters
294
- }) {
319
+ }, headers) {
295
320
  return axiosInstance({
296
321
  method: "get",
297
322
  url: "/folders/" + folder_id + "/source-files",
@@ -299,7 +324,8 @@ function getSourceFilesInFolder({
299
324
  offset,
300
325
  limit,
301
326
  filters
302
- }
327
+ },
328
+ headers
303
329
  }).then((response) => {
304
330
  response.headers["x-source-files-count"] = JSON.parse(response.headers["x-source-files-count"]);
305
331
  return response;
@@ -308,25 +334,27 @@ function getSourceFilesInFolder({
308
334
  function moveSourceFiles({
309
335
  folder_id,
310
336
  source_file_ids
311
- }) {
337
+ }, headers) {
312
338
  return axiosInstance({
313
339
  method: "put",
314
340
  url: "/folders/" + folder_id + "/source-files",
315
- data: source_file_ids
341
+ data: source_file_ids,
342
+ headers
316
343
  });
317
344
  }
318
345
  function getUploadTasksInFolder({
319
346
  folder_id,
320
347
  offset = 0,
321
348
  limit = 10
322
- }) {
349
+ }, headers) {
323
350
  return axiosInstance({
324
351
  method: "get",
325
352
  url: "/folders/" + folder_id + "/upload-tasks",
326
353
  params: {
327
354
  offset,
328
355
  limit
329
- }
356
+ },
357
+ headers
330
358
  });
331
359
  }
332
360
  function getFolderAssets({
@@ -335,7 +363,7 @@ function getFolderAssets({
335
363
  limit = 10,
336
364
  filter,
337
365
  recursive = false
338
- }) {
366
+ }, headers) {
339
367
  return axiosInstance({
340
368
  method: "get",
341
369
  url: "/folders/" + folder_id + "/assets",
@@ -344,30 +372,35 @@ function getFolderAssets({
344
372
  limit,
345
373
  filter,
346
374
  recursive
347
- }
375
+ },
376
+ headers
348
377
  }).then((response) => {
349
- response.headers["x-assets-count"] = JSON.parse(response.headers["x-assets-count"]);
378
+ response.headers["x-assets-count"] = JSON.parse(
379
+ response.headers["x-assets-count"]
380
+ );
350
381
  return response;
351
382
  });
352
383
  }
353
384
  function createAsset({
354
385
  folder_id,
355
386
  asset_creation_options
356
- }) {
387
+ }, headers) {
357
388
  return axiosInstance({
358
389
  method: "post",
359
390
  url: "/folders/" + folder_id + "/assets",
360
- data: asset_creation_options
391
+ data: asset_creation_options,
392
+ headers
361
393
  });
362
394
  }
363
395
  function moveAssets({
364
396
  folder_id,
365
397
  asset_ids
366
- }) {
398
+ }, headers) {
367
399
  return axiosInstance({
368
400
  method: "put",
369
401
  url: "/folders/" + folder_id + "/assets",
370
- data: asset_ids
402
+ data: asset_ids,
403
+ headers
371
404
  });
372
405
  }
373
406
  function createMaterial({
@@ -376,7 +409,7 @@ function createMaterial({
376
409
  isDoubleSided,
377
410
  name,
378
411
  shaderRef
379
- }) {
412
+ }, headers) {
380
413
  return axiosInstance({
381
414
  method: "post",
382
415
  url: "/folders/" + folder_id + "/assets/materials",
@@ -385,53 +418,58 @@ function createMaterial({
385
418
  isDoubleSided,
386
419
  name,
387
420
  shaderRef
388
- }
421
+ },
422
+ headers
389
423
  });
390
424
  }
391
425
  function createCubemap({
392
426
  folder_id,
393
427
  faces,
394
428
  name
395
- }) {
429
+ }, headers) {
396
430
  return axiosInstance({
397
431
  method: "post",
398
432
  url: "/folders/" + folder_id + "/assets/cubemaps",
399
433
  data: {
400
434
  faces,
401
435
  name
402
- }
436
+ },
437
+ headers
403
438
  });
404
439
  }
405
440
  function importAssets({
406
441
  folder_id,
407
442
  overwrite = "never",
408
443
  body
409
- }) {
444
+ }, headers) {
410
445
  return axiosInstance({
411
446
  method: "put",
412
447
  url: "/folders/" + folder_id + "/packages",
413
- headers: {
414
- "Content-Type": "application/zip"
415
- },
416
448
  params: {
417
449
  overwrite
418
450
  },
419
- data: body
451
+ data: body,
452
+ maxRedirects: 0,
453
+ headers: {
454
+ "Content-Type": "application/zip",
455
+ ...headers
456
+ }
420
457
  });
421
458
  }
422
459
  function getSessionsInFolder({
423
460
  folder_id
424
- }) {
461
+ }, headers) {
425
462
  return axiosInstance({
426
463
  method: "get",
427
- url: "/folders/" + folder_id + "/sessions"
464
+ url: "/folders/" + folder_id + "/sessions",
465
+ headers
428
466
  });
429
467
  }
430
468
  function listSourceFiles({
431
469
  offset = 0,
432
470
  limit = 10,
433
471
  filters
434
- }) {
472
+ }, headers) {
435
473
  return axiosInstance({
436
474
  method: "get",
437
475
  url: "/source-files",
@@ -439,7 +477,8 @@ function listSourceFiles({
439
477
  offset,
440
478
  limit,
441
479
  filters
442
- }
480
+ },
481
+ headers
443
482
  }).then((response) => {
444
483
  response.headers["x-source-files-count"] = JSON.parse(response.headers["x-source-files-count"]);
445
484
  return response;
@@ -448,79 +487,97 @@ function listSourceFiles({
448
487
  function deleteSourceFiles({
449
488
  source_file_ids,
450
489
  delete_assets = false
451
- }) {
490
+ }, headers) {
452
491
  return axiosInstance({
453
492
  method: "delete",
454
493
  url: "/source-files",
455
494
  data: {
456
495
  source_file_ids,
457
496
  delete_assets
458
- }
497
+ },
498
+ headers
459
499
  });
460
500
  }
461
501
  function downloadSourceFile({
462
502
  source_file_id
463
- }) {
503
+ }, headers, responseType) {
464
504
  return axiosInstance({
465
505
  method: "get",
466
506
  url: "/source-files/" + source_file_id,
467
- responseType: "arraybuffer"
507
+ headers,
508
+ responseType: responseType || "arraybuffer"
468
509
  });
469
510
  }
470
511
  function getSourceFileDetails({
471
512
  source_file_id
472
- }) {
513
+ }, headers) {
473
514
  return axiosInstance({
474
515
  method: "get",
475
- url: "/source-files/" + source_file_id + "/details"
516
+ url: "/source-files/" + source_file_id + "/details",
517
+ headers
476
518
  });
477
519
  }
478
520
  function updateSourceFileDetails({
479
521
  source_file_id,
480
522
  name
481
- }) {
523
+ }, headers) {
482
524
  return axiosInstance({
483
525
  method: "patch",
484
526
  url: "/source-files/" + source_file_id + "/details",
485
527
  data: {
486
528
  name
487
- }
529
+ },
530
+ headers
488
531
  });
489
532
  }
490
533
  function getSourceFileAssets({
491
534
  source_file_id
492
- }) {
535
+ }, headers) {
493
536
  return axiosInstance({
494
537
  method: "get",
495
- url: "/source-files/" + source_file_id + "/assets"
538
+ url: "/source-files/" + source_file_id + "/assets",
539
+ headers
496
540
  });
497
541
  }
498
542
  function getUploadTasks({
499
543
  offset = 0,
500
544
  limit = 10
501
- }) {
545
+ }, headers) {
502
546
  return axiosInstance({
503
547
  method: "get",
504
548
  url: "/upload-tasks",
505
549
  params: {
506
550
  offset,
507
551
  limit
508
- }
552
+ },
553
+ headers
509
554
  });
510
555
  }
511
556
  function getUploadTask({
512
557
  upload_task_id
513
- }) {
558
+ }, headers) {
514
559
  return axiosInstance({
515
560
  method: "get",
516
- url: "/upload-tasks/" + upload_task_id
561
+ url: "/upload-tasks/" + upload_task_id,
562
+ headers
563
+ });
564
+ }
565
+ function getConversionTaskMetadata({
566
+ asset_id,
567
+ filename
568
+ }, headers, responseType) {
569
+ return axiosInstance({
570
+ method: "get",
571
+ url: "/conversion_tasks/" + asset_id + "/metadata/" + filename,
572
+ headers,
573
+ responseType: responseType || "arraybuffer"
517
574
  });
518
575
  }
519
576
  function listAssets({
520
577
  offset = 0,
521
578
  limit = 10,
522
579
  filter
523
- }) {
580
+ }, headers) {
524
581
  return axiosInstance({
525
582
  method: "get",
526
583
  url: "/assets",
@@ -528,52 +585,58 @@ function listAssets({
528
585
  offset,
529
586
  limit,
530
587
  filter
531
- }
588
+ },
589
+ headers
532
590
  });
533
591
  }
534
592
  function deleteAssets({
535
593
  asset_ids
536
- }) {
594
+ }, headers) {
537
595
  return axiosInstance({
538
596
  method: "delete",
539
597
  url: "/assets",
540
- data: asset_ids
598
+ data: asset_ids,
599
+ headers
541
600
  });
542
601
  }
543
602
  function deleteAsset({
544
603
  asset_container,
545
604
  asset_id
546
- }) {
605
+ }, headers) {
547
606
  return axiosInstance({
548
607
  method: "delete",
549
- url: "/assets/" + asset_container + "/" + asset_id
608
+ url: "/assets/" + asset_container + "/" + asset_id,
609
+ headers
550
610
  });
551
611
  }
552
612
  function getAssetSourceFile({
553
613
  asset_container,
554
614
  asset_id
555
- }) {
615
+ }, headers) {
556
616
  return axiosInstance({
557
617
  method: "get",
558
- url: "/assets/" + asset_container + "/" + asset_id + "/source-file"
618
+ url: "/assets/" + asset_container + "/" + asset_id + "/source-file",
619
+ headers
559
620
  });
560
621
  }
561
622
  function getAssetDetails({
562
623
  asset_container,
563
624
  asset_id
564
- }) {
625
+ }, headers) {
565
626
  return axiosInstance({
566
627
  method: "get",
567
- url: "/assets/" + asset_container + "/" + asset_id + "/details"
628
+ url: "/assets/" + asset_container + "/" + asset_id + "/details",
629
+ headers
568
630
  });
569
631
  }
570
632
  function getAssetFolder({
571
633
  asset_container,
572
634
  asset_id
573
- }) {
635
+ }, headers) {
574
636
  return axiosInstance({
575
637
  method: "get",
576
- url: "/assets/" + asset_container + "/" + asset_id + "/folder"
638
+ url: "/assets/" + asset_container + "/" + asset_id + "/folder",
639
+ headers
577
640
  });
578
641
  }
579
642
  function getAssetDependencies({
@@ -584,7 +647,7 @@ function getAssetDependencies({
584
647
  depth = "all",
585
648
  filters,
586
649
  properties
587
- }) {
650
+ }, headers) {
588
651
  return axiosInstance({
589
652
  method: "get",
590
653
  url: "/assets/" + asset_container + "/" + asset_id + "/dependencies",
@@ -594,7 +657,8 @@ function getAssetDependencies({
594
657
  depth,
595
658
  filters,
596
659
  properties
597
- }
660
+ },
661
+ headers
598
662
  });
599
663
  }
600
664
  function getAssetReferences({
@@ -603,7 +667,7 @@ function getAssetReferences({
603
667
  offset = 0,
604
668
  limit = 10,
605
669
  properties
606
- }) {
670
+ }, headers) {
607
671
  return axiosInstance({
608
672
  method: "get",
609
673
  url: "/assets/" + asset_container + "/" + asset_id + "/references",
@@ -611,70 +675,78 @@ function getAssetReferences({
611
675
  offset,
612
676
  limit,
613
677
  properties
614
- }
678
+ },
679
+ headers
615
680
  });
616
681
  }
617
682
  function getAssetDescription({
618
683
  asset_container,
619
684
  asset_id
620
- }) {
685
+ }, headers) {
621
686
  return axiosInstance({
622
687
  method: "get",
623
- url: "/assets/" + asset_container + "/" + asset_id + "/description"
688
+ url: "/assets/" + asset_container + "/" + asset_id + "/description",
689
+ headers
624
690
  });
625
691
  }
626
692
  function renameAsset({
627
693
  asset_container,
628
694
  asset_id,
629
695
  name
630
- }) {
696
+ }, headers) {
631
697
  return axiosInstance({
632
698
  method: "patch",
633
699
  url: "/assets/" + asset_container + "/" + asset_id + "/description",
634
700
  data: {
635
701
  name
636
- }
702
+ },
703
+ headers
637
704
  });
638
705
  }
639
706
  function getAssetPayload({
640
707
  asset_container_with_payload,
641
708
  asset_id,
642
709
  sub_resource
643
- }) {
710
+ }, headers, responseType) {
644
711
  return axiosInstance({
645
712
  method: "get",
646
713
  url: "/assets/" + asset_container_with_payload + "/" + asset_id + "/payload",
647
- responseType: "arraybuffer",
648
714
  params: {
649
715
  sub_resource
650
- }
716
+ },
717
+ headers,
718
+ responseType: responseType || "arraybuffer"
651
719
  });
652
720
  }
653
721
  function getAssetHistory({
654
722
  asset_container,
655
723
  asset_id
656
- }) {
724
+ }, headers) {
657
725
  return axiosInstance({
658
726
  method: "get",
659
- url: "/assets/" + asset_container + "/" + asset_id + "/history"
727
+ url: "/assets/" + asset_container + "/" + asset_id + "/history",
728
+ headers
660
729
  });
661
730
  }
662
731
  function getAssetMeta({
663
732
  asset_container,
664
733
  asset_id
665
- }) {
734
+ }, headers) {
666
735
  return axiosInstance({
667
736
  method: "get",
668
- url: "/assets/" + asset_container + "/" + asset_id + "/meta"
737
+ url: "/assets/" + asset_container + "/" + asset_id + "/meta",
738
+ headers
669
739
  });
670
740
  }
671
741
  function getAssetCode({
672
742
  asset_container_with_code,
673
743
  asset_id
674
- }) {
744
+ }, headers) {
675
745
  return axiosInstance({
676
746
  method: "get",
677
- url: "/assets/" + asset_container_with_code + "/" + asset_id + "/code"
747
+ url: "/assets/" + asset_container_with_code + "/" + asset_id + "/code",
748
+ headers,
749
+ responseType: "text"
678
750
  });
679
751
  }
680
752
  function getAssetThumbnail({
@@ -682,48 +754,53 @@ function getAssetThumbnail({
682
754
  asset_id,
683
755
  size,
684
756
  default_url
685
- }) {
757
+ }, headers, responseType) {
686
758
  return axiosInstance({
687
759
  method: "get",
688
760
  url: "/assets/" + asset_container + "/" + asset_id + "/thumbnail",
689
- responseType: "arraybuffer",
690
761
  params: {
691
762
  size,
692
763
  default_url
693
- }
764
+ },
765
+ headers,
766
+ responseType: responseType || "arraybuffer"
694
767
  });
695
768
  }
696
769
  function setAssetThumbnail({
697
770
  asset_container,
698
771
  asset_id,
699
772
  body
700
- }, contentType) {
773
+ }, contentType, headers) {
701
774
  return axiosInstance({
702
775
  method: "put",
703
776
  url: "/assets/" + asset_container + "/" + asset_id + "/thumbnail",
777
+ data: body,
778
+ maxRedirects: 0,
704
779
  headers: {
705
- "Content-Type": contentType
706
- },
707
- data: body
780
+ "Content-Type": contentType,
781
+ ...headers
782
+ }
708
783
  });
709
784
  }
710
785
  function getAssetCustomTypes({
711
786
  asset_container_with_custom_types,
712
787
  asset_id
713
- }) {
788
+ }, headers) {
714
789
  return axiosInstance({
715
790
  method: "get",
716
- url: "/assets/" + asset_container_with_custom_types + "/" + asset_id + "/custom-types"
791
+ url: "/assets/" + asset_container_with_custom_types + "/" + asset_id + "/custom-types",
792
+ headers
717
793
  });
718
794
  }
719
795
  function packageAsset({
720
796
  asset_container,
721
797
  asset_id
722
- }) {
798
+ }, headers, responseType) {
723
799
  return axiosInstance({
724
800
  method: "get",
725
801
  url: "/assets/" + asset_container + "/" + asset_id + "/package",
726
- responseType: "arraybuffer"
802
+ headers,
803
+ responseType: responseType || "arraybuffer"
727
804
  });
728
805
  }
729
806
  function exportAsset({
@@ -732,100 +809,109 @@ function exportAsset({
732
809
  format,
733
810
  scale = 1,
734
811
  sub_mesh_index
735
- }) {
812
+ }, headers, responseType) {
736
813
  return axiosInstance({
737
814
  method: "get",
738
815
  url: "/assets/" + asset_container_exportable + "/" + asset_id + "/exports/" + format,
739
- responseType: "arraybuffer",
740
816
  params: {
741
817
  scale,
742
818
  sub_mesh_index
743
- }
819
+ },
820
+ headers,
821
+ responseType: responseType || "arraybuffer"
744
822
  });
745
823
  }
746
824
  function getSceneSessions({
747
825
  scene_id
748
- }) {
826
+ }, headers) {
749
827
  return axiosInstance({
750
828
  method: "get",
751
- url: "/assets/scenes/" + scene_id + "/sessions"
829
+ url: "/assets/scenes/" + scene_id + "/sessions",
830
+ headers
752
831
  });
753
832
  }
754
833
  function getSceneAABB({
755
834
  scene_id
756
- }) {
835
+ }, headers) {
757
836
  return axiosInstance({
758
837
  method: "get",
759
- url: "/assets/scenes/" + scene_id + "/aabb"
838
+ url: "/assets/scenes/" + scene_id + "/aabb",
839
+ headers
760
840
  });
761
841
  }
762
842
  function createEntity({
763
843
  scene_id,
764
844
  entity_components
765
- }) {
845
+ }, headers) {
766
846
  return axiosInstance({
767
847
  method: "post",
768
848
  url: "/assets/scenes/" + scene_id + "/entities",
769
- data: entity_components
849
+ data: entity_components,
850
+ headers
770
851
  });
771
852
  }
772
853
  function getEntity({
773
854
  scene_id,
774
855
  entity_id,
775
856
  compute_global_transform = false
776
- }) {
857
+ }, headers) {
777
858
  return axiosInstance({
778
859
  method: "get",
779
860
  url: "/assets/scenes/" + scene_id + "/entities/" + entity_id,
780
861
  params: {
781
862
  compute_global_transform
782
- }
863
+ },
864
+ headers
783
865
  });
784
866
  }
785
867
  function updateEntity({
786
868
  scene_id,
787
869
  entity_id,
788
870
  entity_components
789
- }) {
871
+ }, headers) {
790
872
  return axiosInstance({
791
873
  method: "patch",
792
874
  url: "/assets/scenes/" + scene_id + "/entities/" + entity_id,
793
- data: entity_components
875
+ data: entity_components,
876
+ headers
794
877
  });
795
878
  }
796
879
  function deleteEntity({
797
880
  scene_id,
798
881
  entity_id
799
- }) {
882
+ }, headers) {
800
883
  return axiosInstance({
801
884
  method: "delete",
802
- url: "/assets/scenes/" + scene_id + "/entities/" + entity_id
885
+ url: "/assets/scenes/" + scene_id + "/entities/" + entity_id,
886
+ headers
803
887
  });
804
888
  }
805
889
  function getSceneSettings({
806
890
  scene_id
807
- }) {
891
+ }, headers) {
808
892
  return axiosInstance({
809
893
  method: "get",
810
- url: "/assets/scenes/" + scene_id + "/settings"
894
+ url: "/assets/scenes/" + scene_id + "/settings",
895
+ headers
811
896
  });
812
897
  }
813
898
  function getRunningSessions({
814
899
  filters
815
- }) {
900
+ }, headers) {
816
901
  return axiosInstance({
817
902
  method: "get",
818
903
  url: "/sessions",
819
904
  params: {
820
905
  filters
821
- }
906
+ },
907
+ headers
822
908
  });
823
909
  }
824
910
  function createSession({
825
911
  scene_id,
826
912
  renderer_version,
827
913
  is_transient = false
828
- }) {
914
+ }, headers) {
829
915
  return axiosInstance({
830
916
  method: "post",
831
917
  url: "/sessions",
@@ -833,54 +919,61 @@ function createSession({
833
919
  scene_id,
834
920
  renderer_version,
835
921
  is_transient
836
- }
922
+ },
923
+ headers
837
924
  });
838
925
  }
839
926
  function getSession({
840
927
  session_id
841
- }) {
928
+ }, headers) {
842
929
  return axiosInstance({
843
930
  method: "get",
844
- url: "/sessions/" + session_id
931
+ url: "/sessions/" + session_id,
932
+ headers
845
933
  });
846
934
  }
847
935
  function killSession({
848
936
  session_id
849
- }) {
937
+ }, headers) {
850
938
  return axiosInstance({
851
939
  method: "delete",
852
- url: "/sessions/" + session_id
940
+ url: "/sessions/" + session_id,
941
+ headers
853
942
  });
854
943
  }
855
944
  function joinSession({
856
945
  session_id
857
- }) {
946
+ }, headers) {
858
947
  return axiosInstance({
859
948
  method: "post",
860
- url: "/sessions/" + session_id + "/clients"
949
+ url: "/sessions/" + session_id + "/clients",
950
+ headers
861
951
  });
862
952
  }
863
953
  function kickClientFromSession({
864
954
  session_id,
865
955
  client_id
866
- }) {
956
+ }, headers) {
867
957
  return axiosInstance({
868
958
  method: "delete",
869
- url: "/sessions/" + session_id + "/clients/" + client_id
959
+ url: "/sessions/" + session_id + "/clients/" + client_id,
960
+ headers
870
961
  });
871
962
  }
872
- function joinSessionAsGuest() {
963
+ function joinSessionAsGuest(headers) {
873
964
  return axiosInstance({
874
965
  method: "post",
875
- url: "/sessions/guests"
966
+ url: "/sessions/guests",
967
+ headers
876
968
  });
877
969
  }
878
970
  function generateGuestToken({
879
971
  session_id
880
- }) {
972
+ }, headers) {
881
973
  return axiosInstance({
882
974
  method: "post",
883
- url: "/sessions/" + session_id + "/guests"
975
+ url: "/sessions/" + session_id + "/guests",
976
+ headers
884
977
  });
885
978
  }
886
979
 
@@ -1013,6 +1106,7 @@ export {
1013
1106
  getAssetReferences,
1014
1107
  getAssetSourceFile,
1015
1108
  getAssetThumbnail,
1109
+ getConversionTaskMetadata,
1016
1110
  getEntity,
1017
1111
  getFolderAssets,
1018
1112
  getFolderInfo,