@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.
Files changed (56) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/esm/commands/index.d.ts +5 -0
  3. package/esm/commands/index.d.ts.map +1 -1
  4. package/esm/commands/index.js +6 -0
  5. package/esm/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.d.ts +32 -0
  6. package/esm/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.d.ts.map +1 -0
  7. package/esm/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.js +50 -0
  8. package/esm/commands/legacy-scenario/legacy-scenario-adapter.restart.d.ts +43 -0
  9. package/esm/commands/legacy-scenario/legacy-scenario-adapter.restart.d.ts.map +1 -0
  10. package/esm/commands/legacy-scenario/legacy-scenario-adapter.restart.js +50 -0
  11. package/esm/commands/legacy-scenario/legacy-scenario.delete.d.ts +35 -0
  12. package/esm/commands/legacy-scenario/legacy-scenario.delete.d.ts.map +1 -0
  13. package/esm/commands/legacy-scenario/legacy-scenario.delete.js +45 -0
  14. package/esm/commands/legacy-scenario/legacy-scenario.fetch.d.ts +23 -0
  15. package/esm/commands/legacy-scenario/legacy-scenario.fetch.d.ts.map +1 -0
  16. package/esm/commands/legacy-scenario/legacy-scenario.fetch.js +57 -0
  17. package/esm/commands/legacy-scenario/legacy-scenario.list.d.ts +32 -0
  18. package/esm/commands/legacy-scenario/legacy-scenario.list.d.ts.map +1 -0
  19. package/esm/commands/legacy-scenario/legacy-scenario.list.js +59 -0
  20. package/esm/common/flowcore-client.d.ts +9 -1
  21. package/esm/common/flowcore-client.d.ts.map +1 -1
  22. package/esm/common/flowcore-client.js +15 -2
  23. package/esm/contracts/index.d.ts +2 -0
  24. package/esm/contracts/index.d.ts.map +1 -1
  25. package/esm/contracts/index.js +1 -0
  26. package/esm/contracts/legacy-scenario.d.ts +98 -0
  27. package/esm/contracts/legacy-scenario.d.ts.map +1 -0
  28. package/esm/contracts/legacy-scenario.js +103 -0
  29. package/package.json +1 -1
  30. package/script/commands/index.d.ts +5 -0
  31. package/script/commands/index.d.ts.map +1 -1
  32. package/script/commands/index.js +6 -0
  33. package/script/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.d.ts +32 -0
  34. package/script/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.d.ts.map +1 -0
  35. package/script/commands/legacy-scenario/legacy-scenario-adapter.fetch-state.js +54 -0
  36. package/script/commands/legacy-scenario/legacy-scenario-adapter.restart.d.ts +43 -0
  37. package/script/commands/legacy-scenario/legacy-scenario-adapter.restart.d.ts.map +1 -0
  38. package/script/commands/legacy-scenario/legacy-scenario-adapter.restart.js +54 -0
  39. package/script/commands/legacy-scenario/legacy-scenario.delete.d.ts +35 -0
  40. package/script/commands/legacy-scenario/legacy-scenario.delete.d.ts.map +1 -0
  41. package/script/commands/legacy-scenario/legacy-scenario.delete.js +49 -0
  42. package/script/commands/legacy-scenario/legacy-scenario.fetch.d.ts +23 -0
  43. package/script/commands/legacy-scenario/legacy-scenario.fetch.d.ts.map +1 -0
  44. package/script/commands/legacy-scenario/legacy-scenario.fetch.js +61 -0
  45. package/script/commands/legacy-scenario/legacy-scenario.list.d.ts +32 -0
  46. package/script/commands/legacy-scenario/legacy-scenario.list.d.ts.map +1 -0
  47. package/script/commands/legacy-scenario/legacy-scenario.list.js +63 -0
  48. package/script/common/flowcore-client.d.ts +9 -1
  49. package/script/common/flowcore-client.d.ts.map +1 -1
  50. package/script/common/flowcore-client.js +15 -2
  51. package/script/contracts/index.d.ts +2 -0
  52. package/script/contracts/index.d.ts.map +1 -1
  53. package/script/contracts/index.js +5 -0
  54. package/script/contracts/legacy-scenario.d.ts +98 -0
  55. package/script/contracts/legacy-scenario.d.ts.map +1 -0
  56. package/script/contracts/legacy-scenario.js +106 -0
