@3dverse/api 0.10.2 → 0.11.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 +0 -1
- package/dist/_prebuild/wrapper.d.ts +3383 -728
- package/dist/index.js +197 -354
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +178 -324
- package/dist/index.mjs.map +2 -2
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -49,20 +49,6 @@ 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
|
-
};
|
|
59
|
-
var InsufficientPermissions = class extends ServiceErrorResponse {
|
|
60
|
-
static ERROR_CODE = 1002;
|
|
61
|
-
constructor(serviceError) {
|
|
62
|
-
super(1002, 403, "Insufficient permissions", serviceError);
|
|
63
|
-
Object.assign(this, serviceError);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
52
|
var InvalidAuthorization = class extends ServiceErrorResponse {
|
|
67
53
|
static ERROR_CODE = 1003;
|
|
68
54
|
constructor(serviceError) {
|
|
@@ -77,45 +63,45 @@ var InsufficientSecurityScope = class extends ServiceErrorResponse {
|
|
|
77
63
|
Object.assign(this, serviceError);
|
|
78
64
|
}
|
|
79
65
|
};
|
|
80
|
-
var
|
|
81
|
-
static ERROR_CODE =
|
|
66
|
+
var InsufficientPermissions = class extends ServiceErrorResponse {
|
|
67
|
+
static ERROR_CODE = 1002;
|
|
82
68
|
constructor(serviceError) {
|
|
83
|
-
super(
|
|
69
|
+
super(1002, 403, "Insufficient permissions", serviceError);
|
|
84
70
|
Object.assign(this, serviceError);
|
|
85
71
|
}
|
|
86
72
|
};
|
|
87
|
-
var
|
|
88
|
-
static ERROR_CODE =
|
|
73
|
+
var InvalidTokenTtl = class extends ServiceErrorResponse {
|
|
74
|
+
static ERROR_CODE = 1017;
|
|
89
75
|
constructor(serviceError) {
|
|
90
|
-
super(
|
|
76
|
+
super(1017, 400, "The time to live of a user token is a duration from 1 minute to 14 days", serviceError);
|
|
91
77
|
Object.assign(this, serviceError);
|
|
92
78
|
}
|
|
93
79
|
};
|
|
94
|
-
var
|
|
95
|
-
static ERROR_CODE =
|
|
80
|
+
var InvalidParameter = class extends ServiceErrorResponse {
|
|
81
|
+
static ERROR_CODE = 1;
|
|
96
82
|
constructor(serviceError) {
|
|
97
|
-
super(
|
|
83
|
+
super(1, 400, "Invalid parameter", serviceError);
|
|
98
84
|
Object.assign(this, serviceError);
|
|
99
85
|
}
|
|
100
86
|
};
|
|
101
|
-
var
|
|
102
|
-
static ERROR_CODE =
|
|
87
|
+
var MemberAccessesDiffer = class extends ServiceErrorResponse {
|
|
88
|
+
static ERROR_CODE = 1020;
|
|
103
89
|
constructor(serviceError) {
|
|
104
|
-
super(
|
|
90
|
+
super(1020, 422, "A member's group and folder accesses differ, while it holds a single role", serviceError);
|
|
105
91
|
Object.assign(this, serviceError);
|
|
106
92
|
}
|
|
107
93
|
};
|
|
108
|
-
var
|
|
109
|
-
static ERROR_CODE =
|
|
94
|
+
var InvalidMaterial = class extends ServiceErrorResponse {
|
|
95
|
+
static ERROR_CODE = 1013;
|
|
110
96
|
constructor(serviceError) {
|
|
111
|
-
super(
|
|
97
|
+
super(1013, 400, "Some of the asset ids are not materials", serviceError);
|
|
112
98
|
Object.assign(this, serviceError);
|
|
113
99
|
}
|
|
114
100
|
};
|
|
115
|
-
var
|
|
116
|
-
static ERROR_CODE =
|
|
101
|
+
var InvalidRequest = class extends ServiceErrorResponse {
|
|
102
|
+
static ERROR_CODE = 1014;
|
|
117
103
|
constructor(serviceError) {
|
|
118
|
-
super(
|
|
104
|
+
super(1014, 400, "Invalid request", serviceError);
|
|
119
105
|
Object.assign(this, serviceError);
|
|
120
106
|
}
|
|
121
107
|
};
|
|
@@ -147,45 +133,75 @@ var UploadTaskNotFound = class extends ServiceErrorResponse {
|
|
|
147
133
|
Object.assign(this, serviceError);
|
|
148
134
|
}
|
|
149
135
|
};
|
|
150
|
-
var
|
|
151
|
-
static ERROR_CODE =
|
|
136
|
+
var ConversionTaskNotFound = class extends ServiceErrorResponse {
|
|
137
|
+
static ERROR_CODE = 1015;
|
|
152
138
|
constructor(serviceError) {
|
|
153
|
-
super(
|
|
139
|
+
super(1015, 404, "Conversion task not found", serviceError);
|
|
154
140
|
Object.assign(this, serviceError);
|
|
155
141
|
}
|
|
156
142
|
};
|
|
157
|
-
var
|
|
158
|
-
static ERROR_CODE =
|
|
143
|
+
var LogsUnavailable = class extends ServiceErrorResponse {
|
|
144
|
+
static ERROR_CODE = 1019;
|
|
159
145
|
constructor(serviceError) {
|
|
160
|
-
super(
|
|
146
|
+
super(1019, 502, "Logs unavailable", serviceError);
|
|
161
147
|
Object.assign(this, serviceError);
|
|
162
148
|
}
|
|
163
149
|
};
|
|
164
|
-
var
|
|
165
|
-
static ERROR_CODE =
|
|
150
|
+
var InvalidGuestToken = class extends ServiceErrorResponse {
|
|
151
|
+
static ERROR_CODE = 1016;
|
|
166
152
|
constructor(serviceError) {
|
|
167
|
-
super(
|
|
153
|
+
super(1016, 403, "You are not allowed to use this guest token for this session", serviceError);
|
|
154
|
+
Object.assign(this, serviceError);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
var Unauthorized = class extends ServiceErrorResponse {
|
|
158
|
+
static ERROR_CODE = 1005;
|
|
159
|
+
constructor(serviceError) {
|
|
160
|
+
super(1005, 401, "Invalid or expired token", serviceError);
|
|
161
|
+
Object.assign(this, serviceError);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
var MissingAuthorizationHeader = class extends ServiceErrorResponse {
|
|
165
|
+
static ERROR_CODE = 1011;
|
|
166
|
+
constructor(serviceError) {
|
|
167
|
+
super(1011, 401, "Missing api key or user token", serviceError);
|
|
168
|
+
Object.assign(this, serviceError);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
var InvalidApiKey = class extends ServiceErrorResponse {
|
|
172
|
+
static ERROR_CODE = 1012;
|
|
173
|
+
constructor(serviceError) {
|
|
174
|
+
super(1012, 401, "Invalid api key", serviceError);
|
|
175
|
+
Object.assign(this, serviceError);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
var TooManyRequests = class extends ServiceErrorResponse {
|
|
179
|
+
static ERROR_CODE = 1021;
|
|
180
|
+
constructor(serviceError) {
|
|
181
|
+
super(1021, 429, "Too many requests", serviceError);
|
|
168
182
|
Object.assign(this, serviceError);
|
|
169
183
|
}
|
|
170
184
|
};
|
|
171
185
|
var declaredErrors = {
|
|
172
|
-
1018: AssetSourceFileNotFound,
|
|
173
|
-
1002: InsufficientPermissions,
|
|
174
186
|
1003: InvalidAuthorization,
|
|
175
187
|
1004: InsufficientSecurityScope,
|
|
176
|
-
|
|
177
|
-
1006: EnvironmentMismatch,
|
|
178
|
-
1011: MissingAuthorizationHeader,
|
|
179
|
-
1012: InvalidApiKey,
|
|
180
|
-
1016: InvalidGuestToken,
|
|
188
|
+
1002: InsufficientPermissions,
|
|
181
189
|
1017: InvalidTokenTtl,
|
|
190
|
+
1: InvalidParameter,
|
|
191
|
+
1020: MemberAccessesDiffer,
|
|
192
|
+
1013: InvalidMaterial,
|
|
193
|
+
1014: InvalidRequest,
|
|
182
194
|
1007: UploadedPayloadTooLarge,
|
|
183
195
|
1008: NoFileUploaded,
|
|
184
196
|
1009: UploadAborted,
|
|
185
197
|
1010: UploadTaskNotFound,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
198
|
+
1015: ConversionTaskNotFound,
|
|
199
|
+
1019: LogsUnavailable,
|
|
200
|
+
1016: InvalidGuestToken,
|
|
201
|
+
1005: Unauthorized,
|
|
202
|
+
1011: MissingAuthorizationHeader,
|
|
203
|
+
1012: InvalidApiKey,
|
|
204
|
+
1021: TooManyRequests
|
|
189
205
|
};
|
|
190
206
|
function errorOf(error) {
|
|
191
207
|
if (Object.values(declaredErrors).some((declared2) => error instanceof declared2)) {
|
|
@@ -209,6 +225,11 @@ function listUsers({
|
|
|
209
225
|
limit
|
|
210
226
|
},
|
|
211
227
|
headers
|
|
228
|
+
}).then((response) => {
|
|
229
|
+
if ("x-total-count" in response.headers) {
|
|
230
|
+
response.headers["x-total-count"] = JSON.parse(response.headers["x-total-count"]);
|
|
231
|
+
}
|
|
232
|
+
return response;
|
|
212
233
|
});
|
|
213
234
|
}
|
|
214
235
|
function registerUser({
|
|
@@ -276,7 +297,7 @@ function generateUserToken({
|
|
|
276
297
|
headers
|
|
277
298
|
});
|
|
278
299
|
}
|
|
279
|
-
function
|
|
300
|
+
function listUserGroups({
|
|
280
301
|
user_id
|
|
281
302
|
}, headers) {
|
|
282
303
|
return axiosInstance({
|
|
@@ -285,21 +306,6 @@ function getUserGroups({
|
|
|
285
306
|
headers
|
|
286
307
|
});
|
|
287
308
|
}
|
|
288
|
-
function getUserUploadTasks({
|
|
289
|
-
user_id,
|
|
290
|
-
offset = 0,
|
|
291
|
-
limit = 10
|
|
292
|
-
}, headers) {
|
|
293
|
-
return axiosInstance({
|
|
294
|
-
method: "get",
|
|
295
|
-
url: "/users/" + encodeURIComponent(user_id) + "/upload-tasks",
|
|
296
|
-
params: {
|
|
297
|
-
offset,
|
|
298
|
-
limit
|
|
299
|
-
},
|
|
300
|
-
headers
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
309
|
function createGroup({
|
|
304
310
|
name,
|
|
305
311
|
description,
|
|
@@ -325,7 +331,7 @@ function getGroup({
|
|
|
325
331
|
headers
|
|
326
332
|
});
|
|
327
333
|
}
|
|
328
|
-
function
|
|
334
|
+
function updateGroup({
|
|
329
335
|
group_id,
|
|
330
336
|
name,
|
|
331
337
|
description
|
|
@@ -405,7 +411,7 @@ function createFolder({
|
|
|
405
411
|
headers
|
|
406
412
|
});
|
|
407
413
|
}
|
|
408
|
-
function
|
|
414
|
+
function getFolder({
|
|
409
415
|
folder_id
|
|
410
416
|
}, headers) {
|
|
411
417
|
return axiosInstance({
|
|
@@ -414,17 +420,6 @@ function getFolderInfo({
|
|
|
414
420
|
headers
|
|
415
421
|
});
|
|
416
422
|
}
|
|
417
|
-
function moveFolders({
|
|
418
|
-
folder_id,
|
|
419
|
-
folder_ids
|
|
420
|
-
}, headers) {
|
|
421
|
-
return axiosInstance({
|
|
422
|
-
method: "put",
|
|
423
|
-
url: "/folders/" + encodeURIComponent(folder_id),
|
|
424
|
-
data: folder_ids,
|
|
425
|
-
headers
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
423
|
function updateFolder({
|
|
429
424
|
folder_id,
|
|
430
425
|
name
|
|
@@ -497,7 +492,7 @@ function createSubfolder({
|
|
|
497
492
|
headers
|
|
498
493
|
});
|
|
499
494
|
}
|
|
500
|
-
function
|
|
495
|
+
function listFolderSubfolders({
|
|
501
496
|
folder_id
|
|
502
497
|
}, headers) {
|
|
503
498
|
return axiosInstance({
|
|
@@ -506,10 +501,22 @@ function listFolderSubFolders({
|
|
|
506
501
|
headers
|
|
507
502
|
});
|
|
508
503
|
}
|
|
504
|
+
function moveFolders({
|
|
505
|
+
folder_id,
|
|
506
|
+
folder_ids
|
|
507
|
+
}, headers) {
|
|
508
|
+
return axiosInstance({
|
|
509
|
+
method: "patch",
|
|
510
|
+
url: "/folders/" + encodeURIComponent(folder_id) + "/folders",
|
|
511
|
+
data: {
|
|
512
|
+
folder_ids
|
|
513
|
+
},
|
|
514
|
+
headers
|
|
515
|
+
});
|
|
516
|
+
}
|
|
509
517
|
function uploadSourceFiles({
|
|
510
518
|
folder_id,
|
|
511
519
|
files,
|
|
512
|
-
task_name,
|
|
513
520
|
conversion_pipeline = "auto-detect",
|
|
514
521
|
source_files,
|
|
515
522
|
options
|
|
@@ -519,7 +526,6 @@ function uploadSourceFiles({
|
|
|
519
526
|
url: "/folders/" + encodeURIComponent(folder_id) + "/source-files",
|
|
520
527
|
data: multipartBody(
|
|
521
528
|
{
|
|
522
|
-
task_name,
|
|
523
529
|
conversion_pipeline,
|
|
524
530
|
source_files,
|
|
525
531
|
options
|
|
@@ -535,7 +541,7 @@ function uploadSourceFiles({
|
|
|
535
541
|
}
|
|
536
542
|
});
|
|
537
543
|
}
|
|
538
|
-
function
|
|
544
|
+
function listFolderSourceFiles({
|
|
539
545
|
folder_id,
|
|
540
546
|
offset = 0,
|
|
541
547
|
limit = 10,
|
|
@@ -551,7 +557,12 @@ function getSourceFilesInFolder({
|
|
|
551
557
|
},
|
|
552
558
|
headers
|
|
553
559
|
}).then((response) => {
|
|
554
|
-
response.headers["x-source-files-count"] = JSON.parse(
|
|
560
|
+
response.headers["x-source-files-count"] = JSON.parse(
|
|
561
|
+
response.headers["x-source-files-count"]
|
|
562
|
+
);
|
|
563
|
+
if ("x-total-count" in response.headers) {
|
|
564
|
+
response.headers["x-total-count"] = JSON.parse(response.headers["x-total-count"]);
|
|
565
|
+
}
|
|
555
566
|
return response;
|
|
556
567
|
});
|
|
557
568
|
}
|
|
@@ -560,13 +571,15 @@ function moveSourceFiles({
|
|
|
560
571
|
source_file_ids
|
|
561
572
|
}, headers) {
|
|
562
573
|
return axiosInstance({
|
|
563
|
-
method: "
|
|
574
|
+
method: "patch",
|
|
564
575
|
url: "/folders/" + encodeURIComponent(folder_id) + "/source-files",
|
|
565
|
-
data:
|
|
576
|
+
data: {
|
|
577
|
+
source_file_ids
|
|
578
|
+
},
|
|
566
579
|
headers
|
|
567
580
|
});
|
|
568
581
|
}
|
|
569
|
-
function
|
|
582
|
+
function listFolderUploadTasks({
|
|
570
583
|
folder_id,
|
|
571
584
|
offset = 0,
|
|
572
585
|
limit = 10
|
|
@@ -581,11 +594,11 @@ function getUploadTasksInFolder({
|
|
|
581
594
|
headers
|
|
582
595
|
});
|
|
583
596
|
}
|
|
584
|
-
function
|
|
597
|
+
function listFolderAssets({
|
|
585
598
|
folder_id,
|
|
586
599
|
offset = 0,
|
|
587
600
|
limit = 10,
|
|
588
|
-
|
|
601
|
+
filters,
|
|
589
602
|
recursive = false
|
|
590
603
|
}, headers) {
|
|
591
604
|
return axiosInstance({
|
|
@@ -594,12 +607,15 @@ function getFolderAssets({
|
|
|
594
607
|
params: {
|
|
595
608
|
offset,
|
|
596
609
|
limit,
|
|
597
|
-
|
|
610
|
+
filters,
|
|
598
611
|
recursive
|
|
599
612
|
},
|
|
600
613
|
headers
|
|
601
614
|
}).then((response) => {
|
|
602
615
|
response.headers["x-assets-count"] = JSON.parse(response.headers["x-assets-count"]);
|
|
616
|
+
if ("x-total-count" in response.headers) {
|
|
617
|
+
response.headers["x-total-count"] = JSON.parse(response.headers["x-total-count"]);
|
|
618
|
+
}
|
|
603
619
|
return response;
|
|
604
620
|
});
|
|
605
621
|
}
|
|
@@ -619,90 +635,10 @@ function moveAssets({
|
|
|
619
635
|
asset_ids
|
|
620
636
|
}, headers) {
|
|
621
637
|
return axiosInstance({
|
|
622
|
-
method: "
|
|
638
|
+
method: "patch",
|
|
623
639
|
url: "/folders/" + encodeURIComponent(folder_id) + "/assets",
|
|
624
|
-
data: asset_ids,
|
|
625
|
-
headers
|
|
626
|
-
});
|
|
627
|
-
}
|
|
628
|
-
function createMaterial({
|
|
629
|
-
folder_id,
|
|
630
|
-
dataJson = {},
|
|
631
|
-
isDoubleSided = false,
|
|
632
|
-
name,
|
|
633
|
-
shaderRef = "00000000-0000-0000-0000-000000000000"
|
|
634
|
-
}, headers) {
|
|
635
|
-
return axiosInstance({
|
|
636
|
-
method: "post",
|
|
637
|
-
url: "/folders/" + encodeURIComponent(folder_id) + "/assets/materials",
|
|
638
|
-
data: {
|
|
639
|
-
dataJson,
|
|
640
|
-
isDoubleSided,
|
|
641
|
-
name,
|
|
642
|
-
shaderRef
|
|
643
|
-
},
|
|
644
|
-
headers
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
function createCubemap({
|
|
648
|
-
folder_id,
|
|
649
|
-
faces = [
|
|
650
|
-
"00000000-0000-0000-0000-000000000000",
|
|
651
|
-
"00000000-0000-0000-0000-000000000000",
|
|
652
|
-
"00000000-0000-0000-0000-000000000000",
|
|
653
|
-
"00000000-0000-0000-0000-000000000000",
|
|
654
|
-
"00000000-0000-0000-0000-000000000000",
|
|
655
|
-
"00000000-0000-0000-0000-000000000000"
|
|
656
|
-
],
|
|
657
|
-
name
|
|
658
|
-
}, headers) {
|
|
659
|
-
return axiosInstance({
|
|
660
|
-
method: "post",
|
|
661
|
-
url: "/folders/" + encodeURIComponent(folder_id) + "/assets/cubemaps",
|
|
662
|
-
data: {
|
|
663
|
-
faces,
|
|
664
|
-
name
|
|
665
|
-
},
|
|
666
|
-
headers
|
|
667
|
-
});
|
|
668
|
-
}
|
|
669
|
-
function getSessionsInFolder({
|
|
670
|
-
folder_id
|
|
671
|
-
}, headers) {
|
|
672
|
-
return axiosInstance({
|
|
673
|
-
method: "get",
|
|
674
|
-
url: "/folders/" + encodeURIComponent(folder_id) + "/sessions",
|
|
675
|
-
headers
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
function createDuplicationRequest({
|
|
679
|
-
assets,
|
|
680
|
-
options
|
|
681
|
-
}, headers) {
|
|
682
|
-
return axiosInstance({
|
|
683
|
-
method: "post",
|
|
684
|
-
url: "/duplication-requests",
|
|
685
640
|
data: {
|
|
686
|
-
|
|
687
|
-
options
|
|
688
|
-
},
|
|
689
|
-
headers
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
function listDuplicationRequests({
|
|
693
|
-
offset = 0,
|
|
694
|
-
limit = 10,
|
|
695
|
-
states,
|
|
696
|
-
mine = false
|
|
697
|
-
}, headers) {
|
|
698
|
-
return axiosInstance({
|
|
699
|
-
method: "get",
|
|
700
|
-
url: "/duplication-requests",
|
|
701
|
-
params: {
|
|
702
|
-
offset,
|
|
703
|
-
limit,
|
|
704
|
-
states,
|
|
705
|
-
mine
|
|
641
|
+
asset_ids
|
|
706
642
|
},
|
|
707
643
|
headers
|
|
708
644
|
});
|
|
@@ -716,41 +652,6 @@ function getDuplicationRequest({
|
|
|
716
652
|
headers
|
|
717
653
|
});
|
|
718
654
|
}
|
|
719
|
-
function updateDuplicationRequest({
|
|
720
|
-
duplication_request_id,
|
|
721
|
-
assets,
|
|
722
|
-
folders_by_type,
|
|
723
|
-
dependencies_folders
|
|
724
|
-
}, headers) {
|
|
725
|
-
return axiosInstance({
|
|
726
|
-
method: "patch",
|
|
727
|
-
url: "/duplication-requests/" + encodeURIComponent(duplication_request_id),
|
|
728
|
-
data: {
|
|
729
|
-
assets,
|
|
730
|
-
folders_by_type,
|
|
731
|
-
dependencies_folders
|
|
732
|
-
},
|
|
733
|
-
headers
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
function discardDuplicationRequest({
|
|
737
|
-
duplication_request_id
|
|
738
|
-
}, headers) {
|
|
739
|
-
return axiosInstance({
|
|
740
|
-
method: "delete",
|
|
741
|
-
url: "/duplication-requests/" + encodeURIComponent(duplication_request_id),
|
|
742
|
-
headers
|
|
743
|
-
});
|
|
744
|
-
}
|
|
745
|
-
function confirmDuplicationRequest({
|
|
746
|
-
duplication_request_id
|
|
747
|
-
}, headers) {
|
|
748
|
-
return axiosInstance({
|
|
749
|
-
method: "post",
|
|
750
|
-
url: "/duplication-requests/" + encodeURIComponent(duplication_request_id) + "/confirm",
|
|
751
|
-
headers
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
655
|
function listSourceFiles({
|
|
755
656
|
offset = 0,
|
|
756
657
|
limit = 10,
|
|
@@ -766,7 +667,12 @@ function listSourceFiles({
|
|
|
766
667
|
},
|
|
767
668
|
headers
|
|
768
669
|
}).then((response) => {
|
|
769
|
-
response.headers["x-source-files-count"] = JSON.parse(
|
|
670
|
+
response.headers["x-source-files-count"] = JSON.parse(
|
|
671
|
+
response.headers["x-source-files-count"]
|
|
672
|
+
);
|
|
673
|
+
if ("x-total-count" in response.headers) {
|
|
674
|
+
response.headers["x-total-count"] = JSON.parse(response.headers["x-total-count"]);
|
|
675
|
+
}
|
|
770
676
|
return response;
|
|
771
677
|
});
|
|
772
678
|
}
|
|
@@ -791,29 +697,29 @@ function getSupportedSourceFileFormats(headers) {
|
|
|
791
697
|
headers
|
|
792
698
|
});
|
|
793
699
|
}
|
|
794
|
-
function
|
|
700
|
+
function getSourceFile({
|
|
795
701
|
source_file_id
|
|
796
702
|
}, headers) {
|
|
797
703
|
return axiosInstance({
|
|
798
704
|
method: "get",
|
|
799
|
-
url: "/source-files/" + encodeURIComponent(source_file_id)
|
|
705
|
+
url: "/source-files/" + encodeURIComponent(source_file_id),
|
|
800
706
|
headers
|
|
801
707
|
});
|
|
802
708
|
}
|
|
803
|
-
function
|
|
709
|
+
function updateSourceFile({
|
|
804
710
|
source_file_id,
|
|
805
711
|
name
|
|
806
712
|
}, headers) {
|
|
807
713
|
return axiosInstance({
|
|
808
714
|
method: "patch",
|
|
809
|
-
url: "/source-files/" + encodeURIComponent(source_file_id)
|
|
715
|
+
url: "/source-files/" + encodeURIComponent(source_file_id),
|
|
810
716
|
data: {
|
|
811
717
|
name
|
|
812
718
|
},
|
|
813
719
|
headers
|
|
814
720
|
});
|
|
815
721
|
}
|
|
816
|
-
function
|
|
722
|
+
function listSourceFileAssets({
|
|
817
723
|
source_file_id
|
|
818
724
|
}, headers) {
|
|
819
725
|
return axiosInstance({
|
|
@@ -822,16 +728,18 @@ function getSourceFileAssets({
|
|
|
822
728
|
headers
|
|
823
729
|
});
|
|
824
730
|
}
|
|
825
|
-
function
|
|
731
|
+
function listUploadTasks({
|
|
826
732
|
offset = 0,
|
|
827
|
-
limit = 10
|
|
733
|
+
limit = 10,
|
|
734
|
+
filters
|
|
828
735
|
}, headers) {
|
|
829
736
|
return axiosInstance({
|
|
830
737
|
method: "get",
|
|
831
738
|
url: "/upload-tasks",
|
|
832
739
|
params: {
|
|
833
740
|
offset,
|
|
834
|
-
limit
|
|
741
|
+
limit,
|
|
742
|
+
filters
|
|
835
743
|
},
|
|
836
744
|
headers
|
|
837
745
|
});
|
|
@@ -851,27 +759,24 @@ function getConversionTaskMetadata({
|
|
|
851
759
|
}, headers, responseType) {
|
|
852
760
|
return axiosInstance({
|
|
853
761
|
method: "get",
|
|
854
|
-
url: "/
|
|
762
|
+
url: "/conversion-tasks/" + encodeURIComponent(conversion_task_id) + "/metadata/" + encodeURIComponent(filename),
|
|
855
763
|
headers,
|
|
856
764
|
responseType: responseType || "arraybuffer"
|
|
857
765
|
});
|
|
858
766
|
}
|
|
859
|
-
function
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
asset_refs
|
|
767
|
+
function getConversionTaskLogs({
|
|
768
|
+
conversion_task_id,
|
|
769
|
+
from,
|
|
770
|
+
to,
|
|
771
|
+
limit
|
|
865
772
|
}, headers) {
|
|
866
773
|
return axiosInstance({
|
|
867
|
-
method: "
|
|
868
|
-
url: "/
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
inputs,
|
|
874
|
-
asset_refs
|
|
774
|
+
method: "get",
|
|
775
|
+
url: "/conversion-tasks/" + encodeURIComponent(conversion_task_id) + "/logs",
|
|
776
|
+
params: {
|
|
777
|
+
from,
|
|
778
|
+
to,
|
|
779
|
+
limit
|
|
875
780
|
},
|
|
876
781
|
headers
|
|
877
782
|
});
|
|
@@ -879,7 +784,7 @@ function schedulePipeline({
|
|
|
879
784
|
function listAssets({
|
|
880
785
|
offset = 0,
|
|
881
786
|
limit = 10,
|
|
882
|
-
|
|
787
|
+
filters
|
|
883
788
|
}, headers) {
|
|
884
789
|
return axiosInstance({
|
|
885
790
|
method: "get",
|
|
@@ -887,9 +792,14 @@ function listAssets({
|
|
|
887
792
|
params: {
|
|
888
793
|
offset,
|
|
889
794
|
limit,
|
|
890
|
-
|
|
795
|
+
filters
|
|
891
796
|
},
|
|
892
797
|
headers
|
|
798
|
+
}).then((response) => {
|
|
799
|
+
if ("x-total-count" in response.headers) {
|
|
800
|
+
response.headers["x-total-count"] = JSON.parse(response.headers["x-total-count"]);
|
|
801
|
+
}
|
|
802
|
+
return response;
|
|
893
803
|
});
|
|
894
804
|
}
|
|
895
805
|
function deleteAssets({
|
|
@@ -912,13 +822,17 @@ function deleteAsset({
|
|
|
912
822
|
headers
|
|
913
823
|
});
|
|
914
824
|
}
|
|
915
|
-
function
|
|
825
|
+
function renameAsset({
|
|
916
826
|
asset_container,
|
|
917
|
-
asset_id
|
|
827
|
+
asset_id,
|
|
828
|
+
name
|
|
918
829
|
}, headers) {
|
|
919
830
|
return axiosInstance({
|
|
920
|
-
method: "
|
|
921
|
-
url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id)
|
|
831
|
+
method: "patch",
|
|
832
|
+
url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id),
|
|
833
|
+
data: {
|
|
834
|
+
name
|
|
835
|
+
},
|
|
922
836
|
headers
|
|
923
837
|
});
|
|
924
838
|
}
|
|
@@ -932,17 +846,7 @@ function getAssetDetails({
|
|
|
932
846
|
headers
|
|
933
847
|
});
|
|
934
848
|
}
|
|
935
|
-
function
|
|
936
|
-
asset_container,
|
|
937
|
-
asset_id
|
|
938
|
-
}, headers) {
|
|
939
|
-
return axiosInstance({
|
|
940
|
-
method: "get",
|
|
941
|
-
url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/folder",
|
|
942
|
-
headers
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
function getAssetDependencies({
|
|
849
|
+
function listAssetDependencies({
|
|
946
850
|
asset_container,
|
|
947
851
|
asset_id,
|
|
948
852
|
offset = 0,
|
|
@@ -964,7 +868,7 @@ function getAssetDependencies({
|
|
|
964
868
|
headers
|
|
965
869
|
});
|
|
966
870
|
}
|
|
967
|
-
function
|
|
871
|
+
function listAssetReferences({
|
|
968
872
|
asset_container,
|
|
969
873
|
asset_id,
|
|
970
874
|
offset = 0,
|
|
@@ -1004,20 +908,6 @@ function updateAssetDescription({
|
|
|
1004
908
|
headers
|
|
1005
909
|
});
|
|
1006
910
|
}
|
|
1007
|
-
function renameAsset({
|
|
1008
|
-
asset_id,
|
|
1009
|
-
asset_container,
|
|
1010
|
-
name
|
|
1011
|
-
}, headers) {
|
|
1012
|
-
return axiosInstance({
|
|
1013
|
-
method: "patch",
|
|
1014
|
-
url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/description",
|
|
1015
|
-
data: {
|
|
1016
|
-
name
|
|
1017
|
-
},
|
|
1018
|
-
headers
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
911
|
function getAssetPayload({
|
|
1022
912
|
asset_container_with_payload,
|
|
1023
913
|
asset_id,
|
|
@@ -1065,16 +955,6 @@ function getAssetHistory({
|
|
|
1065
955
|
headers
|
|
1066
956
|
});
|
|
1067
957
|
}
|
|
1068
|
-
function getAssetMeta({
|
|
1069
|
-
asset_container,
|
|
1070
|
-
asset_id
|
|
1071
|
-
}, headers) {
|
|
1072
|
-
return axiosInstance({
|
|
1073
|
-
method: "get",
|
|
1074
|
-
url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/meta",
|
|
1075
|
-
headers
|
|
1076
|
-
});
|
|
1077
|
-
}
|
|
1078
958
|
function getAssetCode({
|
|
1079
959
|
asset_container_with_code,
|
|
1080
960
|
asset_id
|
|
@@ -1136,7 +1016,7 @@ function exportAsset({
|
|
|
1136
1016
|
format,
|
|
1137
1017
|
scale = 1,
|
|
1138
1018
|
sub_mesh_index
|
|
1139
|
-
}, headers) {
|
|
1019
|
+
}, headers, responseType) {
|
|
1140
1020
|
return axiosInstance({
|
|
1141
1021
|
method: "get",
|
|
1142
1022
|
url: "/assets/" + encodeURIComponent(asset_container_exportable) + "/" + encodeURIComponent(asset_id) + "/exports/" + encodeURIComponent(format),
|
|
@@ -1144,16 +1024,8 @@ function exportAsset({
|
|
|
1144
1024
|
scale,
|
|
1145
1025
|
sub_mesh_index
|
|
1146
1026
|
},
|
|
1147
|
-
headers
|
|
1148
|
-
|
|
1149
|
-
}
|
|
1150
|
-
function getSceneSessions({
|
|
1151
|
-
scene_id
|
|
1152
|
-
}, headers) {
|
|
1153
|
-
return axiosInstance({
|
|
1154
|
-
method: "get",
|
|
1155
|
-
url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/sessions",
|
|
1156
|
-
headers
|
|
1027
|
+
headers,
|
|
1028
|
+
responseType: responseType || "arraybuffer"
|
|
1157
1029
|
});
|
|
1158
1030
|
}
|
|
1159
1031
|
function getSceneAABB({
|
|
@@ -1428,7 +1300,7 @@ function updateSceneSettings({
|
|
|
1428
1300
|
headers
|
|
1429
1301
|
});
|
|
1430
1302
|
}
|
|
1431
|
-
function
|
|
1303
|
+
function listRunningSessions({
|
|
1432
1304
|
filters
|
|
1433
1305
|
}, headers) {
|
|
1434
1306
|
return axiosInstance({
|
|
@@ -1604,46 +1476,37 @@ function installInterceptors() {
|
|
|
1604
1476
|
);
|
|
1605
1477
|
}
|
|
1606
1478
|
function shouldRetryRequest(error) {
|
|
1607
|
-
|
|
1608
|
-
switch (status) {
|
|
1609
|
-
case 403:
|
|
1610
|
-
case 404:
|
|
1611
|
-
return true;
|
|
1612
|
-
default:
|
|
1613
|
-
return isNetworkError(error) || isIdempotentRequestError(error);
|
|
1614
|
-
}
|
|
1479
|
+
return isNetworkError(error) || isIdempotentRequestError(error);
|
|
1615
1480
|
}
|
|
1616
1481
|
installInterceptors();
|
|
1617
1482
|
export {
|
|
1618
1483
|
ApiError,
|
|
1619
|
-
AssetSourceFileNotFound,
|
|
1620
1484
|
ConversionTaskNotFound,
|
|
1621
|
-
EnvironmentMismatch,
|
|
1622
1485
|
InsufficientPermissions,
|
|
1623
1486
|
InsufficientSecurityScope,
|
|
1624
1487
|
InvalidApiKey,
|
|
1625
1488
|
InvalidAuthorization,
|
|
1626
1489
|
InvalidGuestToken,
|
|
1627
1490
|
InvalidMaterial,
|
|
1491
|
+
InvalidParameter,
|
|
1628
1492
|
InvalidRequest,
|
|
1629
1493
|
InvalidTokenTtl,
|
|
1494
|
+
LogsUnavailable,
|
|
1495
|
+
MemberAccessesDiffer,
|
|
1630
1496
|
MissingAuthorizationHeader,
|
|
1631
1497
|
NoFileUploaded,
|
|
1632
1498
|
ServiceErrorResponse,
|
|
1499
|
+
TooManyRequests,
|
|
1633
1500
|
Unauthorized,
|
|
1634
1501
|
UnexpectedServiceError,
|
|
1635
1502
|
UploadAborted,
|
|
1636
1503
|
UploadTaskNotFound,
|
|
1637
1504
|
UploadedPayloadTooLarge,
|
|
1638
1505
|
axiosInstance,
|
|
1639
|
-
confirmDuplicationRequest,
|
|
1640
1506
|
createAsset,
|
|
1641
|
-
createCubemap,
|
|
1642
|
-
createDuplicationRequest,
|
|
1643
1507
|
createEntity,
|
|
1644
1508
|
createFolder,
|
|
1645
1509
|
createGroup,
|
|
1646
|
-
createMaterial,
|
|
1647
1510
|
createSession,
|
|
1648
1511
|
createSubfolder,
|
|
1649
1512
|
deleteAsset,
|
|
@@ -1653,59 +1516,52 @@ export {
|
|
|
1653
1516
|
deleteGroup,
|
|
1654
1517
|
deleteSourceFiles,
|
|
1655
1518
|
deleteUser,
|
|
1656
|
-
discardDuplicationRequest,
|
|
1657
1519
|
errorOf,
|
|
1658
1520
|
exportAsset,
|
|
1659
1521
|
generateGuestToken,
|
|
1660
1522
|
generateUserToken,
|
|
1661
1523
|
getAssetCode,
|
|
1662
|
-
getAssetDependencies,
|
|
1663
1524
|
getAssetDescription,
|
|
1664
1525
|
getAssetDetails,
|
|
1665
|
-
getAssetFolder,
|
|
1666
1526
|
getAssetGraph,
|
|
1667
1527
|
getAssetHistory,
|
|
1668
|
-
getAssetMeta,
|
|
1669
1528
|
getAssetPayload,
|
|
1670
|
-
getAssetReferences,
|
|
1671
|
-
getAssetSourceFile,
|
|
1672
1529
|
getAssetThumbnail,
|
|
1673
1530
|
getClient,
|
|
1531
|
+
getConversionTaskLogs,
|
|
1674
1532
|
getConversionTaskMetadata,
|
|
1675
1533
|
getCurrentUser,
|
|
1676
1534
|
getDuplicationRequest,
|
|
1677
1535
|
getEntity,
|
|
1678
|
-
|
|
1679
|
-
getFolderInfo,
|
|
1536
|
+
getFolder,
|
|
1680
1537
|
getGroup,
|
|
1681
|
-
getRunningSessions,
|
|
1682
1538
|
getSceneAABB,
|
|
1683
|
-
getSceneSessions,
|
|
1684
1539
|
getSceneSettings,
|
|
1685
1540
|
getSession,
|
|
1686
|
-
|
|
1687
|
-
getSourceFileAssets,
|
|
1688
|
-
getSourceFileDetails,
|
|
1689
|
-
getSourceFilesInFolder,
|
|
1541
|
+
getSourceFile,
|
|
1690
1542
|
getSupportedSourceFileFormats,
|
|
1691
1543
|
getUploadTask,
|
|
1692
|
-
getUploadTasks,
|
|
1693
|
-
getUploadTasksInFolder,
|
|
1694
1544
|
getUser,
|
|
1695
|
-
getUserGroups,
|
|
1696
|
-
getUserUploadTasks,
|
|
1697
1545
|
grantMemberAccessToFolder,
|
|
1698
1546
|
grantMemberAccessToGroup,
|
|
1699
1547
|
joinSession,
|
|
1700
1548
|
joinSessionAsGuest,
|
|
1701
1549
|
kickClientFromSession,
|
|
1702
1550
|
killSession,
|
|
1551
|
+
listAssetDependencies,
|
|
1552
|
+
listAssetReferences,
|
|
1703
1553
|
listAssets,
|
|
1704
|
-
listDuplicationRequests,
|
|
1705
1554
|
listFolderAccesses,
|
|
1706
|
-
|
|
1555
|
+
listFolderAssets,
|
|
1556
|
+
listFolderSourceFiles,
|
|
1557
|
+
listFolderSubfolders,
|
|
1558
|
+
listFolderUploadTasks,
|
|
1707
1559
|
listFolders,
|
|
1560
|
+
listRunningSessions,
|
|
1561
|
+
listSourceFileAssets,
|
|
1708
1562
|
listSourceFiles,
|
|
1563
|
+
listUploadTasks,
|
|
1564
|
+
listUserGroups,
|
|
1709
1565
|
listUsers,
|
|
1710
1566
|
moveAssets,
|
|
1711
1567
|
moveFolders,
|
|
@@ -1715,19 +1571,17 @@ export {
|
|
|
1715
1571
|
renameAsset,
|
|
1716
1572
|
revokeMemberAccessToFolder,
|
|
1717
1573
|
revokeMemberAccessToGroup,
|
|
1718
|
-
schedulePipeline,
|
|
1719
1574
|
setApiKey,
|
|
1720
1575
|
setAssetThumbnail,
|
|
1721
1576
|
setBaseURL,
|
|
1722
1577
|
setUserToken,
|
|
1723
1578
|
updateAssetDescription,
|
|
1724
1579
|
updateAssetGraph,
|
|
1725
|
-
updateDuplicationRequest,
|
|
1726
1580
|
updateEntity,
|
|
1727
1581
|
updateFolder,
|
|
1728
|
-
|
|
1582
|
+
updateGroup,
|
|
1729
1583
|
updateSceneSettings,
|
|
1730
|
-
|
|
1584
|
+
updateSourceFile,
|
|
1731
1585
|
updateUser,
|
|
1732
1586
|
uploadSourceFiles
|
|
1733
1587
|
};
|