@3dverse/api 0.1.1 → 0.1.2

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