@3dverse/api 0.8.21 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -195,7 +195,7 @@ export type GetUserUploadTasks_ConversionTask = {
195
195
  source_file_id: string;
196
196
  /** The name of the source file */
197
197
  source_file_name: string;
198
- conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud';
198
+ conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud' | 'package';
199
199
  progress: number;
200
200
  status: StrictUnion<'pending' | 'converting' | 'error' | 'success'> & string;
201
201
  };
@@ -508,15 +508,23 @@ export type UploadSourceFiles_Object = {
508
508
  upload_task_id?: string;
509
509
  };
510
510
  /**
511
- * Uploads the specified source file(s).
512
- * The supported file formats are:
513
- * - Scene :
514
- * - Mesh : `fbx, obj/mtl, stl, ply, ifc, usd, usda, usdc, usdz, skp, ptf, 3ds, 3mf, ac, ac3d, acc, amj, ase, ask, b3d, blend, bvh, cms, cob, dae, dxf, gltf/bin, glb, enff, hmb, irr, irrmesh, lwo, lws, lxo, m3d, md2, md3, md5, mdc, mdl, xml, mot, ms3d, ndo, nff, off, ogex, pmx, prj, q3o, q3s, raw, scn, sib, smd, ter, uc, vta, wrl, x, x3d, xgl, zgl`
515
- * - Point cloud : `e57, ptx, xyz, las, laz`
516
- * - Volume : `dcm`
517
- * - Texture : `jpg, jpeg, png, tga, dds, tif, tiff, bmp, rgbe`
518
- * - Cubemap : `hdr`
519
- * - Sound : `wav, mp3, ogg, flac`.
511
+ * Uploads the specified source file(s). The accepted extensions, their conversion type and
512
+ * per-converter options are listed by `GET /source-files/supported-formats` and documented at
513
+ * https://docs.3dverse.com/references/supported-file-formats.
514
+ * ### Importing an asset package
515
+ * With the `package` conversion pipeline, the source files are already converted assets, imported as they are,
516
+ * submitted as zip archives (asset packages) or as the asset files themselves. The asset files are named
517
+ * `<part>.<asset_type>[.<sub resource>].<uuid>`, where the part is `desc` (the asset description, in JSON),
518
+ * `payload`, `graph` or `layout`, for example `desc.mesh.<uuid>`, `payload.mesh.<uuid>` or
519
+ * `payload.texture.mip0.<uuid>`. The assets they reference must be submitted along with them, unless they already
520
+ * exist. The submitted assets that already exist are overwritten only if they are listed in an `overwrite.json`
521
+ * file, a JSON array of asset ids submitted along with them; without it, the import fails if one of them already
522
+ * exists.
523
+ * The import runs asynchronously, as a data pipeline:
524
+ * 1. `GET /pipelines/{pipeline_id}`, with the returned `upload_task_id` as the pipeline id, tells its status and,
525
+ * on failure, the reason, such as the invalid assets or the missing permissions.
526
+ * 2. Once it has succeeded, `GET /conversion_tasks/{conversion_task_id}/metadata/import_result.json`, with the id
527
+ * of the pipeline job as the conversion task id, returns the imported, overwritten and skipped asset ids.
520
528
  */
