@shapediver/sdk.geometry-api-sdk-v2 1.8.3 → 1.9.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/ShapeDiverErrors.d.ts.map +1 -1
- package/dist/ShapeDiverErrors.js +1 -1
- package/dist/ShapeDiverErrors.js.map +1 -1
- package/dist/ShapeDiverSdk.d.ts.map +1 -1
- package/dist/ShapeDiverSdk.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/ShapeDiverAnalyticsApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverAnalyticsApi.js +3 -1
- package/dist/resources/ShapeDiverAnalyticsApi.js.map +1 -1
- package/dist/resources/ShapeDiverArSceneApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverArSceneApi.js.map +1 -1
- package/dist/resources/ShapeDiverAssetApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverAssetApi.js.map +1 -1
- package/dist/resources/ShapeDiverExportApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverExportApi.js.map +1 -1
- package/dist/resources/ShapeDiverFileApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverFileApi.js +10 -7
- package/dist/resources/ShapeDiverFileApi.js.map +1 -1
- package/dist/resources/ShapeDiverGltfApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverGltfApi.js +4 -1
- package/dist/resources/ShapeDiverGltfApi.js.map +1 -1
- package/dist/resources/ShapeDiverModelApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverModelApi.js +52 -15
- package/dist/resources/ShapeDiverModelApi.js.map +1 -1
- package/dist/resources/ShapeDiverOutputApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverOutputApi.js +12 -4
- package/dist/resources/ShapeDiverOutputApi.js.map +1 -1
- package/dist/resources/ShapeDiverSdtfApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverSdtfApi.js +9 -3
- package/dist/resources/ShapeDiverSdtfApi.js.map +1 -1
- package/dist/resources/ShapeDiverSessionApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverSessionApi.js +3 -1
- package/dist/resources/ShapeDiverSessionApi.js.map +1 -1
- package/dist/resources/ShapeDiverSystemApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverSystemApi.js +18 -6
- package/dist/resources/ShapeDiverSystemApi.js.map +1 -1
- package/dist/resources/ShapeDiverTextureApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverTextureApi.js +3 -1
- package/dist/resources/ShapeDiverTextureApi.js.map +1 -1
- package/dist/resources/ShapeDiverUtilsApi.d.ts +3 -5
- package/dist/resources/ShapeDiverUtilsApi.d.ts.map +1 -1
- package/dist/resources/ShapeDiverUtilsApi.js +31 -15
- package/dist/resources/ShapeDiverUtilsApi.js.map +1 -1
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +9 -9
- package/dist/utils/utils.js.map +1 -1
- package/package.json +4 -2
- package/src/ShapeDiverErrors.ts +24 -23
- package/src/ShapeDiverSdk.ts +110 -109
- package/src/index.ts +15 -16
- package/src/resources/ShapeDiverAnalyticsApi.ts +30 -18
- package/src/resources/ShapeDiverArSceneApi.ts +68 -69
- package/src/resources/ShapeDiverAssetApi.ts +207 -183
- package/src/resources/ShapeDiverExportApi.ts +92 -77
- package/src/resources/ShapeDiverFileApi.ts +136 -108
- package/src/resources/ShapeDiverGltfApi.ts +41 -30
- package/src/resources/ShapeDiverModelApi.ts +351 -240
- package/src/resources/ShapeDiverOutputApi.ts +92 -56
- package/src/resources/ShapeDiverSdtfApi.ts +88 -54
- package/src/resources/ShapeDiverSessionApi.ts +104 -82
- package/src/resources/ShapeDiverSystemApi.ts +106 -70
- package/src/resources/ShapeDiverTextureApi.ts +24 -18
- package/src/resources/ShapeDiverUtilsApi.ts +290 -231
- package/src/utils/utils.ts +61 -53
|
@@ -1,80 +1,116 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "@shapediver/api.geometry-api-dto-v2"
|
|
6
|
-
import {
|
|
7
|
-
|
|
2
|
+
ShapeDiverRequestAuthorizationGroup,
|
|
3
|
+
ShapeDiverRequestLogMessage,
|
|
4
|
+
ShapeDiverResponseDto,
|
|
5
|
+
} from "@shapediver/api.geometry-api-dto-v2";
|
|
6
|
+
import {
|
|
7
|
+
BaseResourceApi,
|
|
8
|
+
ShapeDiverSdkApi,
|
|
9
|
+
} from "@shapediver/sdk.geometry-api-sdk-core";
|
|
10
|
+
import { sendRequest } from "../utils/utils";
|
|
8
11
|
|
|
9
12
|
export class ShapeDiverSystemApi extends BaseResourceApi {
|
|
13
|
+
constructor(api: ShapeDiverSdkApi) {
|
|
14
|
+
super(api);
|
|
15
|
+
}
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*
|
|
32
|
-
* @param modelId
|
|
33
|
-
*/
|
|
34
|
-
async pruneModel (modelId: string): Promise<ShapeDiverResponseDto> {
|
|
35
|
-
return await sendRequest(async () =>
|
|
36
|
-
(await this.api.delete<ShapeDiverResponseDto>(`${ this.buildSystemUri() }/model/${ modelId }`))[1],
|
|
37
|
-
)
|
|
38
|
-
}
|
|
17
|
+
/**
|
|
18
|
+
* Log the specified message.
|
|
19
|
+
*
|
|
20
|
+
* @param sessionId
|
|
21
|
+
* @param body
|
|
22
|
+
*/
|
|
23
|
+
async log(
|
|
24
|
+
sessionId: string,
|
|
25
|
+
body: ShapeDiverRequestLogMessage,
|
|
26
|
+
): Promise<ShapeDiverResponseDto> {
|
|
27
|
+
return await sendRequest(
|
|
28
|
+
async () =>
|
|
29
|
+
(
|
|
30
|
+
await this.api.post<ShapeDiverResponseDto>(
|
|
31
|
+
this.buildSessionUri(sessionId) + "/log/message",
|
|
32
|
+
body,
|
|
33
|
+
)
|
|
34
|
+
)[1],
|
|
35
|
+
);
|
|
36
|
+
}
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Remove a model with all it's components.
|
|
40
|
+
*
|
|
41
|
+
* **WARNING: This operation cannot be undone!**
|
|
42
|
+
*
|
|
43
|
+
* @param modelId
|
|
44
|
+
*/
|
|
45
|
+
async pruneModel(modelId: string): Promise<ShapeDiverResponseDto> {
|
|
46
|
+
return await sendRequest(
|
|
47
|
+
async () =>
|
|
48
|
+
(
|
|
49
|
+
await this.api.delete<ShapeDiverResponseDto>(
|
|
50
|
+
`${this.buildSystemUri()}/model/${modelId}`,
|
|
51
|
+
)
|
|
52
|
+
)[1],
|
|
53
|
+
);
|
|
54
|
+
}
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Decrypt the given ticket.
|
|
58
|
+
*
|
|
59
|
+
* @param ticket
|
|
60
|
+
*/
|
|
61
|
+
async decryptTicket(ticket: string): Promise<ShapeDiverResponseDto> {
|
|
62
|
+
return await sendRequest(
|
|
63
|
+
async () =>
|
|
64
|
+
(
|
|
65
|
+
await this.api.get<ShapeDiverResponseDto>(this.buildTicketUri(ticket))
|
|
66
|
+
)[1],
|
|
67
|
+
);
|
|
68
|
+
}
|
|
61
69
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Create a new authentication group.
|
|
72
|
+
*
|
|
73
|
+
* @param body
|
|
74
|
+
*/
|
|
75
|
+
async authGroup(
|
|
76
|
+
body: ShapeDiverRequestAuthorizationGroup,
|
|
77
|
+
): Promise<ShapeDiverResponseDto> {
|
|
78
|
+
return await sendRequest(
|
|
79
|
+
async () =>
|
|
80
|
+
(
|
|
81
|
+
await this.api.post<ShapeDiverResponseDto>(
|
|
82
|
+
this.buildAuthGroupUri(),
|
|
83
|
+
body,
|
|
84
|
+
)
|
|
85
|
+
)[1],
|
|
86
|
+
);
|
|
87
|
+
}
|
|
70
88
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Returns system information about the Geometry Minions.
|
|
91
|
+
*/
|
|
92
|
+
async getMinionInfo(): Promise<ShapeDiverResponseDto> {
|
|
93
|
+
return sendRequest(
|
|
94
|
+
async () =>
|
|
95
|
+
(
|
|
96
|
+
await this.api.get<ShapeDiverResponseDto>(
|
|
97
|
+
`${this.buildSystemUri()}/minions/info`,
|
|
98
|
+
)
|
|
99
|
+
)[1],
|
|
100
|
+
);
|
|
101
|
+
}
|
|
79
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Returns system information about the Geometry Workers.
|
|
105
|
+
*/
|
|
106
|
+
async getWorkerInfo(): Promise<ShapeDiverResponseDto> {
|
|
107
|
+
return sendRequest(
|
|
108
|
+
async () =>
|
|
109
|
+
(
|
|
110
|
+
await this.api.get<ShapeDiverResponseDto>(
|
|
111
|
+
`${this.buildSystemUri()}/workers/info`,
|
|
112
|
+
)
|
|
113
|
+
)[1],
|
|
114
|
+
);
|
|
115
|
+
}
|
|
80
116
|
}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import { ShapeDiverResponseDto } from "@shapediver/api.geometry-api-dto-v2"
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { ShapeDiverResponseDto } from "@shapediver/api.geometry-api-dto-v2";
|
|
2
|
+
import {
|
|
3
|
+
BaseResourceApi,
|
|
4
|
+
ShapeDiverSdkApi,
|
|
5
|
+
} from "@shapediver/sdk.geometry-api-sdk-core";
|
|
6
|
+
import { sendRequest } from "../utils/utils";
|
|
4
7
|
|
|
5
8
|
export class ShapeDiverTextureApi extends BaseResourceApi {
|
|
9
|
+
constructor(api: ShapeDiverSdkApi) {
|
|
10
|
+
super(api);
|
|
11
|
+
}
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
/**
|
|
14
|
+
* List all textures of the specified model.
|
|
15
|
+
*
|
|
16
|
+
* @param sessionId
|
|
17
|
+
*/
|
|
18
|
+
async listModelTextures(sessionId: string): Promise<ShapeDiverResponseDto> {
|
|
19
|
+
return await sendRequest(
|
|
20
|
+
async () =>
|
|
21
|
+
(
|
|
22
|
+
await this.api.get<ShapeDiverResponseDto>(
|
|
23
|
+
this.buildSessionUri(sessionId) + "/texture/list",
|
|
24
|
+
)
|
|
25
|
+
)[1],
|
|
26
|
+
);
|
|
27
|
+
}
|
|
22
28
|
}
|