hcloud-sdk 22.46.0 → 22.48.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.
- package/changelog.md +2 -2
- package/lib/interfaces/high5/space/execution/index.d.ts +22 -1
- package/lib/interfaces/nats/index.d.ts +3 -0
- package/lib/interfaces/nats/index.js +4 -0
- package/lib/service/high5/execution/status/index.d.ts +31 -5
- package/lib/service/high5/execution/status/index.js +39 -3
- package/package.json +2 -2
package/changelog.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
## [22.
|
|
1
|
+
## [22.48.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v22.47.0...v22.48.0) (2026-10-05)
|
|
2
2
|
|
|
3
3
|
### Features
|
|
4
4
|
|
|
5
|
-
*
|
|
5
|
+
* reflect changes made in high5 ([af4a2a1](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/af4a2a1a89937f24f72b5e163d099b1fc0c6a1de))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HCloud } from "../../../../Hcloud";
|
|
2
|
-
import { ReducedSpace } from "../../../global";
|
|
2
|
+
import { PaginatedResponse, ReducedSpace } from "../../../global";
|
|
3
3
|
import { ReducedOrganization, ReducedUser } from "../../../idp";
|
|
4
4
|
import { WaveCatalog, WaveEngine } from "../../wave";
|
|
5
5
|
import { ReducedEvent } from "../event";
|
|
@@ -159,6 +159,27 @@ export interface High5ExecutionStatus {
|
|
|
159
159
|
startTime?: number;
|
|
160
160
|
currentRetry?: number;
|
|
161
161
|
assignedClient?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Plaintext payload data of the execution, only set when searching execution states by payload
|
|
164
|
+
* (filter keys "payload" or "payload.<path>"). JSON payloads are returned as JSON value, generic payloads as string.
|
|
165
|
+
*/
|
|
166
|
+
payload?: unknown;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Response of an execution state search. Searches with payload filters count at most 1000 matches,
|
|
170
|
+
* a higher number of matches is reported with total = 1000 and totalCapped = true.
|
|
171
|
+
*/
|
|
172
|
+
export interface High5ExecutionStatusSearchResponse extends PaginatedResponse<High5ExecutionStatus> {
|
|
173
|
+
/** True if total holds the capped count of a payload search instead of the exact number of matches */
|
|
174
|
+
totalCapped: boolean;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Response of a full execution state search by payload, which considers all executions but skips the count
|
|
178
|
+
*/
|
|
179
|
+
export interface High5ExecutionStatusFullSearchResponse {
|
|
180
|
+
items: High5ExecutionStatus[];
|
|
181
|
+
/** True if a next page exists */
|
|
182
|
+
hasMore: boolean;
|
|
162
183
|
}
|
|
163
184
|
export interface High5ExecutionLog {
|
|
164
185
|
_id: string;
|
|
@@ -28,6 +28,7 @@ declare enum NatsSubject {
|
|
|
28
28
|
HIGH5_SPACES = "hcloud.high5.organization.${base64orgName}.spaces",
|
|
29
29
|
HIGH5_SPACE_PERMISSIONS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.permissions",
|
|
30
30
|
HIGH5_STREAM_EXECUTE = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}",
|
|
31
|
+
HIGH5_STREAM_EXECUTE_POOL = "hcloud.high5.organization.${organizationId}.spaces.${spaceId}.stream.execute.pool.${base64poolName}",
|
|
31
32
|
HIGH5_STREAM_CANCEL = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}",// eslint-disable-line @typescript-eslint/no-duplicate-enum-values
|
|
32
33
|
HIGH5_STREAM_DEBUG_STOPPED = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}.${executionId}.stopped",
|
|
33
34
|
HIGH5_STREAM_DEBUG_COMMAND = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}.${executionSecret}.command",
|
|
@@ -154,6 +155,7 @@ interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, Nat
|
|
|
154
155
|
[NatsSubject.HIGH5_SPACES]: NatsNameObject;
|
|
155
156
|
[NatsSubject.HIGH5_SPACE_PERMISSIONS]: NatsIdObject;
|
|
156
157
|
[NatsSubject.HIGH5_STREAM_EXECUTE]: High5ExecuteOnAgentRequest | High5ExecutionCancelRequest;
|
|
158
|
+
[NatsSubject.HIGH5_STREAM_EXECUTE_POOL]: High5ExecuteOnAgentRequest | High5ExecutionCancelRequest;
|
|
157
159
|
[NatsSubject.HIGH5_STREAM_CANCEL]: High5ExecuteOnAgentRequest | High5ExecutionCancelRequest;
|
|
158
160
|
[NatsSubject.HIGH5_EVENTS]: NatsNameObject;
|
|
159
161
|
[NatsSubject.HIGH5_STREAMS]: NatsIdObject;
|
|
@@ -304,6 +306,7 @@ declare class NatsSubjects {
|
|
|
304
306
|
Execution: {
|
|
305
307
|
new (): {};
|
|
306
308
|
EXECUTE: (organizationId: string, email: string) => string;
|
|
309
|
+
EXECUTE_POOL: (organizationId: string, spaceId: string, poolName: string) => string;
|
|
307
310
|
CANCEL: (organizationId: string, email: string) => string;
|
|
308
311
|
DEBUG: (organizationId: string, email: string) => {
|
|
309
312
|
STOPPED: (executionId: string) => string;
|
|
@@ -31,6 +31,7 @@ var NatsSubject;
|
|
|
31
31
|
NatsSubject["HIGH5_SPACES"] = "hcloud.high5.organization.${base64orgName}.spaces";
|
|
32
32
|
NatsSubject["HIGH5_SPACE_PERMISSIONS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.permissions";
|
|
33
33
|
NatsSubject["HIGH5_STREAM_EXECUTE"] = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}";
|
|
34
|
+
NatsSubject["HIGH5_STREAM_EXECUTE_POOL"] = "hcloud.high5.organization.${organizationId}.spaces.${spaceId}.stream.execute.pool.${base64poolName}";
|
|
34
35
|
NatsSubject["HIGH5_STREAM_CANCEL"] = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}";
|
|
35
36
|
NatsSubject["HIGH5_STREAM_DEBUG_STOPPED"] = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}.${executionId}.stopped";
|
|
36
37
|
NatsSubject["HIGH5_STREAM_DEBUG_COMMAND"] = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}.${executionSecret}.command";
|
|
@@ -248,6 +249,9 @@ NatsSubjects.High5 = (_f = class {
|
|
|
248
249
|
_g.EXECUTE = (organizationId, email) => {
|
|
249
250
|
return NatsSubjects.replace(NatsSubject.HIGH5_STREAM_EXECUTE, { organizationId, email });
|
|
250
251
|
},
|
|
252
|
+
_g.EXECUTE_POOL = (organizationId, spaceId, poolName) => {
|
|
253
|
+
return NatsSubjects.replace(NatsSubject.HIGH5_STREAM_EXECUTE_POOL, { organizationId, spaceId, poolName });
|
|
254
|
+
},
|
|
251
255
|
_g.CANCEL = (organizationId, email) => {
|
|
252
256
|
return NatsSubjects.replace(NatsSubject.HIGH5_STREAM_CANCEL, { organizationId, email });
|
|
253
257
|
},
|
|
@@ -1,20 +1,46 @@
|
|
|
1
1
|
import Base, { MaybeRaw } from "../../../../Base";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { SearchParams } from "../../../../interfaces/global";
|
|
3
|
+
import { High5ExecutionStatusFullSearchResponse, High5ExecutionStatusSearchResponse } from "../../../../interfaces/high5/space/execution";
|
|
4
4
|
export declare class High5OrganizationExecutionStates extends Base {
|
|
5
5
|
/**
|
|
6
|
-
* Retrieves
|
|
6
|
+
* Retrieves the stream execution states of an organization.
|
|
7
|
+
*
|
|
8
|
+
* Besides the fields of the execution state, filters can target the payload of the execution:
|
|
9
|
+
* - `payload.<path>` filters JSON payloads by the value at the given property path, e.g. `payload.user.id`.
|
|
10
|
+
* `is` matches the exact value (numbers and booleans keep their type), `starts with` is case-sensitive, `contains` and `ends with` are case-insensitive.
|
|
11
|
+
* - `payload` with `contains` is a case-insensitive text search over all string values of the payload. A single word only matches
|
|
12
|
+
* whole words, values with separators are searched as phrase. Only the newest 10000 matching executions are considered,
|
|
13
|
+
* use {@link fullSearchExecutionStates} to consider all of them.
|
|
14
|
+
*
|
|
15
|
+
* When filtering by payload, each state contains the `payload` of its execution and the total is capped at 1000 (see `totalCapped`).
|
|
7
16
|
* @param orgName Name of the Organization
|
|
8
17
|
* @param filters (optional) Array of search filters
|
|
9
18
|
* @param sorting (optional) Sorting object
|
|
10
19
|
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
11
20
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
12
|
-
* @returns Object containing an array of Stream execution
|
|
21
|
+
* @returns Object containing an array of Stream execution states, the total number of results and whether the total is capped
|
|
13
22
|
*/
|
|
14
23
|
searchExecutionStates<R extends boolean = false>({ orgName, filters, sorting, limit, page }: SearchParams & {
|
|
15
24
|
orgName: string;
|
|
16
25
|
}, raw?: {
|
|
17
26
|
raw: R;
|
|
18
|
-
}): Promise<MaybeRaw<R,
|
|
27
|
+
}): Promise<MaybeRaw<R, High5ExecutionStatusSearchResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves the stream execution states of an organization by payload, considering all executions without limits.
|
|
30
|
+
* The count is skipped, so instead of a total the response tells whether a next page exists. Takes the same filters as
|
|
31
|
+
* {@link searchExecutionStates}, but can take considerably longer for payload filters matching many executions.
|
|
32
|
+
* Searches without payload filters behave like {@link searchExecutionStates}.
|
|
33
|
+
* @param orgName Name of the Organization
|
|
34
|
+
* @param filters (optional) Array of search filters
|
|
35
|
+
* @param sorting (optional) Sorting object
|
|
36
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
37
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
38
|
+
* @returns Object containing an array of Stream execution states and whether a next page exists
|
|
39
|
+
*/
|
|
40
|
+
fullSearchExecutionStates<R extends boolean = false>({ orgName, filters, sorting, limit, page }: SearchParams & {
|
|
41
|
+
orgName: string;
|
|
42
|
+
}, raw?: {
|
|
43
|
+
raw: R;
|
|
44
|
+
}): Promise<MaybeRaw<R, High5ExecutionStatusFullSearchResponse>>;
|
|
19
45
|
protected getEndpoint(endpoint: string): string;
|
|
20
46
|
}
|
|
@@ -18,13 +18,22 @@ const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseH
|
|
|
18
18
|
const searchFilter_1 = require("../../../../helper/searchFilter");
|
|
19
19
|
class High5OrganizationExecutionStates extends Base_1.default {
|
|
20
20
|
/**
|
|
21
|
-
* Retrieves
|
|
21
|
+
* Retrieves the stream execution states of an organization.
|
|
22
|
+
*
|
|
23
|
+
* Besides the fields of the execution state, filters can target the payload of the execution:
|
|
24
|
+
* - `payload.<path>` filters JSON payloads by the value at the given property path, e.g. `payload.user.id`.
|
|
25
|
+
* `is` matches the exact value (numbers and booleans keep their type), `starts with` is case-sensitive, `contains` and `ends with` are case-insensitive.
|
|
26
|
+
* - `payload` with `contains` is a case-insensitive text search over all string values of the payload. A single word only matches
|
|
27
|
+
* whole words, values with separators are searched as phrase. Only the newest 10000 matching executions are considered,
|
|
28
|
+
* use {@link fullSearchExecutionStates} to consider all of them.
|
|
29
|
+
*
|
|
30
|
+
* When filtering by payload, each state contains the `payload` of its execution and the total is capped at 1000 (see `totalCapped`).
|
|
22
31
|
* @param orgName Name of the Organization
|
|
23
32
|
* @param filters (optional) Array of search filters
|
|
24
33
|
* @param sorting (optional) Sorting object
|
|
25
34
|
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
26
35
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
27
|
-
* @returns Object containing an array of Stream execution
|
|
36
|
+
* @returns Object containing an array of Stream execution states, the total number of results and whether the total is capped
|
|
28
37
|
*/
|
|
29
38
|
searchExecutionStates(_a, raw_1) {
|
|
30
39
|
return __awaiter(this, arguments, void 0, function* ({ orgName, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
@@ -33,7 +42,34 @@ class High5OrganizationExecutionStates extends Base_1.default {
|
|
|
33
42
|
filters: filtersDTO,
|
|
34
43
|
sorting: sorting,
|
|
35
44
|
});
|
|
36
|
-
|
|
45
|
+
const data = Object.assign(Object.assign({}, (0, paginatedResponseHelper_1.createPaginatedResponse)(resp)), { totalCapped: resp.headers["total-capped"] === "true" });
|
|
46
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data }) : data);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the stream execution states of an organization by payload, considering all executions without limits.
|
|
51
|
+
* The count is skipped, so instead of a total the response tells whether a next page exists. Takes the same filters as
|
|
52
|
+
* {@link searchExecutionStates}, but can take considerably longer for payload filters matching many executions.
|
|
53
|
+
* Searches without payload filters behave like {@link searchExecutionStates}.
|
|
54
|
+
* @param orgName Name of the Organization
|
|
55
|
+
* @param filters (optional) Array of search filters
|
|
56
|
+
* @param sorting (optional) Sorting object
|
|
57
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
58
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
59
|
+
* @returns Object containing an array of Stream execution states and whether a next page exists
|
|
60
|
+
*/
|
|
61
|
+
fullSearchExecutionStates(_a, raw_1) {
|
|
62
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
63
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
64
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/execution/status/search?page=${page}&limit=${limit}&fullSearch=true`), {
|
|
65
|
+
filters: filtersDTO,
|
|
66
|
+
sorting: sorting,
|
|
67
|
+
});
|
|
68
|
+
// searches without payload filters are not full searches and report a total instead
|
|
69
|
+
const hasMoreHeader = resp.headers["has-more"];
|
|
70
|
+
const hasMore = hasMoreHeader !== undefined ? hasMoreHeader === "true" : (page + 1) * limit < parseInt(String(resp.headers["total"]), 10);
|
|
71
|
+
const data = { items: resp.data, hasMore };
|
|
72
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data }) : data);
|
|
37
73
|
});
|
|
38
74
|
}
|
|
39
75
|
getEndpoint(endpoint) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hcloud-sdk",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.48.0",
|
|
4
4
|
"description": "hcloud platform sdk",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"typescript": "^5.8.3"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"axios": "^1.
|
|
55
|
+
"axios": "^1.20.0",
|
|
56
56
|
"nats": "^2.29.3",
|
|
57
57
|
"nats.ws": "^1.30.3"
|
|
58
58
|
}
|