@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/index.mjs CHANGED
@@ -49,6 +49,13 @@ var axiosInstance = axios.create({
49
49
  function setBaseURL(baseURL) {
50
50
  axiosInstance.defaults.baseURL = baseURL;
51
51
  }
52
+ var AssetSourceFileNotFound = class extends ServiceErrorResponse {
53
+ static ERROR_CODE = 1018;
54
+ constructor(serviceError) {
55
+ super(1018, 404, "The asset was imported from no source file", serviceError);
56
+ Object.assign(this, serviceError);
57
+ }
58
+ };
52
59
  var InsufficientPermissions = class extends ServiceErrorResponse {
53
60
  static ERROR_CODE = 1002;
54
61
  constructor(serviceError) {
@@ -105,6 +112,13 @@ var InvalidGuestToken = class extends ServiceErrorResponse {
105
112
  Object.assign(this, serviceError);
106
113
  }
107
114
  };
115
+ var InvalidTokenTtl = class extends ServiceErrorResponse {
116
+ static ERROR_CODE = 1017;
117
+ constructor(serviceError) {
118
+ super(1017, 400, "The time to live of a user token is a duration from 1 minute to 14 days", serviceError);
119
+ Object.assign(this, serviceError);
120
+ }
121
+ };
108
122
  var UploadedPayloadTooLarge = class extends ServiceErrorResponse {
109
123
  static ERROR_CODE = 1007;
110
124
  constructor(serviceError) {
@@ -155,6 +169,7 @@ var ConversionTaskNotFound = class extends ServiceErrorResponse {
155
169
  }
156
170
  };
157
171
  var declaredErrors = {
172
+ 1018: AssetSourceFileNotFound,
158
173
  1002: InsufficientPermissions,
159
174
  1003: InvalidAuthorization,
160
175
  1004: InsufficientSecurityScope,
@@ -163,6 +178,7 @@ var declaredErrors = {
163
178
  1011: MissingAuthorizationHeader,
164
179
  1012: InvalidApiKey,
165
180
  1016: InvalidGuestToken,
181
+ 1017: InvalidTokenTtl,
166
182
  1007: UploadedPayloadTooLarge,
167
183
  1008: NoFileUploaded,
168
184
  1009: UploadAborted,
@@ -860,15 +876,6 @@ function schedulePipeline({
860
876
  headers
861
877
  });
862
878
  }
863
- function getPipeline({
864
- pipeline_id
865
- }, headers) {
866
- return axiosInstance({
867
- method: "get",
868
- url: "/pipelines/" + encodeURIComponent(pipeline_id),
869
- headers
870
- });
871
- }
872
879
  function listAssets({
873
880
  offset = 0,
874
881
  limit = 10,
@@ -1129,7 +1136,7 @@ function exportAsset({
1129
1136
  format,
1130
1137
  scale = 1,
1131
1138
  sub_mesh_index
1132
- }, headers, responseType) {
1139
+ }, headers) {
1133
1140
  return axiosInstance({
1134
1141
  method: "get",
1135
1142
  url: "/assets/" + encodeURIComponent(asset_container_exportable) + "/" + encodeURIComponent(asset_id) + "/exports/" + encodeURIComponent(format),
@@ -1137,8 +1144,7 @@ function exportAsset({
1137
1144
  scale,
1138
1145
  sub_mesh_index
1139
1146
  },
1140
- headers,
1141
- responseType: responseType || "arraybuffer"
1147
+ headers
1142
1148
  });
1143
1149
  }
1144
1150
  function getSceneSessions({
@@ -1438,7 +1444,8 @@ function createSession({
1438
1444
  scene_id,
1439
1445
  renderer_version,
1440
1446
  is_transient = false,
1441
- options
1447
+ options,
1448
+ metadata
1442
1449
  }, headers) {
1443
1450
  return axiosInstance({
1444
1451
  method: "post",
@@ -1447,7 +1454,8 @@ function createSession({
1447
1454
  scene_id,
1448
1455
  renderer_version,
1449
1456
  is_transient,
1450
- options
1457
+ options,
1458
+ metadata
1451
1459
  },
1452
1460
  headers
1453
1461
  });
@@ -1472,13 +1480,15 @@ function killSession({
1472
1480
  }
1473
1481
  function joinSession({
1474
1482
  session_id,
1475
- is_headless = false
1483
+ is_headless = false,
1484
+ metadata
1476
1485
  }, headers) {
1477
1486
  return axiosInstance({
1478
1487
  method: "post",
1479
1488
  url: "/sessions/" + encodeURIComponent(session_id) + "/clients",
1480
1489
  data: optionalBody({
1481
- is_headless
1490
+ is_headless,
1491
+ metadata
1482
1492
  }),
1483
1493
  headers
1484
1494
  });
@@ -1503,10 +1513,15 @@ function kickClientFromSession({
1503
1513
  headers
1504
1514
  });
1505
1515
  }
1506
- function joinSessionAsGuest(headers) {
1516
+ function joinSessionAsGuest({
1517
+ metadata
1518
+ }, headers) {
1507
1519
  return axiosInstance({
1508
1520
  method: "post",
1509
1521
  url: "/sessions/guests",
1522
+ data: optionalBody({
1523
+ metadata
1524
+ }),
1510
1525
  headers
1511
1526
  });
1512
1527
  }
@@ -1601,6 +1616,7 @@ function shouldRetryRequest(error) {
1601
1616
  installInterceptors();
1602
1617
  export {
1603
1618
  ApiError,
1619
+ AssetSourceFileNotFound,
1604
1620
  ConversionTaskNotFound,
1605
1621
  EnvironmentMismatch,
1606
1622
  InsufficientPermissions,
@@ -1610,6 +1626,7 @@ export {
1610
1626
  InvalidGuestToken,
1611
1627
  InvalidMaterial,
1612
1628
  InvalidRequest,
1629
+ InvalidTokenTtl,
1613
1630
  MissingAuthorizationHeader,
1614
1631
  NoFileUploaded,
1615
1632
  ServiceErrorResponse,
@@ -1661,7 +1678,6 @@ export {
1661
1678
  getFolderAssets,
1662
1679
  getFolderInfo,
1663
1680
  getGroup,
1664
- getPipeline,
1665
1681
  getRunningSessions,
1666
1682
  getSceneAABB,
1667
1683
  getSceneSessions,