@@ -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,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LegacyScenarioListCommand = void 0;
4
+ const typebox_1 = require("@sinclair/typebox");
5
+ const command_graphql_js_1 = require("../../common/command-graphql.js");
6
+ const legacy_scenario_js_1 = require("../../contracts/legacy-scenario.js");
7
+ const invalid_response_js_1 = require("../../exceptions/invalid-response.js");
8
+ const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
9
+ const LegacyScenarioListOutputSchema = typebox_1.Type.Object({
10
+ organizationId: typebox_1.Type.String(),
11
+ scenarios: typebox_1.Type.Array(legacy_scenario_js_1.LegacyScenarioListItemSchema),
12
+ });
13
+ const QUERY = `
14
+ query GetScenariosInOrganization($organizationId: ID!) {
15
+ organization(search: { id: $organizationId }) {
16
+ id
17
+ scenarios {
18
+ id
19
+ name
20
+ description
21
+ flowcoreUserId
22
+ deploymentState
23
+ createdAt
24
+ updatedAt
25
+ lastDeployed
26
+ }
27
+ }
28
+ }
29
+ `;
30
+ /**
31
+ * List all legacy scenarios in an organization
32
+ */
33
+ class LegacyScenarioListCommand extends command_graphql_js_1.GraphQlCommand {
34
+ /**
35
+ * Get the body for the request
36
+ */
37
+ getBody() {
38
+ return {
39
+ query: QUERY,
40
+ variables: {
41
+ organizationId: this.input.organizationId,
42
+ },
43
+ };
44
+ }
45
+ /**
46
+ * Parse the response
47
+ */
48
+ parseResponse(rawResponse) {
49
+ const response = rawResponse;
50
+ if (response.errors && response.errors.length > 0) {
51
+ throw new invalid_response_js_1.InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
52
+ }
53
+ if (!response.data?.organization) {
54
+ throw new invalid_response_js_1.InvalidResponseException("Organization not found in response", {});
55
+ }
56
+ const output = {
57
+ organizationId: response.data.organization.id,
58
+ scenarios: response.data.organization.scenarios ?? [],
59
+ };
60
+ return (0, parse_response_helper_js_1.parseResponseHelper)(LegacyScenarioListOutputSchema, output);
61
+ }
62
+ }
63
+ exports.LegacyScenarioListCommand = LegacyScenarioListCommand;
@@ -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
- apiKeyId: string;
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,OA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AAI;IAKb;;OAEG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGzB"}
@@ -6,6 +6,12 @@ const command_error_js_1 = require("../exceptions/command-error.js");
6
6
  const try_catch_js_1 = require("../utils/try-catch.js");
7
7
  const tenant_cache_js_1 = require("./tenant.cache.js");
8
8
  const RETRYABLE_ERROR_CODES = [408, 429, 500, 502, 503, 504];
9
+ function isClientOptionsBearer(options) {
10
+ return "getBearerToken" in options;
11
+ }
12
+ function isClientOptionsApiKey(options) {
13
+ return "apiKey" in options;
14
+ }
9
15
  /**
10
16
  * A base client for executing commands
11
17
  */
