@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.
Files changed (67) hide show
  1. package/dist/ShapeDiverErrors.d.ts.map +1 -1
  2. package/dist/ShapeDiverErrors.js +1 -1
  3. package/dist/ShapeDiverErrors.js.map +1 -1
  4. package/dist/ShapeDiverSdk.d.ts.map +1 -1
  5. package/dist/ShapeDiverSdk.js.map +1 -1
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/resources/ShapeDiverAnalyticsApi.d.ts.map +1 -1
  10. package/dist/resources/ShapeDiverAnalyticsApi.js +3 -1
  11. package/dist/resources/ShapeDiverAnalyticsApi.js.map +1 -1
  12. package/dist/resources/ShapeDiverArSceneApi.d.ts.map +1 -1
  13. package/dist/resources/ShapeDiverArSceneApi.js.map +1 -1
  14. package/dist/resources/ShapeDiverAssetApi.d.ts.map +1 -1
  15. package/dist/resources/ShapeDiverAssetApi.js.map +1 -1
  16. package/dist/resources/ShapeDiverExportApi.d.ts.map +1 -1
  17. package/dist/resources/ShapeDiverExportApi.js.map +1 -1
  18. package/dist/resources/ShapeDiverFileApi.d.ts.map +1 -1
  19. package/dist/resources/ShapeDiverFileApi.js +10 -7
  20. package/dist/resources/ShapeDiverFileApi.js.map +1 -1
  21. package/dist/resources/ShapeDiverGltfApi.d.ts.map +1 -1
  22. package/dist/resources/ShapeDiverGltfApi.js +4 -1
  23. package/dist/resources/ShapeDiverGltfApi.js.map +1 -1
  24. package/dist/resources/ShapeDiverModelApi.d.ts.map +1 -1
  25. package/dist/resources/ShapeDiverModelApi.js +52 -15
  26. package/dist/resources/ShapeDiverModelApi.js.map +1 -1
  27. package/dist/resources/ShapeDiverOutputApi.d.ts.map +1 -1
  28. package/dist/resources/ShapeDiverOutputApi.js +12 -4
  29. package/dist/resources/ShapeDiverOutputApi.js.map +1 -1
  30. package/dist/resources/ShapeDiverSdtfApi.d.ts.map +1 -1
  31. package/dist/resources/ShapeDiverSdtfApi.js +9 -3
  32. package/dist/resources/ShapeDiverSdtfApi.js.map +1 -1
  33. package/dist/resources/ShapeDiverSessionApi.d.ts.map +1 -1
  34. package/dist/resources/ShapeDiverSessionApi.js +3 -1
  35. package/dist/resources/ShapeDiverSessionApi.js.map +1 -1
  36. package/dist/resources/ShapeDiverSystemApi.d.ts.map +1 -1
  37. package/dist/resources/ShapeDiverSystemApi.js +18 -6
  38. package/dist/resources/ShapeDiverSystemApi.js.map +1 -1
  39. package/dist/resources/ShapeDiverTextureApi.d.ts.map +1 -1
  40. package/dist/resources/ShapeDiverTextureApi.js +3 -1
  41. package/dist/resources/ShapeDiverTextureApi.js.map +1 -1
  42. package/dist/resources/ShapeDiverUtilsApi.d.ts +3 -5
  43. package/dist/resources/ShapeDiverUtilsApi.d.ts.map +1 -1
  44. package/dist/resources/ShapeDiverUtilsApi.js +31 -15
  45. package/dist/resources/ShapeDiverUtilsApi.js.map +1 -1
  46. package/dist/utils/utils.d.ts +1 -1
  47. package/dist/utils/utils.d.ts.map +1 -1
  48. package/dist/utils/utils.js +9 -9
  49. package/dist/utils/utils.js.map +1 -1
  50. package/package.json +4 -2
  51. package/src/ShapeDiverErrors.ts +24 -23
  52. package/src/ShapeDiverSdk.ts +110 -109
  53. package/src/index.ts +15 -16
  54. package/src/resources/ShapeDiverAnalyticsApi.ts +30 -18
  55. package/src/resources/ShapeDiverArSceneApi.ts +68 -69
  56. package/src/resources/ShapeDiverAssetApi.ts +207 -183
  57. package/src/resources/ShapeDiverExportApi.ts +92 -77
  58. package/src/resources/ShapeDiverFileApi.ts +136 -108
  59. package/src/resources/ShapeDiverGltfApi.ts +41 -30
  60. package/src/resources/ShapeDiverModelApi.ts +351 -240
  61. package/src/resources/ShapeDiverOutputApi.ts +92 -56
  62. package/src/resources/ShapeDiverSdtfApi.ts +88 -54
  63. package/src/resources/ShapeDiverSessionApi.ts +104 -82
  64. package/src/resources/ShapeDiverSystemApi.ts +106 -70
  65. package/src/resources/ShapeDiverTextureApi.ts +24 -18
  66. package/src/resources/ShapeDiverUtilsApi.ts +290 -231
  67. package/src/utils/utils.ts +61 -53
