@shapediver/sdk.geometry-api-sdk-v2 1.10.0 → 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.
Files changed (69) hide show
  1. package/dist/ShapeDiverSdk.d.ts +3 -0
  2. package/dist/ShapeDiverSdk.d.ts.map +1 -1
  3. package/dist/ShapeDiverSdk.js +5 -0
  4. package/dist/ShapeDiverSdk.js.map +1 -1
  5. package/dist/resources/ShapeDiverAnalyticsApi.d.ts.map +1 -1
  6. package/dist/resources/ShapeDiverAnalyticsApi.js +6 -20
  7. package/dist/resources/ShapeDiverAnalyticsApi.js.map +1 -1
  8. package/dist/resources/ShapeDiverArSceneApi.d.ts +3 -3
  9. package/dist/resources/ShapeDiverArSceneApi.d.ts.map +1 -1
  10. package/dist/resources/ShapeDiverArSceneApi.js +6 -6
  11. package/dist/resources/ShapeDiverArSceneApi.js.map +1 -1
  12. package/dist/resources/ShapeDiverAssetApi.d.ts.map +1 -1
  13. package/dist/resources/ShapeDiverAssetApi.js +12 -10
  14. package/dist/resources/ShapeDiverAssetApi.js.map +1 -1
  15. package/dist/resources/ShapeDiverExportApi.d.ts.map +1 -1
  16. package/dist/resources/ShapeDiverExportApi.js +4 -4
  17. package/dist/resources/ShapeDiverExportApi.js.map +1 -1
  18. package/dist/resources/ShapeDiverFileApi.d.ts +1 -1
  19. package/dist/resources/ShapeDiverFileApi.d.ts.map +1 -1
  20. package/dist/resources/ShapeDiverFileApi.js +7 -4
  21. package/dist/resources/ShapeDiverFileApi.js.map +1 -1
  22. package/dist/resources/ShapeDiverGltfApi.d.ts.map +1 -1
  23. package/dist/resources/ShapeDiverGltfApi.js +1 -1
  24. package/dist/resources/ShapeDiverGltfApi.js.map +1 -1
  25. package/dist/resources/ShapeDiverModelApi.d.ts +1 -1
  26. package/dist/resources/ShapeDiverModelApi.d.ts.map +1 -1
  27. package/dist/resources/ShapeDiverModelApi.js +18 -19
  28. package/dist/resources/ShapeDiverModelApi.js.map +1 -1
  29. package/dist/resources/ShapeDiverModelStateApi.d.ts +14 -0
  30. package/dist/resources/ShapeDiverModelStateApi.d.ts.map +1 -0
  31. package/dist/resources/ShapeDiverModelStateApi.js +104 -0
  32. package/dist/resources/ShapeDiverModelStateApi.js.map +1 -0
  33. package/dist/resources/ShapeDiverOutputApi.d.ts +1 -1
  34. package/dist/resources/ShapeDiverOutputApi.d.ts.map +1 -1
  35. package/dist/resources/ShapeDiverOutputApi.js +8 -5
  36. package/dist/resources/ShapeDiverOutputApi.js.map +1 -1
  37. package/dist/resources/ShapeDiverSdtfApi.d.ts +1 -1
  38. package/dist/resources/ShapeDiverSdtfApi.d.ts.map +1 -1
  39. package/dist/resources/ShapeDiverSdtfApi.js +7 -4
  40. package/dist/resources/ShapeDiverSdtfApi.js.map +1 -1
  41. package/dist/resources/ShapeDiverSessionApi.d.ts +2 -2
  42. package/dist/resources/ShapeDiverSessionApi.d.ts.map +1 -1
  43. package/dist/resources/ShapeDiverSessionApi.js +15 -5
  44. package/dist/resources/ShapeDiverSessionApi.js.map +1 -1
  45. package/dist/resources/ShapeDiverSystemApi.d.ts.map +1 -1
  46. package/dist/resources/ShapeDiverSystemApi.js +2 -2
  47. package/dist/resources/ShapeDiverSystemApi.js.map +1 -1
  48. package/dist/resources/ShapeDiverTextureApi.d.ts +1 -1
  49. package/dist/resources/ShapeDiverTextureApi.d.ts.map +1 -1
  50. package/dist/resources/ShapeDiverTextureApi.js +5 -2
  51. package/dist/resources/ShapeDiverTextureApi.js.map +1 -1
  52. package/dist/resources/ShapeDiverUtilsApi.js +3 -3
  53. package/dist/resources/ShapeDiverUtilsApi.js.map +1 -1
  54. package/package.json +6 -6
  55. package/src/ShapeDiverSdk.ts +7 -0
  56. package/src/resources/ShapeDiverAnalyticsApi.ts +6 -18
  57. package/src/resources/ShapeDiverArSceneApi.ts +11 -9
  58. package/src/resources/ShapeDiverAssetApi.ts +19 -7
  59. package/src/resources/ShapeDiverExportApi.ts +4 -1
  60. package/src/resources/ShapeDiverFileApi.ts +8 -0
  61. package/src/resources/ShapeDiverGltfApi.ts +2 -1
  62. package/src/resources/ShapeDiverModelApi.ts +30 -13
  63. package/src/resources/ShapeDiverModelStateApi.ts +163 -0
  64. package/src/resources/ShapeDiverOutputApi.ts +10 -1
  65. package/src/resources/ShapeDiverSdtfApi.ts +8 -0
  66. package/src/resources/ShapeDiverSessionApi.ts +29 -0
  67. package/src/resources/ShapeDiverSystemApi.ts +2 -0
  68. package/src/resources/ShapeDiverTextureApi.ts +9 -1
  69. package/src/resources/ShapeDiverUtilsApi.ts +3 -3
@@ -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(sessionId: string): Promise<ShapeDiverResponseDto> {
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,