@3dverse/api 0.10.1 → 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 +4096 -921
- package/dist/index.js +211 -370
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +192 -339
- 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
640
|
data: {
|
|
639
|
-
|
|
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
|
-
data: {
|
|
686
|
-
assets,
|
|
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,44 +759,32 @@ 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
|
|
865
|
-
}, headers) {
|
|
866
|
-
return axiosInstance({
|
|
867
|
-
method: "post",
|
|
868
|
-
url: "/pipelines",
|
|
869
|
-
data: {
|
|
870
|
-
data_pipeline_id,
|
|
871
|
-
pipeline_name,
|
|
872
|
-
folder_id,
|
|
873
|
-
inputs,
|
|
874
|
-
asset_refs
|
|
875
|
-
},
|
|
876
|
-
headers
|
|
877
|
-
});
|
|
878
|
-
}
|
|
879
|
-
function getPipeline({
|
|
880
|
-
pipeline_id
|
|
767
|
+
function getConversionTaskLogs({
|
|
768
|
+
conversion_task_id,
|
|
769
|
+
from,
|
|
770
|
+
to,
|
|
771
|
+
limit
|
|
881
772
|
}, headers) {
|
|
882
773
|
return axiosInstance({
|
|
883
774
|
method: "get",
|
|
884
|
-
url: "/
|
|
775
|
+
url: "/conversion-tasks/" + encodeURIComponent(conversion_task_id) + "/logs",
|
|
776
|
+
params: {
|
|
777
|
+
from,
|
|
778
|
+
to,
|
|
779
|
+
limit
|
|
780
|
+
},
|
|
885
781
|
headers
|
|
886
782
|
});
|
|
887
783
|
}
|
|
888
784
|
function listAssets({
|
|
889
785
|
offset = 0,
|
|
890
786
|
limit = 10,
|
|
891
|
-
|
|
787
|
+
filters
|
|
892
788
|
}, headers) {
|
|
893
789
|
return axiosInstance({
|
|
894
790
|
method: "get",
|
|
@@ -896,9 +792,14 @@ function listAssets({
|
|
|
896
792
|
params: {
|
|
897
793
|
offset,
|
|
898
794
|
limit,
|
|
899
|
-
|
|
795
|
+
filters
|
|
900
796
|
},
|
|
901
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;
|
|
902
803
|
});
|
|
903
804
|
}
|
|
904
805
|
function deleteAssets({
|
|
@@ -921,13 +822,17 @@ function deleteAsset({
|
|
|
921
822
|
headers
|
|
922
823
|
});
|
|
923
824
|
}
|
|
924
|
-
function
|
|
825
|
+
function renameAsset({
|
|
925
826
|
asset_container,
|
|
926
|
-
asset_id
|
|
827
|
+
asset_id,
|
|
828
|
+
name
|
|
927
829
|
}, headers) {
|
|
928
830
|
return axiosInstance({
|
|
929
|
-
method: "
|
|
930
|
-
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
|
+
},
|
|
931
836
|
headers
|
|
932
837
|
});
|
|
933
838
|
}
|
|
@@ -941,17 +846,7 @@ function getAssetDetails({
|
|
|
941
846
|
headers
|
|
942
847
|
});
|
|
943
848
|
}
|
|
944
|
-
function
|
|
945
|
-
asset_container,
|
|
946
|
-
asset_id
|
|
947
|
-
}, headers) {
|
|
948
|
-
return axiosInstance({
|
|
949
|
-
method: "get",
|
|
950
|
-
url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/folder",
|
|
951
|
-
headers
|
|
952
|
-
});
|
|
953
|
-
}
|
|
954
|
-
function getAssetDependencies({
|
|
849
|
+
function listAssetDependencies({
|
|
955
850
|
asset_container,
|
|
956
851
|
asset_id,
|
|
957
852
|
offset = 0,
|
|
@@ -973,7 +868,7 @@ function getAssetDependencies({
|
|
|
973
868
|
headers
|
|
974
869
|
});
|
|
975
870
|
}
|
|
976
|
-
function
|
|
871
|
+
function listAssetReferences({
|
|
977
872
|
asset_container,
|
|
978
873
|
asset_id,
|
|
979
874
|
offset = 0,
|
|
@@ -1013,20 +908,6 @@ function updateAssetDescription({
|
|
|
1013
908
|
headers
|
|
1014
909
|
});
|
|
1015
910
|
}
|
|
1016
|
-
function renameAsset({
|
|
1017
|
-
asset_id,
|
|
1018
|
-
asset_container,
|
|
1019
|
-
name
|
|
1020
|
-
}, headers) {
|
|
1021
|
-
return axiosInstance({
|
|
1022
|
-
method: "patch",
|
|
1023
|
-
url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/description",
|
|
1024
|
-
data: {
|
|
1025
|
-
name
|
|
1026
|
-
},
|
|
1027
|
-
headers
|
|
1028
|
-
});
|
|
1029
|
-
}
|
|
1030
911
|
function getAssetPayload({
|
|
1031
912
|
asset_container_with_payload,
|
|
1032
913
|
asset_id,
|
|
@@ -1074,16 +955,6 @@ function getAssetHistory({
|
|
|
1074
955
|
headers
|
|
1075
956
|
});
|
|
1076
957
|
}
|
|
1077
|
-
function getAssetMeta({
|
|
1078
|
-
asset_container,
|
|
1079
|
-
asset_id
|
|
1080
|
-
}, headers) {
|
|
1081
|
-
return axiosInstance({
|
|
1082
|
-
method: "get",
|
|
1083
|
-
url: "/assets/" + encodeURIComponent(asset_container) + "/" + encodeURIComponent(asset_id) + "/meta",
|
|
1084
|
-
headers
|
|
1085
|
-
});
|
|
1086
|
-
}
|
|
1087
958
|
function getAssetCode({
|
|
1088
959
|
asset_container_with_code,
|
|
1089
960
|
asset_id
|
|
@@ -1145,7 +1016,7 @@ function exportAsset({
|
|
|
1145
1016
|
format,
|
|
1146
1017
|
scale = 1,
|
|
1147
1018
|
sub_mesh_index
|
|
1148
|
-
}, headers) {
|
|
1019
|
+
}, headers, responseType) {
|
|
1149
1020
|
return axiosInstance({
|
|
1150
1021
|
method: "get",
|
|
1151
1022
|
url: "/assets/" + encodeURIComponent(asset_container_exportable) + "/" + encodeURIComponent(asset_id) + "/exports/" + encodeURIComponent(format),
|
|
@@ -1153,16 +1024,8 @@ function exportAsset({
|
|
|
1153
1024
|
scale,
|
|
1154
1025
|
sub_mesh_index
|
|
1155
1026
|
},
|
|
1156
|
-
headers
|
|
1157
|
-
|
|
1158
|
-
}
|
|
1159
|
-
function getSceneSessions({
|
|
1160
|
-
scene_id
|
|
1161
|
-
}, headers) {
|
|
1162
|
-
return axiosInstance({
|
|
1163
|
-
method: "get",
|
|
1164
|
-
url: "/assets/scenes/" + encodeURIComponent(scene_id) + "/sessions",
|
|
1165
|
-
headers
|
|
1027
|
+
headers,
|
|
1028
|
+
responseType: responseType || "arraybuffer"
|
|
1166
1029
|
});
|
|
1167
1030
|
}
|
|
1168
1031
|
function getSceneAABB({
|
|
@@ -1437,7 +1300,7 @@ function updateSceneSettings({
|
|
|
1437
1300
|
headers
|
|
1438
1301
|
});
|
|
1439
1302
|
}
|
|
1440
|
-
function
|
|
1303
|
+
function listRunningSessions({
|
|
1441
1304
|
filters
|
|
1442
1305
|
}, headers) {
|
|
1443
1306
|
return axiosInstance({
|
|
@@ -1453,7 +1316,8 @@ function createSession({
|
|
|
1453
1316
|
scene_id,
|
|
1454
1317
|
renderer_version,
|
|
1455
1318
|
is_transient = false,
|
|
1456
|
-
options
|
|
1319
|
+
options,
|
|
1320
|
+
metadata
|
|
1457
1321
|
}, headers) {
|
|
1458
1322
|
return axiosInstance({
|
|
1459
1323
|
method: "post",
|
|
@@ -1462,7 +1326,8 @@ function createSession({
|
|
|
1462
1326
|
scene_id,
|
|
1463
1327
|
renderer_version,
|
|
1464
1328
|
is_transient,
|
|
1465
|
-
options
|
|
1329
|
+
options,
|
|
1330
|
+
metadata
|
|
1466
1331
|
},
|
|
1467
1332
|
headers
|
|
1468
1333
|
});
|
|
@@ -1487,13 +1352,15 @@ function killSession({
|
|
|
1487
1352
|
}
|
|
1488
1353
|
function joinSession({
|
|
1489
1354
|
session_id,
|
|
1490
|
-
is_headless = false
|
|
1355
|
+
is_headless = false,
|
|
1356
|
+
metadata
|
|
1491
1357
|
}, headers) {
|
|
1492
1358
|
return axiosInstance({
|
|
1493
1359
|
method: "post",
|
|
1494
1360
|
url: "/sessions/" + encodeURIComponent(session_id) + "/clients",
|
|
1495
1361
|
data: optionalBody({
|
|
1496
|
-
is_headless
|
|
1362
|
+
is_headless,
|
|
1363
|
+
metadata
|
|
1497
1364
|
}),
|
|
1498
1365
|
headers
|
|
1499
1366
|
});
|
|
@@ -1518,10 +1385,15 @@ function kickClientFromSession({
|
|
|
1518
1385
|
headers
|
|
1519
1386
|
});
|
|
1520
1387
|
}
|
|
1521
|
-
function joinSessionAsGuest(
|
|
1388
|
+
function joinSessionAsGuest({
|
|
1389
|
+
metadata
|
|
1390
|
+
}, headers) {
|
|
1522
1391
|
return axiosInstance({
|
|
1523
1392
|
method: "post",
|
|
1524
1393
|
url: "/sessions/guests",
|
|
1394
|
+
data: optionalBody({
|
|
1395
|
+
metadata
|
|
1396
|
+
}),
|
|
1525
1397
|
headers
|
|
1526
1398
|
});
|
|
1527
1399
|
}
|
|
@@ -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,60 +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
|
-
getPipeline,
|
|
1682
|
-
getRunningSessions,
|
|
1683
1538
|
getSceneAABB,
|
|
1684
|
-
getSceneSessions,
|
|
1685
1539
|
getSceneSettings,
|
|
1686
1540
|
getSession,
|
|
1687
|
-
|
|
1688
|
-
getSourceFileAssets,
|
|
1689
|
-
getSourceFileDetails,
|
|
1690
|
-
getSourceFilesInFolder,
|
|
1541
|
+
getSourceFile,
|
|
1691
1542
|
getSupportedSourceFileFormats,
|
|
1692
1543
|
getUploadTask,
|
|
1693
|
-
getUploadTasks,
|
|
1694
|
-
getUploadTasksInFolder,
|
|
1695
1544
|
getUser,
|
|
1696
|
-
getUserGroups,
|
|
1697
|
-
getUserUploadTasks,
|
|
1698
1545
|
grantMemberAccessToFolder,
|
|
1699
1546
|
grantMemberAccessToGroup,
|
|
1700
1547
|
joinSession,
|
|
1701
1548
|
joinSessionAsGuest,
|
|
1702
1549
|
kickClientFromSession,
|
|
1703
1550
|
killSession,
|
|
1551
|
+
listAssetDependencies,
|
|
1552
|
+
listAssetReferences,
|
|
1704
1553
|
listAssets,
|
|
1705
|
-
listDuplicationRequests,
|
|
1706
1554
|
listFolderAccesses,
|
|
1707
|
-
|
|
1555
|
+
listFolderAssets,
|
|
1556
|
+
listFolderSourceFiles,
|
|
1557
|
+
listFolderSubfolders,
|
|
1558
|
+
listFolderUploadTasks,
|
|
1708
1559
|
listFolders,
|
|
1560
|
+
listRunningSessions,
|
|
1561
|
+
listSourceFileAssets,
|
|
1709
1562
|
listSourceFiles,
|
|
1563
|
+
listUploadTasks,
|
|
1564
|
+
listUserGroups,
|
|
1710
1565
|
listUsers,
|
|
1711
1566
|
moveAssets,
|
|
1712
1567
|
moveFolders,
|
|
@@ -1716,19 +1571,17 @@ export {
|
|
|
1716
1571
|
renameAsset,
|
|
1717
1572
|
revokeMemberAccessToFolder,
|
|
1718
1573
|
revokeMemberAccessToGroup,
|
|
1719
|
-
schedulePipeline,
|
|
1720
1574
|
setApiKey,
|
|
1721
1575
|
setAssetThumbnail,
|
|
1722
1576
|
setBaseURL,
|
|
1723
1577
|
setUserToken,
|
|
1724
1578
|
updateAssetDescription,
|
|
1725
1579
|
updateAssetGraph,
|
|
1726
|
-
updateDuplicationRequest,
|
|
1727
1580
|
updateEntity,
|
|
1728
1581
|
updateFolder,
|
|
1729
|
-
|
|
1582
|
+
updateGroup,
|
|
1730
1583
|
updateSceneSettings,
|
|
1731
|
-
|
|
1584
|
+
updateSourceFile,
|
|
1732
1585
|
updateUser,
|
|
1733
1586
|
uploadSourceFiles
|
|
1734
1587
|
};
|