@hahnpro/hpc-api 2024.4.0-0 → 2024.4.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.
- package/CHANGELOG.md +383 -0
- package/README.md +11 -0
- package/package.json +4 -5
- package/src/lib/http.service.d.ts +1 -1
- package/src/lib/http.service.js +9 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
# @hahnpro/hpc-api
|
|
2
|
+
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- This package now follows a calendar versioning scheme and is tied to the HahnPRO Cloud version.
|
|
8
|
+
|
|
9
|
+
## 6.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- df8453d: # Overview
|
|
14
|
+
|
|
15
|
+
Multiple ways of providing an authentication token have been added.
|
|
16
|
+
|
|
17
|
+
A token can be provided to the `HttpClient` by calling `provideExternalToken(...)`, this token will be used for API-Calls,
|
|
18
|
+
instead of getting a token directly using the User-Id and Secret.
|
|
19
|
+
|
|
20
|
+
Another option ist providing a token directly at an API-Call. For this, a new Option has been added to every API method.
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
await api.assets.getOne('someId', { token: 'TOKEN' });
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The third option is to overwrite the `getAccessToken()` method of the `HttpClient`.
|
|
27
|
+
|
|
28
|
+
The hierarchy of options is:
|
|
29
|
+
|
|
30
|
+
1. token from api-call
|
|
31
|
+
2. token from `provideExternalToken`
|
|
32
|
+
3. token from `getAccessToken`
|
|
33
|
+
|
|
34
|
+
# Breaking Changes
|
|
35
|
+
|
|
36
|
+
1. The signature of `flowDeployments::updateOne` has been changed. The positional parameter `force` is now part of the `options` object (where you can also provide a token as described above).
|
|
37
|
+
|
|
38
|
+
## 5.3.4
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- d3e7ca1: Updated dependencies to reduce vulnerabilities
|
|
43
|
+
|
|
44
|
+
## 5.3.3
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- ef6ee56: added missing asset-type-service init to Mock-API
|
|
49
|
+
|
|
50
|
+
## 5.3.2
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- b783a01: Updated dependencies to reduce vulnerabilities
|
|
55
|
+
|
|
56
|
+
## 5.3.1
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- 74b888f: Updated dependencies to reduce vulnerabilities
|
|
61
|
+
|
|
62
|
+
## 5.3.0
|
|
63
|
+
|
|
64
|
+
### Minor Changes
|
|
65
|
+
|
|
66
|
+
- 0ce38af: Allow Flow-Deployments to be run with owners permissions
|
|
67
|
+
|
|
68
|
+
## 5.2.8
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- 4a1d52d: updated axios for vulnerability
|
|
73
|
+
|
|
74
|
+
## 5.2.7
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- 713ccbd: Updated dependencies to reduce vulnerabilities
|
|
79
|
+
|
|
80
|
+
## 5.2.6
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- 6c7abb2: Updated dependencies to reduce vulnerabilities
|
|
85
|
+
|
|
86
|
+
## 5.2.5
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- a6eebf2: Updated dependencies to reduce vulnerabilities
|
|
91
|
+
|
|
92
|
+
## 5.2.4
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- f93e4f9: Updated dependencies to reduce vulnerabilities
|
|
97
|
+
|
|
98
|
+
## 5.2.3
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- 39b5f50: Updated dependencies to reduce vulnerabilities
|
|
103
|
+
|
|
104
|
+
## 5.2.2
|
|
105
|
+
|
|
106
|
+
- Fixed getFilterString method for api services to filter out null and undefined values
|
|
107
|
+
|
|
108
|
+
## 5.2.1
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- a431b4f: Added type check to getFilterString function
|
|
113
|
+
|
|
114
|
+
## 5.2.0
|
|
115
|
+
|
|
116
|
+
### Minor Changes
|
|
117
|
+
|
|
118
|
+
- e4a9f4d: Added addManyAssetTimeSeriesValues method to TimeSeries API service
|
|
119
|
+
|
|
120
|
+
## 5.1.0
|
|
121
|
+
|
|
122
|
+
### Minor Changes
|
|
123
|
+
|
|
124
|
+
- f0c4d8d: extend filters of getManyFiltered() + improve mock api
|
|
125
|
+
|
|
126
|
+
## 5.0.0
|
|
127
|
+
|
|
128
|
+
### Major Changes
|
|
129
|
+
|
|
130
|
+
- 19af51f: Updated dependencies to reduce vulnerabilities
|
|
131
|
+
|
|
132
|
+
**Breaking changes**
|
|
133
|
+
|
|
134
|
+
- Raise minimum Node.js version to v18 for hpc-api and flow-sdk packages
|
|
135
|
+
|
|
136
|
+
## 4.1.2
|
|
137
|
+
|
|
138
|
+
### Patch Changes
|
|
139
|
+
|
|
140
|
+
- f86bcac: Updated dependencies to reduce vulnerabilities
|
|
141
|
+
|
|
142
|
+
## 4.1.1
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- eb65f7f: Fixed build target to make api-package compatible with tools that use older language versions (i.e. cypress)
|
|
147
|
+
|
|
148
|
+
## 4.1.0
|
|
149
|
+
|
|
150
|
+
### Minor Changes
|
|
151
|
+
|
|
152
|
+
- 621277d: add event level override functions to asset service
|
|
153
|
+
|
|
154
|
+
## 4.0.2
|
|
155
|
+
|
|
156
|
+
### Patch Changes
|
|
157
|
+
|
|
158
|
+
- cdcd295: add new property to notification service
|
|
159
|
+
|
|
160
|
+
## 4.0.1
|
|
161
|
+
|
|
162
|
+
### Patch Changes
|
|
163
|
+
|
|
164
|
+
- 92673bb: Updated dependencies to reduce vulnerabilities
|
|
165
|
+
|
|
166
|
+
## 4.0.0
|
|
167
|
+
|
|
168
|
+
### Major Changes
|
|
169
|
+
|
|
170
|
+
- a7ea37b: Removed deprecated API methods and properties
|
|
171
|
+
|
|
172
|
+
### Minor Changes
|
|
173
|
+
|
|
174
|
+
- a7ea37b: Allow API HttpClient to be provided
|
|
175
|
+
|
|
176
|
+
## 3.8.1
|
|
177
|
+
|
|
178
|
+
### Patch Changes
|
|
179
|
+
|
|
180
|
+
- 75c87ab: fixed addition of timeseries values and events in mock api
|
|
181
|
+
|
|
182
|
+
## 3.8.0
|
|
183
|
+
|
|
184
|
+
### Minor Changes
|
|
185
|
+
|
|
186
|
+
- 6cd509a: Added notification endpoint to create and update notifications
|
|
187
|
+
|
|
188
|
+
## 3.7.1
|
|
189
|
+
|
|
190
|
+
### Patch Changes
|
|
191
|
+
|
|
192
|
+
- 1b1b2d0: Fixed auth token expiration check
|
|
193
|
+
|
|
194
|
+
## 3.7.0
|
|
195
|
+
|
|
196
|
+
### Minor Changes
|
|
197
|
+
|
|
198
|
+
- 7159fd4: Added API function to get Asset Attachments
|
|
199
|
+
|
|
200
|
+
## 3.6.7
|
|
201
|
+
|
|
202
|
+
### Patch Changes
|
|
203
|
+
|
|
204
|
+
- d6e655c: Updated dependencies to reduce vulnerabilities
|
|
205
|
+
|
|
206
|
+
## 3.6.6
|
|
207
|
+
|
|
208
|
+
### Patch Changes
|
|
209
|
+
|
|
210
|
+
- b53dd91: fix addition of timeseries values in mock api
|
|
211
|
+
|
|
212
|
+
## 3.6.5
|
|
213
|
+
|
|
214
|
+
### Patch Changes
|
|
215
|
+
|
|
216
|
+
- b5c2b74: Updated dependencies to reduce vulnerabilities
|
|
217
|
+
|
|
218
|
+
## 3.6.4
|
|
219
|
+
|
|
220
|
+
### Patch Changes
|
|
221
|
+
|
|
222
|
+
- f445b96: Fixes issue with http response encoding/transformation by downgrading axios
|
|
223
|
+
|
|
224
|
+
## 3.6.3
|
|
225
|
+
|
|
226
|
+
### Patch Changes
|
|
227
|
+
|
|
228
|
+
- 827a101: Updated dependencies to reduce vulnerabilities
|
|
229
|
+
|
|
230
|
+
## 3.6.2
|
|
231
|
+
|
|
232
|
+
### Patch Changes
|
|
233
|
+
|
|
234
|
+
- c40f5c5: updated dependencies to reduce vulnerabilities
|
|
235
|
+
|
|
236
|
+
## 3.6.1
|
|
237
|
+
|
|
238
|
+
### Patch Changes
|
|
239
|
+
|
|
240
|
+
- bcc1b60: Fixed bug where wrong endpoint was called when requesting flow diagram revisions. The flow revisions endpoint was called instead.
|
|
241
|
+
|
|
242
|
+
## 3.6.0
|
|
243
|
+
|
|
244
|
+
### Minor Changes
|
|
245
|
+
|
|
246
|
+
- 6a5ab51: fix vault base path
|
|
247
|
+
|
|
248
|
+
## 3.5.0
|
|
249
|
+
|
|
250
|
+
### Minor Changes
|
|
251
|
+
|
|
252
|
+
- f2b8d05: add vault endpoint to create and get secrets
|
|
253
|
+
|
|
254
|
+
## 3.4.4
|
|
255
|
+
|
|
256
|
+
### Patch Changes
|
|
257
|
+
|
|
258
|
+
- 29eb88e: changed over to uuid package for uuid generation. as crypto package is not usable in a cross-platform manner.
|
|
259
|
+
|
|
260
|
+
## 3.4.3
|
|
261
|
+
|
|
262
|
+
### Patch Changes
|
|
263
|
+
|
|
264
|
+
- 6ce20bb: Migrated form openid-client to custom auth implementation, to make the api package browser compatible
|
|
265
|
+
|
|
266
|
+
## 3.4.2
|
|
267
|
+
|
|
268
|
+
### Patch Changes
|
|
269
|
+
|
|
270
|
+
- fa3bf33: Fixes base path of authorization url for HPC API
|
|
271
|
+
|
|
272
|
+
## 3.4.1
|
|
273
|
+
|
|
274
|
+
### Patch Changes
|
|
275
|
+
|
|
276
|
+
- e5202b0: Added paused status to FlowDeploymentService::updateStatus
|
|
277
|
+
|
|
278
|
+
## 3.4.0
|
|
279
|
+
|
|
280
|
+
### Minor Changes
|
|
281
|
+
|
|
282
|
+
- 675a239: Use the more secure client_secret_jwt authentication method for authenticating service accounts against the HPC API
|
|
283
|
+
|
|
284
|
+
## 3.3.0
|
|
285
|
+
|
|
286
|
+
### Minor Changes
|
|
287
|
+
|
|
288
|
+
- 8bd0141: added trash endpoint for all supported resources
|
|
289
|
+
|
|
290
|
+
## 3.2.1
|
|
291
|
+
|
|
292
|
+
### Patch Changes
|
|
293
|
+
|
|
294
|
+
- e0868c0: added createdAt and updatedAt attributes to Event interface
|
|
295
|
+
|
|
296
|
+
## 3.2.0
|
|
297
|
+
|
|
298
|
+
### Minor Changes
|
|
299
|
+
|
|
300
|
+
- 966f2e2: added label service for communication with labels API
|
|
301
|
+
|
|
302
|
+
## 3.1.0
|
|
303
|
+
|
|
304
|
+
### Minor Changes
|
|
305
|
+
|
|
306
|
+
- d95c007: added function for interaction with asset-paperbin API
|
|
307
|
+
|
|
308
|
+
## 3.0.0
|
|
309
|
+
|
|
310
|
+
### Major Changes
|
|
311
|
+
|
|
312
|
+
- 2c6d6f9: added revision functionality for AM and FS
|
|
313
|
+
- added _getRevisions_, _rollback_ and _deleteRevision_ methods to the services of assets, assettypes, flow-functions and flows
|
|
314
|
+
- **BREAKING** renamed _findRevisions_ of asset service to _getRevisions_
|
|
315
|
+
- **BREAKING** renamed old _getRevisions_ method of flow service to _getDiagramRevisions_
|
|
316
|
+
- **BREAKING** removed _getOneWithHistory_ method of flow-function service and the history and current attributes of flow-functions (use _getRevisions_ instead)
|
|
317
|
+
|
|
318
|
+
## 2.3.1
|
|
319
|
+
|
|
320
|
+
### Patch Changes
|
|
321
|
+
|
|
322
|
+
- 3e3ee84: fixed from wrong date access function to valueof
|
|
323
|
+
|
|
324
|
+
## 2.3.0
|
|
325
|
+
|
|
326
|
+
### Minor Changes
|
|
327
|
+
|
|
328
|
+
- 1edd4da: Added function to flow-service to get flow revisions and function to check if a deployment is on the latest version
|
|
329
|
+
|
|
330
|
+
## 2.2.0
|
|
331
|
+
|
|
332
|
+
### Minor Changes
|
|
333
|
+
|
|
334
|
+
- eac4dea: Added functions for flow-service
|
|
335
|
+
|
|
336
|
+
## 2.1.1
|
|
337
|
+
|
|
338
|
+
### Patch Changes
|
|
339
|
+
|
|
340
|
+
- 8edcf1c: fixed breaking change in mock-api
|
|
341
|
+
|
|
342
|
+
## 2.1.0
|
|
343
|
+
|
|
344
|
+
### Minor Changes
|
|
345
|
+
|
|
346
|
+
- 5c2c1c6: feat: added findRevisions to the asset service
|
|
347
|
+
|
|
348
|
+
## 2.0.0
|
|
349
|
+
|
|
350
|
+
### Major Changes
|
|
351
|
+
|
|
352
|
+
- d16e8fc: Updated the interface types to reflect changes to the Assettypes in the HPC-API.
|
|
353
|
+
|
|
354
|
+
## 1.1.0
|
|
355
|
+
|
|
356
|
+
### Minor Changes
|
|
357
|
+
|
|
358
|
+
- 85cc9d7: add assetId and assetName to endpoint api and combine parameters to a single object
|
|
359
|
+
|
|
360
|
+
## 1.0.3
|
|
361
|
+
|
|
362
|
+
### Patch Changes
|
|
363
|
+
|
|
364
|
+
- dac742f: changed Mock-API init types to be dependent on real types
|
|
365
|
+
|
|
366
|
+
## 1.0.2
|
|
367
|
+
|
|
368
|
+
### Patch Changes
|
|
369
|
+
|
|
370
|
+
- Improve handling of API_BASE_URL and API_BASE_PATH environment variables
|
|
371
|
+
|
|
372
|
+
## 1.0.1
|
|
373
|
+
|
|
374
|
+
### Patch Changes
|
|
375
|
+
|
|
376
|
+
- 507dd6e: Added tags to Assettype interface
|
|
377
|
+
- ab04943: Add timeout for http request queue operations
|
|
378
|
+
|
|
379
|
+
## 1.0.0
|
|
380
|
+
|
|
381
|
+
### Major Changes
|
|
382
|
+
|
|
383
|
+
- 205b556: Split API from main SDK package to its own package.
|
package/README.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hahnpro/hpc-api",
|
|
3
|
-
"version": "2024.4.0-
|
|
3
|
+
"version": "2024.4.0-1",
|
|
4
4
|
"description": "Module for easy access to the HahnPRO Cloud API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -9,16 +9,15 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"axios": "1.7.9",
|
|
12
|
-
"eventsource": "
|
|
12
|
+
"eventsource": "3.0.2",
|
|
13
13
|
"form-data": "4.0.1",
|
|
14
14
|
"jose": "5.9.6",
|
|
15
15
|
"jwt-decode": "4.0.0",
|
|
16
|
-
"p-queue": "
|
|
16
|
+
"p-queue": "8.1.0",
|
|
17
17
|
"ts-mixer": "6.0.4",
|
|
18
18
|
"tslib": "2.8.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@types/eventsource": "1.1.15",
|
|
22
21
|
"axios-mock-adapter": "2.1.0"
|
|
23
22
|
},
|
|
24
23
|
"engines": {
|
|
@@ -26,6 +25,6 @@
|
|
|
26
25
|
},
|
|
27
26
|
"main": "./src/index.js",
|
|
28
27
|
"types": "./src/index.d.ts",
|
|
29
|
-
"module": "./
|
|
28
|
+
"module": "./src/index.js",
|
|
30
29
|
"type": "module"
|
|
31
30
|
}
|
package/src/lib/http.service.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { stringify } from 'querystring';
|
|
2
1
|
import axios from 'axios';
|
|
3
|
-
import EventSource from 'eventsource';
|
|
2
|
+
import { EventSource } from 'eventsource';
|
|
4
3
|
import { CompactSign, decodeJwt } from 'jose';
|
|
5
4
|
import { Queue } from './Queue';
|
|
6
5
|
import { TokenSet } from './token-set';
|
|
@@ -66,7 +65,13 @@ export class HttpClient {
|
|
|
66
65
|
};
|
|
67
66
|
const token = options.token ? options.token : await this.getAccessToken();
|
|
68
67
|
const es = new EventSource(`${this.baseURL}${url}`, {
|
|
69
|
-
|
|
68
|
+
fetch: (input, init) => fetch(input, {
|
|
69
|
+
...init,
|
|
70
|
+
headers: {
|
|
71
|
+
...init.headers,
|
|
72
|
+
Authorization: 'Bearer ' + token,
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
70
75
|
});
|
|
71
76
|
es.addEventListener('message', listener);
|
|
72
77
|
es.addEventListener('error', errListener);
|
|
@@ -139,7 +144,7 @@ export class HttpClient {
|
|
|
139
144
|
grant_type: 'client_credentials',
|
|
140
145
|
...additionalOpts,
|
|
141
146
|
};
|
|
142
|
-
const authResponse = await this.authAxiosInstance.post(issuer.token_endpoint,
|
|
147
|
+
const authResponse = await this.authAxiosInstance.post(issuer.token_endpoint, new URLSearchParams(opts).toString(), {
|
|
143
148
|
headers: { Accept: 'application/json', 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
144
149
|
});
|
|
145
150
|
if (authResponse?.data?.access_token && authResponse.data.expires_in) {
|