@3dverse/api 0.11.1 → 0.12.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.
- package/README.md +6 -3
- package/dist/_prebuild/wrapper.d.ts +218 -12
- package/dist/index.js +120 -7
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +113 -7
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,14 +40,17 @@ async () => {
|
|
|
40
40
|
For client-side request, you can authenticate with the User Token.
|
|
41
41
|
|
|
42
42
|
```
|
|
43
|
-
import {
|
|
43
|
+
import { createImport, setUserToken } from '@3dverse/api';
|
|
44
44
|
|
|
45
45
|
setUserToken(MY_USER_TOKEN);
|
|
46
46
|
|
|
47
47
|
async () => {
|
|
48
|
-
const
|
|
48
|
+
const {
|
|
49
|
+
data: { import_id },
|
|
50
|
+
} = await createImport({
|
|
49
51
|
folder_id: 'my_folder_id',
|
|
50
|
-
|
|
52
|
+
conversion_pipeline: 'auto-detect',
|
|
53
|
+
files: [myFile],
|
|
51
54
|
});
|
|
52
55
|
}
|
|
53
56
|
```
|
|
@@ -1680,6 +1680,42 @@ export type SupportedSourceFileFormats = {
|
|
|
1680
1680
|
file_extensions: Array<string>;
|
|
1681
1681
|
};
|
|
1682
1682
|
};
|
|
1683
|
+
/** Import unique identifier, which this service mints: the id of the pipeline running it. */
|
|
1684
|
+
export type ImportId = string;
|
|
1685
|
+
/** The unique identifier of a conversion */
|
|
1686
|
+
export type ConversionId = string;
|
|
1687
|
+
/** The conversion of one file of an import into assets. */
|
|
1688
|
+
export type Conversion = {
|
|
1689
|
+
conversion_id: ConversionId;
|
|
1690
|
+
/** Asset unique identifier, a version 4 uuid in its canonical lowercase form */
|
|
1691
|
+
asset_id?: string;
|
|
1692
|
+
source_file_id: SourceFileId;
|
|
1693
|
+
/** The name of the file converted */
|
|
1694
|
+
source_file_name: string;
|
|
1695
|
+
conversion_pipeline: ConversionPipeline;
|
|
1696
|
+
progress: ConversionProgress;
|
|
1697
|
+
status: ('pending' | 'converting' | 'error' | 'success') & string;
|
|
1698
|
+
};
|
|
1699
|
+
/**
|
|
1700
|
+
* An import of files into the environment, run as a data pipeline: the files uploaded or downloaded, unpacked, and
|
|
1701
|
+
* each one converted into assets, or imported as it is when it is an asset package. It names the folder its assets
|
|
1702
|
+
* were stored into, which they may have left since.
|
|
1703
|
+
*/
|
|
1704
|
+
export type Import = {
|
|
1705
|
+
import_id: ImportId;
|
|
1706
|
+
/** The folder the import stores its assets into */
|
|
1707
|
+
folder_id: FolderId;
|
|
1708
|
+
/** When the import was created */
|
|
1709
|
+
created_at: string;
|
|
1710
|
+
/** The user who created the import */
|
|
1711
|
+
created_by: UserInfo;
|
|
1712
|
+
/** The progress of the import, over all its conversions */
|
|
1713
|
+
progress: ConversionProgress;
|
|
1714
|
+
/** The progress of the download of the files given by URL, while they are downloaded */
|
|
1715
|
+
download_progress?: ConversionProgress;
|
|
1716
|
+
status: ('waiting' | 'downloading' | 'extracting' | 'pending' | 'converting' | 'error' | 'success' | 'rejected') & string;
|
|
1717
|
+
conversions: Array<Conversion>;
|
|
1718
|
+
};
|
|
1683
1719
|
/** A line a conversion task logged, as logged */
|
|
1684
1720
|
export type ConversionLogLine = {
|
|
1685
1721
|
/**
|
|
@@ -5775,8 +5811,6 @@ export type ConversionCompleted = {
|
|
|
5775
5811
|
step_id: string;
|
|
5776
5812
|
}>;
|
|
5777
5813
|
};
|
|
5778
|
-
/** Import unique identifier, which this service mints: the id of the pipeline running it. */
|
|
5779
|
-
export type ImportId = string;
|
|
5780
5814
|
export type PipelineId = ImportId;
|
|
5781
5815
|
export type GroupMemberInput = {
|
|
5782
5816
|
user_id: UserId;
|
|
@@ -7881,6 +7915,20 @@ export declare class UploadAborted extends ServiceErrorResponse {
|
|
|
7881
7915
|
static readonly ERROR_CODE = 1009;
|
|
7882
7916
|
constructor(serviceError: Record<string, unknown>);
|
|
7883
7917
|
}
|
|
7918
|
+
export declare class ImportNotFound extends ServiceErrorResponse {
|
|
7919
|
+
static readonly ERROR_CODE = 1022;
|
|
7920
|
+
readonly import_id: ImportId;
|
|
7921
|
+
constructor(serviceError: Record<string, unknown>);
|
|
7922
|
+
}
|
|
7923
|
+
export declare class ConversionNotFound extends ServiceErrorResponse {
|
|
7924
|
+
static readonly ERROR_CODE = 1023;
|
|
7925
|
+
readonly conversion_id: ConversionId;
|
|
7926
|
+
constructor(serviceError: Record<string, unknown>);
|
|
7927
|
+
}
|
|
7928
|
+
export declare class LogsUnavailable extends ServiceErrorResponse {
|
|
7929
|
+
static readonly ERROR_CODE = 1019;
|
|
7930
|
+
constructor(serviceError: Record<string, unknown>);
|
|
7931
|
+
}
|
|
7884
7932
|
export declare class UploadTaskNotFound extends ServiceErrorResponse {
|
|
7885
7933
|
static readonly ERROR_CODE = 1010;
|
|
7886
7934
|
readonly upload_task_id: UploadTaskId;
|
|
@@ -7891,10 +7939,6 @@ export declare class ConversionTaskNotFound extends ServiceErrorResponse {
|
|
|
7891
7939
|
readonly conversion_task_id: ConversionTaskId;
|
|
7892
7940
|
constructor(serviceError: Record<string, unknown>);
|
|
7893
7941
|
}
|
|
7894
|
-
export declare class LogsUnavailable extends ServiceErrorResponse {
|
|
7895
|
-
static readonly ERROR_CODE = 1019;
|
|
7896
|
-
constructor(serviceError: Record<string, unknown>);
|
|
7897
|
-
}
|
|
7898
7942
|
export declare class InvalidGuestToken extends ServiceErrorResponse {
|
|
7899
7943
|
static readonly ERROR_CODE = 1016;
|
|
7900
7944
|
constructor(serviceError: Record<string, unknown>);
|
|
@@ -7921,7 +7965,7 @@ export declare class TooManyRequests extends ServiceErrorResponse {
|
|
|
7921
7965
|
constructor(serviceError: Record<string, unknown>);
|
|
7922
7966
|
}
|
|
7923
7967
|
/** The errors the spec declares. */
|
|
7924
|
-
export type DeclaredError = InvalidAuthorization | InsufficientSecurityScope | InsufficientPermissions | InvalidTokenTtl | InvalidParameter | MemberAccessesDiffer | InvalidMaterial | InvalidRequest | UploadedPayloadTooLarge | NoFileUploaded | UploadAborted |
|
|
7968
|
+
export type DeclaredError = InvalidAuthorization | InsufficientSecurityScope | InsufficientPermissions | InvalidTokenTtl | InvalidParameter | MemberAccessesDiffer | InvalidMaterial | InvalidRequest | UploadedPayloadTooLarge | NoFileUploaded | UploadAborted | ImportNotFound | ConversionNotFound | LogsUnavailable | UploadTaskNotFound | ConversionTaskNotFound | InvalidGuestToken | Unauthorized | MissingAuthorizationHeader | InvalidApiKey | TooManyRequests;
|
|
7925
7969
|
/**
|
|
7926
7970
|
* The error declared in the spec that a request failed with, or undefined: read from the error a function of this
|
|
7927
7971
|
* client rejected with, e.g. `if (errorOf(error) instanceof FolderNotFound)`.
|
|
@@ -8343,6 +8387,8 @@ export declare function moveFolders({ folder_id, folder_ids, }: {
|
|
|
8343
8387
|
folder_ids: string[];
|
|
8344
8388
|
}, {}, any>>;
|
|
8345
8389
|
/**
|
|
8390
|
+
* **Deprecated**: use `createImport` (`POST /imports?folder_id=…`), which takes the same body, its `source_files`
|
|
8391
|
+
* named `remote_files`, and answers the import's `import_id`.
|
|
8346
8392
|
* Uploads the specified source file(s). The accepted extensions, their conversion type and
|
|
8347
8393
|
* per-converter options are listed by `GET /source-files/supported-formats` and documented at
|
|
8348
8394
|
* https://docs.3dverse.com/references/supported-file-formats.
|
|
@@ -8398,9 +8444,12 @@ export declare function uploadSourceFiles({ folder_id, files, conversion_pipelin
|
|
|
8398
8444
|
options?: {
|
|
8399
8445
|
[_additionalproperties_: string]: any;
|
|
8400
8446
|
};
|
|
8401
|
-
}, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders):
|
|
8447
|
+
}, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): Promise<ResponseWithHeaders<{
|
|
8402
8448
|
upload_task_id?: UploadTaskId;
|
|
8403
|
-
}
|
|
8449
|
+
}, {
|
|
8450
|
+
deprecation?: string;
|
|
8451
|
+
link?: string;
|
|
8452
|
+
}>>;
|
|
8404
8453
|
/**
|
|
8405
8454
|
* Lists all source files in a folder.
|
|
8406
8455
|
* @throws {InvalidParameter}
|
|
@@ -8443,6 +8492,8 @@ export declare function moveSourceFiles({ folder_id, source_file_ids, }: {
|
|
|
8443
8492
|
source_file_ids: string[];
|
|
8444
8493
|
}, {}, any>>;
|
|
8445
8494
|
/**
|
|
8495
|
+
* **Deprecated**, with no replacement: an import names the folder it stored its assets into, which they may have
|
|
8496
|
+
* left since. `listImports` lists the environment's imports, or a user's.
|
|
8446
8497
|
* Lists the upload tasks importing into a folder. The caller needs to be able to list the folder's upload tasks
|
|
8447
8498
|
* only: a user granted the folder lists them, without the environment's permission `listUploadTasks` needs.
|
|
8448
8499
|
* @throws {InvalidParameter}
|
|
@@ -8460,6 +8511,7 @@ export declare function listFolderUploadTasks({ folder_id, offset, limit, }: {
|
|
|
8460
8511
|
limit?: number;
|
|
8461
8512
|
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): Promise<ResponseWithHeaders<Array<UploadTask>, {
|
|
8462
8513
|
link?: string;
|
|
8514
|
+
deprecation?: string;
|
|
8463
8515
|
}>>;
|
|
8464
8516
|
/**
|
|
8465
8517
|
* Lists assets.
|
|
@@ -8665,6 +8717,146 @@ export declare function listSourceFileAssets({ source_file_id, }: {
|
|
|
8665
8717
|
source_file_id: SourceFileId;
|
|
8666
8718
|
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<AssetList>;
|
|
8667
8719
|
/**
|
|
8720
|
+
* Imports files into a folder: source files, converted into assets, or asset packages, imported as they are. The
|
|
8721
|
+
* files are sent in the request, or given by URL, for the import to download them. The accepted extensions, their
|
|
8722
|
+
* conversion type and per-converter options are listed by `GET /source-files/supported-formats` and documented at
|
|
8723
|
+
* https://docs.3dverse.com/references/supported-file-formats.
|
|
8724
|
+
* The folder is given in the query, so that a request the folder's permission refuses is refused before any of its
|
|
8725
|
+
* files is received. The import stores its assets into it.
|
|
8726
|
+
* ### Importing an asset package
|
|
8727
|
+
* With the `package` conversion pipeline, the files are already converted assets, imported as they are, submitted
|
|
8728
|
+
* as zip archives (asset packages) or as the asset files themselves. The asset files are named
|
|
8729
|
+
* `<part>.<asset_type>[.<sub resource>].<uuid>`, where the part is `desc` (the asset description, in JSON),
|
|
8730
|
+
* `payload`, `graph` or `layout`, for example `desc.mesh.<uuid>`, `payload.mesh.<uuid>` or
|
|
8731
|
+
* `payload.texture.mip0.<uuid>`. The assets they reference must be submitted along with them, unless they already
|
|
8732
|
+
* exist. The submitted assets that already exist are overwritten only if they are listed in an `overwrite.json`
|
|
8733
|
+
* file, a JSON array of asset ids submitted along with them, the others being left as they are; without it, the
|
|
8734
|
+
* import fails if one of them already exists. Overwriting an asset requires the `update-asset` and `delete-asset`
|
|
8735
|
+
* permissions on it, referencing one the `read-asset` permission. A file named as an asset file but which is not a
|
|
8736
|
+
* valid one fails the import, the files named otherwise being ignored. The payloads of shaders, scripts, animation
|
|
8737
|
+
* sequences and animation graphs, compiled code which only a library builds, are ignored.
|
|
8738
|
+
* The import runs asynchronously, as a data pipeline, `getImport` telling its progress. It is rejected
|
|
8739
|
+
* (`quota_exceeded`) once its files are unpacked if it would convert more source files than the plan of the
|
|
8740
|
+
* environment's organization has left this month, or store more than its storage has left, the organization's
|
|
8741
|
+
* conversions and assets counted as activity-monitor measures them.
|
|
8742
|
+
* @throws {InvalidMaterial}
|
|
8743
|
+
* @throws {InvalidRequest}
|
|
8744
|
+
* @throws {InvalidParameter}
|
|
8745
|
+
* @throws {MissingAuthorizationHeader}
|
|
8746
|
+
* @throws {InvalidApiKey}
|
|
8747
|
+
* @throws {Unauthorized}
|
|
8748
|
+
* @throws {InvalidAuthorization}
|
|
8749
|
+
* @throws {InsufficientSecurityScope}
|
|
8750
|
+
* @throws {InsufficientPermissions}
|
|
8751
|
+
* @throws {UploadedPayloadTooLarge}
|
|
8752
|
+
* @throws {NoFileUploaded}
|
|
8753
|
+
* @throws {UploadAborted}
|
|
8754
|
+
* @throws {TooManyRequests}
|
|
8755
|
+
*/
|
|
8756
|
+
export declare function createImport({ folder_id, files, conversion_pipeline, remote_files, options, }: {
|
|
8757
|
+
folder_id: FolderId;
|
|
8758
|
+
/** The files to import, each with its file name. Files are accepted under any field name. */
|
|
8759
|
+
files?: Array<Blob>;
|
|
8760
|
+
conversion_pipeline: ConversionPipeline;
|
|
8761
|
+
/**
|
|
8762
|
+
* Files the import downloads, given by URL, in place of or along with the files sent: those already on a
|
|
8763
|
+
* storage service, or too large to send through the API.
|
|
8764
|
+
*/
|
|
8765
|
+
remote_files?: Array<{
|
|
8766
|
+
/** The name of the file */
|
|
8767
|
+
name: string;
|
|
8768
|
+
/** The URL of the file, which must be public, unless an Authorization header is given */
|
|
8769
|
+
url: string;
|
|
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<{
|
|
8778
|
+
import_id: ImportId;
|
|
8779
|
+
}>;
|
|
8780
|
+
/**
|
|
8781
|
+
* Lists the imports of the caller's environment, or those of a user, with `filters`. The caller needs to be able to
|
|
8782
|
+
* list the environment's imports, and those of the user filtered on.
|
|
8783
|
+
* @throws {InvalidParameter}
|
|
8784
|
+
* @throws {MissingAuthorizationHeader}
|
|
8785
|
+
* @throws {InvalidApiKey}
|
|
8786
|
+
* @throws {Unauthorized}
|
|
8787
|
+
* @throws {InvalidAuthorization}
|
|
8788
|
+
* @throws {InsufficientSecurityScope}
|
|
8789
|
+
* @throws {InsufficientPermissions}
|
|
8790
|
+
* @throws {TooManyRequests}
|
|
8791
|
+
*/
|
|
8792
|
+
export declare function listImports({ offset, limit, filters, }: {
|
|
8793
|
+
offset?: number;
|
|
8794
|
+
limit?: number;
|
|
8795
|
+
filters?: {
|
|
8796
|
+
/** Only the imports of this user */
|
|
8797
|
+
user_id?: UserId;
|
|
8798
|
+
};
|
|
8799
|
+
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): Promise<ResponseWithHeaders<Array<Import>, {
|
|
8800
|
+
link?: string;
|
|
8801
|
+
}>>;
|
|
8802
|
+
/**
|
|
8803
|
+
* Gets an import, with its progress and each of its conversions.
|
|
8804
|
+
* @throws {InvalidParameter}
|
|
8805
|
+
* @throws {MissingAuthorizationHeader}
|
|
8806
|
+
* @throws {InvalidApiKey}
|
|
8807
|
+
* @throws {Unauthorized}
|
|
8808
|
+
* @throws {InvalidAuthorization}
|
|
8809
|
+
* @throws {InsufficientSecurityScope}
|
|
8810
|
+
* @throws {InsufficientPermissions}
|
|
8811
|
+
* @throws {ImportNotFound}
|
|
8812
|
+
* @throws {TooManyRequests}
|
|
8813
|
+
*/
|
|
8814
|
+
export declare function getImport({ import_id, }: {
|
|
8815
|
+
import_id: ImportId;
|
|
8816
|
+
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<Import>;
|
|
8817
|
+
/**
|
|
8818
|
+
* Gets the lines a conversion logged, the oldest first, while they are kept: those logged from its creation until a
|
|
8819
|
+
* minute after it finished, or until now while it runs, unless asked otherwise. When there are more lines than
|
|
8820
|
+
* answered, the `link` header gives the next ones (`rel="next"`). To follow a conversion still running, ask again
|
|
8821
|
+
* with `from` just after the timestamp of the last line received.
|
|
8822
|
+
* @throws {InvalidParameter}
|
|
8823
|
+
* @throws {MissingAuthorizationHeader}
|
|
8824
|
+
* @throws {InvalidApiKey}
|
|
8825
|
+
* @throws {Unauthorized}
|
|
8826
|
+
* @throws {InvalidAuthorization}
|
|
8827
|
+
* @throws {InsufficientSecurityScope}
|
|
8828
|
+
* @throws {InsufficientPermissions}
|
|
8829
|
+
* @throws {ConversionNotFound}
|
|
8830
|
+
* @throws {TooManyRequests}
|
|
8831
|
+
* @throws {LogsUnavailable}
|
|
8832
|
+
*/
|
|
8833
|
+
export declare function getConversionLogs({ conversion_id, from, to, limit, }: {
|
|
8834
|
+
conversion_id: ConversionId;
|
|
8835
|
+
from?: string;
|
|
8836
|
+
to?: string;
|
|
8837
|
+
limit?: number;
|
|
8838
|
+
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): Promise<ResponseWithHeaders<Array<ConversionLogLine>, {
|
|
8839
|
+
link?: string;
|
|
8840
|
+
}>>;
|
|
8841
|
+
/**
|
|
8842
|
+
* Gets a metadata file a conversion produced, along with its assets, such as the properties an IFC file's elements
|
|
8843
|
+
* carry. The files are kept for 24 hours after the conversion, then deleted.
|
|
8844
|
+
* @throws {InvalidParameter}
|
|
8845
|
+
* @throws {MissingAuthorizationHeader}
|
|
8846
|
+
* @throws {InvalidApiKey}
|
|
8847
|
+
* @throws {Unauthorized}
|
|
8848
|
+
* @throws {InvalidAuthorization}
|
|
8849
|
+
* @throws {InsufficientSecurityScope}
|
|
8850
|
+
* @throws {InsufficientPermissions}
|
|
8851
|
+
* @throws {ConversionNotFound}
|
|
8852
|
+
* @throws {TooManyRequests}
|
|
8853
|
+
*/
|
|
8854
|
+
export declare function getConversionMetadata<T extends 'arraybuffer' | 'stream' | 'json' | 'text' = 'arraybuffer'>({ conversion_id, filename, }: {
|
|
8855
|
+
conversion_id: ConversionId;
|
|
8856
|
+
filename: string;
|
|
8857
|
+
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders, responseType?: T): AxiosPromise<T extends 'arraybuffer' ? ArrayBuffer : T extends 'json' ? object : T extends 'text' ? string : T extends 'stream' ? ReadableStream : never>;
|
|
8858
|
+
/**
|
|
8859
|
+
* **Deprecated**: use `listImports` (`GET /imports`), which takes the same filters.
|
|
8668
8860
|
* Lists the upload tasks of the caller's environment, or those of a user, with `filters`. These upload tasks relate
|
|
8669
8861
|
* to uploaded source files. The caller needs to be able to list the environment's upload tasks, and those of the
|
|
8670
8862
|
* user filtered on. Those of a folder are listed with `listFolderUploadTasks`.
|
|
@@ -8686,8 +8878,10 @@ export declare function listUploadTasks({ offset, limit, filters, }: {
|
|
|
8686
8878
|
};
|
|
8687
8879
|
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): Promise<ResponseWithHeaders<Array<UploadTask>, {
|
|
8688
8880
|
link?: string;
|
|
8881
|
+
deprecation?: string;
|
|
8689
8882
|
}>>;
|
|
8690
8883
|
/**
|
|
8884
|
+
* **Deprecated**: use `getImport` (`GET /imports/{import_id}`), the import's id being the upload task's.
|
|
8691
8885
|
* Gets information related to an upload task. This upload task relates to uploaded source files.
|
|
8692
8886
|
* @throws {InvalidParameter}
|
|
8693
8887
|
* @throws {MissingAuthorizationHeader}
|
|
@@ -8701,9 +8895,15 @@ export declare function listUploadTasks({ offset, limit, filters, }: {
|
|
|
8701
8895
|
*/
|
|
8702
8896
|
export declare function getUploadTask({ upload_task_id, }: {
|
|
8703
8897
|
upload_task_id: UploadTaskId;
|
|
8704
|
-
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders):
|
|
8898
|
+
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): Promise<ResponseWithHeaders<UploadTask, {
|
|
8899
|
+
deprecation?: string;
|
|
8900
|
+
link?: string;
|
|
8901
|
+
}>>;
|
|
8705
8902
|
/**
|
|
8706
|
-
*
|
|
8903
|
+
* **Deprecated**: use `getConversionMetadata` (`GET /conversions/{conversion_id}/metadata/{filename}`), the
|
|
8904
|
+
* conversion's id being the conversion task's.
|
|
8905
|
+
* Gets metadata related to a conversion task. This metadata is produced by the conversion task, and kept for 24
|
|
8906
|
+
* hours.
|
|
8707
8907
|
* @throws {InvalidParameter}
|
|
8708
8908
|
* @throws {MissingAuthorizationHeader}
|
|
8709
8909
|
* @throws {InvalidApiKey}
|
|
@@ -8717,8 +8917,13 @@ export declare function getUploadTask({ upload_task_id, }: {
|
|
|
8717
8917
|
export declare function getConversionTaskMetadata<T extends 'arraybuffer' | 'stream' | 'json' | 'text' = 'arraybuffer'>({ conversion_task_id, filename, }: {
|
|
8718
8918
|
conversion_task_id: ConversionTaskId;
|
|
8719
8919
|
filename: string;
|
|
8720
|
-
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders, responseType?: T):
|
|
8920
|
+
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders, responseType?: T): Promise<ResponseWithHeaders<T extends 'arraybuffer' ? ArrayBuffer : T extends 'json' ? object : T extends 'text' ? string : T extends 'stream' ? ReadableStream : never, {
|
|
8921
|
+
deprecation?: string;
|
|
8922
|
+
link?: string;
|
|
8923
|
+
}>>;
|
|
8721
8924
|
/**
|
|
8925
|
+
* **Deprecated**: use `getConversionLogs` (`GET /conversions/{conversion_id}/logs`), the conversion's id being the
|
|
8926
|
+
* conversion task's.
|
|
8722
8927
|
* Gets the lines a conversion task logged, the oldest first, while they are kept: those logged from its creation until
|
|
8723
8928
|
* a minute after it finished, or until now while it runs, unless asked otherwise. When there are more lines than
|
|
8724
8929
|
* answered, the `link` header gives the next ones (`rel="next"`). To follow a conversion task still running, ask
|
|
@@ -8741,6 +8946,7 @@ export declare function getConversionTaskLogs({ conversion_task_id, from, to, li
|
|
|
8741
8946
|
limit?: number;
|
|
8742
8947
|
}, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): Promise<ResponseWithHeaders<Array<ConversionLogLine>, {
|
|
8743
8948
|
link?: string;
|
|
8949
|
+
deprecation?: string;
|
|
8744
8950
|
}>>;
|
|
8745
8951
|
/**
|
|
8746
8952
|
* Lists the assets of the caller's environment, at every depth, grouped by type, and with
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var index_exports = {};
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
ApiError: () => ApiError,
|
|
33
|
+
ConversionNotFound: () => ConversionNotFound,
|
|
33
34
|
ConversionTaskNotFound: () => ConversionTaskNotFound,
|
|
35
|
+
ImportNotFound: () => ImportNotFound,
|
|
34
36
|
InsufficientPermissions: () => InsufficientPermissions,
|
|
35
37
|
InsufficientSecurityScope: () => InsufficientSecurityScope,
|
|
36
38
|
InvalidApiKey: () => InvalidApiKey,
|
|
@@ -56,6 +58,7 @@ __export(index_exports, {
|
|
|
56
58
|
createEntity: () => createEntity,
|
|
57
59
|
createFolder: () => createFolder,
|
|
58
60
|
createGroup: () => createGroup,
|
|
61
|
+
createImport: () => createImport,
|
|
59
62
|
createSession: () => createSession,
|
|
60
63
|
createSubfolder: () => createSubfolder,
|
|
61
64
|
deleteAsset: () => deleteAsset,
|
|
@@ -77,6 +80,8 @@ __export(index_exports, {
|
|
|
77
80
|
getAssetPayload: () => getAssetPayload,
|
|
78
81
|
getAssetThumbnail: () => getAssetThumbnail,
|
|
79
82
|
getClient: () => getClient,
|
|
83
|
+
getConversionLogs: () => getConversionLogs,
|
|
84
|
+
getConversionMetadata: () => getConversionMetadata,
|
|
80
85
|
getConversionTaskLogs: () => getConversionTaskLogs,
|
|
81
86
|
getConversionTaskMetadata: () => getConversionTaskMetadata,
|
|
82
87
|
getCurrentUser: () => getCurrentUser,
|
|
@@ -84,6 +89,7 @@ __export(index_exports, {
|
|
|
84
89
|
getEntity: () => getEntity,
|
|
85
90
|
getFolder: () => getFolder,
|
|
86
91
|
getGroup: () => getGroup,
|
|
92
|
+
getImport: () => getImport,
|
|
87
93
|
getSceneAABB: () => getSceneAABB,
|
|
88
94
|
getSceneSettings: () => getSceneSettings,
|
|
89
95
|
getSession: () => getSession,
|
|
@@ -106,6 +112,7 @@ __export(index_exports, {
|
|
|
106
112
|
listFolderSubfolders: () => listFolderSubfolders,
|
|
107
113
|
listFolderUploadTasks: () => listFolderUploadTasks,
|
|
108
114
|
listFolders: () => listFolders,
|
|
115
|
+
listImports: () => listImports,
|
|
109
116
|
listRunningSessions: () => listRunningSessions,
|
|
110
117
|
listSourceFileAssets: () => listSourceFileAssets,
|
|
111
118
|
listSourceFiles: () => listSourceFiles,
|
|
@@ -260,17 +267,17 @@ var UploadAborted = class extends ServiceErrorResponse {
|
|
|
260
267
|
Object.assign(this, serviceError);
|
|
261
268
|
}
|
|
262
269
|
};
|
|
263
|
-
var
|
|
264
|
-
static ERROR_CODE =
|
|
270
|
+
var ImportNotFound = class extends ServiceErrorResponse {
|
|
271
|
+
static ERROR_CODE = 1022;
|
|
265
272
|
constructor(serviceError) {
|
|
266
|
-
super(
|
|
273
|
+
super(1022, 404, "Import not found", serviceError);
|
|
267
274
|
Object.assign(this, serviceError);
|
|
268
275
|
}
|
|
269
276
|
};
|
|
270
|
-
var
|
|
271
|
-
static ERROR_CODE =
|
|
277
|
+
var ConversionNotFound = class extends ServiceErrorResponse {
|
|
278
|
+
static ERROR_CODE = 1023;
|
|
272
279
|
constructor(serviceError) {
|
|
273
|
-
super(
|
|
280
|
+
super(1023, 404, "Conversion not found", serviceError);
|
|
274
281
|
Object.assign(this, serviceError);
|
|
275
282
|
}
|
|
276
283
|
};
|
|
@@ -281,6 +288,20 @@ var LogsUnavailable = class extends ServiceErrorResponse {
|
|
|
281
288
|
Object.assign(this, serviceError);
|
|
282
289
|
}
|
|
283
290
|
};
|
|
291
|
+
var UploadTaskNotFound = class extends ServiceErrorResponse {
|
|
292
|
+
static ERROR_CODE = 1010;
|
|
293
|
+
constructor(serviceError) {
|
|
294
|
+
super(1010, 404, "Upload task not found", serviceError);
|
|
295
|
+
Object.assign(this, serviceError);
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
var ConversionTaskNotFound = class extends ServiceErrorResponse {
|
|
299
|
+
static ERROR_CODE = 1015;
|
|
300
|
+
constructor(serviceError) {
|
|
301
|
+
super(1015, 404, "Conversion task not found", serviceError);
|
|
302
|
+
Object.assign(this, serviceError);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
284
305
|
var InvalidGuestToken = class extends ServiceErrorResponse {
|
|
285
306
|
static ERROR_CODE = 1016;
|
|
286
307
|
constructor(serviceError) {
|
|
@@ -328,9 +349,11 @@ var declaredErrors = {
|
|
|
328
349
|
1007: UploadedPayloadTooLarge,
|
|
329
350
|
1008: NoFileUploaded,
|
|
330
351
|
1009: UploadAborted,
|
|
352
|
+
1022: ImportNotFound,
|
|
353
|
+
1023: ConversionNotFound,
|
|
354
|
+
1019: LogsUnavailable,
|
|
331
355
|
1010: UploadTaskNotFound,
|
|
332
356
|
1015: ConversionTaskNotFound,
|
|
333
|
-
1019: LogsUnavailable,
|
|
334
357
|
1016: InvalidGuestToken,
|
|
335
358
|
1005: Unauthorized,
|
|
336
359
|
1011: MissingAuthorizationHeader,
|
|
@@ -862,6 +885,89 @@ function listSourceFileAssets({
|
|
|
862
885
|
headers
|
|
863
886
|
});
|
|
864
887
|
}
|
|
888
|
+
function createImport({
|
|
889
|
+
folder_id,
|
|
890
|
+
files,
|
|
891
|
+
conversion_pipeline = "auto-detect",
|
|
892
|
+
remote_files,
|
|
893
|
+
options
|
|
894
|
+
}, onUploadProgress, headers) {
|
|
895
|
+
return axiosInstance({
|
|
896
|
+
method: "post",
|
|
897
|
+
url: "/imports",
|
|
898
|
+
params: {
|
|
899
|
+
folder_id
|
|
900
|
+
},
|
|
901
|
+
data: multipartBody(
|
|
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
|
+
}
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
function listImports({
|
|
919
|
+
offset = 0,
|
|
920
|
+
limit = 10,
|
|
921
|
+
filters
|
|
922
|
+
}, headers) {
|
|
923
|
+
return axiosInstance({
|
|
924
|
+
method: "get",
|
|
925
|
+
url: "/imports",
|
|
926
|
+
params: {
|
|
927
|
+
offset,
|
|
928
|
+
limit,
|
|
929
|
+
filters
|
|
930
|
+
},
|
|
931
|
+
headers
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
function getImport({
|
|
935
|
+
import_id
|
|
936
|
+
}, headers) {
|
|
937
|
+
return axiosInstance({
|
|
938
|
+
method: "get",
|
|
939
|
+
url: "/imports/" + encodeURIComponent(import_id),
|
|
940
|
+
headers
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
function getConversionLogs({
|
|
944
|
+
conversion_id,
|
|
945
|
+
from,
|
|
946
|
+
to,
|
|
947
|
+
limit
|
|
948
|
+
}, headers) {
|
|
949
|
+
return axiosInstance({
|
|
950
|
+
method: "get",
|
|
951
|
+
url: "/conversions/" + encodeURIComponent(conversion_id) + "/logs",
|
|
952
|
+
params: {
|
|
953
|
+
from,
|
|
954
|
+
to,
|
|
955
|
+
limit
|
|
956
|
+
},
|
|
957
|
+
headers
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
function getConversionMetadata({
|
|
961
|
+
conversion_id,
|
|
962
|
+
filename
|
|
963
|
+
}, headers, responseType) {
|
|
964
|
+
return axiosInstance({
|
|
965
|
+
method: "get",
|
|
966
|
+
url: "/conversions/" + encodeURIComponent(conversion_id) + "/metadata/" + encodeURIComponent(filename),
|
|
967
|
+
headers,
|
|
968
|
+
responseType: responseType || "arraybuffer"
|
|
969
|
+
});
|
|
970
|
+
}
|
|
865
971
|
function listUploadTasks({
|
|
866
972
|
offset = 0,
|
|
867
973
|
limit = 10,
|
|
@@ -1620,7 +1726,9 @@ installInterceptors();
|
|
|
1620
1726
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1621
1727
|
0 && (module.exports = {
|
|
1622
1728
|
ApiError,
|
|
1729
|
+
ConversionNotFound,
|
|
1623
1730
|
ConversionTaskNotFound,
|
|
1731
|
+
ImportNotFound,
|
|
1624
1732
|
InsufficientPermissions,
|
|
1625
1733
|
InsufficientSecurityScope,
|
|
1626
1734
|
InvalidApiKey,
|
|
@@ -1646,6 +1754,7 @@ installInterceptors();
|
|
|
1646
1754
|
createEntity,
|
|
1647
1755
|
createFolder,
|
|
1648
1756
|
createGroup,
|
|
1757
|
+
createImport,
|
|
1649
1758
|
createSession,
|
|
1650
1759
|
createSubfolder,
|
|
1651
1760
|
deleteAsset,
|
|
@@ -1667,6 +1776,8 @@ installInterceptors();
|
|
|
1667
1776
|
getAssetPayload,
|
|
1668
1777
|
getAssetThumbnail,
|
|
1669
1778
|
getClient,
|
|
1779
|
+
getConversionLogs,
|
|
1780
|
+
getConversionMetadata,
|
|
1670
1781
|
getConversionTaskLogs,
|
|
1671
1782
|
getConversionTaskMetadata,
|
|
1672
1783
|
getCurrentUser,
|
|
@@ -1674,6 +1785,7 @@ installInterceptors();
|
|
|
1674
1785
|
getEntity,
|
|
1675
1786
|
getFolder,
|
|
1676
1787
|
getGroup,
|
|
1788
|
+
getImport,
|
|
1677
1789
|
getSceneAABB,
|
|
1678
1790
|
getSceneSettings,
|
|
1679
1791
|
getSession,
|
|
@@ -1696,6 +1808,7 @@ installInterceptors();
|
|
|
1696
1808
|
listFolderSubfolders,
|
|
1697
1809
|
listFolderUploadTasks,
|
|
1698
1810
|
listFolders,
|
|
1811
|
+
listImports,
|
|
1699
1812
|
listRunningSessions,
|
|
1700
1813
|
listSourceFileAssets,
|
|
1701
1814
|
listSourceFiles,
|