@3dverse/api 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -370,10 +370,14 @@ export declare function getUploadTasksInFolder({ folder_id, offset, limit }: {
370
370
  offset?: number;
371
371
  limit?: number;
372
372
  }): AxiosPromise<Array<GetUploadTasksInFolder_UploadTask>>;
373
- export type GetFolderAssets_Filter = {
374
- asset_type?: (Array<"action_map" | "algorithm" | "animation" | "animation_graph" | "animation_sequence" | "animation_set" | "collision_geometry" | "cubemap" | "event_map" | "material" | "mesh" | "module" | "point_cloud" | "render_graph" | "scene" | "script" | "shader" | "skeleton" | "sound" | "texture" | "texture_1d" | "texture_3d" | "volume_material"> | "action_map" | "algorithm" | "animation" | "animation_graph" | "animation_sequence" | "animation_set" | "collision_geometry" | "cubemap" | "event_map" | "material" | "mesh" | "module" | "point_cloud" | "render_graph" | "scene" | "script" | "shader" | "skeleton" | "sound" | "texture" | "texture_1d" | "texture_3d" | "volume_material");
373
+ export type GetFolderAssets_Filters = {
375
374
  asset_name?: string;
376
- include_public_assets?: boolean;
375
+ asset_type?: (Array<"action_map" | "algorithm" | "animation" | "animation_graph" | "animation_sequence" | "animation_set" | "collision_geometry" | "cubemap" | "event_map" | "material" | "mesh" | "module" | "point_cloud" | "render_graph" | "scene" | "script" | "shader" | "skeleton" | "sound" | "texture" | "texture_1d" | "texture_3d" | "volume_material"> | "action_map" | "algorithm" | "animation" | "animation_graph" | "animation_sequence" | "animation_set" | "collision_geometry" | "cubemap" | "event_map" | "material" | "mesh" | "module" | "point_cloud" | "render_graph" | "scene" | "script" | "shader" | "skeleton" | "sound" | "texture" | "texture_1d" | "texture_3d" | "volume_material");
376
+ source_file?: (Array<string> | string | 'exclude');
377
+ };
378
+ export type GetFolderAssets_AssetCount = {
379
+ total: number;
380
+ [asset_type: string]: number;
377
381
  };
378
382
  export type GetFolderAssets__index_AssetList_AssetList = {
379
383
  action_maps?: Array<GetFolderAssets_Object>;
@@ -404,11 +408,12 @@ export type GetFolderAssets_Object = {
404
408
  asset_id: string;
405
409
  name: string;
406
410
  };
407
- export declare function getFolderAssets({ folder_id, offset, limit, filter }: {
411
+ export declare function getFolderAssets({ folder_id, offset, limit, filter, recursive }: {
408
412
  folder_id: string;
409
413
  offset?: number;
410
414
  limit?: number;
411
- filter?: GetFolderAssets_Filter;
415
+ filter?: GetFolderAssets_Filters;
416
+ recursive?: boolean;
412
417
  }): AxiosPromise<GetFolderAssets__index_AssetList_AssetList>;
413
418
  export type CreateAsset_NewAsset = {
414
419
  asset_type: "action_map" | "algorithm" | "animation_graph" | "animation_sequence" | "cubemap" | "event_map" | "material" | "module" | "render_graph" | "scene" | "script" | "shader" | "volume_material";
@@ -458,6 +463,20 @@ export declare function createCubemap({ folder_id, faces, name }: {
458
463
  faces: Array<string>;
459
464
  name: string;
460
465
  }): AxiosPromise<CreateCubemap_Object>;
466
+ export type ImportAssets__index_ImportAssetsResponse_ImportAssetsResponse = {
467
+ asset_ids: ImportAssets_AssetIds;
468
+ skipped_files?: Array<string>;
469
+ };
470
+ export type ImportAssets_AssetIds = {
471
+ imported: Array<string>;
472
+ overwritten: Array<string>;
473
+ skipped: Array<string>;
474
+ };
475
+ export declare function importAssets({ folder_id, overwrite, body }: {
476
+ folder_id: string;
477
+ overwrite?: StrictUnion<'never' | 'only-specified' | 'always'>;
478
+ body: ArrayBuffer;
479
+ }): AxiosPromise<ImportAssets__index_ImportAssetsResponse_ImportAssetsResponse>;
461
480
  export type GetSessionsInFolder_Session = {
462
481
  session_id: string;
463
482
  scene_id: string;
@@ -766,6 +785,7 @@ export type GetAssetDescription_AnimationSequence = {
766
785
  export type GetAssetDescription_AnimationSet = {
767
786
  animationGraphUUID: string;
768
787
  animationSet: Array<GetAssetDescription_Object>;
788
+ boneMaskSet: Array<GetAssetDescription_Object>;
769
789
  name: string;
770
790
  uuid: string;
771
791
  };
@@ -814,7 +834,7 @@ export type GetAssetDescription_Channel = {
814
834
  elementCount: number;
815
835
  elementSize: number;
816
836
  elementType: StrictUnion<0 | 1 | 2> & number;
817
- semantic: StrictUnion<0 | 1 | 2 | 3 | 4 | 5 | 6 | 7> & number;
837
+ semantic: StrictUnion<'index' | 'position' | 'normal' | 'uv' | 'color' | 'bone_id' | 'weight'>;
818
838
  };
819
839
  export type GetAssetDescription_Module = {
820
840
  functions: GetAssetDescription_Object;
@@ -1005,6 +1025,351 @@ export type GetSceneAabb_Object = {
1005
1025
  export declare function getSceneAABB({ scene_id }: {
1006
1026
  scene_id: string;
1007
1027
  }): AxiosPromise<GetSceneAabb_Object>;
1028
+ export type CreateEntity_animation_controller = {
1029
+ animation_controller: CreateEntity_AnimationController;
1030
+ };
1031
+ export type CreateEntity_AnimationController = {
1032
+ animationGraphRef: string;
1033
+ animationSetRef: string;
1034
+ dataJSON: object;
1035
+ rootBoneEntityRef: CreateEntity_EntityReference;
1036
+ rootMotionEnabled: boolean;
1037
+ };
1038
+ export type CreateEntity_EntityReference = {
1039
+ originalEUID: string;
1040
+ linkage: Array<string>;
1041
+ };
1042
+ export type CreateEntity_bone = {
1043
+ bone: CreateEntity_Bone;
1044
+ };
1045
+ export type CreateEntity_Bone = {
1046
+ boneIndex: number;
1047
+ };
1048
+ export type CreateEntity_box_geometry = {
1049
+ box_geometry: CreateEntity_BoxGeometry;
1050
+ };
1051
+ export type CreateEntity_BoxGeometry = {
1052
+ dimension?: Array<number>;
1053
+ isAdditive?: boolean;
1054
+ offset?: Array<number>;
1055
+ };
1056
+ export type CreateEntity_camera = {
1057
+ camera: CreateEntity_Camera;
1058
+ };
1059
+ export type CreateEntity_Camera = {
1060
+ renderGraphRef: string;
1061
+ renderTargetIndex?: number;
1062
+ dataJSON: object;
1063
+ };
1064
+ export type CreateEntity_capsule_geometry = {
1065
+ capsule_geometry: CreateEntity_CapsuleGeometry;
1066
+ };
1067
+ export type CreateEntity_CapsuleGeometry = {
1068
+ radius?: number;
1069
+ height?: number;
1070
+ axis?: number;
1071
+ isAdditive?: boolean;
1072
+ offset?: Array<number>;
1073
+ };
1074
+ export type CreateEntity_character_controller = {
1075
+ character_controller: CreateEntity_CharacterController;
1076
+ };
1077
+ export type CreateEntity_CharacterController = {
1078
+ stepOffset?: number;
1079
+ slopeLimit?: number;
1080
+ skinWidth?: number;
1081
+ velocity?: Array<number>;
1082
+ };
1083
+ export type CreateEntity_collision_geometry_ref = {
1084
+ collision_geometry_ref: CreateEntity_CollisionGeometryRef;
1085
+ };
1086
+ export type CreateEntity_CollisionGeometryRef = {
1087
+ collisionGeometryRef: string;
1088
+ };
1089
+ export type CreateEntity_cylinder_geometry = {
1090
+ cylinder_geometry: CreateEntity_CylinderGeometry;
1091
+ };
1092
+ export type CreateEntity_CylinderGeometry = {
1093
+ radius?: number;
1094
+ height?: number;
1095
+ axis?: number;
1096
+ isAdditive?: boolean;
1097
+ offset?: Array<number>;
1098
+ };
1099
+ export type CreateEntity_debug_name = {
1100
+ debug_name: CreateEntity_Name;
1101
+ };
1102
+ export type CreateEntity_Name = {
1103
+ value: string;
1104
+ };
1105
+ export type CreateEntity_decal_projector = {
1106
+ decal_projector: CreateEntity_DecalProjector;
1107
+ };
1108
+ export type CreateEntity_DecalProjector = {
1109
+ zIndex?: number;
1110
+ };
1111
+ export type CreateEntity_environment = {
1112
+ environment: CreateEntity_Environment;
1113
+ };
1114
+ export type CreateEntity_Environment = {
1115
+ skyboxUUID: string;
1116
+ radianceUUID: string;
1117
+ irradianceUUID: string;
1118
+ };
1119
+ export type CreateEntity_joint = {
1120
+ joint: CreateEntity_Joint;
1121
+ };
1122
+ export type CreateEntity_Joint = {
1123
+ constrainee: CreateEntity_EntityReference;
1124
+ constrainer: CreateEntity_EntityReference;
1125
+ breakForce?: number;
1126
+ breakTorque?: number;
1127
+ };
1128
+ export type CreateEntity_lineage = {
1129
+ lineage: CreateEntity_Lineage;
1130
+ };
1131
+ export type CreateEntity_Lineage = {
1132
+ parentUUID: string;
1133
+ ordinal?: number;
1134
+ };
1135
+ export type CreateEntity_local_aabb = {
1136
+ local_aabb: CreateEntity_LocalAxisAlignedBoundingBox;
1137
+ };
1138
+ export type CreateEntity_LocalAxisAlignedBoundingBox = {
1139
+ min: Array<number>;
1140
+ max: Array<number>;
1141
+ };
1142
+ export type CreateEntity_local_transform = {
1143
+ local_transform: CreateEntity_Transform;
1144
+ };
1145
+ export type CreateEntity_Transform = {
1146
+ position?: Array<number>;
1147
+ orientation?: Array<number>;
1148
+ scale?: Array<number>;
1149
+ eulerOrientation?: Array<number>;
1150
+ globalEulerOrientation?: Array<number>;
1151
+ };
1152
+ export type CreateEntity_material = {
1153
+ material: CreateEntity_Material;
1154
+ };
1155
+ export type CreateEntity_Material = {
1156
+ shaderRef: string;
1157
+ transparencyMode: number;
1158
+ isDoubleSided: boolean;
1159
+ dataJSON: object;
1160
+ };
1161
+ export type CreateEntity_material_ref = {
1162
+ material_ref: CreateEntity_MaterialReference;
1163
+ };
1164
+ export type CreateEntity_MaterialReference = {
1165
+ value: string;
1166
+ faceCulling?: number;
1167
+ };
1168
+ export type CreateEntity_mesh_ref = {
1169
+ mesh_ref: CreateEntity_MeshReference;
1170
+ };
1171
+ export type CreateEntity_MeshReference = {
1172
+ value: string;
1173
+ submeshIndex?: number;
1174
+ };
1175
+ export type CreateEntity_orthographic_lens = {
1176
+ orthographic_lens: CreateEntity_OrthographicLens;
1177
+ };
1178
+ export type CreateEntity_OrthographicLens = {
1179
+ left?: number;
1180
+ right?: number;
1181
+ top?: number;
1182
+ bottom?: number;
1183
+ zNear?: number;
1184
+ zFar?: number;
1185
+ };
1186
+ export type CreateEntity_overrider = {
1187
+ overrider: CreateEntity_Overrider;
1188
+ };
1189
+ export type CreateEntity_Overrider = {
1190
+ deleter?: boolean;
1191
+ entityRef: CreateEntity_EntityReference;
1192
+ componentsToDetach: Array<number>;
1193
+ };
1194
+ export type CreateEntity_perspective_lens = {
1195
+ perspective_lens: CreateEntity_PerspectiveLens;
1196
+ };
1197
+ export type CreateEntity_PerspectiveLens = {
1198
+ aspectRatio?: number;
1199
+ fovy?: number;
1200
+ nearPlane?: number;
1201
+ farPlane?: number;
1202
+ };
1203
+ export type CreateEntity_physics_material = {
1204
+ physics_material: CreateEntity_PhysicsMaterial;
1205
+ };
1206
+ export type CreateEntity_PhysicsMaterial = {
1207
+ staticFriction?: number;
1208
+ dynamicFriction?: number;
1209
+ restitution?: number;
1210
+ isTrigger?: boolean;
1211
+ };
1212
+ export type CreateEntity_plane_geometry = {
1213
+ plane_geometry: CreateEntity_PlaneGeometry;
1214
+ };
1215
+ export type CreateEntity_PlaneGeometry = {
1216
+ distance?: number;
1217
+ normal?: Array<number>;
1218
+ };
1219
+ export type CreateEntity_point_cloud_ref = {
1220
+ point_cloud_ref: CreateEntity_PointCloudReference;
1221
+ };
1222
+ export type CreateEntity_PointCloudReference = {
1223
+ value: string;
1224
+ };
1225
+ export type CreateEntity_point_light = {
1226
+ point_light: CreateEntity_Light;
1227
+ };
1228
+ export type CreateEntity_Light = {
1229
+ color?: Array<number>;
1230
+ intensity?: number;
1231
+ range?: number;
1232
+ isDirectional?: boolean;
1233
+ isSun?: boolean;
1234
+ };
1235
+ export type CreateEntity_reflection_probe = {
1236
+ reflection_probe: CreateEntity_ReflectionProbe;
1237
+ };
1238
+ export type CreateEntity_ReflectionProbe = {
1239
+ offset?: Array<number>;
1240
+ nearDist?: number;
1241
+ farDist?: number;
1242
+ quality?: number;
1243
+ };
1244
+ export type CreateEntity_revolute_joint = {
1245
+ revolute_joint: CreateEntity_RevoluteJoint;
1246
+ };
1247
+ export type CreateEntity_RevoluteJoint = {
1248
+ axis?: Array<number>;
1249
+ anchor?: Array<number>;
1250
+ };
1251
+ export type CreateEntity_rigid_body = {
1252
+ rigid_body: CreateEntity_RigidBody;
1253
+ };
1254
+ export type CreateEntity_RigidBody = {
1255
+ mass?: number;
1256
+ linearDamping?: number;
1257
+ angularDamping?: number;
1258
+ friction?: number;
1259
+ rollingFriction?: number;
1260
+ spinningFriction?: number;
1261
+ restitution?: number;
1262
+ linearSleepingThreshold?: number;
1263
+ angularSleepingThreshold?: number;
1264
+ isKinematic?: boolean;
1265
+ };
1266
+ export type CreateEntity_scene_ref = {
1267
+ scene_ref: CreateEntity_SceneReference;
1268
+ };
1269
+ export type CreateEntity_SceneReference = {
1270
+ value: string;
1271
+ maxRecursionCount?: number;
1272
+ };
1273
+ export type CreateEntity_script_element = {
1274
+ script_element: CreateEntity_ScriptElement;
1275
+ };
1276
+ export type CreateEntity_ScriptElement = {
1277
+ scriptRef: string;
1278
+ dataJSON: object;
1279
+ };
1280
+ export type CreateEntity_script_map = {
1281
+ script_map: CreateEntity_ScriptMap;
1282
+ };
1283
+ export type CreateEntity_ScriptMap = {
1284
+ elements: object;
1285
+ };
1286
+ export type CreateEntity_shadow_caster = {
1287
+ shadow_caster: CreateEntity_ShadowCaster;
1288
+ };
1289
+ export type CreateEntity_ShadowCaster = {
1290
+ bias?: number;
1291
+ nearDist?: number;
1292
+ farDist?: number;
1293
+ quality?: number;
1294
+ cascadeSplitLambda?: number;
1295
+ cascadeMaxZ?: number;
1296
+ accumulateShadowCascades?: boolean;
1297
+ };
1298
+ export type CreateEntity_skeleton_ref = {
1299
+ skeleton_ref: CreateEntity_SkeletonReference;
1300
+ };
1301
+ export type CreateEntity_SkeletonReference = {
1302
+ value: string;
1303
+ };
1304
+ export type CreateEntity_sound_ref = {
1305
+ sound_ref: CreateEntity_SoundReference;
1306
+ };
1307
+ export type CreateEntity_SoundReference = {
1308
+ value: string;
1309
+ volume?: number;
1310
+ pan?: number;
1311
+ playSpeed?: number;
1312
+ looping?: boolean;
1313
+ };
1314
+ export type CreateEntity_sphere_geometry = {
1315
+ sphere_geometry: CreateEntity_SphereGeometry;
1316
+ };
1317
+ export type CreateEntity_SphereGeometry = {
1318
+ radius?: number;
1319
+ isAdditive?: boolean;
1320
+ offset?: Array<number>;
1321
+ };
1322
+ export type CreateEntity_spot_light = {
1323
+ spot_light: CreateEntity_SpotLight;
1324
+ };
1325
+ export type CreateEntity_SpotLight = {
1326
+ cutoff?: number;
1327
+ IESProfile: string;
1328
+ };
1329
+ export type CreateEntity_stereoscopic_lens = {
1330
+ stereoscopic_lens: CreateEntity_StereoscopicPerspectiveLens;
1331
+ };
1332
+ export type CreateEntity_StereoscopicPerspectiveLens = {
1333
+ angleLeft?: number;
1334
+ angleRight?: number;
1335
+ angleUp?: number;
1336
+ angleDown?: number;
1337
+ nearPlane?: number;
1338
+ farPlane?: number;
1339
+ aspectRatio?: number;
1340
+ };
1341
+ export type CreateEntity_tags = {
1342
+ tags: CreateEntity_Tags;
1343
+ };
1344
+ export type CreateEntity_Tags = {
1345
+ value: Array<string>;
1346
+ };
1347
+ export type CreateEntity_volume_filter = {
1348
+ volume_filter: CreateEntity_VolumeFilter;
1349
+ };
1350
+ export type CreateEntity_VolumeFilter = {
1351
+ range?: Array<number>;
1352
+ applyGaussianFiltering?: boolean;
1353
+ sampleUnfiltered?: boolean;
1354
+ enableMPR?: boolean;
1355
+ enable3D?: boolean;
1356
+ };
1357
+ export type CreateEntity_volume_material_ref = {
1358
+ volume_material_ref: CreateEntity_VolumeMaterialReference;
1359
+ };
1360
+ export type CreateEntity_VolumeMaterialReference = {
1361
+ value: string;
1362
+ };
1363
+ export type CreateEntity_volume_ref = {
1364
+ volume_ref: CreateEntity_VolumeReference;
1365
+ };
1366
+ export type CreateEntity_VolumeReference = {
1367
+ texture3dRef: string;
1368
+ };
1369
+ export declare function createEntity({ scene_id, entity_components }: {
1370
+ scene_id: string;
1371
+ entity_components: (CreateEntity_animation_controller | CreateEntity_bone | CreateEntity_box_geometry | CreateEntity_camera | CreateEntity_capsule_geometry | CreateEntity_character_controller | CreateEntity_collision_geometry_ref | CreateEntity_cylinder_geometry | CreateEntity_debug_name | CreateEntity_decal_projector | CreateEntity_environment | CreateEntity_joint | CreateEntity_lineage | CreateEntity_local_aabb | CreateEntity_local_transform | CreateEntity_material | CreateEntity_material_ref | CreateEntity_mesh_ref | CreateEntity_orthographic_lens | CreateEntity_overrider | CreateEntity_perspective_lens | CreateEntity_physics_material | CreateEntity_plane_geometry | CreateEntity_point_cloud_ref | CreateEntity_point_light | CreateEntity_reflection_probe | CreateEntity_revolute_joint | CreateEntity_rigid_body | CreateEntity_scene_ref | CreateEntity_script_element | CreateEntity_script_map | CreateEntity_shadow_caster | CreateEntity_skeleton_ref | CreateEntity_sound_ref | CreateEntity_sphere_geometry | CreateEntity_spot_light | CreateEntity_stereoscopic_lens | CreateEntity_tags | CreateEntity_volume_filter | CreateEntity_volume_material_ref | CreateEntity_volume_ref);
1372
+ }): AxiosPromise<any>;
1008
1373
  export type GetEntity_animation_controller = {
1009
1374
  animation_controller: GetEntity_AnimationController;
1010
1375
  };
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ __export(library_exports, {
34
34
  axiosInstance: () => axiosInstance,
35
35
  createAsset: () => createAsset,
36
36
  createCubemap: () => createCubemap,
37
+ createEntity: () => createEntity,
37
38
  createFolder: () => createFolder,
38
39
  createGroup: () => createGroup,
39
40
  createMaterial: () => createMaterial,
@@ -83,6 +84,7 @@ __export(library_exports, {
83
84
  getUserUploadTasks: () => getUserUploadTasks,
84
85
  grantMemberAccessToFolder: () => grantMemberAccessToFolder,
85
86
  grantMemberAccessToGroup: () => grantMemberAccessToGroup,
87
+ importAssets: () => importAssets,
86
88
  joinSession: () => joinSession,
87
89
  joinSessionAsGuest: () => joinSessionAsGuest,
88
90
  kickClientFromSession: () => kickClientFromSession,
@@ -447,7 +449,8 @@ function getFolderAssets({
447
449
  folder_id,
448
450
  offset = 0,
449
451
  limit = 10,
450
- filter
452
+ filter,
453
+ recursive = false
451
454
  }) {
452
455
  return axiosInstance({
453
456
  method: "get",
@@ -455,8 +458,12 @@ function getFolderAssets({
455
458
  params: {
456
459
  offset,
457
460
  limit,
458
- filter
461
+ filter,
462
+ recursive
459
463
  }
464
+ }).then((response) => {
465
+ response.headers["x-assets-count"] = JSON.parse(response.headers["x-assets-count"]);
466
+ return response;
460
467
  });
461
468
  }
462
469
  function createAsset({
@@ -511,6 +518,23 @@ function createCubemap({
511
518
  }
512
519
  });
513
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
+ }
514
538
  function getSessionsInFolder({
515
539
  folder_id
516
540
  }) {
@@ -851,6 +875,16 @@ function getSceneAABB({
851
875
  url: "/assets/scenes/" + scene_id + "/aabb"
852
876
  });
853
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
+ }
854
888
  function getEntity({
855
889
  scene_id,
856
890
  entity_id,
@@ -1067,6 +1101,7 @@ function uploadSourceFiles({
1067
1101
  axiosInstance,
1068
1102
  createAsset,
1069
1103
  createCubemap,
1104
+ createEntity,
1070
1105
  createFolder,
1071
1106
  createGroup,
1072
1107
  createMaterial,
@@ -1116,6 +1151,7 @@ function uploadSourceFiles({
1116
1151
  getUserUploadTasks,
1117
1152
  grantMemberAccessToFolder,
1118
1153
  grantMemberAccessToGroup,
1154
+ importAssets,
1119
1155
  joinSession,
1120
1156
  joinSessionAsGuest,
1121
1157
  kickClientFromSession,