@@ -1,246 +1,357 @@
1
1
  import {
2
- ShapeDiverRequestConfigure,
3
- ShapeDiverRequestCustomization,
4
- ShapeDiverRequestModel,
5
- ShapeDiverRequestModelComputationQueryOrder,
6
- ShapeDiverRequestModelComputationQueryStatus,
7
- ShapeDiverRequestModelComputationQueryType,
8
- ShapeDiverRequestParameterDefinition,
9
- ShapeDiverResponseDto,
10
- } from "@shapediver/api.geometry-api-dto-v2"
11
- import { BaseResourceApi, ShapeDiverSdkApi, ShapeDiverSdkApiResponseType } from "@shapediver/sdk.geometry-api-sdk-core"
12
- import { sendRequest } from "../utils/utils"
2
+ ShapeDiverRequestConfigure,
3
+ ShapeDiverRequestCustomization,
4
+ ShapeDiverRequestModel,
5
+ ShapeDiverRequestModelComputationQueryOrder,
6
+ ShapeDiverRequestModelComputationQueryStatus,
7
+ ShapeDiverRequestModelComputationQueryType,
8
+ ShapeDiverRequestParameterDefinition,
9
+ ShapeDiverResponseDto,
10
+ } from "@shapediver/api.geometry-api-dto-v2";
11
+ import {
12
+ BaseResourceApi,
13
+ ShapeDiverSdkApi,
14
+ ShapeDiverSdkApiResponseType,
15
+ } from "@shapediver/sdk.geometry-api-sdk-core";
16
+ import { sendRequest } from "../utils/utils";
13
17
 
