@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/_prebuild/wrapper.d.ts +474 -32
- package/dist/index.js +92 -10
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +87 -10
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -33,8 +33,11 @@ __export(library_exports, {
|
|
33
33
|
UnexpectedServiceError: () => UnexpectedServiceError,
|
34
34
|
axiosInstance: () => axiosInstance,
|
35
35
|
createAsset: () => createAsset,
|
36
|
+
createCubemap: () => createCubemap,
|
37
|
+
createEntity: () => createEntity,
|
36
38
|
createFolder: () => createFolder,
|
37
39
|
createGroup: () => createGroup,
|
40
|
+
createMaterial: () => createMaterial,
|
38
41
|
createSession: () => createSession,
|
39
42
|
createSubfolder: () => createSubfolder,
|
40
43
|
deleteAsset: () => deleteAsset,
|
@@ -67,6 +70,7 @@ __export(library_exports, {
|
|
67
70
|
getRunningSessions: () => getRunningSessions,
|
68
71
|
getSceneAABB: () => getSceneAABB,
|
69
72
|
getSceneSessions: () => getSceneSessions,
|
73
|
+
getSceneSettings: () => getSceneSettings,
|
70
74
|
getSession: () => getSession,
|
71
75
|
getSessionsInFolder: () => getSessionsInFolder,
|
72
76
|
getSourceFileAssets: () => getSourceFileAssets,
|
@@ -80,6 +84,7 @@ __export(library_exports, {
|
|
80
84
|
getUserUploadTasks: () => getUserUploadTasks,
|
81
85
|
grantMemberAccessToFolder: () => grantMemberAccessToFolder,
|
82
86
|
grantMemberAccessToGroup: () => grantMemberAccessToGroup,
|
87
|
+
importAssets: () => importAssets,
|
83
88
|
joinSession: () => joinSession,
|
84
89
|
joinSessionAsGuest: () => joinSessionAsGuest,
|
85
90
|
kickClientFromSession: () => kickClientFromSession,
|
@@ -390,15 +395,11 @@ function createSubfolder({
|
|
390
395
|
});
|
391
396
|
}
|
392
397
|
function listFolderSubFolders({
|
393
|
-
folder_id
|
394
|
-
depth = 0
|
398
|
+
folder_id
|
395
399
|
}) {
|
396
400
|
return axiosInstance({
|
397
401
|
method: "get",
|
398
|
-
url: "/folders/" + folder_id + "/folders"
|
399
|
-
params: {
|
400
|
-
depth
|
401
|
-
}
|
402
|
+
url: "/folders/" + folder_id + "/folders"
|
402
403
|
});
|
403
404
|
}
|
404
405
|
function getSourceFilesInFolder({
|
@@ -448,7 +449,8 @@ function getFolderAssets({
|
|
448
449
|
folder_id,
|
449
450
|
offset = 0,
|
450
451
|
limit = 10,
|
451
|
-
filter
|
452
|
+
filter,
|
453
|
+
recursive = false
|
452
454
|
}) {
|
453
455
|
return axiosInstance({
|
454
456
|
method: "get",
|
@@ -456,8 +458,12 @@ function getFolderAssets({
|
|
456
458
|
params: {
|
457
459
|
offset,
|
458
460
|
limit,
|
459
|
-
filter
|
461
|
+
filter,
|
462
|
+
recursive
|
460
463
|
}
|
464
|
+
}).then((response) => {
|
465
|
+
response.headers["x-assets-count"] = JSON.parse(response.headers["x-assets-count"]);
|
466
|
+
return response;
|
461
467
|
});
|
462
468
|
}
|
463
469
|
function createAsset({
|
@@ -480,6 +486,55 @@ function moveAssets({
|
|
480
486
|
data: asset_ids
|
481
487
|
});
|
482
488
|
}
|
489
|
+
function createMaterial({
|
490
|
+
folder_id,
|
491
|
+
dataJson,
|
492
|
+
isDoubleSided,
|
493
|
+
name,
|
494
|
+
shaderRef
|
495
|
+
}) {
|
496
|
+
return axiosInstance({
|
497
|
+
method: "post",
|
498
|
+
url: "/folders/" + folder_id + "/assets/materials",
|
499
|
+
data: {
|
500
|
+
dataJson,
|
501
|
+
isDoubleSided,
|
502
|
+
name,
|
503
|
+
shaderRef
|
504
|
+
}
|
505
|
+
});
|
506
|
+
}
|
507
|
+
function createCubemap({
|
508
|
+
folder_id,
|
509
|
+
faces,
|
510
|
+
name
|
511
|
+
}) {
|
512
|
+
return axiosInstance({
|
513
|
+
method: "post",
|
514
|
+
url: "/folders/" + folder_id + "/assets/cubemaps",
|
515
|
+
data: {
|
516
|
+
faces,
|
517
|
+
name
|
518
|
+
}
|
519
|
+
});
|
520
|
+
}
|
521
|
+
function importAssets({
|
522
|
+
folder_id,
|
523
|
+
overwrite = "never",
|
524
|
+
body
|
525
|
+
}) {
|
526
|
+
return axiosInstance({
|
527
|
+
method: "put",
|
528
|
+
url: "/folders/" + folder_id + "/packages",
|
529
|
+
headers: {
|
530
|
+
"Content-Type": "application/zip"
|
531
|
+
},
|
532
|
+
params: {
|
533
|
+
overwrite
|
534
|
+
},
|
535
|
+
data: body
|
536
|
+
});
|
537
|
+
}
|
483
538
|
function getSessionsInFolder({
|
484
539
|
folder_id
|
485
540
|
}) {
|
@@ -699,12 +754,16 @@ function renameAsset({
|
|
699
754
|
}
|
700
755
|
function getAssetPayload({
|
701
756
|
asset_container_with_payload,
|
702
|
-
asset_id
|
757
|
+
asset_id,
|
758
|
+
sub_resource
|
703
759
|
}) {
|
704
760
|
return axiosInstance({
|
705
761
|
method: "get",
|
706
762
|
url: "/assets/" + asset_container_with_payload + "/" + asset_id + "/payload",
|
707
|
-
responseType: "arraybuffer"
|
763
|
+
responseType: "arraybuffer",
|
764
|
+
params: {
|
765
|
+
sub_resource
|
766
|
+
}
|
708
767
|
});
|
709
768
|
}
|
710
769
|
function getAssetHistory({
|
@@ -816,6 +875,16 @@ function getSceneAABB({
|
|
816
875
|
url: "/assets/scenes/" + scene_id + "/aabb"
|
817
876
|
});
|
818
877
|
}
|
878
|
+
function createEntity({
|
879
|
+
scene_id,
|
880
|
+
entity_components
|
881
|
+
}) {
|
882
|
+
return axiosInstance({
|
883
|
+
method: "post",
|
884
|
+
url: "/assets/scenes/" + scene_id + "/entities",
|
885
|
+
data: entity_components
|
886
|
+
});
|
887
|
+
}
|
819
888
|
function getEntity({
|
820
889
|
scene_id,
|
821
890
|
entity_id,
|
@@ -849,6 +918,14 @@ function deleteEntity({
|
|
849
918
|
url: "/assets/scenes/" + scene_id + "/entities/" + entity_id
|
850
919
|
});
|
851
920
|
}
|
921
|
+
function getSceneSettings({
|
922
|
+
scene_id
|
923
|
+
}) {
|
924
|
+
return axiosInstance({
|
925
|
+
method: "get",
|
926
|
+
url: "/assets/scenes/" + scene_id + "/settings"
|
927
|
+
});
|
928
|
+
}
|
852
929
|
function getRunningSessions({
|
853
930
|
filters
|
854
931
|
}) {
|
@@ -1023,8 +1100,11 @@ function uploadSourceFiles({
|
|
1023
1100
|
UnexpectedServiceError,
|
1024
1101
|
axiosInstance,
|
1025
1102
|
createAsset,
|
1103
|
+
createCubemap,
|
1104
|
+
createEntity,
|
1026
1105
|
createFolder,
|
1027
1106
|
createGroup,
|
1107
|
+
createMaterial,
|
1028
1108
|
createSession,
|
1029
1109
|
createSubfolder,
|
1030
1110
|
deleteAsset,
|
@@ -1057,6 +1137,7 @@ function uploadSourceFiles({
|
|
1057
1137
|
getRunningSessions,
|
1058
1138
|
getSceneAABB,
|
1059
1139
|
getSceneSessions,
|
1140
|
+
getSceneSettings,
|
1060
1141
|
getSession,
|
1061
1142
|
getSessionsInFolder,
|
1062
1143
|
getSourceFileAssets,
|
@@ -1070,6 +1151,7 @@ function uploadSourceFiles({
|
|
1070
1151
|
getUserUploadTasks,
|
1071
1152
|
grantMemberAccessToFolder,
|
1072
1153
|
grantMemberAccessToGroup,
|
1154
|
+
importAssets,
|
1073
1155
|
joinSession,
|
1074
1156
|
joinSessionAsGuest,
|
1075
1157
|
kickClientFromSession,
|