@3dverse/api 0.7.1 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -279,15 +279,11 @@ function createSubfolder({
279
279
  });
280
280
  }
281
281
  function listFolderSubFolders({
282
- folder_id,
283
- depth = 0
282
+ folder_id
284
283
  }) {
285
284
  return axiosInstance({
286
285
  method: "get",
287
- url: "/folders/" + folder_id + "/folders",
288
- params: {
289
- depth
290
- }
286
+ url: "/folders/" + folder_id + "/folders"
291
287
  });
292
288
  }
293
289
  function getSourceFilesInFolder({
@@ -337,7 +333,8 @@ function getFolderAssets({
337
333
  folder_id,
338
334
  offset = 0,
339
335
  limit = 10,
340
- filter
336
+ filter,
337
+ recursive = false
341
338
  }) {
342
339
  return axiosInstance({
343
340
  method: "get",
@@ -345,8 +342,12 @@ function getFolderAssets({
345
342
  params: {
346
343
  offset,
347
344
  limit,
348
- filter
345
+ filter,
346
+ recursive
349
347
  }
348
+ }).then((response) => {
349
+ response.headers["x-assets-count"] = JSON.parse(response.headers["x-assets-count"]);
350
+ return response;
350
351
  });
351
352
  }
352
353
  function createAsset({
@@ -369,6 +370,55 @@ function moveAssets({
369
370
  data: asset_ids
370
371
  });
371
372
  }
373
+ function createMaterial({
374
+ folder_id,
375
+ dataJson,
376
+ isDoubleSided,
377
+ name,
378
+ shaderRef
379
+ }) {
380
+ return axiosInstance({
381
+ method: "post",
382
+ url: "/folders/" + folder_id + "/assets/materials",
383
+ data: {
384
+ dataJson,
385
+ isDoubleSided,
386
+ name,
387
+ shaderRef
388
+ }
389
+ });
390
+ }
391
+ function createCubemap({
392
+ folder_id,
393
+ faces,
394
+ name
395
+ }) {
396
+ return axiosInstance({
397
+ method: "post",
398
+ url: "/folders/" + folder_id + "/assets/cubemaps",
399
+ data: {
400
+ faces,
401
+ name
402
+ }
403
+ });
404
+ }
405
+ function importAssets({
406
+ folder_id,
407
+ overwrite = "never",
408
+ body
409
+ }) {
410
+ return axiosInstance({
411
+ method: "put",
412
+ url: "/folders/" + folder_id + "/packages",
413
+ headers: {
414
+ "Content-Type": "application/zip"
415
+ },
416
+ params: {
417
+ overwrite
418
+ },
419
+ data: body
420
+ });
421
+ }
372
422
  function getSessionsInFolder({
373
423
  folder_id
374
424
  }) {
@@ -588,12 +638,16 @@ function renameAsset({
588
638
  }
589
639
  function getAssetPayload({
590
640
  asset_container_with_payload,
591
- asset_id
641
+ asset_id,
642
+ sub_resource
592
643
  }) {
593
644
  return axiosInstance({
594
645
  method: "get",
595
646
  url: "/assets/" + asset_container_with_payload + "/" + asset_id + "/payload",
596
- responseType: "arraybuffer"
647
+ responseType: "arraybuffer",
648
+ params: {
649
+ sub_resource
650
+ }
597
651
  });
598
652
  }
599
653
  function getAssetHistory({
@@ -705,6 +759,16 @@ function getSceneAABB({
705
759
  url: "/assets/scenes/" + scene_id + "/aabb"
706
760
  });
707
761
  }
762
+ function createEntity({
763
+ scene_id,
764
+ entity_components
765
+ }) {
766
+ return axiosInstance({
767
+ method: "post",
768
+ url: "/assets/scenes/" + scene_id + "/entities",
769
+ data: entity_components
770
+ });
771
+ }
708
772
  function getEntity({
709
773
  scene_id,
710
774
  entity_id,
@@ -738,6 +802,14 @@ function deleteEntity({
738
802
  url: "/assets/scenes/" + scene_id + "/entities/" + entity_id
739
803
  });
740
804
  }
805
+ function getSceneSettings({
806
+ scene_id
807
+ }) {
808
+ return axiosInstance({
809
+ method: "get",
810
+ url: "/assets/scenes/" + scene_id + "/settings"
811
+ });
812
+ }
741
813
  function getRunningSessions({
742
814
  filters
743
815
  }) {
@@ -911,8 +983,11 @@ export {
911
983
  UnexpectedServiceError,
912
984
  axiosInstance,
913
985
  createAsset,
986
+ createCubemap,
987
+ createEntity,
914
988
  createFolder,
915
989
  createGroup,
990
+ createMaterial,
916
991
  createSession,
917
992
  createSubfolder,
918
993
  deleteAsset,
@@ -945,6 +1020,7 @@ export {
945
1020
  getRunningSessions,
946
1021
  getSceneAABB,
947
1022
  getSceneSessions,
1023
+ getSceneSettings,
948
1024
  getSession,
949
1025
  getSessionsInFolder,
950
1026
  getSourceFileAssets,
@@ -958,6 +1034,7 @@ export {
958
1034
  getUserUploadTasks,
959
1035
  grantMemberAccessToFolder,
960
1036
  grantMemberAccessToGroup,
1037
+ importAssets,
961
1038
  joinSession,
962
1039
  joinSessionAsGuest,
963
1040
  kickClientFromSession,