@3dverse/api 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,678 @@
1
+ "use strict";
2
+ /**
3
+ * 3dverse v1.0
4
+ * # 3dverse API
5
+ *
6
+ * Welcome to the 3dverse API. The 3dverse API scopes to an API key. Each development environment of an application requires a separate API key.
7
+ * Through the API key, you can manage ownership, access, and permissions for each environment.
8
+ * Each environment has its own set of users, groups, folders, and assets.
9
+ *
10
+ *
11
+ * Contact: 3dverse Support (support@3dverse.com)
12
+ *
13
+ * NOTE: This file is auto generated by library-generator (https://gitlab.com/3dverse/libs/library-generator).
14
+ * Do not edit this file class manually.
15
+ */
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.getAssetDescription = exports.getAssetReferences = exports.getAssetDependencies = exports.getAssetFolder = exports.getAssetDetails = exports.getAssetSourceFile = exports.deleteAsset = exports.deleteAssets = exports.listAssets = exports.getUploadTask = exports.getSourceFileAssets = exports.updateSourceFileDetails = exports.getSourceFileDetails = exports.downloadSourceFile = exports.deleteSourceFiles = exports.listSourceFiles = exports.getSessionsInFolder = exports.createAsset = exports.moveAssets = exports.getFolderAssets = exports.getUploadTasksInFolder = exports.moveSourceFiles = exports.getSourceFilesInFolder = exports.uploadSourceFiles = exports.listFolderSubFolders = exports.createSubfolder = exports.revokeMemberAccessToFolder = exports.grantMemberAccessToFolder = exports.listFolderAccesses = exports.deleteFolder = exports.updateFolder = exports.moveFolders = exports.getFolderInfo = exports.createFolder = exports.listFolders = exports.revokeMemberAccessToGroup = exports.grantMemberAccessToGroup = exports.deleteGroup = exports.updateGroupDescription = exports.getGroup = exports.createGroup = exports.getUserUploadTasks = exports.getUserGroups = exports.generateUserToken = exports.deleteUser = exports.updateUser = exports.getUser = exports.registerUser = exports.listUsers = exports.axiosInstance = void 0;
21
+ exports.kickClientFromSession = exports.joinSession = exports.killSession = exports.createSession = exports.getEntity = exports.getSceneAABB = exports.getSceneSessions = exports.exportAsset = exports.packageAsset = exports.getAssetCustomTypes = exports.setAssetThumbnail = exports.getAssetThumbnail = exports.getAssetCode = exports.getAssetMeta = exports.getAssetHistory = exports.getAssetPayload = exports.updateAssetDescription = void 0;
22
+ //--------------------------------------------------------------------------
23
+ const axios_1 = __importDefault(require("axios"));
24
+ //--------------------------------------------------------------------------
25
+ exports.axiosInstance = createAxiosInstance();
26
+ ;
27
+ //------------------------------------------------------------------------------
28
+ function createAxiosInstance() {
29
+ const axiosInstance = axios_1.default.create({
30
+ baseURL: "https://api.3dverse.com/v1"
31
+ });
32
+ axiosInstance.interceptors.response.use(successFulResponse => {
33
+ if (successFulResponse.config.responseType === 'stream') {
34
+ successFulResponse.data.pause();
35
+ successFulResponse.data.responseContentType = successFulResponse.headers['content-type'];
36
+ successFulResponse.data.responseContentLength = successFulResponse.headers['content-length'];
37
+ successFulResponse.data.responseStatus = successFulResponse.status;
38
+ }
39
+ return successFulResponse.data;
40
+ }, axiosError => {
41
+ if (!axiosError.response) {
42
+ return Promise.reject(axiosError);
43
+ }
44
+ const errorData = axiosError.response.data;
45
+ const error = {
46
+ errorCode: errorData.error?.errorNum,
47
+ status: axiosError.response.status,
48
+ error: errorData.error || errorData
49
+ };
50
+ return Promise.reject(error);
51
+ });
52
+ return axiosInstance;
53
+ }
54
+ function listUsers({ offset = 0, limit = 10 }) {
55
+ return (0, exports.axiosInstance)({
56
+ method: "get",
57
+ url: "/users",
58
+ params: {
59
+ offset: offset,
60
+ limit: limit
61
+ }
62
+ });
63
+ }
64
+ exports.listUsers = listUsers;
65
+ function registerUser({ username }) {
66
+ return (0, exports.axiosInstance)({
67
+ method: "post",
68
+ url: "/users",
69
+ data: {
70
+ username: username
71
+ }
72
+ });
73
+ }
74
+ exports.registerUser = registerUser;
75
+ function getUser({ user_id }) {
76
+ return (0, exports.axiosInstance)({
77
+ method: "get",
78
+ url: "/users/" + user_id + ""
79
+ });
80
+ }
81
+ exports.getUser = getUser;
82
+ //--------------------------------------------------------------------------
83
+ // Updates the details of the target user.
84
+ function updateUser({ user_id, username }) {
85
+ return (0, exports.axiosInstance)({
86
+ method: "patch",
87
+ url: "/users/" + user_id + "",
88
+ data: {
89
+ username: username
90
+ }
91
+ });
92
+ }
93
+ exports.updateUser = updateUser;
94
+ function deleteUser({ user_id }) {
95
+ return (0, exports.axiosInstance)({
96
+ method: "delete",
97
+ url: "/users/" + user_id + ""
98
+ });
99
+ }
100
+ exports.deleteUser = deleteUser;
101
+ function generateUserToken({ user_id, scope, ttl = '1h' }) {
102
+ return (0, exports.axiosInstance)({
103
+ method: "post",
104
+ url: "/users/" + user_id + "/tokens",
105
+ data: {
106
+ scope: scope,
107
+ ttl: ttl
108
+ }
109
+ });
110
+ }
111
+ exports.generateUserToken = generateUserToken;
112
+ function getUserGroups({ user_id }) {
113
+ return (0, exports.axiosInstance)({
114
+ method: "get",
115
+ url: "/users/" + user_id + "/groups"
116
+ });
117
+ }
118
+ exports.getUserGroups = getUserGroups;
119
+ function getUserUploadTasks({ user_id, offset = 0, limit = 10 }) {
120
+ return (0, exports.axiosInstance)({
121
+ method: "get",
122
+ url: "/users/" + user_id + "/upload-tasks",
123
+ params: {
124
+ offset: offset,
125
+ limit: limit
126
+ }
127
+ });
128
+ }
129
+ exports.getUserUploadTasks = getUserUploadTasks;
130
+ function createGroup({ group_name, group_description, members }) {
131
+ return (0, exports.axiosInstance)({
132
+ method: "post",
133
+ url: "/groups",
134
+ data: {
135
+ group_name: group_name,
136
+ group_description: group_description,
137
+ members: members
138
+ }
139
+ });
140
+ }
141
+ exports.createGroup = createGroup;
142
+ function getGroup({ group_id }) {
143
+ return (0, exports.axiosInstance)({
144
+ method: "get",
145
+ url: "/groups/" + group_id + ""
146
+ });
147
+ }
148
+ exports.getGroup = getGroup;
149
+ //--------------------------------------------------------------------------
150
+ // Updates a group details.
151
+ function updateGroupDescription({ group_id, group_name, group_description }) {
152
+ return (0, exports.axiosInstance)({
153
+ method: "patch",
154
+ url: "/groups/" + group_id + "",
155
+ data: {
156
+ group_name: group_name,
157
+ group_description: group_description
158
+ }
159
+ });
160
+ }
161
+ exports.updateGroupDescription = updateGroupDescription;
162
+ //--------------------------------------------------------------------------
163
+ // Deletes a group and all its access rights.
164
+ function deleteGroup({ group_id }) {
165
+ return (0, exports.axiosInstance)({
166
+ method: "delete",
167
+ url: "/groups/" + group_id + ""
168
+ });
169
+ }
170
+ exports.deleteGroup = deleteGroup;
171
+ //--------------------------------------------------------------------------
172
+ // Grants member access to the group.
173
+ function grantMemberAccessToGroup({ group_id, member_type, member_id, group_access, folder_access }) {
174
+ return (0, exports.axiosInstance)({
175
+ method: "put",
176
+ url: "/groups/" + group_id + "/members/" + member_type + "/" + member_id + "",
177
+ data: {
178
+ group_access: group_access,
179
+ folder_access: folder_access
180
+ }
181
+ });
182
+ }
183
+ exports.grantMemberAccessToGroup = grantMemberAccessToGroup;
184
+ //--------------------------------------------------------------------------
185
+ // Revoke requested user access to group.
186
+ function revokeMemberAccessToGroup({ group_id, member_type, member_id }) {
187
+ return (0, exports.axiosInstance)({
188
+ method: "delete",
189
+ url: "/groups/" + group_id + "/members/" + member_type + "/" + member_id + ""
190
+ });
191
+ }
192
+ exports.revokeMemberAccessToGroup = revokeMemberAccessToGroup;
193
+ function listFolders({ offset = 0, limit = 10 }) {
194
+ return (0, exports.axiosInstance)({
195
+ method: "get",
196
+ url: "/folders",
197
+ params: {
198
+ offset: offset,
199
+ limit: limit
200
+ }
201
+ });
202
+ }
203
+ exports.listFolders = listFolders;
204
+ function createFolder({ folder_name, subfolders }) {
205
+ return (0, exports.axiosInstance)({
206
+ method: "post",
207
+ url: "/folders",
208
+ data: {
209
+ folder_name: folder_name,
210
+ subfolders: subfolders
211
+ }
212
+ });
213
+ }
214
+ exports.createFolder = createFolder;
215
+ function getFolderInfo({ folder_id }) {
216
+ return (0, exports.axiosInstance)({
217
+ method: "get",
218
+ url: "/folders/" + folder_id + ""
219
+ });
220
+ }
221
+ exports.getFolderInfo = getFolderInfo;
222
+ //--------------------------------------------------------------------------
223
+ // Move folders inside the specified folder.
224
+ function moveFolders({ folder_id, folder_ids }) {
225
+ return (0, exports.axiosInstance)({
226
+ method: "put",
227
+ url: "/folders/" + folder_id + "",
228
+ data: folder_ids
229
+ });
230
+ }
231
+ exports.moveFolders = moveFolders;
232
+ //--------------------------------------------------------------------------
233
+ // Updates the folder details.
234
+ function updateFolder({ folder_id, folder_name }) {
235
+ return (0, exports.axiosInstance)({
236
+ method: "patch",
237
+ url: "/folders/" + folder_id + "",
238
+ data: {
239
+ folder_name: folder_name
240
+ }
241
+ });
242
+ }
243
+ exports.updateFolder = updateFolder;
244
+ //--------------------------------------------------------------------------
245
+ // Deletes the requested folder. The target folder must be empty.
246
+ function deleteFolder({ folder_id }) {
247
+ return (0, exports.axiosInstance)({
248
+ method: "delete",
249
+ url: "/folders/" + folder_id + ""
250
+ });
251
+ }
252
+ exports.deleteFolder = deleteFolder;
253
+ function listFolderAccesses({ folder_id }) {
254
+ return (0, exports.axiosInstance)({
255
+ method: "get",
256
+ url: "/folders/" + folder_id + "/access"
257
+ });
258
+ }
259
+ exports.listFolderAccesses = listFolderAccesses;
260
+ //--------------------------------------------------------------------------
261
+ // Grants member access to the targeted folder.
262
+ function grantMemberAccessToFolder({ folder_id, member_type, member_id, access }) {
263
+ return (0, exports.axiosInstance)({
264
+ method: "put",
265
+ url: "/folders/" + folder_id + "/access/" + member_type + "/" + member_id + "",
266
+ data: {
267
+ access: access
268
+ }
269
+ });
270
+ }
271
+ exports.grantMemberAccessToFolder = grantMemberAccessToFolder;
272
+ //--------------------------------------------------------------------------
273
+ // Revokes member access to a target folder.
274
+ function revokeMemberAccessToFolder({ folder_id, member_type, member_id }) {
275
+ return (0, exports.axiosInstance)({
276
+ method: "delete",
277
+ url: "/folders/" + folder_id + "/access/" + member_type + "/" + member_id + ""
278
+ });
279
+ }
280
+ exports.revokeMemberAccessToFolder = revokeMemberAccessToFolder;
281
+ function createSubfolder({ folder_id, folder_name, subfolders }) {
282
+ return (0, exports.axiosInstance)({
283
+ method: "post",
284
+ url: "/folders/" + folder_id + "/folders",
285
+ data: {
286
+ folder_name: folder_name,
287
+ subfolders: subfolders
288
+ }
289
+ });
290
+ }
291
+ exports.createSubfolder = createSubfolder;
292
+ function listFolderSubFolders({ folder_id, depth = 0 }) {
293
+ return (0, exports.axiosInstance)({
294
+ method: "get",
295
+ url: "/folders/" + folder_id + "/folders",
296
+ params: {
297
+ depth: depth
298
+ }
299
+ });
300
+ }
301
+ exports.listFolderSubFolders = listFolderSubFolders;
302
+ function uploadSourceFiles({ folder_id, body }) {
303
+ return (0, exports.axiosInstance)({
304
+ method: "post",
305
+ url: "/folders/" + folder_id + "/source-files",
306
+ headers: {
307
+ "Content-Type": "multipart/form-data"
308
+ },
309
+ data: body
310
+ });
311
+ }
312
+ exports.uploadSourceFiles = uploadSourceFiles;
313
+ function getSourceFilesInFolder({ folder_id, offset = 0, limit = 10 }) {
314
+ return (0, exports.axiosInstance)({
315
+ method: "get",
316
+ url: "/folders/" + folder_id + "/source-files",
317
+ params: {
318
+ offset: offset,
319
+ limit: limit
320
+ }
321
+ });
322
+ }
323
+ exports.getSourceFilesInFolder = getSourceFilesInFolder;
324
+ //--------------------------------------------------------------------------
325
+ // Move source files inside the specified folder.
326
+ function moveSourceFiles({ folder_id, source_file_ids }) {
327
+ return (0, exports.axiosInstance)({
328
+ method: "put",
329
+ url: "/folders/" + folder_id + "/source-files",
330
+ data: source_file_ids
331
+ });
332
+ }
333
+ exports.moveSourceFiles = moveSourceFiles;
334
+ function getUploadTasksInFolder({ folder_id, offset = 0, limit = 10 }) {
335
+ return (0, exports.axiosInstance)({
336
+ method: "get",
337
+ url: "/folders/" + folder_id + "/upload-tasks",
338
+ params: {
339
+ offset: offset,
340
+ limit: limit
341
+ }
342
+ });
343
+ }
344
+ exports.getUploadTasksInFolder = getUploadTasksInFolder;
345
+ function getFolderAssets({ folder_id }) {
346
+ return (0, exports.axiosInstance)({
347
+ method: "get",
348
+ url: "/folders/" + folder_id + "/assets"
349
+ });
350
+ }
351
+ exports.getFolderAssets = getFolderAssets;
352
+ //--------------------------------------------------------------------------
353
+ // Move assets inside the specified folder.
354
+ function moveAssets({ folder_id, asset_ids }) {
355
+ return (0, exports.axiosInstance)({
356
+ method: "put",
357
+ url: "/folders/" + folder_id + "/assets",
358
+ data: asset_ids
359
+ });
360
+ }
361
+ exports.moveAssets = moveAssets;
362
+ function createAsset({ folder_id, asset_container_creatable, body }) {
363
+ return (0, exports.axiosInstance)({
364
+ method: "post",
365
+ url: "/folders/" + folder_id + "/assets/" + asset_container_creatable + "",
366
+ data: body
367
+ });
368
+ }
369
+ exports.createAsset = createAsset;
370
+ function getSessionsInFolder({ folder_id }) {
371
+ return (0, exports.axiosInstance)({
372
+ method: "get",
373
+ url: "/folders/" + folder_id + "/sessions"
374
+ });
375
+ }
376
+ exports.getSessionsInFolder = getSessionsInFolder;
377
+ function listSourceFiles({ offset = 0, limit = 10 }) {
378
+ return (0, exports.axiosInstance)({
379
+ method: "get",
380
+ url: "/source-files",
381
+ params: {
382
+ offset: offset,
383
+ limit: limit
384
+ }
385
+ });
386
+ }
387
+ exports.listSourceFiles = listSourceFiles;
388
+ //--------------------------------------------------------------------------
389
+ // Deletes the target source files. Deleting a source file is permanent.
390
+ function deleteSourceFiles({ source_file_ids }) {
391
+ return (0, exports.axiosInstance)({
392
+ method: "delete",
393
+ url: "/source-files",
394
+ data: source_file_ids
395
+ });
396
+ }
397
+ exports.deleteSourceFiles = deleteSourceFiles;
398
+ //--------------------------------------------------------------------------
399
+ // Downloads the target source file.
400
+ function downloadSourceFile({ source_file_id }) {
401
+ return (0, exports.axiosInstance)({
402
+ method: "get",
403
+ url: "/source-files/" + source_file_id + "",
404
+ responseType: "arraybuffer"
405
+ });
406
+ }
407
+ exports.downloadSourceFile = downloadSourceFile;
408
+ function getSourceFileDetails({ source_file_id }) {
409
+ return (0, exports.axiosInstance)({
410
+ method: "get",
411
+ url: "/source-files/" + source_file_id + "/details"
412
+ });
413
+ }
414
+ exports.getSourceFileDetails = getSourceFileDetails;
415
+ //--------------------------------------------------------------------------
416
+ // Updates details for a specific source file.
417
+ function updateSourceFileDetails({ source_file_id, source_file_name }) {
418
+ return (0, exports.axiosInstance)({
419
+ method: "patch",
420
+ url: "/source-files/" + source_file_id + "/details",
421
+ data: {
422
+ source_file_name: source_file_name
423
+ }
424
+ });
425
+ }
426
+ exports.updateSourceFileDetails = updateSourceFileDetails;
427
+ function getSourceFileAssets({ source_file_id }) {
428
+ return (0, exports.axiosInstance)({
429
+ method: "get",
430
+ url: "/source-files/" + source_file_id + "/assets"
431
+ });
432
+ }
433
+ exports.getSourceFileAssets = getSourceFileAssets;
434
+ function getUploadTask({ upload_task_id }) {
435
+ return (0, exports.axiosInstance)({
436
+ method: "get",
437
+ url: "/upload-tasks/" + upload_task_id + ""
438
+ });
439
+ }
440
+ exports.getUploadTask = getUploadTask;
441
+ function listAssets({ offset = 0, limit = 10 }) {
442
+ return (0, exports.axiosInstance)({
443
+ method: "get",
444
+ url: "/assets",
445
+ params: {
446
+ offset: offset,
447
+ limit: limit
448
+ }
449
+ });
450
+ }
451
+ exports.listAssets = listAssets;
452
+ //--------------------------------------------------------------------------
453
+ // Batch delete assets. You **MUST NOT** reference assets.
454
+ function deleteAssets({ asset_ids }) {
455
+ return (0, exports.axiosInstance)({
456
+ method: "delete",
457
+ url: "/assets",
458
+ data: asset_ids
459
+ });
460
+ }
461
+ exports.deleteAssets = deleteAssets;
462
+ //--------------------------------------------------------------------------
463
+ // Deletes the asset.
464
+ function deleteAsset({ asset_container, asset_id }) {
465
+ return (0, exports.axiosInstance)({
466
+ method: "delete",
467
+ url: "/assets/" + asset_container + "/" + asset_id + ""
468
+ });
469
+ }
470
+ exports.deleteAsset = deleteAsset;
471
+ function getAssetSourceFile({ asset_container, asset_id }) {
472
+ return (0, exports.axiosInstance)({
473
+ method: "get",
474
+ url: "/assets/" + asset_container + "/" + asset_id + "/source-file"
475
+ });
476
+ }
477
+ exports.getAssetSourceFile = getAssetSourceFile;
478
+ function getAssetDetails({ asset_container, asset_id }) {
479
+ return (0, exports.axiosInstance)({
480
+ method: "get",
481
+ url: "/assets/" + asset_container + "/" + asset_id + "/details"
482
+ });
483
+ }
484
+ exports.getAssetDetails = getAssetDetails;
485
+ function getAssetFolder({ asset_container, asset_id }) {
486
+ return (0, exports.axiosInstance)({
487
+ method: "get",
488
+ url: "/assets/" + asset_container + "/" + asset_id + "/folder"
489
+ });
490
+ }
491
+ exports.getAssetFolder = getAssetFolder;
492
+ function getAssetDependencies({ asset_container, asset_id, format = 'flat', depth = 'all', filter }) {
493
+ return (0, exports.axiosInstance)({
494
+ method: "get",
495
+ url: "/assets/" + asset_container + "/" + asset_id + "/dependencies",
496
+ params: {
497
+ format: format,
498
+ depth: depth,
499
+ filter: filter
500
+ }
501
+ });
502
+ }
503
+ exports.getAssetDependencies = getAssetDependencies;
504
+ function getAssetReferences({ asset_container, asset_id }) {
505
+ return (0, exports.axiosInstance)({
506
+ method: "get",
507
+ url: "/assets/" + asset_container + "/" + asset_id + "/references"
508
+ });
509
+ }
510
+ exports.getAssetReferences = getAssetReferences;
511
+ function getAssetDescription({ asset_container, asset_id }) {
512
+ return (0, exports.axiosInstance)({
513
+ method: "get",
514
+ url: "/assets/" + asset_container + "/" + asset_id + "/description"
515
+ });
516
+ }
517
+ exports.getAssetDescription = getAssetDescription;
518
+ //--------------------------------------------------------------------------
519
+ // Updates asset description. Supports only updating name.
520
+ function updateAssetDescription({ asset_container, asset_id, name }) {
521
+ return (0, exports.axiosInstance)({
522
+ method: "patch",
523
+ url: "/assets/" + asset_container + "/" + asset_id + "/description",
524
+ data: {
525
+ name: name
526
+ }
527
+ });
528
+ }
529
+ exports.updateAssetDescription = updateAssetDescription;
530
+ //--------------------------------------------------------------------------
531
+ // Gets the asset payload from the specified asset.
532
+ function getAssetPayload({ asset_container_with_payload, asset_id }) {
533
+ return (0, exports.axiosInstance)({
534
+ method: "get",
535
+ url: "/assets/" + asset_container_with_payload + "/" + asset_id + "/payload",
536
+ responseType: "arraybuffer"
537
+ });
538
+ }
539
+ exports.getAssetPayload = getAssetPayload;
540
+ function getAssetHistory({ asset_container, asset_id }) {
541
+ return (0, exports.axiosInstance)({
542
+ method: "get",
543
+ url: "/assets/" + asset_container + "/" + asset_id + "/history"
544
+ });
545
+ }
546
+ exports.getAssetHistory = getAssetHistory;
547
+ function getAssetMeta({ asset_container, asset_id }) {
548
+ return (0, exports.axiosInstance)({
549
+ method: "get",
550
+ url: "/assets/" + asset_container + "/" + asset_id + "/meta"
551
+ });
552
+ }
553
+ exports.getAssetMeta = getAssetMeta;
554
+ //--------------------------------------------------------------------------
555
+ // Gets the code of the specified asset.
556
+ function getAssetCode({ asset_container_with_code, asset_id }) {
557
+ return (0, exports.axiosInstance)({
558
+ method: "get",
559
+ url: "/assets/" + asset_container_with_code + "/" + asset_id + "/code"
560
+ });
561
+ }
562
+ exports.getAssetCode = getAssetCode;
563
+ //--------------------------------------------------------------------------
564
+ // Gets the asset thumbnail from the specified asset.
565
+ function getAssetThumbnail({ asset_container, asset_id, size, default_url }) {
566
+ return (0, exports.axiosInstance)({
567
+ method: "get",
568
+ url: "/assets/" + asset_container + "/" + asset_id + "/thumbnail",
569
+ params: {
570
+ size: size,
571
+ default_url: default_url
572
+ }
573
+ });
574
+ }
575
+ exports.getAssetThumbnail = getAssetThumbnail;
576
+ //--------------------------------------------------------------------------
577
+ // Assigns a thumbnail to the specified asset.
578
+ function setAssetThumbnail({ asset_container, asset_id, body }, contentType) {
579
+ return (0, exports.axiosInstance)({
580
+ method: "put",
581
+ url: "/assets/" + asset_container + "/" + asset_id + "/thumbnail",
582
+ headers: {
583
+ "Content-Type": contentType
584
+ },
585
+ data: body
586
+ });
587
+ }
588
+ exports.setAssetThumbnail = setAssetThumbnail;
589
+ function getAssetCustomTypes({ asset_container_with_custom_types, asset_id }) {
590
+ return (0, exports.axiosInstance)({
591
+ method: "get",
592
+ url: "/assets/" + asset_container_with_custom_types + "/" + asset_id + "/custom-types"
593
+ });
594
+ }
595
+ exports.getAssetCustomTypes = getAssetCustomTypes;
596
+ //--------------------------------------------------------------------------
597
+ // Packages and downloads the target asset.
598
+ function packageAsset({ asset_container, asset_id }) {
599
+ return (0, exports.axiosInstance)({
600
+ method: "get",
601
+ url: "/assets/" + asset_container + "/" + asset_id + "/package",
602
+ responseType: "arraybuffer"
603
+ });
604
+ }
605
+ exports.packageAsset = packageAsset;
606
+ //--------------------------------------------------------------------------
607
+ // Downloads an asset payload in a given format. Only mesh is supported for the moment. This endpoint requires special export permission.
608
+ function exportAsset({ asset_container_exportable, asset_id, format, scale = 1 }) {
609
+ return (0, exports.axiosInstance)({
610
+ method: "get",
611
+ url: "/assets/" + asset_container_exportable + "/" + asset_id + "/exports/" + format + "",
612
+ responseType: "arraybuffer",
613
+ params: {
614
+ scale: scale
615
+ }
616
+ });
617
+ }
618
+ exports.exportAsset = exportAsset;
619
+ function getSceneSessions({ scene_id }) {
620
+ return (0, exports.axiosInstance)({
621
+ method: "get",
622
+ url: "/assets/scenes/" + scene_id + "/sessions"
623
+ });
624
+ }
625
+ exports.getSceneSessions = getSceneSessions;
626
+ function getSceneAABB({ scene_id }) {
627
+ return (0, exports.axiosInstance)({
628
+ method: "get",
629
+ url: "/assets/scenes/" + scene_id + "/aabb"
630
+ });
631
+ }
632
+ exports.getSceneAABB = getSceneAABB;
633
+ function getEntity({ scene_id, entity_id, compute_global_transform = false }) {
634
+ return (0, exports.axiosInstance)({
635
+ method: "get",
636
+ url: "/assets/scenes/" + scene_id + "/entities/" + entity_id + "",
637
+ params: {
638
+ compute_global_transform: compute_global_transform
639
+ }
640
+ });
641
+ }
642
+ exports.getEntity = getEntity;
643
+ function createSession({ scene_id }) {
644
+ return (0, exports.axiosInstance)({
645
+ method: "post",
646
+ url: "/sessions",
647
+ data: {
648
+ scene_id: scene_id
649
+ }
650
+ });
651
+ }
652
+ exports.createSession = createSession;
653
+ //--------------------------------------------------------------------------
654
+ // Forcefully terminates a session.
655
+ function killSession({ session_id }) {
656
+ return (0, exports.axiosInstance)({
657
+ method: "delete",
658
+ url: "/sessions/" + session_id + ""
659
+ });
660
+ }
661
+ exports.killSession = killSession;
662
+ function joinSession({ session_id }) {
663
+ return (0, exports.axiosInstance)({
664
+ method: "post",
665
+ url: "/sessions/" + session_id + "/clients"
666
+ });
667
+ }
668
+ exports.joinSession = joinSession;
669
+ //--------------------------------------------------------------------------
670
+ // Kick a client from a running session.
671
+ function kickClientFromSession({ session_id, client_id }) {
672
+ return (0, exports.axiosInstance)({
673
+ method: "delete",
674
+ url: "/sessions/" + session_id + "/clients/" + client_id + ""
675
+ });
676
+ }
677
+ exports.kickClientFromSession = kickClientFromSession;
678
+ //# sourceMappingURL=wrapper.js.map