521
529
  export declare function uploadSourceFiles({ folder_id, body, }: {
522
530
  folder_id: string;
@@ -582,7 +590,7 @@ export type GetUploadTasksInFolder_ConversionTask = {
582
590
  source_file_id: string;
583
591
  /** The name of the source file */
584
592
  source_file_name: string;
585
- conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud';
593
+ conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud' | 'package';
586
594
  progress: number;
587
595
  status: StrictUnion<'pending' | 'converting' | 'error' | 'success'> & string;
588
596
  };
@@ -726,59 +734,6 @@ export declare function createCubemap({ folder_id, faces, name, }: {
726
734
  /** Name of the asset */
727
735
  name: string;
728
736
  }, headers?: AxiosRequestHeaders): AxiosPromise<CreateCubemap_Object>;
729
- export type ImportAssets__index_ImportAssetsResponse_ImportAssetsResponse = {
730
- /** List of asset ids contained in the package */
731
- asset_ids: ImportAssets_AssetIds;
732
- /** List of skipped file names in the package */
733
- skipped_files?: Array<string>;
734
- };
735
- export type ImportAssets_AssetIds = {
736
- /** List of asset ids that were created */
737
- imported: Array<string>;
738
- /** List of asset ids that were overwritten */
739
- overwritten: Array<string>;
740
- /** List of asset ids that were skipped because they already exist and were not specified in the overwrite.json file */
741
- skipped: Array<string>;
742
- };
743
- /**
744
- * Imports or replaces multiple assets submitted as a package.
745
- * The package must be a zip archive containing the assets to import.
746
- * The package should contain the assets themselves at the root level of the archive with their descriptions in JSON format, and their payloads (e.g. textures, meshes, etc.)
747
- * and contain all the assets' dependencies if they do not already exist.
748
- * Supported assets are :
749
- * - scene
750
- * - mesh
751
- * - material
752
- * - animation
753
- * - animation_set
754
- * - animation_graph
755
- * - skeleton
756
- * - texture_1d
757
- * - texture
758
- * - texture_3d
759
- * - collision_geometry
760
- * - cubemap
761
- * - volume_material
762
- * - event_map
763
- * - action_map
764
- * - sound
765
- * - point_cloud
766
- * The packaged assets' files should be named according to the following pattern:
767
- * ``` json
768
- * - desc.[asset_type].{uuid}
769
- * - payload.[mesh|texture|animation|skeleton|texture_1d|texture_3d|collision_geometry|sound].{uuid}
770
- * - payload.[texture_1d|texture|texture_3d].mips[0-16].{uuid}
771
- * - payload.point_cloud.[position|color].{uuid}
772
- * - payload.texture_3d.histogram.{uuid}
773
- * ```
774
- * The package may also contain an overwrite.json file that describes which assets to overwrite.
775
- * The overwrite.json file is only used if the overwrite query parameter is set to only-specified.
776
- */
777
- export declare function importAssets({ folder_id, overwrite, body, }: {
778
- folder_id: string;
779
- overwrite?: 'never' | 'only-specified' | 'always';
780
- body: ArrayBuffer | ReadableStream;
781
- }, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void, headers?: AxiosRequestHeaders): AxiosPromise<ImportAssets__index_ImportAssetsResponse_ImportAssetsResponse>;
782
737
  export type GetSessionsInFolder_Session = {
783
738
  /** Session unique identifier */
784
739
  session_id: string;
@@ -790,8 +745,10 @@ export type GetSessionsInFolder_Session = {
790
745
  folder_id: string;
791
746
  /** Maximum number of users allowed in this session at the same time */
792
747
  max_users: number;
793
- /** User identifier of the creator of the session */
748
+ /** @deprecated User identifier of the creator of the session (deprecated, use `created_by` instead) */
794
749
  creator_user_id: string;
750
+ /** User identifier of the creator of the session */
751
+ created_by?: GetSessionsInFolder_CreatedBy;
795
752
  /** Session creation date */
796
753
  created_at: string;
797
754
  /** Country code of the rendering server location */
@@ -803,6 +760,12 @@ export type GetSessionsInFolder_Session = {
803
760
  /** Current clients in session */
804
761
  clients: Array<GetSessionsInFolder_Client_UserInfo>;
805
762
  };
763
+ export type GetSessionsInFolder_CreatedBy = {
764
+ /** User unique identifier */
765
+ user_id?: string;
766
+ username?: string;
767
+ required?: any;
768
+ };
806
769
  export type GetSessionsInFolder_Client_UserInfo = {
807
770
  /** Client unique identifier */
808
771
  client_id?: string;
@@ -849,6 +812,34 @@ export declare function deleteSourceFiles({ source_file_ids, delete_assets, }: {
849
812
  */
850
813
  delete_assets?: boolean;
851
814
  }, headers?: AxiosRequestHeaders): Promise<import("axios").AxiosResponse<any, any, {}>>;
815
+ export type GetSupportedSourceFileFormats_SupportedSourceFileFormats = {
816
+ /** Files accepted by one conversion type. Aggregates are the union over its converters. */
817
+ cubemap: GetSupportedSourceFileFormats_SupportedFormat;
818
+ /** Files accepted by one conversion type. Aggregates are the union over its converters. */
819
+ point_cloud: GetSupportedSourceFileFormats_SupportedFormat;
820
+ /** Files accepted by one conversion type. Aggregates are the union over its converters. */
821
+ scene: GetSupportedSourceFileFormats_SupportedFormat;
822
+ /** Files accepted by one conversion type. Aggregates are the union over its converters. */
823
+ sound: GetSupportedSourceFileFormats_SupportedFormat;
824
+ /** Files accepted by one conversion type. Aggregates are the union over its converters. */
825
+ texture: GetSupportedSourceFileFormats_SupportedFormat;
826
+ /** Files accepted by one conversion type. Aggregates are the union over its converters. */
827
+ volume: GetSupportedSourceFileFormats_SupportedFormat;
828
+ };
829
+ export type GetSupportedSourceFileFormats_SupportedFormat = {
830
+ /** Extra file extensions to bundle with a given primary extension. */
831
+ associated_file_extensions?: GetSupportedSourceFileFormats_Object;
832
+ /** Per sub-pipeline breakdown, keyed by converter name. */
833
+ converters: GetSupportedSourceFileFormats_Object;
834
+ file_extensions: Array<string>;
835
+ };
836
+ export type GetSupportedSourceFileFormats_Object = {
837
+ [_additionalproperties_: string]: Array<string>;
838
+ };
839
+ /**
840
+ * Returns the source file formats accepted for conversion, grouped by conversion type, with the per-converter breakdown and each converter's options schema.
841
+ */
842
+ export declare function getSupportedSourceFileFormats(headers?: AxiosRequestHeaders): AxiosPromise<GetSupportedSourceFileFormats_SupportedSourceFileFormats>;
852
843
  /**
853
844
  * Downloads the target source file.
854
845
  */
@@ -953,7 +944,7 @@ export type GetUploadTask_ConversionTask = {
953
944
  source_file_id: string;
954
945
  /** The name of the source file */
955
946
  source_file_name: string;
956
- conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud';
947
+ conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud' | 'package';
957
948
  progress: number;
958
949
  status: StrictUnion<'pending' | 'converting' | 'error' | 'success'> & string;
959
950
  };
@@ -999,6 +990,10 @@ export type GetPipeline_Pipeline = {
999
990
  data_pipeline_id: string;
1000
991
  /** Unique identifier of an environment */
1001
992
  environment_id: string;
993
+ /** Reason why the pipeline failed or was rejected, if applicable. */
994
+ error?: string;
995
+ /** Stable, machine-readable category for why a pipeline/job/step failed or was rejected. Meant for programmatic handling (e.g. displaying a localized, user-facing message) — the accompanying `error` field carries the technical detail. `processing_failed` is a catch-all used whenever the failure doesn't fall into one of the other, more specific categories. */
996
+ error_code?: 'quota_exceeded' | 'unsupported_file_format' | 'nothing_to_process' | 'enqueue_failed' | 'download_failed' | 'extraction_failed' | 'processing_failed';
1002
997
  /** Date and time when the pipeline was completed, either successfully or with errors. */
1003
998
  finished_at?: string;
1004
999
  /** Folder unique identifier */
@@ -1019,6 +1014,10 @@ export type GetPipeline_Pipeline = {
1019
1014
  user_id: string;
1020
1015
  };
1021
1016
  export type GetPipeline_Job = {
1017
+ /** Reason why the job failed, if applicable. */
1018
+ error?: string;
1019
+ /** Stable, machine-readable category for why a pipeline/job/step failed or was rejected. Meant for programmatic handling (e.g. displaying a localized, user-facing message) — the accompanying `error` field carries the technical detail. `processing_failed` is a catch-all used whenever the failure doesn't fall into one of the other, more specific categories. */
1020
+ error_code?: 'quota_exceeded' | 'unsupported_file_format' | 'nothing_to_process' | 'enqueue_failed' | 'download_failed' | 'extraction_failed' | 'processing_failed';
1022
1021
  /** Date and time when the job was completed, either successfully or with errors. */
1023
1022
  finished_at?: string;
1024
1023
  /** Data Pipeline job unique identifier. */
@@ -1037,6 +1036,10 @@ export type GetPipeline_Job = {
1037
1036
  steps: Array<GetPipeline_Step>;
1038
1037
  };
1039
1038
  export type GetPipeline_Step = {
1039
+ /** Reason why the step failed, if applicable. */
1040
+ error?: string;
1041
+ /** Stable, machine-readable category for why a pipeline/job/step failed or was rejected. Meant for programmatic handling (e.g. displaying a localized, user-facing message) — the accompanying `error` field carries the technical detail. `processing_failed` is a catch-all used whenever the failure doesn't fall into one of the other, more specific categories. */
1042
+ error_code?: 'quota_exceeded' | 'unsupported_file_format' | 'nothing_to_process' | 'enqueue_failed' | 'download_failed' | 'extraction_failed' | 'processing_failed';
1040
1043
  /** Date and time when the step was completed, either successfully or with errors. */
1041
1044
  finished_at?: string;
1042
1045
  /** Data Pipeline job unique identifier. */
@@ -1776,7 +1779,7 @@ export type GetAssetDescription_Shader = {
1776
1779
  };
1777
1780
  export type GetAssetDescription_ComputeShaderSettings = {
1778
1781
  /** Global group reference */
1779
- sizeReference?: StrictUnion<0 | 1 | 2>;
1782
+ sizeReference?: StrictUnion<0 | 1 | 2 | 3>;
1780
1783
  /** Size of the workgroup */
1781
1784
  workgroupSize?: Array<number>;
1782
1785
  /** Scaling factor to apply to the total workgroup count */
@@ -2332,8 +2335,10 @@ export type GetSceneSessions_Session = {
2332
2335
  folder_id: string;
2333
2336
  /** Maximum number of users allowed in this session at the same time */
2334
2337
  max_users: number;
2335
- /** User identifier of the creator of the session */
2338
+ /** @deprecated User identifier of the creator of the session (deprecated, use `created_by` instead) */
2336
2339
  creator_user_id: string;
2340
+ /** User identifier of the creator of the session */
2341
+ created_by?: GetSceneSessions_CreatedBy;
2337
2342
  /** Session creation date */
2338
2343
  created_at: string;
2339
2344
  /** Country code of the rendering server location */
@@ -2345,6 +2350,12 @@ export type GetSceneSessions_Session = {
2345
2350
  /** Current clients in session */
2346
2351
  clients: Array<GetSceneSessions_Client_UserInfo>;
2347
2352
  };
2353
+ export type GetSceneSessions_CreatedBy = {
2354
+ /** User unique identifier */
2355
+ user_id?: string;
2356
+ username?: string;
2357
+ required?: any;
2358
+ };
2348
2359
  export type GetSceneSessions_Client_UserInfo = {
2349
2360
  /** Client unique identifier */
2350
2361
  client_id?: string;
@@ -4200,8 +4211,10 @@ export type GetRunningSessions_Session = {
4200
4211
  folder_id: string;
4201
4212
  /** Maximum number of users allowed in this session at the same time */
4202
4213
  max_users: number;
4203
- /** User identifier of the creator of the session */
4214
+ /** @deprecated User identifier of the creator of the session (deprecated, use `created_by` instead) */
4204
4215
  creator_user_id: string;
4216
+ /** User identifier of the creator of the session */
4217
+ created_by?: GetRunningSessions_CreatedBy;
4205
4218
  /** Session creation date */
4206
4219
  created_at: string;
4207
4220
  /** Country code of the rendering server location */
@@ -4213,6 +4226,12 @@ export type GetRunningSessions_Session = {
4213
4226
  /** Current clients in session */
4214
4227
  clients: Array<GetRunningSessions_Client_UserInfo>;
4215
4228
  };
4229
+ export type GetRunningSessions_CreatedBy = {
4230
+ /** User unique identifier */
4231
+ user_id?: string;
4232
+ username?: string;
4233
+ required?: any;
4234
+ };
4216
4235
  export type GetRunningSessions_Client_UserInfo = {
4217
4236
  /** Client unique identifier */
4218
4237
  client_id?: string;
@@ -4256,8 +4275,10 @@ export type GetSession_Session = {
4256
4275
  folder_id: string;
4257
4276
  /** Maximum number of users allowed in this session at the same time */
4258
4277
  max_users: number;
4259
- /** User identifier of the creator of the session */
4278
+ /** @deprecated User identifier of the creator of the session (deprecated, use `created_by` instead) */
4260
4279
  creator_user_id: string;
4280
+ /** User identifier of the creator of the session */
4281
+ created_by?: GetSession_CreatedBy;
4261
4282
  /** Session creation date */
4262
4283
  created_at: string;
4263
4284
  /** Country code of the rendering server location */
@@ -4269,6 +4290,12 @@ export type GetSession_Session = {
4269
4290
  /** Current clients in session */
4270
4291
  clients: Array<GetSession_Client_UserInfo>;
4271
4292
  };
4293
+ export type GetSession_CreatedBy = {
4294
+ /** User unique identifier */
4295
+ user_id?: string;
4296
+ username?: string;
4297
+ required?: any;
4298
+ };
4272
4299
  export type GetSession_Client_UserInfo = {
4273
4300
  /** Client unique identifier */
4274
4301
  client_id?: string;
package/dist/index.js CHANGED
@@ -81,6 +81,7 @@ __export(index_exports, {
81
81
  getSourceFileAssets: () => getSourceFileAssets,
82
82
  getSourceFileDetails: () => getSourceFileDetails,
83
83
  getSourceFilesInFolder: () => getSourceFilesInFolder,
84
+ getSupportedSourceFileFormats: () => getSupportedSourceFileFormats,
84
85
  getUploadTask: () => getUploadTask,
85
86
  getUploadTasks: () => getUploadTasks,
86
87
  getUploadTasksInFolder: () => getUploadTasksInFolder,
@@ -89,7 +90,6 @@ __export(index_exports, {
89
90
  getUserUploadTasks: () => getUserUploadTasks,
90
91
  grantMemberAccessToFolder: () => grantMemberAccessToFolder,
91
92
  grantMemberAccessToGroup: () => grantMemberAccessToGroup,
92
- importAssets: () => importAssets,
93
93
  joinSession: () => joinSession,
94
94
  joinSessionAsGuest: () => joinSessionAsGuest,
95
95
  kickClientFromSession: () => kickClientFromSession,
@@ -584,26 +584,6 @@ function createCubemap({
584
584
  headers
585
585
  });
586
586
  }
587
- function importAssets({
588
- folder_id,
589
- overwrite = "never",
590
- body
591
- }, onUploadProgress, headers) {
592
- return axiosInstance({
593
- method: "put",
594
- url: "/folders/" + folder_id + "/packages",
595
- params: {
596
- overwrite
597
- },
598
- data: body,
599
- maxRedirects: 0,
600
- onUploadProgress,
601
- headers: {
602
- "Content-Type": "application/zip",
603
- ...headers?.toJSON()
604
- }
605
- });
606
- }
607
587
  function getSessionsInFolder({
608
588
  folder_id
609
589
  }, headers) {
@@ -646,6 +626,13 @@ function deleteSourceFiles({
646
626
  headers
647
627
  });
648
628
  }
629
+ function getSupportedSourceFileFormats(headers) {
630
+ return axiosInstance({
631
+ method: "get",
632
+ url: "/source-files/supported-formats",
633
+ headers
634
+ });
635
+ }
649
636
  function downloadSourceFile({
650
637
  source_file_id
651
638
  }, headers, responseType) {
@@ -1348,6 +1335,7 @@ installInterceptors();
1348
1335
  getSourceFileAssets,
1349
1336
  getSourceFileDetails,
1350
1337
  getSourceFilesInFolder,
1338
+ getSupportedSourceFileFormats,
1351
1339
  getUploadTask,
1352
1340
  getUploadTasks,
1353
1341
  getUploadTasksInFolder,
@@ -1356,7 +1344,6 @@ installInterceptors();
1356
1344
  getUserUploadTasks,
1357
1345
  grantMemberAccessToFolder,
1358
1346
  grantMemberAccessToGroup,
1359
- importAssets,
1360
1347
  joinSession,
1361
1348
  joinSessionAsGuest,
1362
1349
  kickClientFromSession,