@flowcore/sdk 1.58.2 → 1.60.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 +28 -0
- package/esm/commands/index.d.ts +5 -0
- package/esm/commands/index.d.ts.map +1 -1
- package/esm/commands/index.js +6 -0
- package/esm/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.d.ts +32 -0
- package/esm/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.d.ts.map +1 -0
- package/esm/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.js +50 -0
- package/esm/commands/legacy-scenario/legacy-scenario-adapter.restart.d.ts +43 -0
- package/esm/commands/legacy-scenario/legacy-scenario-adapter.restart.d.ts.map +1 -0
- package/esm/commands/legacy-scenario/legacy-scenario-adapter.restart.js +50 -0
- package/esm/commands/legacy-scenario/legacy-scenario.delete.d.ts +35 -0
- package/esm/commands/legacy-scenario/legacy-scenario.delete.d.ts.map +1 -0
- package/esm/commands/legacy-scenario/legacy-scenario.delete.js +45 -0
- package/esm/commands/legacy-scenario/legacy-scenario.fetch.d.ts +23 -0
- package/esm/commands/legacy-scenario/legacy-scenario.fetch.d.ts.map +1 -0
- package/esm/commands/legacy-scenario/legacy-scenario.fetch.js +57 -0
- package/esm/commands/legacy-scenario/legacy-scenario.list.d.ts +32 -0
- package/esm/commands/legacy-scenario/legacy-scenario.list.d.ts.map +1 -0
- package/esm/commands/legacy-scenario/legacy-scenario.list.js +59 -0
- package/esm/common/flowcore-client.d.ts +9 -1
- package/esm/common/flowcore-client.d.ts.map +1 -1
- package/esm/common/flowcore-client.js +15 -2
- package/esm/contracts/index.d.ts +2 -0
- package/esm/contracts/index.d.ts.map +1 -1
- package/esm/contracts/index.js +1 -0
- package/esm/contracts/legacy-scenario.d.ts +98 -0
- package/esm/contracts/legacy-scenario.d.ts.map +1 -0
- package/esm/contracts/legacy-scenario.js +103 -0
- package/package.json +1 -1
- package/script/commands/index.d.ts +5 -0
- package/script/commands/index.d.ts.map +1 -1
- package/script/commands/index.js +6 -0
- package/script/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.d.ts +32 -0
- package/script/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.d.ts.map +1 -0
- package/script/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.js +54 -0
- package/script/commands/legacy-scenario/legacy-scenario-adapter.restart.d.ts +43 -0
- package/script/commands/legacy-scenario/legacy-scenario-adapter.restart.d.ts.map +1 -0
- package/script/commands/legacy-scenario/legacy-scenario-adapter.restart.js +54 -0
- package/script/commands/legacy-scenario/legacy-scenario.delete.d.ts +35 -0
- package/script/commands/legacy-scenario/legacy-scenario.delete.d.ts.map +1 -0
- package/script/commands/legacy-scenario/legacy-scenario.delete.js +49 -0
- package/script/commands/legacy-scenario/legacy-scenario.fetch.d.ts +23 -0
- package/script/commands/legacy-scenario/legacy-scenario.fetch.d.ts.map +1 -0
- package/script/commands/legacy-scenario/legacy-scenario.fetch.js +61 -0
- package/script/commands/legacy-scenario/legacy-scenario.list.d.ts +32 -0
- package/script/commands/legacy-scenario/legacy-scenario.list.d.ts.map +1 -0
- package/script/commands/legacy-scenario/legacy-scenario.list.js +63 -0
- package/script/common/flowcore-client.d.ts +9 -1
- package/script/common/flowcore-client.d.ts.map +1 -1
- package/script/common/flowcore-client.js +15 -2
- package/script/contracts/index.d.ts +2 -0
- package/script/contracts/index.d.ts.map +1 -1
- package/script/contracts/index.js +5 -0
- package/script/contracts/legacy-scenario.d.ts +98 -0
- package/script/contracts/legacy-scenario.d.ts.map +1 -0
- package/script/contracts/legacy-scenario.js +106 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.60.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.59.0...v1.60.0) (2025-12-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add @std/testing dependency and update import path in legacy scenario tests ([5991e5d](https://github.com/flowcore-io/flowcore-sdk/commit/5991e5d36a2a73bad8de54c26d955d3537e72ed2))
|
|
9
|
+
* add legacy scenario commands and types for GraphQL integration ([c03e021](https://github.com/flowcore-io/flowcore-sdk/commit/c03e021baf08cdbb948046d01850341658878ddc))
|
|
10
|
+
* add legacy scenario commands and types for GraphQL integration ([eae8304](https://github.com/flowcore-io/flowcore-sdk/commit/eae8304ffaf42db4eb50a9fdc4c6e9b64d5c47e5))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* correct typo in LegacyScenarioDeploymentState and add reminder to update type ([7db0f4b](https://github.com/flowcore-io/flowcore-sdk/commit/7db0f4b6025f6f1f7c5e88a25e3a920209069b96))
|
|
16
|
+
* deno fmt ([ca8fed8](https://github.com/flowcore-io/flowcore-sdk/commit/ca8fed80f01383963dd17874585abd92ac1845ff))
|
|
17
|
+
|
|
18
|
+
## [1.59.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.58.2...v1.59.0) (2025-07-24)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* support new api key format ([214e27e](https://github.com/flowcore-io/flowcore-sdk/commit/214e27e3186d17162288ba73dbbf5daebebead5e))
|
|
24
|
+
* support new api key format ([a94f0de](https://github.com/flowcore-io/flowcore-sdk/commit/a94f0de8069d23997dd07d2702bb24b54bbb5cce))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* add comments ([c324b71](https://github.com/flowcore-io/flowcore-sdk/commit/c324b71eece4bfeb7cd12686d7643d6af057cd28))
|
|
30
|
+
|
|
3
31
|
## [1.58.2](https://github.com/flowcore-io/flowcore-sdk/compare/v1.58.1...v1.58.2) (2025-07-21)
|
|
4
32
|
|
|
5
33
|
|
package/esm/commands/index.d.ts
CHANGED
|
@@ -63,6 +63,11 @@ export * from "./scenario/scenario.delete.js";
|
|
|
63
63
|
export * from "./scenario/scenario.fetch.js";
|
|
64
64
|
export * from "./scenario/scenario.list.js";
|
|
65
65
|
export * from "./scenario/scenario.update.js";
|
|
66
|
+
export * from "./legacy-scenario/legacy-scenario.delete.js";
|
|
67
|
+
export * from "./legacy-scenario/legacy-scenario.fetch.js";
|
|
68
|
+
export * from "./legacy-scenario/legacy-scenario.list.js";
|
|
69
|
+
export * from "./legacy-scenario/legacy-scenario-adapter.fetch-state.js";
|
|
70
|
+
export * from "./legacy-scenario/legacy-scenario-adapter.restart.js";
|
|
66
71
|
export * from "./iam/permissions/get-user-permissions.js";
|
|
67
72
|
export * from "./iam/policies/create-policy.js";
|
|
68
73
|
export * from "./iam/policies/get-policy.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,2CAA2C,CAAA;AACzD,cAAc,0CAA0C,CAAA;AACxD,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AAGvD,cAAc,4BAA4B,CAAA;AAG1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AAGzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AAGvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAG3C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cA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12 @@ export * from "./scenario/scenario.delete.js";
|
|
|
76
76
|
export * from "./scenario/scenario.fetch.js";
|
|
77
77
|
export * from "./scenario/scenario.list.js";
|
|
78
78
|
export * from "./scenario/scenario.update.js";
|
|
79
|
+
// Legacy Scenario (GraphQL-based)
|
|
80
|
+
export * from "./legacy-scenario/legacy-scenario.delete.js";
|
|
81
|
+
export * from "./legacy-scenario/legacy-scenario.fetch.js";
|
|
82
|
+
export * from "./legacy-scenario/legacy-scenario.list.js";
|
|
83
|
+
export * from "./legacy-scenario/legacy-scenario-adapter.fetch-state.js";
|
|
84
|
+
export * from "./legacy-scenario/legacy-scenario-adapter.restart.js";
|
|
79
85
|
// Identity and Access Management
|
|
80
86
|
export * from "./iam/permissions/get-user-permissions.js";
|
|
81
87
|
export * from "./iam/policies/create-policy.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
2
|
+
import { type LegacyScenarioAdapterState } from "../../contracts/legacy-scenario.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for fetching legacy scenario adapter state
|
|
5
|
+
*/
|
|
6
|
+
export interface LegacyScenarioAdapterFetchStateInput {
|
|
7
|
+
/** The adapter ID */
|
|
8
|
+
adapterId: string;
|
|
9
|
+
/** The organization ID */
|
|
10
|
+
organizationId: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The output for fetching legacy scenario adapter state
|
|
14
|
+
*/
|
|
15
|
+
export interface LegacyScenarioAdapterFetchStateOutput {
|
|
16
|
+
/** The adapter state */
|
|
17
|
+
state: LegacyScenarioAdapterState;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetch the deployment state of a legacy scenario adapter
|
|
21
|
+
*/
|
|
22
|
+
export declare class LegacyScenarioAdapterFetchStateCommand extends GraphQlCommand<LegacyScenarioAdapterFetchStateInput, LegacyScenarioAdapterFetchStateOutput> {
|
|
23
|
+
/**
|
|
24
|
+
* Get the body for the request
|
|
25
|
+
*/
|
|
26
|
+
protected getBody(): Record<string, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Parse the response
|
|
29
|
+
*/
|
|
30
|
+
protected parseResponse(rawResponse: unknown): LegacyScenarioAdapterFetchStateOutput;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=legacy-scenario-adapter.fetch-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-scenario-adapter.fetch-state.d.ts","sourceRoot":"","sources":["../../../src/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,KAAK,0BAA0B,EAAoC,MAAM,oCAAoC,CAAA;AAKtH;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACnD,qBAAqB;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,0BAA0B;IAC1B,cAAc,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,qCAAqC;IACpD,wBAAwB;IACxB,KAAK,EAAE,0BAA0B,CAAA;CAClC;AAcD;;GAEG;AACH,qBAAa,sCAAuC,SAAQ,cAAc,CACxE,oCAAoC,EACpC,qCAAqC,CACtC;IACC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAUrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,qCAAqC;CA4B9F"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
2
|
+
import { LegacyScenarioAdapterStateSchema } from "../../contracts/legacy-scenario.js";
|
|
3
|
+
import { InvalidResponseException } from "../../exceptions/invalid-response.js";
|
|
4
|
+
import { NotFoundException } from "../../exceptions/not-found.js";
|
|
5
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
6
|
+
const QUERY = `
|
|
7
|
+
query GetAdapterDeploymentState($adapterId: ID!, $organizationId: ID!) {
|
|
8
|
+
adapter(search: { id: $adapterId, organizationId: $organizationId }) {
|
|
9
|
+
state {
|
|
10
|
+
kubernetes {
|
|
11
|
+
status
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
/**
|
|
18
|
+
* Fetch the deployment state of a legacy scenario adapter
|
|
19
|
+
*/
|
|
20
|
+
export class LegacyScenarioAdapterFetchStateCommand extends GraphQlCommand {
|
|
21
|
+
/**
|
|
22
|
+
* Get the body for the request
|
|
23
|
+
*/
|
|
24
|
+
getBody() {
|
|
25
|
+
return {
|
|
26
|
+
query: QUERY,
|
|
27
|
+
variables: {
|
|
28
|
+
adapterId: this.input.adapterId,
|
|
29
|
+
organizationId: this.input.organizationId,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parse the response
|
|
35
|
+
*/
|
|
36
|
+
parseResponse(rawResponse) {
|
|
37
|
+
const response = rawResponse;
|
|
38
|
+
if (response.errors && response.errors.length > 0) {
|
|
39
|
+
throw new InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
40
|
+
}
|
|
41
|
+
if (!response.data?.adapter) {
|
|
42
|
+
throw new NotFoundException("Legacy Scenario Adapter", {
|
|
43
|
+
id: this.input.adapterId,
|
|
44
|
+
organizationId: this.input.organizationId,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const state = parseResponseHelper(LegacyScenarioAdapterStateSchema, response.data.adapter.state);
|
|
48
|
+
return { state };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for restarting a legacy scenario adapter
|
|
4
|
+
*/
|
|
5
|
+
export interface LegacyScenarioAdapterRestartInput {
|
|
6
|
+
/** The adapter ID */
|
|
7
|
+
adapterId: string;
|
|
8
|
+
/**
|
|
9
|
+
* The event ID to restart from.
|
|
10
|
+
* This should be a UUID v1 generated from the restart timestamp (milliseconds).
|
|
11
|
+
*/
|
|
12
|
+
afterEventId: string;
|
|
13
|
+
/**
|
|
14
|
+
* The time bucket to restart from.
|
|
15
|
+
* Format: YYYYMMDDHHmm (year, month, day, hour, minute)
|
|
16
|
+
*/
|
|
17
|
+
timeBucket: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The output for restarting a legacy scenario adapter
|
|
21
|
+
*/
|
|
22
|
+
export interface LegacyScenarioAdapterRestartOutput {
|
|
23
|
+
/** Whether the restart was initiated successfully */
|
|
24
|
+
success: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Restart a legacy scenario adapter from a specific point in time
|
|
28
|
+
*/
|
|
29
|
+
export declare class LegacyScenarioAdapterRestartCommand extends GraphQlCommand<LegacyScenarioAdapterRestartInput, LegacyScenarioAdapterRestartOutput> {
|
|
30
|
+
/**
|
|
31
|
+
* Whether the command should retry on failure
|
|
32
|
+
*/
|
|
33
|
+
protected retryOnFailure: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Get the body for the request
|
|
36
|
+
*/
|
|
37
|
+
protected getBody(): Record<string, unknown>;
|
|
38
|
+
/**
|
|
39
|
+
* Parse the response
|
|
40
|
+
*/
|
|
41
|
+
protected parseResponse(rawResponse: unknown): LegacyScenarioAdapterRestartOutput;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=legacy-scenario-adapter.restart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-scenario-adapter.restart.d.ts","sourceRoot":"","sources":["../../../src/commands/legacy-scenario/legacy-scenario-adapter.restart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGhE;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,qBAAqB;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAA;CACjB;AAcD;;GAEG;AACH,qBAAa,mCAAoC,SAAQ,cAAc,CACrE,iCAAiC,EACjC,kCAAkC,CACnC;IACC;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAWrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,kCAAkC;CAyB3F"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
2
|
+
import { InvalidResponseException } from "../../exceptions/invalid-response.js";
|
|
3
|
+
const MUTATION = `
|
|
4
|
+
mutation RestartAdapter(
|
|
5
|
+
$adapterId: ID!
|
|
6
|
+
$afterEventId: String!
|
|
7
|
+
$timeBucket: String!
|
|
8
|
+
) {
|
|
9
|
+
adapter(id: $adapterId) {
|
|
10
|
+
reset(input: { afterEventId: $afterEventId, timeBucket: $timeBucket })
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
/**
|
|
15
|
+
* Restart a legacy scenario adapter from a specific point in time
|
|
16
|
+
*/
|
|
17
|
+
export class LegacyScenarioAdapterRestartCommand extends GraphQlCommand {
|
|
18
|
+
/**
|
|
19
|
+
* Whether the command should retry on failure
|
|
20
|
+
*/
|
|
21
|
+
retryOnFailure = false;
|
|
22
|
+
/**
|
|
23
|
+
* Get the body for the request
|
|
24
|
+
*/
|
|
25
|
+
getBody() {
|
|
26
|
+
return {
|
|
27
|
+
query: MUTATION,
|
|
28
|
+
variables: {
|
|
29
|
+
adapterId: this.input.adapterId,
|
|
30
|
+
afterEventId: this.input.afterEventId,
|
|
31
|
+
timeBucket: this.input.timeBucket,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Parse the response
|
|
37
|
+
*/
|
|
38
|
+
parseResponse(rawResponse) {
|
|
39
|
+
const response = rawResponse;
|
|
40
|
+
if (response.errors && response.errors.length > 0) {
|
|
41
|
+
throw new InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
42
|
+
}
|
|
43
|
+
if (response.data?.adapter?.reset === undefined) {
|
|
44
|
+
throw new InvalidResponseException("Invalid response from restart adapter mutation", {});
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
success: response.data.adapter.reset ?? false,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the legacy scenario delete command
|
|
4
|
+
*/
|
|
5
|
+
export interface LegacyScenarioDeleteInput {
|
|
6
|
+
/** The organization ID */
|
|
7
|
+
organizationId: string;
|
|
8
|
+
/** The scenario ID */
|
|
9
|
+
scenarioId: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The output for the legacy scenario delete command
|
|
13
|
+
*/
|
|
14
|
+
export interface LegacyScenarioDeleteOutput {
|
|
15
|
+
/** Whether the deletion was successful */
|
|
16
|
+
success: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Delete a legacy scenario
|
|
20
|
+
*/
|
|
21
|
+
export declare class LegacyScenarioDeleteCommand extends GraphQlCommand<LegacyScenarioDeleteInput, LegacyScenarioDeleteOutput> {
|
|
22
|
+
/**
|
|
23
|
+
* Whether the command should retry on failure
|
|
24
|
+
*/
|
|
25
|
+
protected retryOnFailure: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Get the body for the request
|
|
28
|
+
*/
|
|
29
|
+
protected getBody(): Record<string, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Parse the response
|
|
32
|
+
*/
|
|
33
|
+
protected parseResponse(rawResponse: unknown): LegacyScenarioDeleteOutput;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=legacy-scenario.delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-scenario.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/legacy-scenario/legacy-scenario.delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGhE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,0BAA0B;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAA;CACjB;AAUD;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,cAAc,CAAC,yBAAyB,EAAE,0BAA0B,CAAC;IACpH;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAUrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,0BAA0B;CAyBnF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
2
|
+
import { InvalidResponseException } from "../../exceptions/invalid-response.js";
|
|
3
|
+
const MUTATION = `
|
|
4
|
+
mutation DeleteScenario($organizationId: ID!, $scenarioId: ID!) {
|
|
5
|
+
organization(id: $organizationId) {
|
|
6
|
+
deleteScenario(scenarioId: $scenarioId)
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
/**
|
|
11
|
+
* Delete a legacy scenario
|
|
12
|
+
*/
|
|
13
|
+
export class LegacyScenarioDeleteCommand extends GraphQlCommand {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the command should retry on failure
|
|
16
|
+
*/
|
|
17
|
+
retryOnFailure = false;
|
|
18
|
+
/**
|
|
19
|
+
* Get the body for the request
|
|
20
|
+
*/
|
|
21
|
+
getBody() {
|
|
22
|
+
return {
|
|
23
|
+
query: MUTATION,
|
|
24
|
+
variables: {
|
|
25
|
+
organizationId: this.input.organizationId,
|
|
26
|
+
scenarioId: this.input.scenarioId,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parse the response
|
|
32
|
+
*/
|
|
33
|
+
parseResponse(rawResponse) {
|
|
34
|
+
const response = rawResponse;
|
|
35
|
+
if (response.errors && response.errors.length > 0) {
|
|
36
|
+
throw new InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
37
|
+
}
|
|
38
|
+
if (response.data?.organization?.deleteScenario === undefined) {
|
|
39
|
+
throw new InvalidResponseException("Invalid response from delete scenario mutation", {});
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
success: response.data.organization.deleteScenario,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
2
|
+
import { type LegacyScenario } from "../../contracts/legacy-scenario.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the legacy scenario fetch command
|
|
5
|
+
*/
|
|
6
|
+
export interface LegacyScenarioFetchInput {
|
|
7
|
+
/** The scenario ID */
|
|
8
|
+
scenarioId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fetch a legacy scenario by ID
|
|
12
|
+
*/
|
|
13
|
+
export declare class LegacyScenarioFetchCommand extends GraphQlCommand<LegacyScenarioFetchInput, LegacyScenario> {
|
|
14
|
+
/**
|
|
15
|
+
* Get the body for the request
|
|
16
|
+
*/
|
|
17
|
+
protected getBody(): Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Parse the response
|
|
20
|
+
*/
|
|
21
|
+
protected parseResponse(rawResponse: unknown): LegacyScenario;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=legacy-scenario.fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-scenario.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/legacy-scenario/legacy-scenario.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,oCAAoC,CAAA;AAK9F;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;CACnB;AA0BD;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,cAAc,CAAC,wBAAwB,EAAE,cAAc,CAAC;IACtG;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IASrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,cAAc;CAqBvE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
2
|
+
import { LegacyScenarioSchema } from "../../contracts/legacy-scenario.js";
|
|
3
|
+
import { InvalidResponseException } from "../../exceptions/invalid-response.js";
|
|
4
|
+
import { NotFoundException } from "../../exceptions/not-found.js";
|
|
5
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
6
|
+
const QUERY = `
|
|
7
|
+
query GetScenarioById($scenarioId: ID!) {
|
|
8
|
+
scenario(id: $scenarioId) {
|
|
9
|
+
id
|
|
10
|
+
name
|
|
11
|
+
description
|
|
12
|
+
flowcoreUserId
|
|
13
|
+
organizationId
|
|
14
|
+
deploymentState
|
|
15
|
+
createdAt
|
|
16
|
+
updatedAt
|
|
17
|
+
nodes {
|
|
18
|
+
id
|
|
19
|
+
type
|
|
20
|
+
name
|
|
21
|
+
description
|
|
22
|
+
data
|
|
23
|
+
parents
|
|
24
|
+
children
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
/**
|
|
30
|
+
* Fetch a legacy scenario by ID
|
|
31
|
+
*/
|
|
32
|
+
export class LegacyScenarioFetchCommand extends GraphQlCommand {
|
|
33
|
+
/**
|
|
34
|
+
* Get the body for the request
|
|
35
|
+
*/
|
|
36
|
+
getBody() {
|
|
37
|
+
return {
|
|
38
|
+
query: QUERY,
|
|
39
|
+
variables: {
|
|
40
|
+
scenarioId: this.input.scenarioId,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse the response
|
|
46
|
+
*/
|
|
47
|
+
parseResponse(rawResponse) {
|
|
48
|
+
const response = rawResponse;
|
|
49
|
+
if (response.errors && response.errors.length > 0) {
|
|
50
|
+
throw new InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
51
|
+
}
|
|
52
|
+
if (!response.data?.scenario) {
|
|
53
|
+
throw new NotFoundException("Legacy Scenario", { id: this.input.scenarioId });
|
|
54
|
+
}
|
|
55
|
+
return parseResponseHelper(LegacyScenarioSchema, response.data.scenario);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
2
|
+
import { type LegacyScenarioListItem } from "../../contracts/legacy-scenario.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the legacy scenario list command
|
|
5
|
+
*/
|
|
6
|
+
export interface LegacyScenarioListInput {
|
|
7
|
+
/** The organization ID */
|
|
8
|
+
organizationId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The output for the legacy scenario list command
|
|
12
|
+
*/
|
|
13
|
+
export interface LegacyScenarioListOutput {
|
|
14
|
+
/** The organization ID */
|
|
15
|
+
organizationId: string;
|
|
16
|
+
/** The scenarios in the organization */
|
|
17
|
+
scenarios: LegacyScenarioListItem[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* List all legacy scenarios in an organization
|
|
21
|
+
*/
|
|
22
|
+
export declare class LegacyScenarioListCommand extends GraphQlCommand<LegacyScenarioListInput, LegacyScenarioListOutput> {
|
|
23
|
+
/**
|
|
24
|
+
* Get the body for the request
|
|
25
|
+
*/
|
|
26
|
+
protected getBody(): Record<string, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Parse the response
|
|
29
|
+
*/
|
|
30
|
+
protected parseResponse(rawResponse: unknown): LegacyScenarioListOutput;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=legacy-scenario.list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-scenario.list.d.ts","sourceRoot":"","sources":["../../../src/commands/legacy-scenario/legacy-scenario.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,KAAK,sBAAsB,EAAgC,MAAM,oCAAoC,CAAA;AAI9G;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,0BAA0B;IAC1B,cAAc,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,0BAA0B;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,wCAAwC;IACxC,SAAS,EAAE,sBAAsB,EAAE,CAAA;CACpC;AAyBD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,cAAc,CAAC,uBAAuB,EAAE,wBAAwB,CAAC;IAC9G;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IASrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,wBAAwB;CA6BjF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
3
|
+
import { LegacyScenarioListItemSchema } from "../../contracts/legacy-scenario.js";
|
|
4
|
+
import { InvalidResponseException } from "../../exceptions/invalid-response.js";
|
|
5
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
6
|
+
const LegacyScenarioListOutputSchema = Type.Object({
|
|
7
|
+
organizationId: Type.String(),
|
|
8
|
+
scenarios: Type.Array(LegacyScenarioListItemSchema),
|
|
9
|
+
});
|
|
10
|
+
const QUERY = `
|
|
11
|
+
query GetScenariosInOrganization($organizationId: ID!) {
|
|
12
|
+
organization(search: { id: $organizationId }) {
|
|
13
|
+
id
|
|
14
|
+
scenarios {
|
|
15
|
+
id
|
|
16
|
+
name
|
|
17
|
+
description
|
|
18
|
+
flowcoreUserId
|
|
19
|
+
deploymentState
|
|
20
|
+
createdAt
|
|
21
|
+
updatedAt
|
|
22
|
+
lastDeployed
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
/**
|
|
28
|
+
* List all legacy scenarios in an organization
|
|
29
|
+
*/
|
|
30
|
+
export class LegacyScenarioListCommand extends GraphQlCommand {
|
|
31
|
+
/**
|
|
32
|
+
* Get the body for the request
|
|
33
|
+
*/
|
|
34
|
+
getBody() {
|
|
35
|
+
return {
|
|
36
|
+
query: QUERY,
|
|
37
|
+
variables: {
|
|
38
|
+
organizationId: this.input.organizationId,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Parse the response
|
|
44
|
+
*/
|
|
45
|
+
parseResponse(rawResponse) {
|
|
46
|
+
const response = rawResponse;
|
|
47
|
+
if (response.errors && response.errors.length > 0) {
|
|
48
|
+
throw new InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
49
|
+
}
|
|
50
|
+
if (!response.data?.organization) {
|
|
51
|
+
throw new InvalidResponseException("Organization not found in response", {});
|
|
52
|
+
}
|
|
53
|
+
const output = {
|
|
54
|
+
organizationId: response.data.organization.id,
|
|
55
|
+
scenarios: response.data.organization.scenarios ?? [],
|
|
56
|
+
};
|
|
57
|
+
return parseResponseHelper(LegacyScenarioListOutputSchema, output);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -4,6 +4,10 @@ import type { Command } from "./command.js";
|
|
|
4
4
|
*/
|
|
5
5
|
interface ClientOptionsBearer {
|
|
6
6
|
getBearerToken: () => Promise<string | null> | string | null;
|
|
7
|
+
/**
|
|
8
|
+
* The ID of the API key.
|
|
9
|
+
* @deprecated Use apiKey only instead (apiKeyId is only used for old api keys).
|
|
10
|
+
*/
|
|
7
11
|
apiKeyId?: never;
|
|
8
12
|
apiKey?: never;
|
|
9
13
|
retry?: {
|
|
@@ -15,7 +19,11 @@ interface ClientOptionsBearer {
|
|
|
15
19
|
* The options for the api key
|
|
16
20
|
*/
|
|
17
21
|
interface ClientOptionsApiKey {
|
|
18
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The ID of the API key.
|
|
24
|
+
* @deprecated Use apiKey only instead (apiKeyId is only used for old api keys).
|
|
25
|
+
*/
|
|
26
|
+
apiKeyId?: string;
|
|
19
27
|
apiKey: string;
|
|
20
28
|
getBearerToken?: never;
|
|
21
29
|
retry?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowcore-client.d.ts","sourceRoot":"","sources":["../../src/common/flowcore-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAK3C;;GAEG;AACH,UAAU,mBAAmB;IAC3B,cAAc,EA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CAAC,OAAO,CAAoB;gBAEN,OAAO,EAAE,aAAa;IAwBnD;;OAEG;YACW,aAAa;IAc3B;;OAEG;YACW,YAAY;IA0F1B;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1F;;;OAGG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGzB"}
|
|
@@ -3,6 +3,12 @@ import { CommandError } from "../exceptions/command-error.js";
|
|
|
3
3
|
import { tryCatch } from "../utils/try-catch.js";
|
|
4
4
|
import { tenantCache } from "./tenant.cache.js";
|
|
5
5
|
const RETRYABLE_ERROR_CODES = [408, 429, 500, 502, 503, 504];
|
|
6
|
+
function isClientOptionsBearer(options) {
|
|
7
|
+
return "getBearerToken" in options;
|
|
8
|
+
}
|
|
9
|
+
function isClientOptionsApiKey(options) {
|
|
10
|
+
return "apiKey" in options;
|
|
11
|
+
}
|
|
6
12
|
/**
|
|
7
13
|
* A base client for executing commands
|
|
8
14
|
*/
|
|
@@ -12,10 +18,17 @@ export class FlowcoreClient {
|
|
|
12
18
|
baseUrl;
|
|
13
19
|
constructor(options) {
|
|
14
20
|
this.options = options;
|
|
15
|
-
if (this.options
|
|
21
|
+
if (isClientOptionsBearer(this.options)) {
|
|
16
22
|
this.mode = "bearer";
|
|
17
23
|
}
|
|
18
|
-
else if (this.options
|
|
24
|
+
else if (isClientOptionsApiKey(this.options)) {
|
|
25
|
+
if (!this.options.apiKeyId) {
|
|
26
|
+
const parts = this.options.apiKey.split("_");
|
|
27
|
+
if (parts.length !== 3 || parts[0] !== "fc") {
|
|
28
|
+
throw new Error("Invalid api key");
|
|
29
|
+
}
|
|
30
|
+
this.options.apiKeyId = parts[1];
|
|
31
|
+
}
|
|
19
32
|
this.mode = "apiKey";
|
|
20
33
|
}
|
|
21
34
|
else {
|
package/esm/contracts/index.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ export type { FlowType } from "./flow-type.js";
|
|
|
6
6
|
export type { FlowcoreEvent, IngestEventInput } from "./event.js";
|
|
7
7
|
export type { Tenant } from "./tenant.js";
|
|
8
8
|
export type { Permission } from "./permission.js";
|
|
9
|
+
export type { LegacyScenario, LegacyScenarioAdapterState, LegacyScenarioListItem, LegacyScenarioNode, } from "./legacy-scenario.js";
|
|
10
|
+
export { LegacyScenarioAdapterKubernetesStatus, LegacyScenarioDeploymentState, LegacyScenarioNodeType, } from "./legacy-scenario.js";
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,2BAA2B,CAAA;AACzC,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,YAAY,EACV,SAAS,EACT,eAAe,EACf,0BAA0B,EAC1B,gCAAgC,EAChC,sCAAsC,EACtC,gCAAgC,EAChC,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACjE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,2BAA2B,CAAA;AACzC,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,YAAY,EACV,SAAS,EACT,eAAe,EACf,0BAA0B,EAC1B,gCAAgC,EAChC,sCAAsC,EACtC,gCAAgC,EAChC,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACjE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,YAAY,EACV,cAAc,EACd,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,qCAAqC,EACrC,6BAA6B,EAC7B,sBAAsB,GACvB,MAAM,sBAAsB,CAAA"}
|
package/esm/contracts/index.js
CHANGED