@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,80 +1,116 @@
1
1
  import {
2
- ShapeDiverRequestAuthorizationGroup,
3
- ShapeDiverRequestLogMessage,
4
- ShapeDiverResponseDto,
5
- } from "@shapediver/api.geometry-api-dto-v2"
6
- import { BaseResourceApi, ShapeDiverSdkApi } from "@shapediver/sdk.geometry-api-sdk-core"
7
- import { sendRequest } from "../utils/utils"
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
- constructor (api: ShapeDiverSdkApi) {
12
- super(api)
13
- }
14
-
15
- /**
16
- * Log the specified message.
17
- *
18
- * @param sessionId
19
- * @param body
20
- */
21
- async log (sessionId: string, body: ShapeDiverRequestLogMessage): Promise<ShapeDiverResponseDto> {
22
- return await sendRequest(async () =>
23
- (await this.api.post<ShapeDiverResponseDto>(this.buildSessionUri(sessionId) + "/log/message", body))[1],
24
- )
25
- }
26
-
27
- /**
28
- * Remove a model with all it's components.
29
- *
30
- * **WARNING: This operation cannot be undone!**
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
- * Decrypt the given ticket.
42
- *
43
- * @param ticket
44
- */
45
- async decryptTicket (ticket: string): Promise<ShapeDiverResponseDto> {
46
- return await sendRequest(async () =>
47
- (await this.api.get<ShapeDiverResponseDto>(this.buildTicketUri(ticket)))[1],
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
- * Create a new authentication group.
53
- *
54
- * @param body
55
- */
56
- async authGroup (body: ShapeDiverRequestAuthorizationGroup): Promise<ShapeDiverResponseDto> {
57
- return await sendRequest(async () =>
58
- (await this.api.post<ShapeDiverResponseDto>(this.buildAuthGroupUri(), body))[1],
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
- * Returns system information about the Geometry Minions.
64
- */
65
- async getMinionInfo (): Promise<ShapeDiverResponseDto> {
66
- return sendRequest(async () =>
67
- (await this.api.get<ShapeDiverResponseDto>(`${ this.buildSystemUri() }/minions/info`))[1],
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
- * Returns system information about the Geometry Workers.
73
- */
74
- async getWorkerInfo (): Promise<ShapeDiverResponseDto> {
75
- return sendRequest(async () =>
76
- (await this.api.get<ShapeDiverResponseDto>(`${ this.buildSystemUri() }/workers/info`))[1],
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 { BaseResourceApi, ShapeDiverSdkApi } from "@shapediver/sdk.geometry-api-sdk-core"
3
- import { sendRequest } from "../utils/utils"
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
- constructor (api: ShapeDiverSdkApi) {
8
- super(api)
9
- }
10
-
11
- /**
12
- * List all textures of the specified model.
13
- *
14
- * @param sessionId
15
- */
16
- async listModelTextures (sessionId: string): Promise<ShapeDiverResponseDto> {
17
- return await sendRequest(async () =>
18
- (await this.api.get<ShapeDiverResponseDto>(this.buildSessionUri(sessionId) + "/texture/list"))[1],
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
  }