@@ -15,10 +21,17 @@ class FlowcoreClient {
15
21
  baseUrl;
16
22
  constructor(options) {
17
23
  this.options = options;
18
- if (this.options.getBearerToken) {
24
+ if (isClientOptionsBearer(this.options)) {
19
25
  this.mode = "bearer";
20
26
  }
21
- else if (this.options.apiKeyId && this.options.apiKey) {
27
+ else if (isClientOptionsApiKey(this.options)) {
28
+ if (!this.options.apiKeyId) {
29
+ const parts = this.options.apiKey.split("_");
30
+ if (parts.length !== 3 || parts[0] !== "fc") {
31
+ throw new Error("Invalid api key");
32
+ }
33
+ this.options.apiKeyId = parts[1];
34
+ }
22
35
  this.mode = "apiKey";
23
36
  }
24
37
  else {
@@ -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"}
@@ -14,5 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.LegacyScenarioNodeType = exports.LegacyScenarioDeploymentState = exports.LegacyScenarioAdapterKubernetesStatus = void 0;
17
18
  __exportStar(require("./ai-agent-coordinator-stream.js"), exports);
18
19
  __exportStar(require("./ai-agent-coordinator.js"), exports);
20
+ var legacy_scenario_js_1 = require("./legacy-scenario.js");
21
+ Object.defineProperty(exports, "LegacyScenarioAdapterKubernetesStatus", { enumerable: true, get: function () { return legacy_scenario_js_1.LegacyScenarioAdapterKubernetesStatus; } });
22
+ Object.defineProperty(exports, "LegacyScenarioDeploymentState", { enumerable: true, get: function () { return legacy_scenario_js_1.LegacyScenarioDeploymentState; } });
23
+ Object.defineProperty(exports, "LegacyScenarioNodeType", { enumerable: true, get: function () { return legacy_scenario_js_1.LegacyScenarioNodeType; } });
@@ -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,C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,EAAE,OAAO,CAAA;IACxB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,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,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LegacyScenarioAdapterStateSchema = exports.LegacyScenarioSchema = exports.LegacyScenarioListItemSchema = exports.LegacyScenarioNodeSchema = exports.LegacyScenarioNodeType = exports.LegacyScenarioAdapterKubernetesStatus = exports.LegacyScenarioDeploymentState = void 0;
4
+ const typebox_1 = require("@sinclair/typebox");
5
+ /**
6
+ * Deployment states for Legacy Scenarios
7
+ */
8
+ exports.LegacyScenarioDeploymentState = {
9
+ // when updating this object remember to update the type too
10
+ NOT_DEPLOYED: "NOT_DEPLOYED",
11
+ DEPLOYED: "DEPLOYED",
12
+ PARTIALLY_DEPLOYED: "PARTIALLY_DEPLOYED",
13
+ DELETING: "DELETING",
14
+ };
15
+ /**
16
+ * Kubernetes statuses for Legacy Scenario adapters
17
+ */
18
+ exports.LegacyScenarioAdapterKubernetesStatus = {
19
+ RUNNING: "RUNNING",
20
+ PENDING: "PENDING",
21
+ FAILED: "FAILED",
22
+ NOT_DEPLOYED: "NOT_DEPLOYED",
23
+ };
24
+ /**
25
+ * Node types in Legacy Scenarios
26
+ */
27
+ exports.LegacyScenarioNodeType = {
28
+ Adapter: "Adapter",
29
+ DataCore: "DataCore",
30
+ };
31
+ /**
32
+ * The schema for a Legacy Scenario node
33
+ */
34
+ exports.LegacyScenarioNodeSchema = typebox_1.Type.Object({
35
+ /** Unique identifier for the node */
36
+ id: typebox_1.Type.String(),
37
+ /** Type of the node (Adapter or DataCore) */
38
+ type: typebox_1.Type.String(),
39
+ /** Name of the node */
40
+ name: typebox_1.Type.String(),
41
+ /** Description of the node */
42
+ description: typebox_1.Type.Optional(typebox_1.Type.String()),
43
+ /** Node configuration data as JSON string */
44
+ data: typebox_1.Type.Optional(typebox_1.Type.String()),
45
+ /** Parent node IDs */
46
+ parents: typebox_1.Type.Array(typebox_1.Type.String()),
47
+ /** Child node IDs */
48
+ children: typebox_1.Type.Array(typebox_1.Type.String()),
49
+ });
50
+ /**
51
+ * The schema for a Legacy Scenario (list view)
52
+ */
53
+ exports.LegacyScenarioListItemSchema = typebox_1.Type.Object({
54
+ /** Unique identifier for the scenario */
55
+ id: typebox_1.Type.String(),
56
+ /** Name of the scenario */
57
+ name: typebox_1.Type.String(),
58
+ /** Description of the scenario */
59
+ description: typebox_1.Type.Optional(typebox_1.Type.String()),
60
+ /** ID of the user who created the scenario */
61
+ flowcoreUserId: typebox_1.Type.String(),
62
+ /** Current deployment state */
63
+ deploymentState: typebox_1.Type.Union([
64
+ typebox_1.Type.Literal(exports.LegacyScenarioDeploymentState.NOT_DEPLOYED),
65
+ typebox_1.Type.Literal(exports.LegacyScenarioDeploymentState.DEPLOYED),
66
+ typebox_1.Type.Literal(exports.LegacyScenarioDeploymentState.PARTIALLY_DEPLOYED),
67
+ typebox_1.Type.Literal(exports.LegacyScenarioDeploymentState.DELETING),
68
+ ]),
69
+ /** Creation timestamp */
70
+ createdAt: typebox_1.Type.String(),
71
+ /** Last update timestamp */
72
+ updatedAt: typebox_1.Type.String(),
73
+ /** Last deployment timestamp */
74
+ lastDeployed: typebox_1.Type.Optional(typebox_1.Type.String()),
75
+ });
76
+ /**
77
+ * The schema for a Legacy Scenario (full view with nodes)
78
+ */
79
+ exports.LegacyScenarioSchema = typebox_1.Type.Object({
80
+ /** Unique identifier for the scenario */
81
+ id: typebox_1.Type.String(),
82
+ /** Name of the scenario */
83
+ name: typebox_1.Type.String(),
84
+ /** Description of the scenario */
85
+ description: typebox_1.Type.Optional(typebox_1.Type.String()),
86
+ /** ID of the user who created the scenario */
87
+ flowcoreUserId: typebox_1.Type.String(),
88
+ /** ID of the organization that owns this scenario */
89
+ organizationId: typebox_1.Type.String(),
90
+ /** Current deployment state */
91
+ deploymentState: typebox_1.Type.String(),
92
+ /** Creation timestamp */
93
+ createdAt: typebox_1.Type.String(),
94
+ /** Last update timestamp */
95
+ updatedAt: typebox_1.Type.String(),
96
+ /** Nodes in the scenario */
97
+ nodes: typebox_1.Type.Array(exports.LegacyScenarioNodeSchema),
98
+ });
99
+ /**
100
+ * The schema for adapter state
101
+ */
102
+ exports.LegacyScenarioAdapterStateSchema = typebox_1.Type.Object({
103
+ kubernetes: typebox_1.Type.Object({
104
+ status: typebox_1.Type.String(),
105
+ }),
106
+ });