@shapediver/sdk.geometry-api-sdk-v2 1.12.2 → 2.0.1

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 (137) hide show
  1. package/README.md +160 -60
  2. package/dist/UtilsApi.d.ts +20 -0
  3. package/dist/UtilsApi.d.ts.map +1 -0
  4. package/dist/UtilsApi.js +185 -0
  5. package/dist/UtilsApi.js.map +1 -0
  6. package/dist/client/api.d.ts +2117 -0
  7. package/dist/client/api.d.ts.map +1 -0
  8. package/dist/client/api.js +3473 -0
  9. package/dist/client/api.js.map +1 -0
  10. package/dist/client/base.d.ts +32 -0
  11. package/dist/client/base.d.ts.map +1 -0
  12. package/dist/client/base.js +37 -0
  13. package/dist/client/base.js.map +1 -0
  14. package/dist/client/common.d.ts +14 -0
  15. package/dist/client/common.d.ts.map +1 -0
  16. package/dist/client/common.js +108 -0
  17. package/dist/client/common.js.map +1 -0
  18. package/dist/client/configuration.d.ts +23 -0
  19. package/dist/client/configuration.d.ts.map +1 -0
  20. package/dist/client/configuration.js +21 -0
  21. package/dist/client/configuration.js.map +1 -0
  22. package/dist/client/index.d.ts +3 -0
  23. package/dist/client/index.d.ts.map +1 -0
  24. package/dist/client/index.js +19 -0
  25. package/dist/client/index.js.map +1 -0
  26. package/dist/configuration.d.ts +8 -0
  27. package/dist/configuration.d.ts.map +1 -0
  28. package/dist/configuration.js +22 -0
  29. package/dist/configuration.js.map +1 -0
  30. package/dist/error.d.ts +22 -0
  31. package/dist/error.d.ts.map +1 -0
  32. package/dist/error.js +48 -0
  33. package/dist/error.js.map +1 -0
  34. package/dist/index.d.ts +5 -6
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +5 -17
  37. package/dist/index.js.map +1 -1
  38. package/dist/utils.d.ts +12 -0
  39. package/dist/utils.d.ts.map +1 -0
  40. package/dist/utils.js +93 -0
  41. package/dist/utils.js.map +1 -0
  42. package/package.json +55 -57
  43. package/src/UtilsApi.ts +393 -0
  44. package/src/client/api.ts +14084 -0
  45. package/src/client/base.ts +86 -0
  46. package/src/client/common.ts +150 -0
  47. package/src/client/configuration.ts +110 -0
  48. package/src/client/index.ts +18 -0
  49. package/src/configuration.ts +27 -0
  50. package/src/error.ts +92 -0
  51. package/src/index.ts +5 -17
  52. package/src/utils.ts +126 -0
  53. package/dist/ShapeDiverErrors.d.ts +0 -10
  54. package/dist/ShapeDiverErrors.d.ts.map +0 -1
  55. package/dist/ShapeDiverErrors.js +0 -18
  56. package/dist/ShapeDiverErrors.js.map +0 -1
  57. package/dist/ShapeDiverSdk.d.ts +0 -48
  58. package/dist/ShapeDiverSdk.d.ts.map +0 -1
  59. package/dist/ShapeDiverSdk.js +0 -87
  60. package/dist/ShapeDiverSdk.js.map +0 -1
  61. package/dist/resources/ShapeDiverAnalyticsApi.d.ts +0 -12
  62. package/dist/resources/ShapeDiverAnalyticsApi.d.ts.map +0 -1
  63. package/dist/resources/ShapeDiverAnalyticsApi.js +0 -63
  64. package/dist/resources/ShapeDiverAnalyticsApi.js.map +0 -1
  65. package/dist/resources/ShapeDiverArSceneApi.d.ts +0 -8
  66. package/dist/resources/ShapeDiverArSceneApi.d.ts.map +0 -1
  67. package/dist/resources/ShapeDiverArSceneApi.js +0 -63
  68. package/dist/resources/ShapeDiverArSceneApi.js.map +0 -1
  69. package/dist/resources/ShapeDiverAssetApi.d.ts +0 -13
  70. package/dist/resources/ShapeDiverAssetApi.d.ts.map +0 -1
  71. package/dist/resources/ShapeDiverAssetApi.js +0 -131
  72. package/dist/resources/ShapeDiverAssetApi.js.map +0 -1
  73. package/dist/resources/ShapeDiverExportApi.d.ts +0 -10
  74. package/dist/resources/ShapeDiverExportApi.d.ts.map +0 -1
  75. package/dist/resources/ShapeDiverExportApi.js +0 -49
  76. package/dist/resources/ShapeDiverExportApi.js.map +0 -1
  77. package/dist/resources/ShapeDiverFileApi.d.ts +0 -15
  78. package/dist/resources/ShapeDiverFileApi.d.ts.map +0 -1
  79. package/dist/resources/ShapeDiverFileApi.js +0 -67
  80. package/dist/resources/ShapeDiverFileApi.js.map +0 -1
  81. package/dist/resources/ShapeDiverGltfApi.d.ts +0 -7
  82. package/dist/resources/ShapeDiverGltfApi.d.ts.map +0 -1
  83. package/dist/resources/ShapeDiverGltfApi.js +0 -32
  84. package/dist/resources/ShapeDiverGltfApi.js.map +0 -1
  85. package/dist/resources/ShapeDiverModelApi.d.ts +0 -22
  86. package/dist/resources/ShapeDiverModelApi.d.ts.map +0 -1
  87. package/dist/resources/ShapeDiverModelApi.js +0 -156
  88. package/dist/resources/ShapeDiverModelApi.js.map +0 -1
  89. package/dist/resources/ShapeDiverModelStateApi.d.ts +0 -14
  90. package/dist/resources/ShapeDiverModelStateApi.d.ts.map +0 -1
  91. package/dist/resources/ShapeDiverModelStateApi.js +0 -104
  92. package/dist/resources/ShapeDiverModelStateApi.js.map +0 -1
  93. package/dist/resources/ShapeDiverOutputApi.d.ts +0 -10
  94. package/dist/resources/ShapeDiverOutputApi.d.ts.map +0 -1
  95. package/dist/resources/ShapeDiverOutputApi.js +0 -52
  96. package/dist/resources/ShapeDiverOutputApi.js.map +0 -1
  97. package/dist/resources/ShapeDiverSdtfApi.d.ts +0 -10
  98. package/dist/resources/ShapeDiverSdtfApi.d.ts.map +0 -1
  99. package/dist/resources/ShapeDiverSdtfApi.js +0 -52
  100. package/dist/resources/ShapeDiverSdtfApi.js.map +0 -1
  101. package/dist/resources/ShapeDiverSessionApi.d.ts +0 -11
  102. package/dist/resources/ShapeDiverSessionApi.d.ts.map +0 -1
  103. package/dist/resources/ShapeDiverSessionApi.js +0 -66
  104. package/dist/resources/ShapeDiverSessionApi.js.map +0 -1
  105. package/dist/resources/ShapeDiverSystemApi.d.ts +0 -12
  106. package/dist/resources/ShapeDiverSystemApi.d.ts.map +0 -1
  107. package/dist/resources/ShapeDiverSystemApi.js +0 -63
  108. package/dist/resources/ShapeDiverSystemApi.js.map +0 -1
  109. package/dist/resources/ShapeDiverTextureApi.d.ts +0 -7
  110. package/dist/resources/ShapeDiverTextureApi.d.ts.map +0 -1
  111. package/dist/resources/ShapeDiverTextureApi.js +0 -31
  112. package/dist/resources/ShapeDiverTextureApi.js.map +0 -1
  113. package/dist/resources/ShapeDiverUtilsApi.d.ts +0 -18
  114. package/dist/resources/ShapeDiverUtilsApi.d.ts.map +0 -1
  115. package/dist/resources/ShapeDiverUtilsApi.js +0 -146
  116. package/dist/resources/ShapeDiverUtilsApi.js.map +0 -1
  117. package/dist/utils/utils.d.ts +0 -12
  118. package/dist/utils/utils.d.ts.map +0 -1
  119. package/dist/utils/utils.js +0 -109
  120. package/dist/utils/utils.js.map +0 -1
  121. package/src/ShapeDiverErrors.ts +0 -34
  122. package/src/ShapeDiverSdk.ts +0 -121
  123. package/src/resources/ShapeDiverAnalyticsApi.ts +0 -108
  124. package/src/resources/ShapeDiverArSceneApi.ts +0 -77
  125. package/src/resources/ShapeDiverAssetApi.ts +0 -241
  126. package/src/resources/ShapeDiverExportApi.ts +0 -103
  127. package/src/resources/ShapeDiverFileApi.ts +0 -150
  128. package/src/resources/ShapeDiverGltfApi.ts +0 -46
  129. package/src/resources/ShapeDiverModelApi.ts +0 -374
  130. package/src/resources/ShapeDiverModelStateApi.ts +0 -163
  131. package/src/resources/ShapeDiverOutputApi.ts +0 -109
  132. package/src/resources/ShapeDiverSdtfApi.ts +0 -103
  133. package/src/resources/ShapeDiverSessionApi.ts +0 -142
  134. package/src/resources/ShapeDiverSystemApi.ts +0 -118
  135. package/src/resources/ShapeDiverTextureApi.ts +0 -36
  136. package/src/resources/ShapeDiverUtilsApi.ts +0 -318
  137. package/src/utils/utils.ts +0 -135
