@3dverse/api 0.1.1 → 0.1.2

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