14
18
  export class ShapeDiverModelApi extends BaseResourceApi {
19
+ constructor(api: ShapeDiverSdkApi) {
20
+ super(api);
21
+ }
22
+
23
+ /**
24
+ * Get information about a ShapeDiver Model.
25
+ *
26
+ * @param modelId
27
+ */
28
+ async get(modelId: string): Promise<ShapeDiverResponseDto> {
29
+ return await sendRequest(
30
+ async () =>
31
+ (
32
+ await this.api.get<ShapeDiverResponseDto>(this.buildModelUri(modelId))
33
+ )[1],
34
+ );
35
+ }
36
+
37
+ /**
38
+ * Create a new ShapeDiver Model.
39
+ *
40
+ * @param body
41
+ */
42
+ async create(body: ShapeDiverRequestModel): Promise<ShapeDiverResponseDto> {
43
+ return await sendRequest(
44
+ async () =>
45
+ (await this.api.post<ShapeDiverResponseDto>(this.commonPath, body))[1],
46
+ );
47
+ }
48
+
49
+ /**
50
+ * Update properties of a ShapeDiver Model.
51
+ *
52
+ * @param modelId
53
+ * @param body
54
+ */
55
+ async update(
56
+ modelId: string,
57
+ body: ShapeDiverRequestModel,
58
+ ): Promise<ShapeDiverResponseDto> {
59
+ return await sendRequest(
60
+ async () =>
61
+ (
62
+ await this.api.put<ShapeDiverResponseDto>(
63
+ this.buildModelUri(modelId),
64
+ body,
65
+ )
66
+ )[1],
67
+ );
68
+ }
69
+
70
+ /**
71
+ * Delete a ShapeDiver Model.
72
+ *
73
+ * @param modelId
74
+ */
75
+ async delete(modelId: string): Promise<ShapeDiverResponseDto> {
76
+ return await sendRequest(
77
+ async () =>
78
+ (
79
+ await this.api.delete<ShapeDiverResponseDto>(
80
+ this.buildModelUri(modelId),
81
+ )
82
+ )[1],
83
+ );
84
+ }
85
+
86
+ /**
87
+ * List models.
88
+ */
89
+ async list(): Promise<ShapeDiverResponseDto> {
90
+ return await sendRequest(
91
+ async () =>
92
+ (
93
+ await this.api.get<ShapeDiverResponseDto>(`${this.commonPath}/list`)
94
+ )[1],
95
+ );
96
+ }
97
+
98
+ /**
99
+ * Get configurations of the viewer.
100
+ *
101
+ * @param modelId
102
+ */
103
+ async getConfig(modelId: string): Promise<ShapeDiverResponseDto> {
104
+ return await sendRequest(
105
+ async () =>
106
+ (
107
+ await this.api.get<ShapeDiverResponseDto>(
108
+ this.buildModelUri(modelId) + "/config",
109
+ )
110
+ )[1],
111
+ );
112
+ }
113
+
114
+ /**
115
+ * Create viewer configurations.
116
+ *
117
+ * @param modelId
118
+ * @param body
119
+ */
120
+ async createConfig(
121
+ modelId: string,
122
+ body: ShapeDiverRequestConfigure,
123
+ ): Promise<ShapeDiverResponseDto> {
124
+ return await sendRequest(
125
+ async () =>
126
+ (
127
+ await this.api.post<ShapeDiverResponseDto>(
128
+ this.buildModelUri(modelId) + "/config",
129
+ body,
130
+ )
131
+ )[1],
132
+ );
133
+ }
134
+
135
+ /**
136
+ * Update viewer configurations.
137
+ *
138
+ * @param modelId
139
+ * @param body
140
+ */
141
+ async updateConfig(
142
+ modelId: string,
143
+ body: ShapeDiverRequestConfigure,
144
+ ): Promise<ShapeDiverResponseDto> {
145
+ return await sendRequest(
146
+ async () =>
147
+ (
148
+ await this.api.patch<ShapeDiverResponseDto>(
149
+ this.buildModelUri(modelId) + "/config",
150
+ body,
151
+ )
152
+ )[1],
153
+ );
154
+ }
155
+
156
+ /**
157
+ * Download the Grasshopper file of the ShapeDiver Model.
158
+ *
159
+ * @param modelId
160
+ */
161
+ async getFile(modelId: string): Promise<ArrayBuffer> {
162
+ return await sendRequest(
163
+ async () =>
164
+ (
165
+ await this.api.get<ArrayBuffer>(
166
+ this.buildModelUri(modelId) + "/file/download",
167
+ {
168
+ contentType: "application/json",
169
+ responseType: ShapeDiverSdkApiResponseType.DATA,
170
+ },
171
+ )
172
+ )[1],
173
+ );
174
+ }
175
+
176
+ /**
177
+ * Set the default parameters for the ShapeDiver Model.
178
+ *
179
+ * @param modelId
180
+ * @param body
181
+ */
182
+ async setDefaultParams(
183
+ modelId: string,
184
+ body: ShapeDiverRequestCustomization,
185
+ ): Promise<ShapeDiverResponseDto> {
186
+ return await sendRequest(
187
+ async () =>
188
+ (
189
+ await this.api.patch<ShapeDiverResponseDto>(
190
+ this.buildModelUri(modelId) + "/parameter/defval",
191
+ body,
192
+ )
193
+ )[1],
194
+ );
195
+ }
196
+
197
+ /**
198
+ * Updates the definitions of the given parameters.
199
+ *
200
+ * @param modelId
201
+ * @param body
202
+ */
203
+ async updateParameterDefinitions(
204
+ modelId: string,
205
+ body: ShapeDiverRequestParameterDefinition,
206
+ ): Promise<ShapeDiverResponseDto> {
207
+ return await sendRequest(
208
+ async () =>
209
+ (
210
+ await this.api.patch<ShapeDiverResponseDto>(
211
+ this.buildModelUri(modelId) + "/parameter",
212
+ body,
213
+ )
214
+ )[1],
215
+ );
216
+ }
217
+
218
+ /**
219
+ * Query model computation statistics.
220
+ *
221
+ * @param modelId
222
+ * @param timestampFrom - Timestamp to query from
223
+ * @param timestampTo - Timestamp to query to.
224
+ * @param limit - How many items to return at most.
225
+ * @param strictLimit - Whether the limit shall be attained (if there are enough items).
226
+ * @param order - Order in which to query computation stats items.
227
+ * @param status - Filter computations by the result status.
228
+ * @param type - Filter computations by type.
229
+ * @param offset - Continuation token for pagination.
230
+ */
231
+ async queryComputations(
232
+ modelId: string,
233
+ timestampFrom?: string,
234
+ timestampTo?: string,
235
+ limit?: number,
236
+ strictLimit?: boolean,
237
+ order?: ShapeDiverRequestModelComputationQueryOrder,
238
+ status?: ShapeDiverRequestModelComputationQueryStatus,
239
+ type?: ShapeDiverRequestModelComputationQueryType,
240
+ offset?: string,
241
+ ): Promise<ShapeDiverResponseDto> {
242
+ // Build queries
243
+ const queries: string[] = [];
244
+ if (timestampFrom !== undefined)
245
+ queries.push("timestamp_from=" + timestampFrom);
246
+ if (timestampTo !== undefined) queries.push("timestamp_to=" + timestampTo);
247
+ if (limit !== undefined) queries.push("limit=" + limit);
248
+ if (strictLimit !== undefined) queries.push("strict_limit=" + strictLimit);
249
+ if (order !== undefined) queries.push("order=" + order);
250
+ if (status !== undefined) queries.push("status=" + status);
251
+ if (type !== undefined) queries.push("type=" + type);
252
+ if (offset !== undefined) queries.push("offset=" + offset);
253
+
254
+ return await sendRequest(
255
+ async () =>
256
+ (
257
+ await this.api.get<ShapeDiverResponseDto>(
258
+ this.buildModelUri(modelId) + "/computations?" + queries.join("&"),
259
+ )
260
+ )[1],
261
+ );
262
+ }
263
+
264
+ /**
265
+ * Delete all export components that have been last used at or before {@link untilLastSeen} timestamp.
266
+ *
267
+ * @param modelId
268
+ * @param untilLastSeen - Timestamp, inclusive limit.
269
+ * Allowed Patterns: YYYY, YYYYMM, YYYYMMDD, YYYYMMDDhh, YYYYMMDDhhmm, YYYYMMDDhhmmss, YYYYMMDDhhmmssSSS
270
+ * @example
271
+ * untilLastSeen = "20221104112923123"
272
+ * represents the date-time "2022-11-04T11:29:23.123"
273
+ */
274
+ async enqueueCleanupExports(
275
+ modelId: string,
276
+ untilLastSeen: string,
277
+ ): Promise<ShapeDiverResponseDto> {
278
+ return await sendRequest(
279
+ async () =>
280
+ (
281
+ await this.api.post<ShapeDiverResponseDto>(
282
+ this.buildModelUri(modelId) +
283
+ "/cleanup/export?untilLastSeen=" +
284
+ untilLastSeen,
285
+ )
286
+ )[1],
287
+ );
288
+ }
289
+
290
+ /**
291
+ * Delete all output components that have been last used at or before {@link untilLastSeen} timestamp.
292
+ *
293
+ * @param modelId
294
+ * @param untilLastSeen - Timestamp, inclusive limit.
295
+ * Allowed Patterns: YYYY, YYYYMM, YYYYMMDD, YYYYMMDDhh, YYYYMMDDhhmm, YYYYMMDDhhmmss, YYYYMMDDhhmmssSSS
296
+ * @example
297
+ * untilLastSeen = "20221104112923123"
298
+ * represents the date-time "2022-11-04T11:29:23.123"
299
+ */
300
+ async enqueueCleanupOutputs(
301
+ modelId: string,
302
+ untilLastSeen: string,
303
+ ): Promise<ShapeDiverResponseDto> {
304
+ return await sendRequest(
305
+ async () =>
306
+ (
307
+ await this.api.post<ShapeDiverResponseDto>(
308
+ this.buildModelUri(modelId) +
309
+ "/cleanup/output?untilLastSeen=" +
310
+ untilLastSeen,
311
+ )
312
+ )[1],
313
+ );
314
+ }
15
315
 
16
- constructor (api: ShapeDiverSdkApi) {
17
- super(api)
18
- }
19
-
20
- /**
21
- * Get information about a ShapeDiver Model.
22
- *
23
- * @param modelId
24
- */
25
- async get (modelId: string): Promise<ShapeDiverResponseDto> {
26
- return await sendRequest(async () =>
27
- (await this.api.get<ShapeDiverResponseDto>(this.buildModelUri(modelId)))[1],
28
- )
29
- }
30
-
31
- /**
32
- * Create a new ShapeDiver Model.
33
- *
34
- * @param body
35
- */
36
- async create (body: ShapeDiverRequestModel): Promise<ShapeDiverResponseDto> {
37
- return await sendRequest(async () =>
38
- (await this.api.post<ShapeDiverResponseDto>(this.commonPath, body))[1],
39
- )
40
- }
41
-
42
- /**
43
- * Update properties of a ShapeDiver Model.
44
- *
45
- * @param modelId
46
- * @param body
47
- */
48
- async update (modelId: string, body: ShapeDiverRequestModel): Promise<ShapeDiverResponseDto> {
49
- return await sendRequest(async () =>
50
- (await this.api.put<ShapeDiverResponseDto>(this.buildModelUri(modelId), body))[1],
51
- )
52
- }
53
-
54
- /**
55
- * Delete a ShapeDiver Model.
56
- *
57
- * @param modelId
58
- */
59
- async delete (modelId: string): Promise<ShapeDiverResponseDto> {
60
- return await sendRequest(async () =>
61
- (await this.api.delete<ShapeDiverResponseDto>(this.buildModelUri(modelId)))[1],
62
- )
63
- }
64
-
65
- /**
66
- * List models.
67
- */
68
- async list (): Promise<ShapeDiverResponseDto> {
69
- return await sendRequest(async () =>
70
- (await this.api.get<ShapeDiverResponseDto>(`${ this.commonPath }/list`))[1],
71
- )
72
- }
73
-
74
- /**
75
- * Get configurations of the viewer.
76
- *
77
- * @param modelId
78
- */
79
- async getConfig (modelId: string): Promise<ShapeDiverResponseDto> {
80
- return await sendRequest(async () =>
81
- (await this.api.get<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/config"))[1],
82
- )
83
- }
84
-
85
- /**
86
- * Create viewer configurations.
87
- *
88
- * @param modelId
89
- * @param body
90
- */
91
- async createConfig (modelId: string, body: ShapeDiverRequestConfigure): Promise<ShapeDiverResponseDto> {
92
- return await sendRequest(async () =>
93
- (await this.api.post<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/config", body))[1],
94
- )
95
- }
96
-
97
- /**
98
- * Update viewer configurations.
99
- *
100
- * @param modelId
101
- * @param body
102
- */
103
- async updateConfig (modelId: string, body: ShapeDiverRequestConfigure): Promise<ShapeDiverResponseDto> {
104
- return await sendRequest(async () =>
105
- (await this.api.patch<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/config", body))[1],
106
- )
107
- }
108
-
109
- /**
110
- * Download the Grasshopper file of the ShapeDiver Model.
111
- *
112
- * @param modelId
113
- */
114
- async getFile (modelId: string): Promise<ArrayBuffer> {
115
- return await sendRequest(async () =>
116
- (await this.api.get<ArrayBuffer>(
117
- this.buildModelUri(modelId) + "/file/download",
118
- { contentType: "application/json", responseType: ShapeDiverSdkApiResponseType.DATA },
119
- ))[1],
120
- )
121
- }
122
-
123
- /**
124
- * Set the default parameters for the ShapeDiver Model.
125
- *
126
- * @param modelId
127
- * @param body
128
- */
129
- async setDefaultParams (modelId: string, body: ShapeDiverRequestCustomization): Promise<ShapeDiverResponseDto> {
130
- return await sendRequest(async () =>
131
- (await this.api.patch<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/parameter/defval", body))[1],
132
- )
133
- }
134
-
135
- /**
136
- * Updates the definitions of the given parameters.
137
- *
138
- * @param modelId
139
- * @param body
140
- */
141
- async updateParameterDefinitions (modelId: string, body: ShapeDiverRequestParameterDefinition): Promise<ShapeDiverResponseDto> {
142
- return await sendRequest(async () =>
143
- (await this.api.patch<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/parameter", body))[1],
144
- )
145
- }
146
-
147
- /**
148
- * Query model computation statistics.
149
- *
150
- * @param modelId
151
- * @param timestampFrom - Timestamp to query from
152
- * @param timestampTo - Timestamp to query to.
153
- * @param limit - How many items to return at most.
154
- * @param strictLimit - Whether the limit shall be attained (if there are enough items).
155
- * @param order - Order in which to query computation stats items.
156
- * @param status - Filter computations by the result status.
157
- * @param type - Filter computations by type.
158
- * @param offset - Continuation token for pagination.
159
- */
160
- async queryComputations (
161
- modelId: string,
162
- timestampFrom?: string,
163
- timestampTo?: string,
164
- limit?: number,
165
- strictLimit?: boolean,
166
- order?: ShapeDiverRequestModelComputationQueryOrder,
167
- status?: ShapeDiverRequestModelComputationQueryStatus,
168
- type?: ShapeDiverRequestModelComputationQueryType,
169
- offset?: string,
170
- ): Promise<ShapeDiverResponseDto> {
171
- // Build queries
172
- const queries: string[] = []
173
- if (timestampFrom !== undefined) queries.push("timestamp_from=" + timestampFrom)
174
- if (timestampTo !== undefined) queries.push("timestamp_to=" + timestampTo)
175
- if (limit !== undefined) queries.push("limit=" + limit)
176
- if (strictLimit !== undefined) queries.push("strict_limit=" + strictLimit)
177
- if (order !== undefined) queries.push("order=" + order)
178
- if (status !== undefined) queries.push("status=" + status)
179
- if (type !== undefined) queries.push("type=" + type)
180
- if (offset !== undefined) queries.push("offset=" + offset)
181
-
182
- return await sendRequest(async () =>
183
- (await this.api.get<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/computations?" + queries.join("&")))[1],
184
- )
185
- }
186
-
187
- /**
188
- * Delete all export components that have been last used at or before {@link untilLastSeen} timestamp.
189
- *
190
- * @param modelId
191
- * @param untilLastSeen - Timestamp, inclusive limit.
192
- * Allowed Patterns: YYYY, YYYYMM, YYYYMMDD, YYYYMMDDhh, YYYYMMDDhhmm, YYYYMMDDhhmmss, YYYYMMDDhhmmssSSS
193
- * @example
194
- * untilLastSeen = "20221104112923123"
195
- * represents the date-time "2022-11-04T11:29:23.123"
196
- */
197
- async enqueueCleanupExports (modelId: string, untilLastSeen: string): Promise<ShapeDiverResponseDto> {
198
- return await sendRequest(async () =>
199
- (await this.api.post<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/cleanup/export?untilLastSeen=" + untilLastSeen))[1],
200
- )
201
- }
202
-
203
- /**
204
- * Delete all output components that have been last used at or before {@link untilLastSeen} timestamp.
205
- *
206
- * @param modelId
207
- * @param untilLastSeen - Timestamp, inclusive limit.
208
- * Allowed Patterns: YYYY, YYYYMM, YYYYMMDD, YYYYMMDDhh, YYYYMMDDhhmm, YYYYMMDDhhmmss, YYYYMMDDhhmmssSSS
209
- * @example
210
- * untilLastSeen = "20221104112923123"
211
- * represents the date-time "2022-11-04T11:29:23.123"
212
- */
213
- async enqueueCleanupOutputs (modelId: string, untilLastSeen: string): Promise<ShapeDiverResponseDto> {
214
- return await sendRequest(async () =>
215
- (await this.api.post<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/cleanup/output?untilLastSeen=" + untilLastSeen))[1],
216
- )
217
- }
218
-
219
- /**
220
- * Delete all texture components that have been last used at or before {@link untilLastSeen} timestamp.
221
- *
222
- * @param modelId
223
- * @param untilLastSeen - Timestamp, inclusive limit.
224
- * Allowed Patterns: YYYY, YYYYMM, YYYYMMDD, YYYYMMDDhh, YYYYMMDDhhmm, YYYYMMDDhhmmss, YYYYMMDDhhmmssSSS
225
- * @example
226
- * untilLastSeen = "20221104112923123"
227
- * represents the date-time "2022-11-04T11:29:23.123"
228
- */
229
- async enqueueCleanupTextures (modelId: string, untilLastSeen: string): Promise<ShapeDiverResponseDto> {
230
- return await sendRequest(async () =>
231
- (await this.api.post<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/cleanup/texture?untilLastSeen=" + untilLastSeen))[1],
232
- )
233
- }
234
-
235
- /**
236
- * Get the status of all running model cleanup processes.
237
- *
238
- * @param modelId
239
- */
240
- async getCleanupStatus (modelId: string): Promise<ShapeDiverResponseDto> {
241
- return await sendRequest(async () =>
242
- (await this.api.get<ShapeDiverResponseDto>(this.buildModelUri(modelId) + "/cleanup/status"))[1],
243
- )
244
- }
316
+ /**
317
+ * Delete all texture components that have been last used at or before {@link untilLastSeen} timestamp.
318
+ *
319
+ * @param modelId
320
+ * @param untilLastSeen - Timestamp, inclusive limit.
321
+ * Allowed Patterns: YYYY, YYYYMM, YYYYMMDD, YYYYMMDDhh, YYYYMMDDhhmm, YYYYMMDDhhmmss, YYYYMMDDhhmmssSSS
322
+ * @example
323
+ * untilLastSeen = "20221104112923123"
324
+ * represents the date-time "2022-11-04T11:29:23.123"
325
+ */
326
+ async enqueueCleanupTextures(
327
+ modelId: string,
328
+ untilLastSeen: string,
329
+ ): Promise<ShapeDiverResponseDto> {
330
+ return await sendRequest(
331
+ async () =>
332
+ (
333
+ await this.api.post<ShapeDiverResponseDto>(
334
+ this.buildModelUri(modelId) +
335
+ "/cleanup/texture?untilLastSeen=" +
336
+ untilLastSeen,
337
+ )
338
+ )[1],
339
+ );
340
+ }
245
341
 
342
+ /**
343
+ * Get the status of all running model cleanup processes.
344
+ *
345
+ * @param modelId
346
+ */
347
+ async getCleanupStatus(modelId: string): Promise<ShapeDiverResponseDto> {
348
+ return await sendRequest(
349
+ async () =>
350
+ (
351
+ await this.api.get<ShapeDiverResponseDto>(
352
+ this.buildModelUri(modelId) + "/cleanup/status",
353
+ )
354
+ )[1],
355
+ );
356
+ }
246
357
  }