package/README.md CHANGED
@@ -4,121 +4,220 @@
4
4
  </a>
5
5
  </p>
6
6
 
7
- # ShapeDiver Geometry Backend API - SDK v2
7
+ # GeometryBackendSdkTypeScript
8
8
 
9
- > :warning: **Version 1 is deprecated. Please upgrade to [v2](https://github.com/shapediver/GeometryBackendSdkTypeScript/tree/master/packages/sdk.geometry-api-sdk-v2) to receive the newest features - [Migration Guide](<https://help.shapediver.com/doc/geometry-backend-sdk-typescript-migration-guide#GeometryBackendSDKTypeScript-MigrationGuide-MigratingfromVersion1.x.xto2.x.x(03/11/2024)>).**
9
+ > :warning: **You might be looking for the [v1 docs](https://github.com/shapediver/GeometryBackendSdkTypeScript/tree/legacy/v1) - [Migration Guide](<https://help.shapediver.com/doc/geometry-backend-sdk-typescript-migration-guide#GeometryBackendSDKTypeScript-MigrationGuide-MigratingfromVersion1.x.xto2.x.x(03/11/2024)>).**
10
10
 
11
- [ShapeDiver](https://www.shapediver.com/) is a cloud platform for building online applications based on parametric 3D files made with Rhinoceros 3D and Grasshopper.
11
+ [ShapeDiver](https://www.shapediver.com/) is a cloud platform for building online applications
12
+ based on parametric 3D files made with [Rhinoceros 3D](https://www.rhino3d.com/) and
13
+ [Grasshopper](https://www.grasshopper3d.com/).
12
14
 
13
- Using the **ShapeDiver Geometry Backend API** allows accessing ShapeDiver models without using the **ShapeDiver Viewer**.
14
- The SDKs provide the functionality to communicate with a specific version of our Geometry Backend API, and they expose all TypeScript-types describing request and response objects.
15
-
16
- This SDK provides functionality to communicate with the **ShapeDiver Geometry Backend API v2** and exposes all TypeScript-types describing request and response objects.
17
- See the [API documentation](https://sdeuc1.eu-central-1.shapediver.com/api/v2/docs/) for more details.
15
+ Using the **ShapeDiver Geometry Backend API** allows access to ShapeDiver models without using the
16
+ **ShapeDiver Viewer**. This SDK provides functionality to communicate with the Geometry Backend API
17
+ **version 2**, and includes type hints describing request and response data objects. See the
18
+ [API documentation](https://sdeuc1.eu-central-1.shapediver.com/api/v2/docs/) for more details.
18
19
 
19
20
  ## Authentication
20
21
 
21
- The authentication system for the Geometry Backend API is based on **ticket objects** and **JWT tokens**, which are handled by the [ShapeDiver Platform](https://www.shapediver.com/app/).
22
- You can obtain **tickets** and **JWT tokens** by
22
+ The authentication system for the Geometry Backend API is based on **ticket objects** and **JWT
23
+ tokens**, which are handled by the [ShapeDiver Platform](https://www.shapediver.com/app/). You can
24
+ obtain **tickets** and **JWT tokens** by:
23
25
 
24
- - using your account on the [ShapeDiver Platform](https://www.shapediver.com/app/) (tickets only), or
25
- - you can obtain them programmatically using the [ShapeDiver Platform API](https://app.shapediver.com/api/documentation) (both tickets and JWT tokens).
26
+ - using your account on the [ShapeDiver Platform](https://www.shapediver.com/app/) (tickets only),
27
+ or
26
28
 
27
- An SDK for the [ShapeDiver Platform API](https://app.shapediver.com/api/documentation) will be released soon.
29
+ - you can obtain them programmatically using the [ShapeDiver Platform API](https://app.shapediver.com/api/documentation) (both tickets and JWT tokens).
28
30
 
29
- When obtaining a ticket for your model from the ShapeDiver Platform, please be aware that you will need a
31
+ An SDK for the [ShapeDiver Platform API](https://app.shapediver.com/api/documentation) will be
32
+ released soon.
30
33
 
31
- - _ticket for direct embedding_ in case you are accessing the Geometry Backend API from a web browser, or a
32
- - _ticket for backend access_ in case you are accessing the Geometry Backend API from an arbitrary client application that is not a web browser.
34
+ When obtaining a ticket for your model from the ShapeDiver Platform, please be aware that you will
35
+ need a _ticket for backend access_, since you are accessing the Geometry Backend API from an
36
+ arbitrary client application that is not a web browser. For more details see the [ShapeDiver
37
+ Help Center developer settings](https://help.shapediver.com/doc/developers-settings).
33
38
 
34
39
  ## Base URL
35
40
 
36
41
  The base URL to use depends on which ShapeDiver Geometry Backend System your model was uploaded to.
37
- You can find the base URL in your model's dashboard on the ShapeDiver Platform, it is also called the _model view url_.
42
+ You can find the base URL in your model's dashboard on the ShapeDiver Platform, it is also called
43
+ the _model view url_.
38
44
 
39
45
  ## Usage - Ticket only
40
46
 
41
- ```
42
- import { create } from "@shapediver/sdk.geometry-api-sdk-v2"
47
+ ```typescript
48
+ import {
49
+ Configuration,
50
+ SessionApi
51
+ } from '@shapediver/sdk.geometry-api-sdk-v2';
43
52
 
44
53
  (async function () {
45
- # Please see above on how to obtain a ticket
46
- const ticket = "8b23fae66cf535719a9ec797e390208b2003e3cfc894b7624ada2f6894515f8836a4-66303337623538322d34386"
54
+ // Please see above on how to obtain a ticket
55
+ const ticket = '8b23fae66cf535719a9ec797e390208b2003e3cfc894b7624ada2f6894515f8836a4-66303337623538322d34386';
47
56
 
48
- # Initialize the SDK by providing the base URL
49
- const sdk = create("https://sdeuc1.eu-central-1.shapediver.com")
57
+ // Initialize the SDK configuration instance by providing the base URL
58
+ const config = new Configuration({
59
+ basePath: 'https://sdeuc1.eu-central-1.shapediver.com'
60
+ });
50
61
 
51
- # This initializes a new session and returns your ShapeDiver Model and your session
52
- const res = await sdk.session.init(ticket)
53
- console.log(res)
54
- })()
62
+ // Initialize a new session using the ticket.
63
+ const res = (
64
+ await new SessionApi(config).createSessionByTicket(ticket)
65
+ ).data;
66
+
67
+ console.log(res);
68
+ })();
55
69
  ```
56
70
 
57
71
  ## Usage - Ticket and JWT
58
72
 
59
- It is possible to configure your ShapeDiver models such that JWT tokens are required to communicate with them, which provides a strong authorisation mechanism.
60
- In this case you will need to use the [ShapeDiver Platform API](https://app.shapediver.com/api/documentation) to obtain a JWT token for your model on demand.
73
+ It is possible to configure your ShapeDiver models such that JWT tokens are required to communicate
74
+ with them, which provides a strong authorisation mechanism. In this case you will need to use the
75
+ [ShapeDiver Platform API](https://app.shapediver.com/api/documentation) to obtain a JWT token for
76
+ your model on demand:
61
77
 
62
- ```
63
- import { create } from "@shapediver/sdk.geometry-api-sdk-v2"
78
+ ```typescript
79
+ import {
80
+ Configuration,
81
+ SessionApi
82
+ } from '@shapediver/sdk.geometry-api-sdk-v2';
64
83
 
65
84
  (async function () {
66
- # Please see above on how to obtain a ticket and a JWT
67
- const jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikp1c3QgYSB0ZXN0IiwiaWF0IjoxNjE4OTExMjcxLCJleHAiOjE2MTg5MTQ4OTcsImp0aSI6IjYzMjA3ODE3LWJiNWQtNDY3Zi04NzRkLWM4N2EyYzAxYmZlZCJ9.S5Ps_Fx5p6aJxdBOJMBKgpf2SIlp--6kkIZU55tiqEg"
68
- const ticket = "8b23fae66cf535719a9ec797e390208b2003e3cfc894b7624ada2f6894515f8836a4-66303337623538322d34386"
69
-
70
- # Initialize the SDK by providing the base URL and your JWT
71
- const sdk = create("https://sdeuc1.eu-central-1.shapediver.com", jwt)
72
-
73
- # This initializes a new session and returns your ShapeDiver Model and your session
74
- const res = await sdk.session.init(ticket)
75
- console.log(res)
76
- })()
85
+ // Please see above on how to obtain a ticket and a JWT.
86
+ const jwt = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikp1c3QgYSB0ZXN0IiwiaWF0IjoxNjE4OTExMjcxLCJleHAiOjE2MTg5MTQ4OTcsImp0aSI6IjYzMjA3ODE3LWJiNWQtNDY3Zi04NzRkLWM4N2EyYzAxYmZlZCJ9.S5Ps_Fx5p6aJxdBOJMBKgpf2SIlp--6kkIZU55tiqEg';
87
+ const ticket = '8b23fae66cf535719a9ec797e390208b2003e3cfc894b7624ada2f6894515f8836a4-66303337623538322d34386';
88
+
89
+ // Initialize the SDK client instance by providing the base URL
90
+ const config = new Configuration({
91
+ basePath: 'https://sdeuc1.eu-central-1.shapediver.com',
92
+ accessToken: jwt,
93
+ });
94
+
95
+ // Initialize a new session using the ticket.
96
+ const res = (
97
+ await new SessionApi(config).createSessionByTicket(ticket)
98
+ ).data;
99
+
100
+ console.log(res);
101
+ })();
77
102
  ```
78
103
 
79
104
  ## Handling Errors
80
105
 
81
- The SDK provides type guards to distinguish between error types.
106
+ The SDK provides a helper function to extract ShapeDiver error information from an `AxiosError`:
82
107
 
83
- ```
108
+ ```typescript
84
109
  import {
85
- isGBError,
86
- isGBGenericError,
87
- isGBRequestError,
88
- isGBResponseError,
110
+ processError,
111
+ SdError,
112
+ SdRequestError,
113
+ SdResponseError,
89
114
  } from "@shapediver/sdk.geometry-api-sdk-v2"
90
115
 
91
116
  try {
92
117
  sdk.model.get("be5d4ce5-f76d-417d-8496-1f038e6f0cab")
93
- catch (e: any) {
94
- if (isGBRequestError(e)) {
118
+ catch (err) {
119
+ const e = processError(err);
120
+
121
+ if (e instanceof SdRequestError) {
95
122
  // e is a request error.
96
123
  // In this case, the request was made but no response was received.
97
124
  }
98
125
 
99
- if (isGBResponseError(e)) {
126
+ if (e instanceof SdResponseError) {
100
127
  // e is a response error.
101
128
  // In this case, the request was made and the server responded with a status code that falls
102
129
  // out of the range of 2xx.
103
130
  }
104
131
 
105
- if (isGBGenericError(e)) {
132
+ if (e instanceof SdError) {
106
133
  // e is a generic error.
107
134
  // Generic errors are used for everything that is neither a request error nor a response error.
108
135
  }
109
-
110
- if (isGBError(e)) {
111
- // e is either a generic error, request error or response error.
112
- }
113
136
  }
114
137
  ```
115
138
 
116
139
  ## Examples
117
140
 
118
- Some practical use cases, we will regularly extend the list:
141
+ - For examples of interacting with SDK endpoints, refer to the [tests
142
+ directory](https://github.com/shapediver/GeometryBackendSdkTypeScript/tree/master/packages/sdk.geometry-api-sdk-v2/__tests__),
143
+ which provides detailed usage scenarios for each endpoint.
144
+
145
+ - [ShapeDiver CAD to sdTF and sdTF to glTF
146
+ Conversion](https://github.com/shapediver/TypeScriptSdkExample-sdTF-in-out): An example of using
147
+ the ShapeDiver backend to convert _CAD files to sdTF_ and _sdTF files to glTF_.
148
+
149
+ - [ShapeDiver CAD to glTF
150
+ Conversion](https://github.com/shapediver/TypeScriptSdkExample-glTF-Converter): An example of
151
+ using the ShapeDiver backend to convert _CAD files to glTF format_.
152
+
153
+ - [Command-Line Interface Example](https://github.com/shapediver/TypeScriptSdkExample-CLI): A simple
154
+ example demonstrating how to use the ShapeDiver TypeScript SDKs (_Platform SDK_ and _Geometry
155
+ Backend SDK_) within a CLI tool.
156
+
157
+ ## Making Changes & Contributing
158
+
159
+ Most of the code in this repository has been generated via the
160
+ [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator). The specification of the
161
+ Geometry Backend API version 2 can be found in the
162
+ [ShapeDiver
163
+ OAS](https://github.com/shapediver/OpenApiSpecifications/blob/main/geometry_backend_v2.yaml)
164
+ repository. Additionally, we have added wrappers and utility functions to improve overall
165
+ usability.
166
+
167
+ ### Setup
168
+
169
+ This project is written in _TypeScript_ and uses [PNPM](https://pnpm.io/) as a dependency manager.
170
+ Project-specific commands are handled either via [NPM](https://docs.npmjs.com/cli/v8) or
171
+ [just](https://github.com/casey/just), so make sure that both tools are installed. To get an
172
+ overview of all available commands run `npm run -l` and `just --list`.
173
+
174
+ Run the following commands to install all dependencies:
175
+
176
+ ```bash
177
+ npm run init
178
+ ```
179
+
180
+ ## Generate Code
181
+
182
+ To re-generate the code from the
183
+ [ShapeDiver
184
+ OAS](https://github.com/shapediver/OpenApiSpecifications/blob/main/geometry_backend_v2.yaml)
185
+ file, you need to install version 7 of the
186
+ [OpenAPI
187
+ Generator](https://github.com/OpenAPITools/openapi-generator?tab=readme-ov-file#1---installation).
188
+ We recommend installing it as a global NPM package:
189
+
190
+ ```bash
191
+ npm i -g openapi-generator
192
+ ```
193
+
194
+ Afterwards, update the local file `./oas_spec.yaml` and generate the new code via
195
+ `just generate <version>`. The _version_ argument represents the respective Git tag from
196
+ [ShapeDiver OAS](https://github.com/shapediver/OpenApiSpecifications/tags). For instance, use
197
+ version "1.0.0" when targeting the Git tag "gb_v2@1.0.0".
198
+
199
+ Alternatively, the client can be generated from a local file. Check out the [ShapeDiver OAS
200
+ repository](https://github.com/shapediver/OpenApiSpecifications) and run `just generate local`.
201
+
202
+ ## Release
203
+
204
+ Before releasing a new versions of this package ensure that you have configured everything in your
205
+ `~/.npmrc` file. Afterwards, run `npm run publish` and follow the CLI to build, publish, and commit
206
+ a new version of the TypeScript package.
207
+ Before releasing a new version of this package, ensure that your `~/.npmrc` file is fully
208
+ configured. Then, run `npm run publish` and follow the CLI instructions to build, publish, and
209
+ commit the new version of the TypeScript package.
210
+
211
+ ## Test
212
+
213
+ Unit and integration tests can be executed via `npm run test`. However, should you want to run only
214
+ a single test file then run `npx jest -i --forceExit <path>` within the package instead.
215
+
216
+ ## Versioning
119
217
 
120
- - [A Twitter Bot calling a ShapeDiver Model](https://github.com/shapediver/ServerlessExample-TwitterBot):
121
- This example shows how to run computations using a ShapeDiver Model which has image and data inputs and outputs.
218
+ We take care to provide backwards compatibility for all older versions.
219
+ However, new features might be limited to newer API versions.
220
+ Therefore, we recommend always using the newest API version out there.
122
221
 
123
222
  ## Support
124
223
 
@@ -128,4 +227,5 @@ You can find out more about ShapeDiver [right here](https://www.shapediver.com/)
128
227
 
129
228
  ## Licensing
130
229
 
131
- This project is released under the [MIT License](https://github.com/shapediver/GeometryBackendSdkTypeScript/blob/master/packages/sdk.geometry-api-sdk-v2/LICENSE).
230
+ This project is released under the [MIT
231
+ License](https://github.com/shapediver/GeometryBackendSdkTypeScript/blob/master/LICENSE).
@@ -0,0 +1,20 @@
1
+ import { AxiosInstance, AxiosPromise, RawAxiosRequestConfig } from 'axios';
2
+ import { Configuration, ReqCustomization, ReqExport, ResAssetUploadHeaders, ResComputeExports, ResComputeOutputs } from './client';
3
+ import { BaseAPI } from './client/base';
4
+ export declare class UtilsApi extends BaseAPI {
5
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
6
+ upload(url: string, data: string | Record<string, any> | ArrayBuffer | File, contentType: string, filename?: string, options?: RawAxiosRequestConfig): AxiosPromise<unknown>;
7
+ uploadAsset(url: string, data: string | Record<string, any> | ArrayBuffer | File, headers: ResAssetUploadHeaders, options?: RawAxiosRequestConfig): AxiosPromise<unknown>;
8
+ download(url: string, options?: RawAxiosRequestConfig): AxiosPromise<File>;
9
+ downloadAsset(url: string, options?: RawAxiosRequestConfig): [AxiosPromise<File>, 'export' | 'output' | 'texture'];
10
+ downloadImage(sessionId: string, url: string, options?: RawAxiosRequestConfig): AxiosPromise<File>;
11
+ submitAndWaitForOutput(sessionId: string, body: ReqCustomization, maxWaitMsec?: number, options?: RawAxiosRequestConfig): Promise<ResComputeOutputs>;
12
+ submitAndWaitForExport(sessionId: string, body: ReqExport, maxWaitMsec?: number, options?: RawAxiosRequestConfig): Promise<ResComputeExports>;
13
+ private waitForOutputResult;
14
+ private waitForExportResult;
15
+ private getMaxOutputDelay;
16
+ private getMaxExportDelay;
17
+ private buildRequest;
18
+ private disableAuthHeaderForShapeDiverUris;
19
+ }
20
+ //# sourceMappingURL=UtilsApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UtilsApi.d.ts","sourceRoot":"","sources":["../src/UtilsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAA0B,MAAM,OAAO,CAAC;AAEnG,OAAO,EAEH,aAAa,EAIb,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAKpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAe,MAAM,eAAe,CAAC;AAkBrD,qBAAa,QAAS,SAAQ,OAAO;gBACrB,aAAa,CAAC,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,aAAa;IAY5E,MAAM,CACT,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,WAAW,GAAG,IAAI,EACvD,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAChC,YAAY,CAAC,OAAO,CAAC;IAsBjB,WAAW,CACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,WAAW,GAAG,IAAI,EACvD,OAAO,EAAE,qBAAqB,EAC9B,OAAO,CAAC,EAAE,qBAAqB,GAChC,YAAY,CAAC,OAAO,CAAC;IAqBjB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,YAAY,CAAC,IAAI,CAAC;IAY1E,aAAa,CAChB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,qBAAqB,GAChC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAwBjD,aAAa,CAChB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,qBAAqB,GAChC,YAAY,CAAC,IAAI,CAAC;IAwBR,sBAAsB,CAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,gBAAgB,EACtB,WAAW,SAAK,EAChB,OAAO,CAAC,EAAE,qBAAqB,GAChC,OAAO,CAAC,iBAAiB,CAAC;IAqBhB,sBAAsB,CAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,SAAS,EACf,WAAW,SAAK,EAChB,OAAO,CAAC,EAAE,qBAAqB,GAChC,OAAO,CAAC,iBAAiB,CAAC;YAqBf,mBAAmB;YAsDnB,mBAAmB;IAuCjC,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,iBAAiB;IA0BzB,OAAO,CAAC,YAAY;IA2BpB,OAAO,CAAC,kCAAkC;CAW7C"}
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UtilsApi = void 0;
13
+ const common_1 = require("./client/common");
14
+ const client_1 = require("./client");
15
+ const base_1 = require("./client/base");
16
+ const utils_1 = require("./utils");
17
+ const error_1 = require("./error");
18
+ const apiAssetExportUri = /.+\/session\/.+\/export\/.+/;
19
+ const apiAssetOutputUri = /.+\/session\/.+\/output\/.+/;
20
+ const apiAssetTextureUri = /.+\/session\/.+\/texture\/.+/;
21
+ const cdnAssetUri = /.+\/cdn-asset-(exports|outputs|textures)\/.+/;
22
+ const cdnAssetExportUri = /.+\/cdn-asset-exports\/.+/;
23
+ const cdnAssetOutputUri = /.+\/cdn-asset-outputs\/.+/;
24
+ const cdnAssetTextureUri = /.+\/cdn-asset-textures\/.+/;
25
+ const directDownloadUri = /^(http[s]?:\/\/)?(viewer|textures|downloads)\.shapediver\.com(\/.*)?$/;
26
+ class UtilsApi extends base_1.BaseAPI {
27
+ constructor(configuration, basePath, axios) {
28
+ super(configuration, basePath, axios);
29
+ }
30
+ upload(url, data, contentType, filename, options) {
31
+ const reqHeaders = {
32
+ Authorization: undefined,
33
+ 'Content-Type': contentType,
34
+ };
35
+ if (filename)
36
+ reqHeaders['Content-Disposition'] = (0, utils_1.contentDispositionFromFilename)(filename);
37
+ const reqOptions = Object.assign({}, options);
38
+ reqOptions.headers = Object.assign(Object.assign({}, reqHeaders), options === null || options === void 0 ? void 0 : options.headers);
39
+ const request = this.buildRequest('PUT', url, data, reqOptions)();
40
+ return request();
41
+ }
42
+ uploadAsset(url, data, headers, options) {
43
+ const reqHeaders = {
44
+ Authorization: undefined,
45
+ 'Content-Type': headers.contentType,
46
+ };
47
+ if (headers.contentDisposition)
48
+ reqHeaders['Content-Disposition'] = headers.contentDisposition;
49
+ const reqOptions = Object.assign({}, options);
50
+ reqOptions.headers = Object.assign(Object.assign({}, reqHeaders), options === null || options === void 0 ? void 0 : options.headers);
51
+ const request = this.buildRequest('PUT', url, data, reqOptions)();
52
+ return request();
53
+ }
54
+ download(url, options) {
55
+ const request = this.buildRequest('GET', url, undefined, options)();
56
+ return request();
57
+ }
58
+ downloadAsset(url, options) {
59
+ let type;
60
+ this.disableAuthHeaderForShapeDiverUris(url, options);
61
+ if (apiAssetExportUri.test(url) || cdnAssetExportUri.test(url))
62
+ type = 'export';
63
+ else if (apiAssetOutputUri.test(url) || cdnAssetOutputUri.test(url))
64
+ type = 'output';
65
+ else if (apiAssetTextureUri.test(url) || cdnAssetTextureUri.test(url))
66
+ type = 'texture';
67
+ else {
68
+ throw new error_1.IllegalArgumentError(`Cannot fetch asset: Invalid URL '${url}' - Only ShapeDiver asset URLs are allowed.`);
69
+ }
70
+ return [this.download(url, options), type];
71
+ }
72
+ downloadImage(sessionId, url, options) {
73
+ this.disableAuthHeaderForShapeDiverUris(url, options);
74
+ if (apiAssetTextureUri.test(url) ||
75
+ cdnAssetTextureUri.test(url) ||
76
+ directDownloadUri.test(url)) {
77
+ return this.download(url, options);
78
+ }
79
+ else {
80
+ return new client_1.AssetsApi(this.configuration).downloadImage(sessionId, url, options);
81
+ }
82
+ }
83
+ submitAndWaitForOutput(sessionId_1, body_1) {
84
+ return __awaiter(this, arguments, void 0, function* (sessionId, body, maxWaitMsec = -1, options) {
85
+ const startMsec = Date.now();
86
+ const dto = (yield new client_1.OutputApi(this.configuration).computeOutputs(sessionId, body, options)).data;
87
+ const waitMsec = Date.now() - startMsec;
88
+ maxWaitMsec = maxWaitMsec < 0 ? maxWaitMsec : Math.max(0, maxWaitMsec - waitMsec);
89
+ return this.waitForOutputResult(sessionId, dto, maxWaitMsec, options);
90
+ });
91
+ }
92
+ submitAndWaitForExport(sessionId_1, body_1) {
93
+ return __awaiter(this, arguments, void 0, function* (sessionId, body, maxWaitMsec = -1, options) {
94
+ const startMsec = Date.now();
95
+ const dto = (yield new client_1.ExportApi(this.configuration).computeExports(sessionId, body, options)).data;
96
+ const waitMsec = Date.now() - startMsec;
97
+ maxWaitMsec = maxWaitMsec < 0 ? maxWaitMsec : Math.max(0, maxWaitMsec - waitMsec);
98
+ return this.waitForExportResult(sessionId, body, dto, maxWaitMsec, options);
99
+ });
100
+ }
101
+ waitForOutputResult(sessionId, dto, maxWaitMsec, options) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ if (!dto.outputs)
104
+ return dto;
105
+ const outputVersions = {};
106
+ Object.keys(dto.outputs).forEach((id) => (outputVersions[id] = dto.outputs[id].version));
107
+ let delay = this.getMaxOutputDelay(dto);
108
+ const startMsec = Date.now();
109
+ while (delay > 0) {
110
+ if (maxWaitMsec >= 0) {
111
+ const waitMsec = Date.now() - startMsec;
112
+ if (waitMsec >= maxWaitMsec) {
113
+ throw new error_1.TimeoutError(`Maximum wait time of ${maxWaitMsec} ms reached`);
114
+ }
115
+ if (waitMsec + delay > maxWaitMsec) {
116
+ delay = maxWaitMsec - waitMsec;
117
+ }
118
+ }
119
+ yield (0, utils_1.sleep)(delay);
120
+ dto = (yield new client_1.OutputApi(this.configuration).getCachedOutputs(sessionId, outputVersions, options)).data;
121
+ delay = this.getMaxOutputDelay(dto);
122
+ }
123
+ return dto;
124
+ });
125
+ }
126
+ waitForExportResult(sessionId, body, dto, maxWaitMsec, options) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ let delay = this.getMaxExportDelay(body, dto);
129
+ const startMsec = Date.now();
130
+ while (delay > 0) {
131
+ if (maxWaitMsec >= 0) {
132
+ const waitMsec = Date.now() - startMsec;
133
+ if (waitMsec >= maxWaitMsec) {
134
+ throw new error_1.TimeoutError(`Maximum wait time of ${maxWaitMsec} ms reached`);
135
+ }
136
+ if (waitMsec + delay > maxWaitMsec) {
137
+ delay = maxWaitMsec - waitMsec;
138
+ }
139
+ }
140
+ yield (0, utils_1.sleep)(delay);
141
+ dto = (yield new client_1.ExportApi(this.configuration).getCachedExports(sessionId, body, options)).data;
142
+ delay = this.getMaxExportDelay(body, dto);
143
+ }
144
+ return dto;
145
+ });
146
+ }
147
+ getMaxOutputDelay(dto) {
148
+ var _a;
149
+ return Math.max(...Object.values((_a = dto.outputs) !== null && _a !== void 0 ? _a : {}).map((output) => { var _a; return (_a = output.delay) !== null && _a !== void 0 ? _a : -1; }), -1);
150
+ }
151
+ getMaxExportDelay(body, dto) {
152
+ var _a, _b, _c, _d;
153
+ const exports = (_a = body.exports) !== null && _a !== void 0 ? _a : [];
154
+ const outputs = (_b = body.outputs) !== null && _b !== void 0 ? _b : [];
155
+ return Math.max(...Object.values((_c = dto.exports) !== null && _c !== void 0 ? _c : {})
156
+ .filter((e) => exports.includes(e.id))
157
+ .map((e) => { var _a; return (_a = e.delay) !== null && _a !== void 0 ? _a : -1; }), ...Object.values((_d = dto.outputs) !== null && _d !== void 0 ? _d : {})
158
+ .filter((o) => outputs.includes(o.id))
159
+ .map((o) => { var _a; return (_a = o.delay) !== null && _a !== void 0 ? _a : -1; }), -1);
160
+ }
161
+ buildRequest(method, url, data, options = {}) {
162
+ return (basePath = '') => {
163
+ var _a, _b, _c;
164
+ const baseOptions = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.baseOptions) !== null && _b !== void 0 ? _b : {};
165
+ const baseHeaders = baseOptions && baseOptions.headers ? baseOptions.headers : {};
166
+ const reqOptions = Object.assign(Object.assign({ method }, baseOptions), options);
167
+ reqOptions.headers = Object.assign(Object.assign({}, baseHeaders), options.headers);
168
+ if (!reqOptions.data && data) {
169
+ const configuration = (_c = this.configuration) !== null && _c !== void 0 ? _c : new client_1.Configuration();
170
+ reqOptions.data = (0, common_1.serializeDataIfNeeded)(data, reqOptions, configuration);
171
+ }
172
+ const axiosArgs = { url, options: reqOptions };
173
+ return (0, common_1.createRequestFunction)(axiosArgs, this.axios, basePath, this.configuration).bind(this.axios);
174
+ };
175
+ }
176
+ disableAuthHeaderForShapeDiverUris(url, options) {
177
+ var _a;
178
+ options = Object.assign({}, options);
179
+ if (!((_a = options.headers) === null || _a === void 0 ? void 0 : _a.Authorization) &&
180
+ (cdnAssetUri.test(url) || directDownloadUri.test(url)))
181
+ options.headers = Object.assign({ Authorization: undefined }, options.headers);
182
+ }
183
+ }
184
+ exports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