@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
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { type Static, type TLiteral, type TObject, type TOptional, type TString, type TUnion, Type } from "@sinclair/typebox";
|
|
2
|
+
/**
|
|
3
|
+
* Deployment states for Legacy Scenarios
|
|
4
|
+
*/
|
|
5
|
+
export declare const LegacyScenarioDeploymentState: {
|
|
6
|
+
readonly NOT_DEPLOYED: "NOT_DEPLOYED";
|
|
7
|
+
readonly DEPLOYED: "DEPLOYED";
|
|
8
|
+
readonly PARTIALLY_DEPLOYED: "PARTIALLY_DEPLOYED";
|
|
9
|
+
readonly DELETING: "DELETING";
|
|
10
|
+
};
|
|
11
|
+
export type LegacyScenarioDeploymentState = TUnion<[
|
|
12
|
+
TLiteral<typeof LegacyScenarioDeploymentState.NOT_DEPLOYED>,
|
|
13
|
+
TLiteral<typeof LegacyScenarioDeploymentState.DEPLOYED>,
|
|
14
|
+
TLiteral<typeof LegacyScenarioDeploymentState.PARTIALLY_DEPLOYED>,
|
|
15
|
+
TLiteral<typeof LegacyScenarioDeploymentState.DELETING>
|
|
16
|
+
]>;
|
|
17
|
+
/**
|
|
18
|
+
* Kubernetes statuses for Legacy Scenario adapters
|
|
19
|
+
*/
|
|
20
|
+
export declare const LegacyScenarioAdapterKubernetesStatus: {
|
|
21
|
+
readonly RUNNING: "RUNNING";
|
|
22
|
+
readonly PENDING: "PENDING";
|
|
23
|
+
readonly FAILED: "FAILED";
|
|
24
|
+
readonly NOT_DEPLOYED: "NOT_DEPLOYED";
|
|
25
|
+
};
|
|
26
|
+
export type LegacyScenarioAdapterKubernetesStatus = (typeof LegacyScenarioAdapterKubernetesStatus)[keyof typeof LegacyScenarioAdapterKubernetesStatus];
|
|
27
|
+
/**
|
|
28
|
+
* Node types in Legacy Scenarios
|
|
29
|
+
*/
|
|
30
|
+
export declare const LegacyScenarioNodeType: {
|
|
31
|
+
readonly Adapter: "Adapter";
|
|
32
|
+
readonly DataCore: "DataCore";
|
|
33
|
+
};
|
|
34
|
+
export type LegacyScenarioNodeType = (typeof LegacyScenarioNodeType)[keyof typeof LegacyScenarioNodeType];
|
|
35
|
+
/**
|
|
36
|
+
* The schema for a Legacy Scenario node
|
|
37
|
+
*/
|
|
38
|
+
export declare const LegacyScenarioNodeSchema: TObject<{
|
|
39
|
+
id: TString;
|
|
40
|
+
type: TString;
|
|
41
|
+
name: TString;
|
|
42
|
+
description: TOptional<TString>;
|
|
43
|
+
data: TOptional<TString>;
|
|
44
|
+
parents: ReturnType<typeof Type.Array<TString>>;
|
|
45
|
+
children: ReturnType<typeof Type.Array<TString>>;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* The type for a Legacy Scenario node
|
|
49
|
+
*/
|
|
50
|
+
export type LegacyScenarioNode = Static<typeof LegacyScenarioNodeSchema>;
|
|
51
|
+
/**
|
|
52
|
+
* The schema for a Legacy Scenario (list view)
|
|
53
|
+
*/
|
|
54
|
+
export declare const LegacyScenarioListItemSchema: TObject<{
|
|
55
|
+
id: TString;
|
|
56
|
+
name: TString;
|
|
57
|
+
description: TOptional<TString>;
|
|
58
|
+
flowcoreUserId: TString;
|
|
59
|
+
deploymentState: LegacyScenarioDeploymentState;
|
|
60
|
+
createdAt: TString;
|
|
61
|
+
updatedAt: TString;
|
|
62
|
+
lastDeployed: TOptional<TString>;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* The type for a Legacy Scenario list item
|
|
66
|
+
*/
|
|
67
|
+
export type LegacyScenarioListItem = Static<typeof LegacyScenarioListItemSchema>;
|
|
68
|
+
/**
|
|
69
|
+
* The schema for a Legacy Scenario (full view with nodes)
|
|
70
|
+
*/
|
|
71
|
+
export declare const LegacyScenarioSchema: TObject<{
|
|
72
|
+
id: TString;
|
|
73
|
+
name: TString;
|
|
74
|
+
description: TOptional<TString>;
|
|
75
|
+
flowcoreUserId: TString;
|
|
76
|
+
organizationId: TString;
|
|
77
|
+
deploymentState: TString;
|
|
78
|
+
createdAt: TString;
|
|
79
|
+
updatedAt: TString;
|
|
80
|
+
nodes: ReturnType<typeof Type.Array<typeof LegacyScenarioNodeSchema>>;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* The type for a Legacy Scenario
|
|
84
|
+
*/
|
|
85
|
+
export type LegacyScenario = Static<typeof LegacyScenarioSchema>;
|
|
86
|
+
/**
|
|
87
|
+
* The schema for adapter state
|
|
88
|
+
*/
|
|
89
|
+
export declare const LegacyScenarioAdapterStateSchema: TObject<{
|
|
90
|
+
kubernetes: TObject<{
|
|
91
|
+
status: TString;
|
|
92
|
+
}>;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* The type for adapter state
|
|
96
|
+
*/
|
|
97
|
+
export type LegacyScenarioAdapterState = Static<typeof LegacyScenarioAdapterStateSchema>;
|
|
98
|
+
//# sourceMappingURL=legacy-scenario.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-scenario.d.ts","sourceRoot":"","sources":["../../src/contracts/legacy-scenario.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,IAAI,EACL,MAAM,mBAAmB,CAAA;AAE1B;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;CAMhC,CAAA;AAEV,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAChD;IACE,QAAQ,CAAC,OAAO,6BAA6B,CAAC,YAAY,CAAC;IAC3D,QAAQ,CAAC,OAAO,6BAA6B,CAAC,QAAQ,CAAC;IACvD,QAAQ,CAAC,OAAO,6BAA6B,CAAC,kBAAkB,CAAC;IACjE,QAAQ,CAAC,OAAO,6BAA6B,CAAC,QAAQ,CAAC;CACxD,CACF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;CAKxC,CAAA;AAEV,MAAM,MAAM,qCAAqC,GAC/C,CAAC,OAAO,qCAAqC,CAAC,CAAC,MAAM,OAAO,qCAAqC,CAAC,CAAA;AAEpG;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;CAGzB,CAAA;AAEV,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAA;AAEzG;;GAEG;AACH,eAAO,M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AO,CAAA;IAClB,KAAK,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAA;CACtE,CAmBC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,OAAO,CAAC;IACrD,UAAU,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,OAAO,CAAA;KAChB,CAAC,CAAA;CACH,CAIC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,OAAO,gCAAgC,CAAC,CAAA"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Type, } from "@sinclair/typebox";
|
|
2
|
+
/**
|
|
3
|
+
* Deployment states for Legacy Scenarios
|
|
4
|
+
*/
|
|
5
|
+
export const LegacyScenarioDeploymentState = {
|
|
6
|
+
// when updating this object remember to update the type too
|
|
7
|
+
NOT_DEPLOYED: "NOT_DEPLOYED",
|
|
8
|
+
DEPLOYED: "DEPLOYED",
|
|
9
|
+
PARTIALLY_DEPLOYED: "PARTIALLY_DEPLOYED",
|
|
10
|
+
DELETING: "DELETING",
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Kubernetes statuses for Legacy Scenario adapters
|
|
14
|
+
*/
|
|
15
|
+
export const LegacyScenarioAdapterKubernetesStatus = {
|
|
16
|
+
RUNNING: "RUNNING",
|
|
17
|
+
PENDING: "PENDING",
|
|
18
|
+
FAILED: "FAILED",
|
|
19
|
+
NOT_DEPLOYED: "NOT_DEPLOYED",
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Node types in Legacy Scenarios
|
|
23
|
+
*/
|
|
24
|
+
export const LegacyScenarioNodeType = {
|
|
25
|
+
Adapter: "Adapter",
|
|
26
|
+
DataCore: "DataCore",
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The schema for a Legacy Scenario node
|
|
30
|
+
*/
|
|
31
|
+
export const LegacyScenarioNodeSchema = Type.Object({
|
|
32
|
+
/** Unique identifier for the node */
|
|
33
|
+
id: Type.String(),
|
|
34
|
+
/** Type of the node (Adapter or DataCore) */
|
|
35
|
+
type: Type.String(),
|
|
36
|
+
/** Name of the node */
|
|
37
|
+
name: Type.String(),
|
|
38
|
+
/** Description of the node */
|
|
39
|
+
description: Type.Optional(Type.String()),
|
|
40
|
+
/** Node configuration data as JSON string */
|
|
41
|
+
data: Type.Optional(Type.String()),
|
|
42
|
+
/** Parent node IDs */
|
|
43
|
+
parents: Type.Array(Type.String()),
|
|
44
|
+
/** Child node IDs */
|
|
45
|
+
children: Type.Array(Type.String()),
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* The schema for a Legacy Scenario (list view)
|
|
49
|
+
*/
|
|
50
|
+
export const LegacyScenarioListItemSchema = Type.Object({
|
|
51
|
+
/** Unique identifier for the scenario */
|
|
52
|
+
id: Type.String(),
|
|
53
|
+
/** Name of the scenario */
|
|
54
|
+
name: Type.String(),
|
|
55
|
+
/** Description of the scenario */
|
|
56
|
+
description: Type.Optional(Type.String()),
|
|
57
|
+
/** ID of the user who created the scenario */
|
|
58
|
+
flowcoreUserId: Type.String(),
|
|
59
|
+
/** Current deployment state */
|
|
60
|
+
deploymentState: Type.Union([
|
|
61
|
+
Type.Literal(LegacyScenarioDeploymentState.NOT_DEPLOYED),
|
|
62
|
+
Type.Literal(LegacyScenarioDeploymentState.DEPLOYED),
|
|
63
|
+
Type.Literal(LegacyScenarioDeploymentState.PARTIALLY_DEPLOYED),
|
|
64
|
+
Type.Literal(LegacyScenarioDeploymentState.DELETING),
|
|
65
|
+
]),
|
|
66
|
+
/** Creation timestamp */
|
|
67
|
+
createdAt: Type.String(),
|
|
68
|
+
/** Last update timestamp */
|
|
69
|
+
updatedAt: Type.String(),
|
|
70
|
+
/** Last deployment timestamp */
|
|
71
|
+
lastDeployed: Type.Optional(Type.String()),
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* The schema for a Legacy Scenario (full view with nodes)
|
|
75
|
+
*/
|
|
76
|
+
export const LegacyScenarioSchema = Type.Object({
|
|
77
|
+
/** Unique identifier for the scenario */
|
|
78
|
+
id: Type.String(),
|
|
79
|
+
/** Name of the scenario */
|
|
80
|
+
name: Type.String(),
|
|
81
|
+
/** Description of the scenario */
|
|
82
|
+
description: Type.Optional(Type.String()),
|
|
83
|
+
/** ID of the user who created the scenario */
|
|
84
|
+
flowcoreUserId: Type.String(),
|
|
85
|
+
/** ID of the organization that owns this scenario */
|
|
86
|
+
organizationId: Type.String(),
|
|
87
|
+
/** Current deployment state */
|
|
88
|
+
deploymentState: Type.String(),
|
|
89
|
+
/** Creation timestamp */
|
|
90
|
+
createdAt: Type.String(),
|
|
91
|
+
/** Last update timestamp */
|
|
92
|
+
updatedAt: Type.String(),
|
|
93
|
+
/** Nodes in the scenario */
|
|
94
|
+
nodes: Type.Array(LegacyScenarioNodeSchema),
|
|
95
|
+
});
|
|
96
|
+
/**
|
|
97
|
+
* The schema for adapter state
|
|
98
|
+
*/
|
|
99
|
+
export const LegacyScenarioAdapterStateSchema = Type.Object({
|
|
100
|
+
kubernetes: Type.Object({
|
|
101
|
+
status: Type.String(),
|
|
102
|
+
}),
|
|
103
|
+
});
|
package/package.json
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,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAG/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAG/C,cAAc,mCAAmC,CAAA;AACjD,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC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C/C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,qCAAqC,CAAA;AACnD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,oCAAoC,CAAA;AAElD,cAAc,+CAA+C,CAAA;AAC7D,cAAc,wDAAwD,CAAA;AACtE,cAAc,sDAAsD,CAAA;AACpE,cAAc,gDAAgD,CAAA;AAC9D,cAAc,gDAAgD,CAAA;AAC9D,cAAc,8CAA8C,CAAA;AAC5D,cAAc,+CAA+C,CAAA;AAC7D,cAAc,+CAA+C,CAAA;AAC7D,cAAc,gDAAgD,CAAA;AAC9D,cAAc,iDAAiD,CAAA;AAC/D,cAAc,iDAAiD,CAAA;AAE/D,cAAc,0CAA0C,CAAA;AACxD,cAAc,mDAAmD,CAAA;AACjE,cAAc,kDAAkD,CAAA;AAChE,cAAc,2CAA2C,CAAA;AACzD,cAAc,0CAA0C,CAAA;AACxD,cAAc,2CAA2C,CAAA;AACzD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,6CAA6C,CAAA;AAE3D,cAAc,4BAA4B,CAAA;AAC1C,cAAc,0BAA0B,CAAA;AACxC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAE7C,cAAc,gDAAgD,CAAA;AAE9D,cAAc,gCAAgC,CAAA;AAC9C,cAAc,iCAAiC,CAAA"}
|
package/script/commands/index.js
CHANGED
|
@@ -92,6 +92,12 @@ __exportStar(require("./scenario/scenario.delete.js"), exports);
|
|
|
92
92
|
__exportStar(require("./scenario/scenario.fetch.js"), exports);
|
|
93
93
|
__exportStar(require("./scenario/scenario.list.js"), exports);
|
|
94
94
|
__exportStar(require("./scenario/scenario.update.js"), exports);
|
|
95
|
+
// Legacy Scenario (GraphQL-based)
|
|
96
|
+
__exportStar(require("./legacy-scenario/legacy-scenario.delete.js"), exports);
|
|
97
|
+
__exportStar(require("./legacy-scenario/legacy-scenario.fetch.js"), exports);
|
|
98
|
+
__exportStar(require("./legacy-scenario/legacy-scenario.list.js"), exports);
|
|
99
|
+
__exportStar(require("./legacy-scenario/legacy-scenario-adapter.fetch-state.js"), exports);
|
|
100
|
+
__exportStar(require("./legacy-scenario/legacy-scenario-adapter.restart.js"), exports);
|
|
95
101
|
// Identity and Access Management
|
|
96
102
|
__exportStar(require("./iam/permissions/get-user-permissions.js"), exports);
|
|
97
103
|
__exportStar(require("./iam/policies/create-policy.js"), exports);
|
|
@@ -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,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LegacyScenarioAdapterFetchStateCommand = void 0;
|
|
4
|
+
const command_graphql_js_1 = require("../../common/command-graphql.js");
|
|
5
|
+
const legacy_scenario_js_1 = require("../../contracts/legacy-scenario.js");
|
|
6
|
+
const invalid_response_js_1 = require("../../exceptions/invalid-response.js");
|
|
7
|
+
const not_found_js_1 = require("../../exceptions/not-found.js");
|
|
8
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
9
|
+
const QUERY = `
|
|
10
|
+
query GetAdapterDeploymentState($adapterId: ID!, $organizationId: ID!) {
|
|
11
|
+
adapter(search: { id: $adapterId, organizationId: $organizationId }) {
|
|
12
|
+
state {
|
|
13
|
+
kubernetes {
|
|
14
|
+
status
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
/**
|
|
21
|
+
* Fetch the deployment state of a legacy scenario adapter
|
|
22
|
+
*/
|
|
23
|
+
class LegacyScenarioAdapterFetchStateCommand extends command_graphql_js_1.GraphQlCommand {
|
|
24
|
+
/**
|
|
25
|
+
* Get the body for the request
|
|
26
|
+
*/
|
|
27
|
+
getBody() {
|
|
28
|
+
return {
|
|
29
|
+
query: QUERY,
|
|
30
|
+
variables: {
|
|
31
|
+
adapterId: this.input.adapterId,
|
|
32
|
+
organizationId: this.input.organizationId,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parse the response
|
|
38
|
+
*/
|
|
39
|
+
parseResponse(rawResponse) {
|
|
40
|
+
const response = rawResponse;
|
|
41
|
+
if (response.errors && response.errors.length > 0) {
|
|
42
|
+
throw new invalid_response_js_1.InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
43
|
+
}
|
|
44
|
+
if (!response.data?.adapter) {
|
|
45
|
+
throw new not_found_js_1.NotFoundException("Legacy Scenario Adapter", {
|
|
46
|
+
id: this.input.adapterId,
|
|
47
|
+
organizationId: this.input.organizationId,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const state = (0, parse_response_helper_js_1.parseResponseHelper)(legacy_scenario_js_1.LegacyScenarioAdapterStateSchema, response.data.adapter.state);
|
|
51
|
+
return { state };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.LegacyScenarioAdapterFetchStateCommand = LegacyScenarioAdapterFetchStateCommand;
|
|
@@ -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,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LegacyScenarioAdapterRestartCommand = void 0;
|
|
4
|
+
const command_graphql_js_1 = require("../../common/command-graphql.js");
|
|
5
|
+
const invalid_response_js_1 = require("../../exceptions/invalid-response.js");
|
|
6
|
+
const MUTATION = `
|
|
7
|
+
mutation RestartAdapter(
|
|
8
|
+
$adapterId: ID!
|
|
9
|
+
$afterEventId: String!
|
|
10
|
+
$timeBucket: String!
|
|
11
|
+
) {
|
|
12
|
+
adapter(id: $adapterId) {
|
|
13
|
+
reset(input: { afterEventId: $afterEventId, timeBucket: $timeBucket })
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
/**
|
|
18
|
+
* Restart a legacy scenario adapter from a specific point in time
|
|
19
|
+
*/
|
|
20
|
+
class LegacyScenarioAdapterRestartCommand extends command_graphql_js_1.GraphQlCommand {
|
|
21
|
+
/**
|
|
22
|
+
* Whether the command should retry on failure
|
|
23
|
+
*/
|
|
24
|
+
retryOnFailure = false;
|
|
25
|
+
/**
|
|
26
|
+
* Get the body for the request
|
|
27
|
+
*/
|
|
28
|
+
getBody() {
|
|
29
|
+
return {
|
|
30
|
+
query: MUTATION,
|
|
31
|
+
variables: {
|
|
32
|
+
adapterId: this.input.adapterId,
|
|
33
|
+
afterEventId: this.input.afterEventId,
|
|
34
|
+
timeBucket: this.input.timeBucket,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse the response
|
|
40
|
+
*/
|
|
41
|
+
parseResponse(rawResponse) {
|
|
42
|
+
const response = rawResponse;
|
|
43
|
+
if (response.errors && response.errors.length > 0) {
|
|
44
|
+
throw new invalid_response_js_1.InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
45
|
+
}
|
|
46
|
+
if (response.data?.adapter?.reset === undefined) {
|
|
47
|
+
throw new invalid_response_js_1.InvalidResponseException("Invalid response from restart adapter mutation", {});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
success: response.data.adapter.reset ?? false,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.LegacyScenarioAdapterRestartCommand = LegacyScenarioAdapterRestartCommand;
|
|
@@ -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,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LegacyScenarioDeleteCommand = void 0;
|
|
4
|
+
const command_graphql_js_1 = require("../../common/command-graphql.js");
|
|
5
|
+
const invalid_response_js_1 = require("../../exceptions/invalid-response.js");
|
|
6
|
+
const MUTATION = `
|
|
7
|
+
mutation DeleteScenario($organizationId: ID!, $scenarioId: ID!) {
|
|
8
|
+
organization(id: $organizationId) {
|
|
9
|
+
deleteScenario(scenarioId: $scenarioId)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
/**
|
|
14
|
+
* Delete a legacy scenario
|
|
15
|
+
*/
|
|
16
|
+
class LegacyScenarioDeleteCommand extends command_graphql_js_1.GraphQlCommand {
|
|
17
|
+
/**
|
|
18
|
+
* Whether the command should retry on failure
|
|
19
|
+
*/
|
|
20
|
+
retryOnFailure = false;
|
|
21
|
+
/**
|
|
22
|
+
* Get the body for the request
|
|
23
|
+
*/
|
|
24
|
+
getBody() {
|
|
25
|
+
return {
|
|
26
|
+
query: MUTATION,
|
|
27
|
+
variables: {
|
|
28
|
+
organizationId: this.input.organizationId,
|
|
29
|
+
scenarioId: this.input.scenarioId,
|
|
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 invalid_response_js_1.InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
40
|
+
}
|
|
41
|
+
if (response.data?.organization?.deleteScenario === undefined) {
|
|
42
|
+
throw new invalid_response_js_1.InvalidResponseException("Invalid response from delete scenario mutation", {});
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
success: response.data.organization.deleteScenario,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.LegacyScenarioDeleteCommand = LegacyScenarioDeleteCommand;
|
|
@@ -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,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LegacyScenarioFetchCommand = void 0;
|
|
4
|
+
const command_graphql_js_1 = require("../../common/command-graphql.js");
|
|
5
|
+
const legacy_scenario_js_1 = require("../../contracts/legacy-scenario.js");
|
|
6
|
+
const invalid_response_js_1 = require("../../exceptions/invalid-response.js");
|
|
7
|
+
const not_found_js_1 = require("../../exceptions/not-found.js");
|
|
8
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
9
|
+
const QUERY = `
|
|
10
|
+
query GetScenarioById($scenarioId: ID!) {
|
|
11
|
+
scenario(id: $scenarioId) {
|
|
12
|
+
id
|
|
13
|
+
name
|
|
14
|
+
description
|
|
15
|
+
flowcoreUserId
|
|
16
|
+
organizationId
|
|
17
|
+
deploymentState
|
|
18
|
+
createdAt
|
|
19
|
+
updatedAt
|
|
20
|
+
nodes {
|
|
21
|
+
id
|
|
22
|
+
type
|
|
23
|
+
name
|
|
24
|
+
description
|
|
25
|
+
data
|
|
26
|
+
parents
|
|
27
|
+
children
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
/**
|
|
33
|
+
* Fetch a legacy scenario by ID
|
|
34
|
+
*/
|
|
35
|
+
class LegacyScenarioFetchCommand extends command_graphql_js_1.GraphQlCommand {
|
|
36
|
+
/**
|
|
37
|
+
* Get the body for the request
|
|
38
|
+
*/
|
|
39
|
+
getBody() {
|
|
40
|
+
return {
|
|
41
|
+
query: QUERY,
|
|
42
|
+
variables: {
|
|
43
|
+
scenarioId: this.input.scenarioId,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parse the response
|
|
49
|
+
*/
|
|
50
|
+
parseResponse(rawResponse) {
|
|
51
|
+
const response = rawResponse;
|
|
52
|
+
if (response.errors && response.errors.length > 0) {
|
|
53
|
+
throw new invalid_response_js_1.InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
54
|
+
}
|
|
55
|
+
if (!response.data?.scenario) {
|
|
56
|
+
throw new not_found_js_1.NotFoundException("Legacy Scenario", { id: this.input.scenarioId });
|
|
57
|
+
}
|
|
58
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(legacy_scenario_js_1.LegacyScenarioSchema, response.data.scenario);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.LegacyScenarioFetchCommand = LegacyScenarioFetchCommand;
|
|
@@ -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
|