@3dverse/api 0.10.0 → 0.10.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 +349 -239
- package/dist/index.js +22 -3
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +20 -3
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var index_exports = {};
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
ApiError: () => ApiError,
|
|
33
|
+
AssetSourceFileNotFound: () => AssetSourceFileNotFound,
|
|
33
34
|
ConversionTaskNotFound: () => ConversionTaskNotFound,
|
|
34
35
|
EnvironmentMismatch: () => EnvironmentMismatch,
|
|
35
36
|
InsufficientPermissions: () => InsufficientPermissions,
|
|
@@ -39,6 +40,7 @@ __export(index_exports, {
|
|
|
39
40
|
InvalidGuestToken: () => InvalidGuestToken,
|
|
40
41
|
InvalidMaterial: () => InvalidMaterial,
|
|
41
42
|
InvalidRequest: () => InvalidRequest,
|
|
43
|
+
InvalidTokenTtl: () => InvalidTokenTtl,
|
|
42
44
|
MissingAuthorizationHeader: () => MissingAuthorizationHeader,
|
|
43
45
|
NoFileUploaded: () => NoFileUploaded,
|
|
44
46
|
ServiceErrorResponse: () => ServiceErrorResponse,
|
|
@@ -193,6 +195,13 @@ var axiosInstance = import_axios.default.create({
|
|
|
193
195
|
function setBaseURL(baseURL) {
|
|
194
196
|
axiosInstance.defaults.baseURL = baseURL;
|
|
195
197
|
}
|
|
198
|
+
var AssetSourceFileNotFound = class extends ServiceErrorResponse {
|
|
199
|
+
static ERROR_CODE = 1018;
|
|
200
|
+
constructor(serviceError) {
|
|
201
|
+
super(1018, 404, "The asset was imported from no source file", serviceError);
|
|
202
|
+
Object.assign(this, serviceError);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
196
205
|
var InsufficientPermissions = class extends ServiceErrorResponse {
|
|
197
206
|
static ERROR_CODE = 1002;
|
|
198
207
|
constructor(serviceError) {
|
|
@@ -249,6 +258,13 @@ var InvalidGuestToken = class extends ServiceErrorResponse {
|
|
|
249
258
|
Object.assign(this, serviceError);
|
|
250
259
|
}
|
|
251
260
|
};
|
|
261
|
+
var InvalidTokenTtl = class extends ServiceErrorResponse {
|
|
262
|
+
static ERROR_CODE = 1017;
|
|
263
|
+
constructor(serviceError) {
|
|
264
|
+
super(1017, 400, "The time to live of a user token is a duration from 1 minute to 14 days", serviceError);
|
|
265
|
+
Object.assign(this, serviceError);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
252
268
|
var UploadedPayloadTooLarge = class extends ServiceErrorResponse {
|
|
253
269
|
static ERROR_CODE = 1007;
|
|
254
270
|
constructor(serviceError) {
|
|
@@ -299,6 +315,7 @@ var ConversionTaskNotFound = class extends ServiceErrorResponse {
|
|
|
299
315
|
}
|
|
300
316
|
};
|
|
301
317
|
var declaredErrors = {
|
|
318
|
+
1018: AssetSourceFileNotFound,
|
|
302
319
|
1002: InsufficientPermissions,
|
|
303
320
|
1003: InvalidAuthorization,
|
|
304
321
|
1004: InsufficientSecurityScope,
|
|
@@ -307,6 +324,7 @@ var declaredErrors = {
|
|
|
307
324
|
1011: MissingAuthorizationHeader,
|
|
308
325
|
1012: InvalidApiKey,
|
|
309
326
|
1016: InvalidGuestToken,
|
|
327
|
+
1017: InvalidTokenTtl,
|
|
310
328
|
1007: UploadedPayloadTooLarge,
|
|
311
329
|
1008: NoFileUploaded,
|
|
312
330
|
1009: UploadAborted,
|
|
@@ -1273,7 +1291,7 @@ function exportAsset({
|
|
|
1273
1291
|
format,
|
|
1274
1292
|
scale = 1,
|
|
1275
1293
|
sub_mesh_index
|
|
1276
|
-
}, headers
|
|
1294
|
+
}, headers) {
|
|
1277
1295
|
return axiosInstance({
|
|
1278
1296
|
method: "get",
|
|
1279
1297
|
url: "/assets/" + encodeURIComponent(asset_container_exportable) + "/" + encodeURIComponent(asset_id) + "/exports/" + encodeURIComponent(format),
|
|
@@ -1281,8 +1299,7 @@ function exportAsset({
|
|
|
1281
1299
|
scale,
|
|
1282
1300
|
sub_mesh_index
|
|
1283
1301
|
},
|
|
1284
|
-
headers
|
|
1285
|
-
responseType: responseType || "arraybuffer"
|
|
1302
|
+
headers
|
|
1286
1303
|
});
|
|
1287
1304
|
}
|
|
1288
1305
|
function getSceneSessions({
|
|
@@ -1746,6 +1763,7 @@ installInterceptors();
|
|
|
1746
1763
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1747
1764
|
0 && (module.exports = {
|
|
1748
1765
|
ApiError,
|
|
1766
|
+
AssetSourceFileNotFound,
|
|
1749
1767
|
ConversionTaskNotFound,
|
|
1750
1768
|
EnvironmentMismatch,
|
|
1751
1769
|
InsufficientPermissions,
|
|
@@ -1755,6 +1773,7 @@ installInterceptors();
|
|
|
1755
1773
|
InvalidGuestToken,
|
|
1756
1774
|
InvalidMaterial,
|
|
1757
1775
|
InvalidRequest,
|
|
1776
|
+
InvalidTokenTtl,
|
|
1758
1777
|
MissingAuthorizationHeader,
|
|
1759
1778
|
NoFileUploaded,
|
|
1760
1779
|
ServiceErrorResponse,
|