@3dverse/api 0.8.22 → 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,7 +508,23 @@ export type UploadSourceFiles_Object = {
508
508
  upload_task_id?: string;
509
509
  };
510
510
  /**
511
- * Uploads the specified source file(s). The accepted extensions, their conversion type and per-converter options are listed by `GET /source-files/supported-formats` and documented at https://docs.3dverse.com/references/supported-file-formats.
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.
512
528
  */
513
529
  export declare function uploadSourceFiles({ folder_id, body, }: {
514
530
  folder_id: string;
@@ -574,7 +590,7 @@ export type GetUploadTasksInFolder_ConversionTask = {
574
590
  source_file_id: string;
575
591
  /** The name of the source file */
576
592
  source_file_name: string;
577
- conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud';
593
+ conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud' | 'package';
578
594
  progress: number;
579
595
  status: StrictUnion<'pending' | 'converting' | 'error' | 'success'> & string;
580
596
  };
@@ -718,60 +734,6 @@ export declare function createCubemap({ folder_id, faces, name, }: {
718
734
  /** Name of the asset */
719
735
  name: string;
720
736
  }, headers?: AxiosRequestHeaders): AxiosPromise<CreateCubemap_Object>;
721
- export type ImportAssets__index_ImportAssetsResponse_ImportAssetsResponse = {
722
- /** List of asset ids contained in the package */
723
- asset_ids: ImportAssets_AssetIds;
724
- /** List of skipped file names in the package. Includes the payload files of shader, script and animation_sequence assets, whose payload is intentionally not imported (only their description is).
725
- */
726
- skipped_files?: Array<string>;
727
- };
728
- export type ImportAssets_AssetIds = {
729
- /** List of asset ids that were created */
730
- imported: Array<string>;
731
- /** List of asset ids that were overwritten */
732
- overwritten: Array<string>;
733
- /** List of asset ids that were skipped because they already exist and were not specified in the overwrite.json file */
734
- skipped: Array<string>;
735
- };
736
- /**
737
- * Imports or replaces multiple assets submitted as a package.
738
- * The package must be a zip archive containing the assets to import.
739
- * 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.)
740
- * and contain all the assets' dependencies if they do not already exist.
741
- * Supported assets are :
742
- * - scene
743
- * - mesh
744
- * - material
745
- * - animation
746
- * - animation_set
747
- * - animation_graph
748
- * - skeleton
749
- * - texture_1d
750
- * - texture
751
- * - texture_3d
752
- * - collision_geometry
753
- * - cubemap
754
- * - volume_material
755
- * - event_map
756
- * - action_map
757
- * - sound
758
- * - point_cloud
759
- * The packaged assets' files should be named according to the following pattern:
760
- * ``` json
761
- * - desc.[asset_type].{uuid}
762
- * - payload.[mesh|texture|animation|skeleton|texture_1d|texture_3d|collision_geometry|sound].{uuid}
763
- * - payload.[texture_1d|texture|texture_3d].mips[0-16].{uuid}
764
- * - payload.point_cloud.[position|color].{uuid}
765
- * - payload.texture_3d.histogram.{uuid}
766
- * ```
767
- * The package may also contain an overwrite.json file that describes which assets to overwrite.
768
- * The overwrite.json file is only used if the overwrite query parameter is set to only-specified.
769
- */
770
- export declare function importAssets({ folder_id, overwrite, body, }: {
771
- folder_id: string;
772
- overwrite?: 'never' | 'only-specified' | 'always';
773
- body: ArrayBuffer | ReadableStream;
774
- }, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void, headers?: AxiosRequestHeaders): AxiosPromise<ImportAssets__index_ImportAssetsResponse_ImportAssetsResponse>;
775
737
  export type GetSessionsInFolder_Session = {
776
738
  /** Session unique identifier */
777
739
  session_id: string;
@@ -982,7 +944,7 @@ export type GetUploadTask_ConversionTask = {
982
944
  source_file_id: string;
983
945
  /** The name of the source file */
984
946
  source_file_name: string;
985
- conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud';
947
+ conversion_pipeline: 'auto-detect' | 'volume' | 'scene' | 'texture' | 'animation' | 'point-cloud' | 'package';
986
948
  progress: number;
987
949
  status: StrictUnion<'pending' | 'converting' | 'error' | 'success'> & string;
988
950
  };
@@ -1028,6 +990,10 @@ export type GetPipeline_Pipeline = {
1028
990
  data_pipeline_id: string;
1029
991
  /** Unique identifier of an environment */
1030
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';
1031
997
  /** Date and time when the pipeline was completed, either successfully or with errors. */
1032
998
  finished_at?: string;
1033
999
  /** Folder unique identifier */
@@ -1048,6 +1014,10 @@ export type GetPipeline_Pipeline = {
1048
1014
  user_id: string;
1049
1015
  };
1050
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';
1051
1021
  /** Date and time when the job was completed, either successfully or with errors. */
1052
1022
  finished_at?: string;
1053
1023
  /** Data Pipeline job unique identifier. */
@@ -1066,6 +1036,10 @@ export type GetPipeline_Job = {
1066
1036
  steps: Array<GetPipeline_Step>;
1067
1037
  };
1068
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';
1069
1043
  /** Date and time when the step was completed, either successfully or with errors. */
1070
1044
  finished_at?: string;
1071
1045
  /** Data Pipeline job unique identifier. */
package/dist/index.js CHANGED
@@ -90,7 +90,6 @@ __export(index_exports, {
90
90
  getUserUploadTasks: () => getUserUploadTasks,
91
91
  grantMemberAccessToFolder: () => grantMemberAccessToFolder,
92
92
  grantMemberAccessToGroup: () => grantMemberAccessToGroup,
93
- importAssets: () => importAssets,
94
93
  joinSession: () => joinSession,
95
94
  joinSessionAsGuest: () => joinSessionAsGuest,
96
95
  kickClientFromSession: () => kickClientFromSession,
@@ -585,26 +584,6 @@ function createCubemap({
585
584
  headers
586
585
  });
587
586
  }
588
- function importAssets({
589
- folder_id,
590
- overwrite = "never",
591
- body
592
- }, onUploadProgress, headers) {
593
- return axiosInstance({
594
- method: "put",
595
- url: "/folders/" + folder_id + "/packages",
596
- params: {
597
- overwrite
598
- },
599
- data: body,
600
- maxRedirects: 0,
601
- onUploadProgress,
602
- headers: {
603
- "Content-Type": "application/zip",
604
- ...headers?.toJSON()
605
- }
606
- });
607
- }
608
587
  function getSessionsInFolder({
609
588
  folder_id
610
589
  }, headers) {
@@ -1365,7 +1344,6 @@ installInterceptors();
1365
1344
  getUserUploadTasks,
1366
1345
  grantMemberAccessToFolder,
1367
1346
  grantMemberAccessToGroup,
1368
- importAssets,
1369
1347
  joinSession,
1370
1348
  joinSessionAsGuest,
1371
1349
  kickClientFromSession,