@3dverse/api 0.10.0 → 0.10.2
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 +1142 -512
- package/dist/index.js +36 -19
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +34 -18
- 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,
|
|
@@ -90,7 +92,6 @@ __export(index_exports, {
|
|
|
90
92
|
getFolderAssets: () => getFolderAssets,
|
|
91
93
|
getFolderInfo: () => getFolderInfo,
|
|
92
94
|
getGroup: () => getGroup,
|
|
93
|
-
getPipeline: () => getPipeline,
|
|
94
95
|
getRunningSessions: () => getRunningSessions,
|
|
95
96
|
getSceneAABB: () => getSceneAABB,
|
|
96
97
|
getSceneSessions: () => getSceneSessions,
|
|
@@ -193,6 +194,13 @@ var axiosInstance = import_axios.default.create({
|
|
|
193
194
|
function setBaseURL(baseURL) {
|
|
194
195
|
axiosInstance.defaults.baseURL = baseURL;
|
|
195
196
|
}
|
|
197
|
+
var AssetSourceFileNotFound = class extends ServiceErrorResponse {
|
|
198
|
+
static ERROR_CODE = 1018;
|
|
199
|
+
constructor(serviceError) {
|
|
200
|
+
super(1018, 404, "The asset was imported from no source file", serviceError);
|
|
201
|
+
Object.assign(this, serviceError);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
196
204
|
var InsufficientPermissions = class extends ServiceErrorResponse {
|
|
197
205
|
static ERROR_CODE = 1002;
|
|
198
206
|
constructor(serviceError) {
|
|
@@ -249,6 +257,13 @@ var InvalidGuestToken = class extends ServiceErrorResponse {
|
|
|
249
257
|
Object.assign(this, serviceError);
|
|
250
258
|
}
|
|
251
259
|
};
|
|
260
|
+
var InvalidTokenTtl = class extends ServiceErrorResponse {
|
|
261
|
+
static ERROR_CODE = 1017;
|
|
262
|
+
constructor(serviceError) {
|
|
263
|
+
super(1017, 400, "The time to live of a user token is a duration from 1 minute to 14 days", serviceError);
|
|
264
|
+
Object.assign(this, serviceError);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
252
267
|
var UploadedPayloadTooLarge = class extends ServiceErrorResponse {
|
|
253
268
|
static ERROR_CODE = 1007;
|
|
254
269
|
constructor(serviceError) {
|
|
@@ -299,6 +314,7 @@ var ConversionTaskNotFound = class extends ServiceErrorResponse {
|
|
|
299
314
|
}
|
|
300
315
|
};
|
|
301
316
|
var declaredErrors = {
|
|
317
|
+
1018: AssetSourceFileNotFound,
|
|
302
318
|
1002: InsufficientPermissions,
|
|
303
319
|
1003: InvalidAuthorization,
|
|
304
320
|
1004: InsufficientSecurityScope,
|
|
@@ -307,6 +323,7 @@ var declaredErrors = {
|
|
|
307
323
|
1011: MissingAuthorizationHeader,
|
|
308
324
|
1012: InvalidApiKey,
|
|
309
325
|
1016: InvalidGuestToken,
|
|
326
|
+
1017: InvalidTokenTtl,
|
|
310
327
|
1007: UploadedPayloadTooLarge,
|
|
311
328
|
1008: NoFileUploaded,
|
|
312
329
|
1009: UploadAborted,
|
|
@@ -1004,15 +1021,6 @@ function schedulePipeline({
|
|
|
1004
1021
|
headers
|
|
1005
1022
|
});
|
|
1006
1023
|
}
|
|
1007
|
-
function getPipeline({
|
|
1008
|
-
pipeline_id
|
|
1009
|
-
}, headers) {
|
|
1010
|
-
return axiosInstance({
|
|
1011
|
-
method: "get",
|
|
1012
|
-
url: "/pipelines/" + encodeURIComponent(pipeline_id),
|
|
1013
|
-
headers
|
|
1014
|
-
});
|
|
1015
|
-
}
|
|
1016
1024
|
function listAssets({
|
|
1017
1025
|
offset = 0,
|
|
1018
1026
|
limit = 10,
|
|
@@ -1273,7 +1281,7 @@ function exportAsset({
|
|
|
1273
1281
|
format,
|
|
1274
1282
|
scale = 1,
|
|
1275
1283
|
sub_mesh_index
|
|
1276
|
-
}, headers
|
|
1284
|
+
}, headers) {
|
|
1277
1285
|
return axiosInstance({
|
|
1278
1286
|
method: "get",
|
|
1279
1287
|
url: "/assets/" + encodeURIComponent(asset_container_exportable) + "/" + encodeURIComponent(asset_id) + "/exports/" + encodeURIComponent(format),
|
|
@@ -1281,8 +1289,7 @@ function exportAsset({
|
|
|
1281
1289
|
scale,
|
|
1282
1290
|
sub_mesh_index
|
|
1283
1291
|
},
|
|
1284
|
-
headers
|
|
1285
|
-
responseType: responseType || "arraybuffer"
|
|
1292
|
+
headers
|
|
1286
1293
|
});
|
|
1287
1294
|
}
|
|
1288
1295
|
function getSceneSessions({
|
|
@@ -1582,7 +1589,8 @@ function createSession({
|
|
|
1582
1589
|
scene_id,
|
|
1583
1590
|
renderer_version,
|
|
1584
1591
|
is_transient = false,
|
|
1585
|
-
options
|
|
1592
|
+
options,
|
|
1593
|
+
metadata
|
|
1586
1594
|
}, headers) {
|
|
1587
1595
|
return axiosInstance({
|
|
1588
1596
|
method: "post",
|
|
@@ -1591,7 +1599,8 @@ function createSession({
|
|
|
1591
1599
|
scene_id,
|
|
1592
1600
|
renderer_version,
|
|
1593
1601
|
is_transient,
|
|
1594
|
-
options
|
|
1602
|
+
options,
|
|
1603
|
+
metadata
|
|
1595
1604
|
},
|
|
1596
1605
|
headers
|
|
1597
1606
|
});
|
|
@@ -1616,13 +1625,15 @@ function killSession({
|
|
|
1616
1625
|
}
|
|
1617
1626
|
function joinSession({
|
|
1618
1627
|
session_id,
|
|
1619
|
-
is_headless = false
|
|
1628
|
+
is_headless = false,
|
|
1629
|
+
metadata
|
|
1620
1630
|
}, headers) {
|
|
1621
1631
|
return axiosInstance({
|
|
1622
1632
|
method: "post",
|
|
1623
1633
|
url: "/sessions/" + encodeURIComponent(session_id) + "/clients",
|
|
1624
1634
|
data: optionalBody({
|
|
1625
|
-
is_headless
|
|
1635
|
+
is_headless,
|
|
1636
|
+
metadata
|
|
1626
1637
|
}),
|
|
1627
1638
|
headers
|
|
1628
1639
|
});
|
|
@@ -1647,10 +1658,15 @@ function kickClientFromSession({
|
|
|
1647
1658
|
headers
|
|
1648
1659
|
});
|
|
1649
1660
|
}
|
|
1650
|
-
function joinSessionAsGuest(
|
|
1661
|
+
function joinSessionAsGuest({
|
|
1662
|
+
metadata
|
|
1663
|
+
}, headers) {
|
|
1651
1664
|
return axiosInstance({
|
|
1652
1665
|
method: "post",
|
|
1653
1666
|
url: "/sessions/guests",
|
|
1667
|
+
data: optionalBody({
|
|
1668
|
+
metadata
|
|
1669
|
+
}),
|
|
1654
1670
|
headers
|
|
1655
1671
|
});
|
|
1656
1672
|
}
|
|
@@ -1746,6 +1762,7 @@ installInterceptors();
|
|
|
1746
1762
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1747
1763
|
0 && (module.exports = {
|
|
1748
1764
|
ApiError,
|
|
1765
|
+
AssetSourceFileNotFound,
|
|
1749
1766
|
ConversionTaskNotFound,
|
|
1750
1767
|
EnvironmentMismatch,
|
|
1751
1768
|
InsufficientPermissions,
|
|
@@ -1755,6 +1772,7 @@ installInterceptors();
|
|
|
1755
1772
|
InvalidGuestToken,
|
|
1756
1773
|
InvalidMaterial,
|
|
1757
1774
|
InvalidRequest,
|
|
1775
|
+
InvalidTokenTtl,
|
|
1758
1776
|
MissingAuthorizationHeader,
|
|
1759
1777
|
NoFileUploaded,
|
|
1760
1778
|
ServiceErrorResponse,
|
|
@@ -1806,7 +1824,6 @@ installInterceptors();
|
|
|
1806
1824
|
getFolderAssets,
|
|
1807
1825
|
getFolderInfo,
|
|
1808
1826
|
getGroup,
|
|
1809
|
-
getPipeline,
|
|
1810
1827
|
getRunningSessions,
|
|
1811
1828
|
getSceneAABB,
|
|
1812
1829
|
getSceneSessions,
|