@3dverse/api 0.12.0 → 0.13.1
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.
- package/dist/_prebuild/wrapper.d.ts +161 -26
- package/dist/index.js +4 -20
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +4 -20
- package/dist/index.mjs.map +2 -2
- package/package.json +2 -2
|
@@ -86,9 +86,10 @@ export type ServiceError = {
|
|
|
86
86
|
};
|
|
87
87
|
/**
|
|
88
88
|
* The kind of token authenticating a request: OAuthToken, an access token of the authorization server acting for a
|
|
89
|
-
* person in one environment, authenticates the MCP endpoint only
|
|
89
|
+
* person in one environment, authenticates the MCP endpoint only, and UploadToken, issued by its tool
|
|
90
|
+
* `import_files`, one import
|
|
90
91
|
*/
|
|
91
|
-
export type SessionType = 'ApiKey' | 'UserToken' | 'GuestToken' | 'OAuthToken';
|
|
92
|
+
export type SessionType = 'ApiKey' | 'UserToken' | 'GuestToken' | 'OAuthToken' | 'UploadToken';
|
|
92
93
|
/** What a token lets its holder do, each scope allowing what the ones before it allow */
|
|
93
94
|
export type SecurityScope = 'read' | 'write' | 'manage';
|
|
94
95
|
/** Why the caller may not do what it asks, its credentials being valid */
|
|
@@ -1687,6 +1688,14 @@ export type ConversionId = string;
|
|
|
1687
1688
|
/** The conversion of one file of an import into assets. */
|
|
1688
1689
|
export type Conversion = {
|
|
1689
1690
|
conversion_id: ConversionId;
|
|
1691
|
+
/**
|
|
1692
|
+
* The assets the conversion stored, once stored: its main one, standing for the file, and the others, those of a
|
|
1693
|
+
* conversion embedded in another one included, e.g. the textures of an FBX file.
|
|
1694
|
+
*/
|
|
1695
|
+
assets: Array<{
|
|
1696
|
+
asset_id: AssetId;
|
|
1697
|
+
asset_type: AssetType;
|
|
1698
|
+
}>;
|
|
1690
1699
|
/** Asset unique identifier, a version 4 uuid in its canonical lowercase form */
|
|
1691
1700
|
asset_id?: string;
|
|
1692
1701
|
source_file_id: SourceFileId;
|
|
@@ -1716,6 +1725,76 @@ export type Import = {
|
|
|
1716
1725
|
status: ('waiting' | 'downloading' | 'extracting' | 'pending' | 'converting' | 'error' | 'success' | 'rejected') & string;
|
|
1717
1726
|
conversions: Array<Conversion>;
|
|
1718
1727
|
};
|
|
1728
|
+
/** A file an import downloads, given by its URL */
|
|
1729
|
+
export type RemoteFile = {
|
|
1730
|
+
/** The name of the file */
|
|
1731
|
+
name: string;
|
|
1732
|
+
/** The URL of the file, which must be public, unless an Authorization header is given */
|
|
1733
|
+
url: string;
|
|
1734
|
+
/** The value of the Authorization header of the download, when it needs one */
|
|
1735
|
+
authorization?: string;
|
|
1736
|
+
};
|
|
1737
|
+
export type AssetGenerationOptions = {
|
|
1738
|
+
asset_type: 'collision_geometry';
|
|
1739
|
+
data_pipeline: 'collision-geometry-baker';
|
|
1740
|
+
/** What a collision geometry is baked from: submeshes of meshes, merged into one geometry. The data pipeline scheduler adds the asset's asset_name. */
|
|
1741
|
+
options: {
|
|
1742
|
+
/** The shape baked */
|
|
1743
|
+
collision_geometry_type: 0 | 1;
|
|
1744
|
+
/** The meshes the geometry is baked from */
|
|
1745
|
+
mesh_ids: Array<string>;
|
|
1746
|
+
/** For each mesh of mesh_ids, at the same index, the submeshes baked */
|
|
1747
|
+
submesh_indices_per_mesh: Array<Array<number>>;
|
|
1748
|
+
};
|
|
1749
|
+
} | {
|
|
1750
|
+
asset_type: 'navmesh';
|
|
1751
|
+
data_pipeline: 'navmesh-baker';
|
|
1752
|
+
/** What a navmesh is baked from, submeshes of meshes, and how Recast bakes it: each setting left out takes its default. The data pipeline scheduler adds the asset's asset_name. */
|
|
1753
|
+
options: {
|
|
1754
|
+
/** Traversal cost multiplier of each area, by area id: 1 for an area left out */
|
|
1755
|
+
area_costs?: Array<number>;
|
|
1756
|
+
/** Border around a tile, in voxels */
|
|
1757
|
+
border_size?: number;
|
|
1758
|
+
/** Build a bounding volume tree for each tile */
|
|
1759
|
+
build_bv_tree?: boolean;
|
|
1760
|
+
/** Build the detail mesh of each tile */
|
|
1761
|
+
build_detail_mesh?: boolean;
|
|
1762
|
+
/** Height of a voxel */
|
|
1763
|
+
cell_height?: number;
|
|
1764
|
+
/** Size of a voxel on the xz-plane */
|
|
1765
|
+
cell_size?: number;
|
|
1766
|
+
/** Distance between the samples of the detail mesh */
|
|
1767
|
+
detail_sample_dist?: number;
|
|
1768
|
+
/** Furthest the detail mesh strays from the heightfield */
|
|
1769
|
+
detail_sample_max_error?: number;
|
|
1770
|
+
/** Longest edge along the mesh border, in voxels, 0 for none */
|
|
1771
|
+
max_edge_len?: number;
|
|
1772
|
+
/** Furthest a simplified contour strays from the raw one, in voxels */
|
|
1773
|
+
max_simplification_error?: number;
|
|
1774
|
+
/** Most vertices a polygon has */
|
|
1775
|
+
max_verts_per_poly?: number;
|
|
1776
|
+
/** Area under which a region is merged into a larger one, in voxels */
|
|
1777
|
+
merge_region_area?: number;
|
|
1778
|
+
/** The meshes the navmesh is baked from */
|
|
1779
|
+
mesh_ids: Array<string>;
|
|
1780
|
+
/** Area of the smallest region kept, in voxels */
|
|
1781
|
+
min_region_area?: number;
|
|
1782
|
+
/** How the walkable area is partitioned into regions */
|
|
1783
|
+
partition_type?: 'watershed' | 'monotone' | 'layers';
|
|
1784
|
+
/** For each mesh of mesh_ids, at the same index, the submeshes baked */
|
|
1785
|
+
submesh_indices_per_mesh: Array<Array<number>>;
|
|
1786
|
+
/** Size of a tile, in voxels */
|
|
1787
|
+
tile_size?: number;
|
|
1788
|
+
/** Height of a step an agent climbs, in voxels */
|
|
1789
|
+
walkable_climb?: number;
|
|
1790
|
+
/** Height an agent needs, in voxels */
|
|
1791
|
+
walkable_height?: number;
|
|
1792
|
+
/** Radius of an agent, in voxels */
|
|
1793
|
+
walkable_radius?: number;
|
|
1794
|
+
/** Steepest slope an agent walks, in degrees */
|
|
1795
|
+
walkable_slope_angle?: number;
|
|
1796
|
+
};
|
|
1797
|
+
};
|
|
1719
1798
|
/** A line a conversion task logged, as logged */
|
|
1720
1799
|
export type ConversionLogLine = {
|
|
1721
1800
|
/**
|
|
@@ -8718,7 +8797,8 @@ export declare function listSourceFileAssets({ source_file_id, }: {
|
|
|
8718
8797
|
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<AssetList>;
|
|
8719
8798
|
/**
|
|
8720
8799
|
* Imports files into a folder: source files, converted into assets, or asset packages, imported as they are. The
|
|
8721
|
-
* files are sent in
|
|
8800
|
+
* files are sent in a multipart body, or given by URL, for the import to download them: in a JSON body when none is
|
|
8801
|
+
* sent. An import may also generate an asset from others, in a JSON body (below). The accepted extensions, their
|
|
8722
8802
|
* conversion type and per-converter options are listed by `GET /source-files/supported-formats` and documented at
|
|
8723
8803
|
* https://docs.3dverse.com/references/supported-file-formats.
|
|
8724
8804
|
* The folder is given in the query, so that a request the folder's permission refuses is refused before any of its
|
|
@@ -8735,6 +8815,11 @@ export declare function listSourceFileAssets({ source_file_id, }: {
|
|
|
8735
8815
|
* permissions on it, referencing one the `read-asset` permission. A file named as an asset file but which is not a
|
|
8736
8816
|
* valid one fails the import, the files named otherwise being ignored. The payloads of shaders, scripts, animation
|
|
8737
8817
|
* sequences and animation graphs, compiled code which only a library builds, are ignored.
|
|
8818
|
+
* ### Generating an asset
|
|
8819
|
+
* A collision geometry or a navmesh is generated from meshes by a data pipeline of its type, which the JSON body
|
|
8820
|
+
* names along with the asset's type and name, and the options of the data pipeline's baker: the meshes, by
|
|
8821
|
+
* `mesh_ids`, with the submeshes of each, and what is baked, e.g. the shape of the collision geometry, or the Recast
|
|
8822
|
+
* settings of the navmesh, each left out taking its default. The meshes must exist and be readable by the caller.
|
|
8738
8823
|
* The import runs asynchronously, as a data pipeline, `getImport` telling its progress. It is rejected
|
|
8739
8824
|
* (`quota_exceeded`) once its files are unpacked if it would convert more source files than the plan of the
|
|
8740
8825
|
* environment's organization has left this month, or store more than its storage has left, the organization's
|
|
@@ -8745,36 +8830,86 @@ export declare function listSourceFileAssets({ source_file_id, }: {
|
|
|
8745
8830
|
* @throws {MissingAuthorizationHeader}
|
|
8746
8831
|
* @throws {InvalidApiKey}
|
|
8747
8832
|
* @throws {Unauthorized}
|
|
8748
|
-
* @throws {InvalidAuthorization}
|
|
8749
|
-
* @throws {InsufficientSecurityScope}
|
|
8750
|
-
* @throws {InsufficientPermissions}
|
|
8751
8833
|
* @throws {UploadedPayloadTooLarge}
|
|
8752
8834
|
* @throws {NoFileUploaded}
|
|
8753
8835
|
* @throws {UploadAborted}
|
|
8754
8836
|
* @throws {TooManyRequests}
|
|
8755
8837
|
*/
|
|
8756
|
-
export declare function createImport({ folder_id,
|
|
8838
|
+
export declare function createImport({ folder_id, body, }: {
|
|
8757
8839
|
folder_id: FolderId;
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8840
|
+
body: StrictUnion<{
|
|
8841
|
+
conversion_pipeline: ConversionPipeline;
|
|
8842
|
+
/** The files the import downloads */
|
|
8843
|
+
remote_files: Array<RemoteFile>;
|
|
8844
|
+
/** Options for the conversion pipeline. For future use. */
|
|
8845
|
+
options?: {
|
|
8846
|
+
[_additionalproperties_: string]: any;
|
|
8847
|
+
};
|
|
8848
|
+
} | (({
|
|
8849
|
+
asset_type: 'collision_geometry';
|
|
8850
|
+
data_pipeline: 'collision-geometry-baker';
|
|
8851
|
+
/** What a collision geometry is baked from: submeshes of meshes, merged into one geometry. The data pipeline scheduler adds the asset's asset_name. */
|
|
8852
|
+
options: {
|
|
8853
|
+
/** The shape baked */
|
|
8854
|
+
collision_geometry_type: 0 | 1;
|
|
8855
|
+
/** The meshes the geometry is baked from */
|
|
8856
|
+
mesh_ids: Array<string>;
|
|
8857
|
+
/** For each mesh of mesh_ids, at the same index, the submeshes baked */
|
|
8858
|
+
submesh_indices_per_mesh: Array<Array<number>>;
|
|
8859
|
+
};
|
|
8860
|
+
} | {
|
|
8861
|
+
asset_type: 'navmesh';
|
|
8862
|
+
data_pipeline: 'navmesh-baker';
|
|
8863
|
+
/** What a navmesh is baked from, submeshes of meshes, and how Recast bakes it: each setting left out takes its default. The data pipeline scheduler adds the asset's asset_name. */
|
|
8864
|
+
options: {
|
|
8865
|
+
/** Traversal cost multiplier of each area, by area id: 1 for an area left out */
|
|
8866
|
+
area_costs?: Array<number>;
|
|
8867
|
+
/** Border around a tile, in voxels */
|
|
8868
|
+
border_size?: number;
|
|
8869
|
+
/** Build a bounding volume tree for each tile */
|
|
8870
|
+
build_bv_tree?: boolean;
|
|
8871
|
+
/** Build the detail mesh of each tile */
|
|
8872
|
+
build_detail_mesh?: boolean;
|
|
8873
|
+
/** Height of a voxel */
|
|
8874
|
+
cell_height?: number;
|
|
8875
|
+
/** Size of a voxel on the xz-plane */
|
|
8876
|
+
cell_size?: number;
|
|
8877
|
+
/** Distance between the samples of the detail mesh */
|
|
8878
|
+
detail_sample_dist?: number;
|
|
8879
|
+
/** Furthest the detail mesh strays from the heightfield */
|
|
8880
|
+
detail_sample_max_error?: number;
|
|
8881
|
+
/** Longest edge along the mesh border, in voxels, 0 for none */
|
|
8882
|
+
max_edge_len?: number;
|
|
8883
|
+
/** Furthest a simplified contour strays from the raw one, in voxels */
|
|
8884
|
+
max_simplification_error?: number;
|
|
8885
|
+
/** Most vertices a polygon has */
|
|
8886
|
+
max_verts_per_poly?: number;
|
|
8887
|
+
/** Area under which a region is merged into a larger one, in voxels */
|
|
8888
|
+
merge_region_area?: number;
|
|
8889
|
+
/** The meshes the navmesh is baked from */
|
|
8890
|
+
mesh_ids: Array<string>;
|
|
8891
|
+
/** Area of the smallest region kept, in voxels */
|
|
8892
|
+
min_region_area?: number;
|
|
8893
|
+
/** How the walkable area is partitioned into regions */
|
|
8894
|
+
partition_type?: 'watershed' | 'monotone' | 'layers';
|
|
8895
|
+
/** For each mesh of mesh_ids, at the same index, the submeshes baked */
|
|
8896
|
+
submesh_indices_per_mesh: Array<Array<number>>;
|
|
8897
|
+
/** Size of a tile, in voxels */
|
|
8898
|
+
tile_size?: number;
|
|
8899
|
+
/** Height of a step an agent climbs, in voxels */
|
|
8900
|
+
walkable_climb?: number;
|
|
8901
|
+
/** Height an agent needs, in voxels */
|
|
8902
|
+
walkable_height?: number;
|
|
8903
|
+
/** Radius of an agent, in voxels */
|
|
8904
|
+
walkable_radius?: number;
|
|
8905
|
+
/** Steepest slope an agent walks, in degrees */
|
|
8906
|
+
walkable_slope_angle?: number;
|
|
8907
|
+
};
|
|
8908
|
+
}) & {
|
|
8909
|
+
/** The name of the asset generated */
|
|
8767
8910
|
name: string;
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
/** The value of the Authorization header of the download, when it needs one */
|
|
8771
|
-
authorization?: string;
|
|
8772
|
-
}>;
|
|
8773
|
-
/** Options for the conversion pipeline. For future use. */
|
|
8774
|
-
options?: {
|
|
8775
|
-
[_additionalproperties_: string]: any;
|
|
8776
|
-
};
|
|
8777
|
-
}, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<{
|
|
8911
|
+
})>;
|
|
8912
|
+
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<{
|
|
8778
8913
|
import_id: ImportId;
|
|
8779
8914
|
}>;
|
|
8780
8915
|
/**
|
package/dist/index.js
CHANGED
|
@@ -887,32 +887,16 @@ function listSourceFileAssets({
|
|
|
887
887
|
}
|
|
888
888
|
function createImport({
|
|
889
889
|
folder_id,
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
remote_files,
|
|
893
|
-
options
|
|
894
|
-
}, onUploadProgress, headers) {
|
|
890
|
+
body
|
|
891
|
+
}, headers) {
|
|
895
892
|
return axiosInstance({
|
|
896
893
|
method: "post",
|
|
897
894
|
url: "/imports",
|
|
898
895
|
params: {
|
|
899
896
|
folder_id
|
|
900
897
|
},
|
|
901
|
-
data:
|
|
902
|
-
|
|
903
|
-
conversion_pipeline,
|
|
904
|
-
remote_files,
|
|
905
|
-
options
|
|
906
|
-
},
|
|
907
|
-
{
|
|
908
|
-
files
|
|
909
|
-
}
|
|
910
|
-
),
|
|
911
|
-
onUploadProgress,
|
|
912
|
-
headers: {
|
|
913
|
-
"Content-Type": "multipart/form-data",
|
|
914
|
-
...plainHeaders(headers)
|
|
915
|
-
}
|
|
898
|
+
data: body,
|
|
899
|
+
headers
|
|
916
900
|
});
|
|
917
901
|
}
|
|
918
902
|
function listImports({
|