@3dverse/api 0.0.1 → 0.0.2

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