@shapediver/sdk.geometry-api-sdk-v2 1.9.1 → 1.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/dist/ShapeDiverSdk.d.ts +3 -0
- package/dist/ShapeDiverSdk.d.ts.map +1 -1
- package/dist/ShapeDiverSdk.js +5 -0
- package/dist/ShapeDiverSdk.js.map +1 -1
- package/dist/resources/ShapeDiverAnalyticsApi.d.ts +6 -1
- package/dist/resources/ShapeDiverAnalyticsApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverAnalyticsApi.js +36 -1
- package/dist/resources/ShapeDiverAnalyticsApi.js.map +1 -1
- package/dist/resources/ShapeDiverArSceneApi.d.ts +3 -3
- package/dist/resources/ShapeDiverArSceneApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverArSceneApi.js +6 -6
- package/dist/resources/ShapeDiverArSceneApi.js.map +1 -1
- package/dist/resources/ShapeDiverAssetApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverAssetApi.js +12 -10
- package/dist/resources/ShapeDiverAssetApi.js.map +1 -1
- package/dist/resources/ShapeDiverExportApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverExportApi.js +4 -4
- package/dist/resources/ShapeDiverExportApi.js.map +1 -1
- package/dist/resources/ShapeDiverFileApi.d.ts +1 -1
- package/dist/resources/ShapeDiverFileApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverFileApi.js +7 -4
- package/dist/resources/ShapeDiverFileApi.js.map +1 -1
- package/dist/resources/ShapeDiverGltfApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverGltfApi.js +1 -1
- package/dist/resources/ShapeDiverGltfApi.js.map +1 -1
- package/dist/resources/ShapeDiverModelApi.d.ts +1 -1
- package/dist/resources/ShapeDiverModelApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverModelApi.js +18 -19
- package/dist/resources/ShapeDiverModelApi.js.map +1 -1
- package/dist/resources/ShapeDiverModelStateApi.d.ts +14 -0
- package/dist/resources/ShapeDiverModelStateApi.d.ts.map +1 -0
- package/dist/resources/ShapeDiverModelStateApi.js +104 -0
- package/dist/resources/ShapeDiverModelStateApi.js.map +1 -0
- package/dist/resources/ShapeDiverOutputApi.d.ts +1 -1
- package/dist/resources/ShapeDiverOutputApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverOutputApi.js +8 -5
- package/dist/resources/ShapeDiverOutputApi.js.map +1 -1
- package/dist/resources/ShapeDiverSdtfApi.d.ts +1 -1
- package/dist/resources/ShapeDiverSdtfApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverSdtfApi.js +7 -4
- package/dist/resources/ShapeDiverSdtfApi.js.map +1 -1
- package/dist/resources/ShapeDiverSessionApi.d.ts +2 -2
- package/dist/resources/ShapeDiverSessionApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverSessionApi.js +15 -5
- package/dist/resources/ShapeDiverSessionApi.js.map +1 -1
- package/dist/resources/ShapeDiverSystemApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverSystemApi.js +2 -2
- package/dist/resources/ShapeDiverSystemApi.js.map +1 -1
- package/dist/resources/ShapeDiverTextureApi.d.ts +1 -1
- package/dist/resources/ShapeDiverTextureApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverTextureApi.js +5 -2
- package/dist/resources/ShapeDiverTextureApi.js.map +1 -1
- package/dist/resources/ShapeDiverUtilsApi.js +3 -3
- package/dist/resources/ShapeDiverUtilsApi.js.map +1 -1
- package/package.json +6 -6
- package/src/ShapeDiverSdk.ts +7 -0
- package/src/resources/ShapeDiverAnalyticsApi.ts +74 -0
- package/src/resources/ShapeDiverArSceneApi.ts +11 -9
- package/src/resources/ShapeDiverAssetApi.ts +19 -7
- package/src/resources/ShapeDiverExportApi.ts +4 -1
- package/src/resources/ShapeDiverFileApi.ts +8 -0
- package/src/resources/ShapeDiverGltfApi.ts +2 -1
- package/src/resources/ShapeDiverModelApi.ts +30 -13
- package/src/resources/ShapeDiverModelStateApi.ts +163 -0
- package/src/resources/ShapeDiverOutputApi.ts +10 -1
- package/src/resources/ShapeDiverSdtfApi.ts +8 -0
- package/src/resources/ShapeDiverSessionApi.ts +29 -0
- package/src/resources/ShapeDiverSystemApi.ts +2 -0
- package/src/resources/ShapeDiverTextureApi.ts +9 -1
- package/src/resources/ShapeDiverUtilsApi.ts +3 -3
|
@@ -30,6 +30,7 @@ export class ShapeDiverOutputApi extends BaseResourceApi {
|
|
|
30
30
|
(
|
|
31
31
|
await this.api.put<ShapeDiverResponseDto>(
|
|
32
32
|
this.buildSessionUri(sessionId) + "/output",
|
|
33
|
+
undefined,
|
|
33
34
|
body,
|
|
34
35
|
)
|
|
35
36
|
)[1],
|
|
@@ -51,6 +52,7 @@ export class ShapeDiverOutputApi extends BaseResourceApi {
|
|
|
51
52
|
(
|
|
52
53
|
await this.api.put<ShapeDiverResponseDto>(
|
|
53
54
|
this.buildSessionUri(sessionId) + "/output/cache",
|
|
55
|
+
undefined,
|
|
54
56
|
body,
|
|
55
57
|
)
|
|
56
58
|
)[1],
|
|
@@ -72,6 +74,7 @@ export class ShapeDiverOutputApi extends BaseResourceApi {
|
|
|
72
74
|
(
|
|
73
75
|
await this.api.patch<ShapeDiverResponseDto>(
|
|
74
76
|
this.buildModelUri(modelId) + "/output",
|
|
77
|
+
undefined,
|
|
75
78
|
body,
|
|
76
79
|
)
|
|
77
80
|
)[1],
|
|
@@ -87,12 +90,18 @@ export class ShapeDiverOutputApi extends BaseResourceApi {
|
|
|
87
90
|
async listVersions(
|
|
88
91
|
sessionId: string,
|
|
89
92
|
outputId: string,
|
|
93
|
+
offset?: string,
|
|
90
94
|
): Promise<ShapeDiverResponseDto> {
|
|
95
|
+
// Build queries
|
|
96
|
+
const queries: string[] = [];
|
|
97
|
+
if (offset !== undefined) queries.push("offset=" + offset);
|
|
98
|
+
|
|
91
99
|
return await sendRequest(
|
|
92
100
|
async () =>
|
|
93
101
|
(
|
|
94
102
|
await this.api.get<ShapeDiverResponseDto>(
|
|
95
|
-
this.buildSessionUri(sessionId)
|
|
103
|
+
`${this.buildSessionUri(sessionId)}/output/${outputId}/list`,
|
|
104
|
+
queries,
|
|
96
105
|
)
|
|
97
106
|
)[1],
|
|
98
107
|
);
|
|
@@ -23,12 +23,18 @@ export class ShapeDiverSdtfApi extends BaseResourceApi {
|
|
|
23
23
|
async list(
|
|
24
24
|
sessionId: string,
|
|
25
25
|
namespace: string,
|
|
26
|
+
offset?: string,
|
|
26
27
|
): Promise<ShapeDiverResponseDto> {
|
|
28
|
+
// Build queries
|
|
29
|
+
const queries: string[] = [];
|
|
30
|
+
if (offset !== undefined) queries.push("offset=" + offset);
|
|
31
|
+
|
|
27
32
|
return await sendRequest(
|
|
28
33
|
async () =>
|
|
29
34
|
(
|
|
30
35
|
await this.api.get<ShapeDiverResponseDto>(
|
|
31
36
|
`${this.buildSessionUri(sessionId)}/sdtf/${namespace}/list`,
|
|
37
|
+
queries,
|
|
32
38
|
)
|
|
33
39
|
)[1],
|
|
34
40
|
);
|
|
@@ -46,6 +52,7 @@ export class ShapeDiverSdtfApi extends BaseResourceApi {
|
|
|
46
52
|
(
|
|
47
53
|
await this.api.get<ArrayBuffer>(
|
|
48
54
|
`${this.buildSessionUri(sessionId)}/sdtf/${sdtfId}`,
|
|
55
|
+
undefined,
|
|
49
56
|
{ responseType: ShapeDiverSdkApiResponseType.DATA },
|
|
50
57
|
)
|
|
51
58
|
)[1],
|
|
@@ -87,6 +94,7 @@ export class ShapeDiverSdtfApi extends BaseResourceApi {
|
|
|
87
94
|
(
|
|
88
95
|
await this.api.post<ShapeDiverResponseDto>(
|
|
89
96
|
this.buildSessionUri(sessionId) + "/sdtf/upload",
|
|
97
|
+
undefined,
|
|
90
98
|
body,
|
|
91
99
|
)
|
|
92
100
|
)[1],
|
|
@@ -31,6 +31,7 @@ export class ShapeDiverSessionApi extends BaseResourceApi {
|
|
|
31
31
|
(
|
|
32
32
|
await this.api.post<ShapeDiverResponseDto>(
|
|
33
33
|
this.buildModelUri(modelId) + "/ticket",
|
|
34
|
+
undefined,
|
|
34
35
|
body,
|
|
35
36
|
)
|
|
36
37
|
)[1],
|
|
@@ -42,16 +43,30 @@ export class ShapeDiverSessionApi extends BaseResourceApi {
|
|
|
42
43
|
*
|
|
43
44
|
* @param ticket
|
|
44
45
|
* @param request - Optional customization or export request.
|
|
46
|
+
* @param modelStateId - ID of the Model-State to apply.
|
|
47
|
+
* @param strictValidation - When `false`, any Model-State parameter that cannot be applied to the
|
|
48
|
+
* model is ignored. However, when set to `true`, any validation error will result in an error
|
|
49
|
+
* response.
|
|
45
50
|
*/
|
|
46
51
|
async init(
|
|
47
52
|
ticket: string,
|
|
48
53
|
request?: ShapeDiverRequestCustomization | ShapeDiverRequestExport,
|
|
54
|
+
modelStateId?: string,
|
|
55
|
+
strictValidation?: boolean,
|
|
49
56
|
): Promise<ShapeDiverResponseDto> {
|
|
57
|
+
// Build queries
|
|
58
|
+
const queries: string[] = [];
|
|
59
|
+
if (modelStateId !== undefined)
|
|
60
|
+
queries.push("modelStateId=" + modelStateId);
|
|
61
|
+
if (strictValidation !== undefined)
|
|
62
|
+
queries.push("strictValidation=" + strictValidation);
|
|
63
|
+
|
|
50
64
|
return await sendRequest(
|
|
51
65
|
async () =>
|
|
52
66
|
(
|
|
53
67
|
await this.api.post<ShapeDiverResponseDto>(
|
|
54
68
|
this.buildTicketUri(ticket),
|
|
69
|
+
queries,
|
|
55
70
|
request,
|
|
56
71
|
)
|
|
57
72
|
)[1],
|
|
@@ -63,16 +78,30 @@ export class ShapeDiverSessionApi extends BaseResourceApi {
|
|
|
63
78
|
*
|
|
64
79
|
* @param ticket
|
|
65
80
|
* @param request - Optional customization or export request.
|
|
81
|
+
* @param modelStateId - ID of the Model-State to apply.
|
|
82
|
+
* @param strictValidation - When `false`, any Model-State parameter that cannot be applied to the
|
|
83
|
+
* model is ignored. However, when set to `true`, any validation error will result in an error
|
|
84
|
+
* response.
|
|
66
85
|
*/
|
|
67
86
|
async initForModel(
|
|
68
87
|
modelId: string,
|
|
69
88
|
request?: ShapeDiverRequestCustomization | ShapeDiverRequestExport,
|
|
89
|
+
modelStateId?: string,
|
|
90
|
+
strictValidation?: boolean,
|
|
70
91
|
): Promise<ShapeDiverResponseDto> {
|
|
92
|
+
// Build queries
|
|
93
|
+
const queries: string[] = [];
|
|
94
|
+
if (modelStateId !== undefined)
|
|
95
|
+
queries.push("modelStateId=" + modelStateId);
|
|
96
|
+
if (strictValidation !== undefined)
|
|
97
|
+
queries.push("strictValidation=" + strictValidation);
|
|
98
|
+
|
|
71
99
|
return await sendRequest(
|
|
72
100
|
async () =>
|
|
73
101
|
(
|
|
74
102
|
await this.api.post<ShapeDiverResponseDto>(
|
|
75
103
|
this.buildModelUri(modelId) + "/session",
|
|
104
|
+
queries,
|
|
76
105
|
request,
|
|
77
106
|
)
|
|
78
107
|
)[1],
|
|
@@ -29,6 +29,7 @@ export class ShapeDiverSystemApi extends BaseResourceApi {
|
|
|
29
29
|
(
|
|
30
30
|
await this.api.post<ShapeDiverResponseDto>(
|
|
31
31
|
this.buildSessionUri(sessionId) + "/log/message",
|
|
32
|
+
undefined,
|
|
32
33
|
body,
|
|
33
34
|
)
|
|
34
35
|
)[1],
|
|
@@ -80,6 +81,7 @@ export class ShapeDiverSystemApi extends BaseResourceApi {
|
|
|
80
81
|
(
|
|
81
82
|
await this.api.post<ShapeDiverResponseDto>(
|
|
82
83
|
this.buildAuthGroupUri(),
|
|
84
|
+
undefined,
|
|
83
85
|
body,
|
|
84
86
|
)
|
|
85
87
|
)[1],
|
|
@@ -15,12 +15,20 @@ export class ShapeDiverTextureApi extends BaseResourceApi {
|
|
|
15
15
|
*
|
|
16
16
|
* @param sessionId
|
|
17
17
|
*/
|
|
18
|
-
async listModelTextures(
|
|
18
|
+
async listModelTextures(
|
|
19
|
+
sessionId: string,
|
|
20
|
+
offset?: string,
|
|
21
|
+
): Promise<ShapeDiverResponseDto> {
|
|
22
|
+
// Build queries
|
|
23
|
+
const queries: string[] = [];
|
|
24
|
+
if (offset !== undefined) queries.push("offset=" + offset);
|
|
25
|
+
|
|
19
26
|
return await sendRequest(
|
|
20
27
|
async () =>
|
|
21
28
|
(
|
|
22
29
|
await this.api.get<ShapeDiverResponseDto>(
|
|
23
30
|
this.buildSessionUri(sessionId) + "/texture/list",
|
|
31
|
+
queries,
|
|
24
32
|
)
|
|
25
33
|
)[1],
|
|
26
34
|
);
|
|
@@ -51,7 +51,7 @@ export class ShapeDiverUtilsApi extends BaseResourceApi {
|
|
|
51
51
|
filename?: string,
|
|
52
52
|
): Promise<any> {
|
|
53
53
|
return await sendRequest(async () =>
|
|
54
|
-
this.api.put<any>(url, data, {
|
|
54
|
+
this.api.put<any>(url, undefined, data, {
|
|
55
55
|
contentType: contentType,
|
|
56
56
|
contentDisposition: filename
|
|
57
57
|
? contentDispositionFromFilename(filename)
|
|
@@ -76,7 +76,7 @@ export class ShapeDiverUtilsApi extends BaseResourceApi {
|
|
|
76
76
|
headers: ShapeDiverResponseAssetUploadHeaders,
|
|
77
77
|
): Promise<any> {
|
|
78
78
|
return await sendRequest(async () =>
|
|
79
|
-
this.api.put<any>(url, data, {
|
|
79
|
+
this.api.put<any>(url, undefined, data, {
|
|
80
80
|
contentType: headers.contentType,
|
|
81
81
|
contentDisposition: headers.contentDisposition,
|
|
82
82
|
responseType: ShapeDiverSdkApiResponseType.JSON,
|
|
@@ -98,7 +98,7 @@ export class ShapeDiverUtilsApi extends BaseResourceApi {
|
|
|
98
98
|
responseType: T,
|
|
99
99
|
): Promise<[Record<string, any>, ShapeDiverSdkUtilsDownloadType<T>]> {
|
|
100
100
|
return await sendRequest(async () =>
|
|
101
|
-
this.api.get<any>(url, {
|
|
101
|
+
this.api.get<any>(url, undefined, {
|
|
102
102
|
contentType: "application/json",
|
|
103
103
|
responseType: responseType,
|
|
104
104
|
disableAuthorization: true,
|