@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/dist/index.mjs
CHANGED
|
@@ -126,17 +126,17 @@ var UploadAborted = class extends ServiceErrorResponse {
|
|
|
126
126
|
Object.assign(this, serviceError);
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
var
|
|
130
|
-
static ERROR_CODE =
|
|
129
|
+
var ImportNotFound = class extends ServiceErrorResponse {
|
|
130
|
+
static ERROR_CODE = 1022;
|
|
131
131
|
constructor(serviceError) {
|
|
132
|
-
super(
|
|
132
|
+
super(1022, 404, "Import not found", serviceError);
|
|
133
133
|
Object.assign(this, serviceError);
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
|
-
var
|
|
137
|
-
static ERROR_CODE =
|
|
136
|
+
var ConversionNotFound = class extends ServiceErrorResponse {
|
|
137
|
+
static ERROR_CODE = 1023;
|
|
138
138
|
constructor(serviceError) {
|
|
139
|
-
super(
|
|
139
|
+
super(1023, 404, "Conversion not found", serviceError);
|
|
140
140
|
Object.assign(this, serviceError);
|
|
141
141
|
}
|
|
142
142
|
};
|
|
@@ -147,6 +147,20 @@ var LogsUnavailable = class extends ServiceErrorResponse {
|
|
|
147
147
|
Object.assign(this, serviceError);
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
|
+
var UploadTaskNotFound = class extends ServiceErrorResponse {
|
|
151
|
+
static ERROR_CODE = 1010;
|
|
152
|
+
constructor(serviceError) {
|
|
153
|
+
super(1010, 404, "Upload task not found", serviceError);
|
|
154
|
+
Object.assign(this, serviceError);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
var ConversionTaskNotFound = class extends ServiceErrorResponse {
|
|
158
|
+
static ERROR_CODE = 1015;
|
|
159
|
+
constructor(serviceError) {
|
|
160
|
+
super(1015, 404, "Conversion task not found", serviceError);
|
|
161
|
+
Object.assign(this, serviceError);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
150
164
|
var InvalidGuestToken = class extends ServiceErrorResponse {
|
|
151
165
|
static ERROR_CODE = 1016;
|
|
152
166
|
constructor(serviceError) {
|
|
@@ -194,9 +208,11 @@ var declaredErrors = {
|
|
|
194
208
|
1007: UploadedPayloadTooLarge,
|
|
195
209
|
1008: NoFileUploaded,
|
|
196
210
|
1009: UploadAborted,
|
|
211
|
+
1022: ImportNotFound,
|
|
212
|
+
1023: ConversionNotFound,
|
|
213
|
+
1019: LogsUnavailable,
|
|
197
214
|
1010: UploadTaskNotFound,
|
|
198
215
|
1015: ConversionTaskNotFound,
|
|
199
|
-
1019: LogsUnavailable,
|
|
200
216
|
1016: InvalidGuestToken,
|
|
201
217
|
1005: Unauthorized,
|
|
202
218
|
1011: MissingAuthorizationHeader,
|
|
@@ -728,6 +744,89 @@ function listSourceFileAssets({
|
|
|
728
744
|
headers
|
|
729
745
|
});
|
|
730
746
|
}
|
|
747
|
+
function createImport({
|
|
748
|
+
folder_id,
|
|
749
|
+
files,
|
|
750
|
+
conversion_pipeline = "auto-detect",
|
|
751
|
+
remote_files,
|
|
752
|
+
options
|
|
753
|
+
}, onUploadProgress, headers) {
|
|
754
|
+
return axiosInstance({
|
|
755
|
+
method: "post",
|
|
756
|
+
url: "/imports",
|
|
757
|
+
params: {
|
|
758
|
+
folder_id
|
|
759
|
+
},
|
|
760
|
+
data: multipartBody(
|
|
761
|
+
{
|
|
762
|
+
conversion_pipeline,
|
|
763
|
+
remote_files,
|
|
764
|
+
options
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
files
|
|
768
|
+
}
|
|
769
|
+
),
|
|
770
|
+
onUploadProgress,
|
|
771
|
+
headers: {
|
|
772
|
+
"Content-Type": "multipart/form-data",
|
|
773
|
+
...plainHeaders(headers)
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
function listImports({
|
|
778
|
+
offset = 0,
|
|
779
|
+
limit = 10,
|
|
780
|
+
filters
|
|
781
|
+
}, headers) {
|
|
782
|
+
return axiosInstance({
|
|
783
|
+
method: "get",
|
|
784
|
+
url: "/imports",
|
|
785
|
+
params: {
|
|
786
|
+
offset,
|
|
787
|
+
limit,
|
|
788
|
+
filters
|
|
789
|
+
},
|
|
790
|
+
headers
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
function getImport({
|
|
794
|
+
import_id
|
|
795
|
+
}, headers) {
|
|
796
|
+
return axiosInstance({
|
|
797
|
+
method: "get",
|
|
798
|
+
url: "/imports/" + encodeURIComponent(import_id),
|
|
799
|
+
headers
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
function getConversionLogs({
|
|
803
|
+
conversion_id,
|
|
804
|
+
from,
|
|
805
|
+
to,
|
|
806
|
+
limit
|
|
807
|
+
}, headers) {
|
|
808
|
+
return axiosInstance({
|
|
809
|
+
method: "get",
|
|
810
|
+
url: "/conversions/" + encodeURIComponent(conversion_id) + "/logs",
|
|
811
|
+
params: {
|
|
812
|
+
from,
|
|
813
|
+
to,
|
|
814
|
+
limit
|
|
815
|
+
},
|
|
816
|
+
headers
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
function getConversionMetadata({
|
|
820
|
+
conversion_id,
|
|
821
|
+
filename
|
|
822
|
+
}, headers, responseType) {
|
|
823
|
+
return axiosInstance({
|
|
824
|
+
method: "get",
|
|
825
|
+
url: "/conversions/" + encodeURIComponent(conversion_id) + "/metadata/" + encodeURIComponent(filename),
|
|
826
|
+
headers,
|
|
827
|
+
responseType: responseType || "arraybuffer"
|
|
828
|
+
});
|
|
829
|
+
}
|
|
731
830
|
function listUploadTasks({
|
|
732
831
|
offset = 0,
|
|
733
832
|
limit = 10,
|
|
@@ -1485,7 +1584,9 @@ function shouldRetryRequest(error) {
|
|
|
1485
1584
|
installInterceptors();
|
|
1486
1585
|
export {
|
|
1487
1586
|
ApiError,
|
|
1587
|
+
ConversionNotFound,
|
|
1488
1588
|
ConversionTaskNotFound,
|
|
1589
|
+
ImportNotFound,
|
|
1489
1590
|
InsufficientPermissions,
|
|
1490
1591
|
InsufficientSecurityScope,
|
|
1491
1592
|
InvalidApiKey,
|
|
@@ -1511,6 +1612,7 @@ export {
|
|
|
1511
1612
|
createEntity,
|
|
1512
1613
|
createFolder,
|
|
1513
1614
|
createGroup,
|
|
1615
|
+
createImport,
|
|
1514
1616
|
createSession,
|
|
1515
1617
|
createSubfolder,
|
|
1516
1618
|
deleteAsset,
|
|
@@ -1532,6 +1634,8 @@ export {
|
|
|
1532
1634
|
getAssetPayload,
|
|
1533
1635
|
getAssetThumbnail,
|
|
1534
1636
|
getClient,
|
|
1637
|
+
getConversionLogs,
|
|
1638
|
+
getConversionMetadata,
|
|
1535
1639
|
getConversionTaskLogs,
|
|
1536
1640
|
getConversionTaskMetadata,
|
|
1537
1641
|
getCurrentUser,
|
|
@@ -1539,6 +1643,7 @@ export {
|
|
|
1539
1643
|
getEntity,
|
|
1540
1644
|
getFolder,
|
|
1541
1645
|
getGroup,
|
|
1646
|
+
getImport,
|
|
1542
1647
|
getSceneAABB,
|
|
1543
1648
|
getSceneSettings,
|
|
1544
1649
|
getSession,
|
|
@@ -1561,6 +1666,7 @@ export {
|
|
|
1561
1666
|
listFolderSubfolders,
|
|
1562
1667
|
listFolderUploadTasks,
|
|
1563
1668
|
listFolders,
|
|
1669
|
+
listImports,
|
|
1564
1670
|
listRunningSessions,
|
|
1565
1671
|
listSourceFileAssets,
|
|
1566
1672
|
listSourceFiles,
|