@flowcore/sdk 1.48.0 → 1.50.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 (157) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +47 -0
  3. package/esm/_dnt.shims.d.ts +1 -1
  4. package/esm/commands/adapter/reset-adapter.d.ts +52 -0
  5. package/esm/commands/adapter/reset-adapter.d.ts.map +1 -0
  6. package/esm/commands/adapter/reset-adapter.js +38 -0
  7. package/esm/commands/ai-agent-coordinator/conversation-stream.command.js +1 -6
  8. package/esm/commands/api-key/api-key.create.js +8 -21
  9. package/esm/commands/api-key/api-key.delete.js +4 -12
  10. package/esm/commands/api-key/api-key.list.js +4 -12
  11. package/esm/commands/data-core/data-core.create.js +4 -12
  12. package/esm/commands/data-core/data-core.request-delete.js +4 -12
  13. package/esm/commands/event-type/event-type.create.js +4 -12
  14. package/esm/commands/event-type/event-type.request-delete.js +4 -12
  15. package/esm/commands/event-type/event-type.request-truncate.js +4 -12
  16. package/esm/commands/events/event.list.js +4 -12
  17. package/esm/commands/events/events.fetch-time-buckets-by-names.js +4 -12
  18. package/esm/commands/events/events.fetch.js +4 -12
  19. package/esm/commands/events/time-bucket.list.js +4 -12
  20. package/esm/commands/flow-type/flow-type.create.js +4 -12
  21. package/esm/commands/flow-type/flow-type.request-delete.js +4 -12
  22. package/esm/commands/index.d.ts +1 -7
  23. package/esm/commands/index.d.ts.map +1 -1
  24. package/esm/commands/index.js +2 -8
  25. package/esm/commands/ingestion/ingest.batch.js +5 -18
  26. package/esm/commands/ingestion/ingest.event.js +5 -18
  27. package/esm/commands/scenario/scenario.create.js +4 -12
  28. package/esm/commands/scenario/scenario.delete.js +4 -12
  29. package/esm/commands/scenario/scenario.fetch.d.ts +22 -4
  30. package/esm/commands/scenario/scenario.fetch.d.ts.map +1 -1
  31. package/esm/commands/scenario/scenario.fetch.js +29 -13
  32. package/esm/commands/scenario/scenario.list.js +4 -12
  33. package/esm/commands/scenario/scenario.update.d.ts +4 -2
  34. package/esm/commands/scenario/scenario.update.d.ts.map +1 -1
  35. package/esm/commands/scenario/scenario.update.js +13 -12
  36. package/esm/commands/secret/secret.create.js +4 -12
  37. package/esm/commands/secret/secret.delete.js +4 -12
  38. package/esm/commands/secret/secret.list.js +4 -12
  39. package/esm/commands/security/pat.create.js +4 -12
  40. package/esm/commands/security/pat.delete.js +4 -12
  41. package/esm/commands/security/pat.exchange.js +4 -12
  42. package/esm/commands/security/pat.get.js +4 -12
  43. package/esm/commands/security/pat.list.js +4 -12
  44. package/esm/commands/tenant/tenant.list.js +4 -12
  45. package/esm/commands/variable/variable.create.js +4 -12
  46. package/esm/commands/variable/variable.delete.js +4 -12
  47. package/esm/commands/variable/variable.list.js +4 -12
  48. package/esm/common/command-graphql.js +4 -12
  49. package/esm/common/command.js +20 -45
  50. package/esm/common/flowcore-client.js +4 -18
  51. package/esm/common/notification-client.js +15 -72
  52. package/esm/common/websocket-client.js +16 -80
  53. package/esm/exceptions/client-error.js +6 -18
  54. package/esm/exceptions/invalid-response.js +2 -6
  55. package/esm/utils/local-cache.js +5 -19
  56. package/package.json +1 -1
  57. package/script/_dnt.shims.d.ts +1 -1
  58. package/script/commands/adapter/reset-adapter.d.ts +52 -0
  59. package/script/commands/adapter/reset-adapter.d.ts.map +1 -0
  60. package/script/commands/adapter/reset-adapter.js +42 -0
  61. package/script/commands/ai-agent-coordinator/conversation-stream.command.js +1 -6
  62. package/script/commands/api-key/api-key.create.js +8 -21
  63. package/script/commands/api-key/api-key.delete.js +4 -12
  64. package/script/commands/api-key/api-key.list.js +4 -12
  65. package/script/commands/data-core/data-core.create.js +4 -12
  66. package/script/commands/data-core/data-core.request-delete.js +4 -12
  67. package/script/commands/event-type/event-type.create.js +4 -12
  68. package/script/commands/event-type/event-type.request-delete.js +4 -12
  69. package/script/commands/event-type/event-type.request-truncate.js +4 -12
  70. package/script/commands/events/event.list.js +4 -12
  71. package/script/commands/events/events.fetch-time-buckets-by-names.js +4 -12
  72. package/script/commands/events/events.fetch.js +4 -12
  73. package/script/commands/events/time-bucket.list.js +4 -12
  74. package/script/commands/flow-type/flow-type.create.js +4 -12
  75. package/script/commands/flow-type/flow-type.request-delete.js +4 -12
  76. package/script/commands/index.d.ts +1 -7
  77. package/script/commands/index.d.ts.map +1 -1
  78. package/script/commands/index.js +2 -8
  79. package/script/commands/ingestion/ingest.batch.js +5 -18
  80. package/script/commands/ingestion/ingest.event.js +5 -18
  81. package/script/commands/scenario/scenario.create.js +4 -12
  82. package/script/commands/scenario/scenario.delete.js +4 -12
  83. package/script/commands/scenario/scenario.fetch.d.ts +22 -4
  84. package/script/commands/scenario/scenario.fetch.d.ts.map +1 -1
  85. package/script/commands/scenario/scenario.fetch.js +29 -13
  86. package/script/commands/scenario/scenario.list.js +4 -12
  87. package/script/commands/scenario/scenario.update.d.ts +4 -2
  88. package/script/commands/scenario/scenario.update.d.ts.map +1 -1
  89. package/script/commands/scenario/scenario.update.js +13 -12
  90. package/script/commands/secret/secret.create.js +4 -12
  91. package/script/commands/secret/secret.delete.js +4 -12
  92. package/script/commands/secret/secret.list.js +4 -12
  93. package/script/commands/security/pat.create.js +4 -12
  94. package/script/commands/security/pat.delete.js +4 -12
  95. package/script/commands/security/pat.exchange.js +4 -12
  96. package/script/commands/security/pat.get.js +4 -12
  97. package/script/commands/security/pat.list.js +4 -12
  98. package/script/commands/tenant/tenant.list.js +4 -12
  99. package/script/commands/variable/variable.create.js +4 -12
  100. package/script/commands/variable/variable.delete.js +4 -12
  101. package/script/commands/variable/variable.list.js +4 -12
  102. package/script/common/command-graphql.js +4 -12
  103. package/script/common/command.js +20 -45
  104. package/script/common/flowcore-client.js +4 -18
  105. package/script/common/notification-client.js +15 -72
  106. package/script/common/websocket-client.js +16 -80
  107. package/script/exceptions/client-error.js +6 -18
  108. package/script/exceptions/invalid-response.js +2 -6
  109. package/script/utils/local-cache.js +5 -19
  110. package/esm/commands/iam/api-key-role-association.create.d.ts +0 -45
  111. package/esm/commands/iam/api-key-role-association.create.d.ts.map +0 -1
  112. package/esm/commands/iam/api-key-role-association.create.js +0 -44
  113. package/esm/commands/iam/api-key-role-association.delete.d.ts +0 -45
  114. package/esm/commands/iam/api-key-role-association.delete.d.ts.map +0 -1
  115. package/esm/commands/iam/api-key-role-association.delete.js +0 -44
  116. package/esm/commands/iam/api-key-role-association.list.d.ts +0 -31
  117. package/esm/commands/iam/api-key-role-association.list.d.ts.map +0 -1
  118. package/esm/commands/iam/api-key-role-association.list.js +0 -37
  119. package/esm/commands/iam/role.list.d.ts +0 -33
  120. package/esm/commands/iam/role.list.d.ts.map +0 -1
  121. package/esm/commands/iam/role.list.js +0 -41
  122. package/esm/commands/iam/user-role-association.create.d.ts +0 -42
  123. package/esm/commands/iam/user-role-association.create.d.ts.map +0 -1
  124. package/esm/commands/iam/user-role-association.create.js +0 -40
  125. package/esm/commands/iam/user-role-association.delete.d.ts +0 -42
  126. package/esm/commands/iam/user-role-association.delete.d.ts.map +0 -1
  127. package/esm/commands/iam/user-role-association.delete.js +0 -40
  128. package/esm/commands/iam/user-role-association.list.d.ts +0 -33
  129. package/esm/commands/iam/user-role-association.list.d.ts.map +0 -1
  130. package/esm/commands/iam/user-role-association.list.js +0 -39
  131. package/esm/contracts/iam.d.ts +0 -13
  132. package/esm/contracts/iam.d.ts.map +0 -1
  133. package/esm/contracts/iam.js +0 -9
  134. package/script/commands/iam/api-key-role-association.create.d.ts +0 -45
  135. package/script/commands/iam/api-key-role-association.create.d.ts.map +0 -1
  136. package/script/commands/iam/api-key-role-association.create.js +0 -48
  137. package/script/commands/iam/api-key-role-association.delete.d.ts +0 -45
  138. package/script/commands/iam/api-key-role-association.delete.d.ts.map +0 -1
  139. package/script/commands/iam/api-key-role-association.delete.js +0 -48
  140. package/script/commands/iam/api-key-role-association.list.d.ts +0 -31
  141. package/script/commands/iam/api-key-role-association.list.d.ts.map +0 -1
  142. package/script/commands/iam/api-key-role-association.list.js +0 -41
  143. package/script/commands/iam/role.list.d.ts +0 -33
  144. package/script/commands/iam/role.list.d.ts.map +0 -1
  145. package/script/commands/iam/role.list.js +0 -45
  146. package/script/commands/iam/user-role-association.create.d.ts +0 -42
  147. package/script/commands/iam/user-role-association.create.d.ts.map +0 -1
  148. package/script/commands/iam/user-role-association.create.js +0 -44
  149. package/script/commands/iam/user-role-association.delete.d.ts +0 -42
  150. package/script/commands/iam/user-role-association.delete.d.ts.map +0 -1
  151. package/script/commands/iam/user-role-association.delete.js +0 -44
  152. package/script/commands/iam/user-role-association.list.d.ts +0 -33
  153. package/script/commands/iam/user-role-association.list.d.ts.map +0 -1
  154. package/script/commands/iam/user-role-association.list.js +0 -43
  155. package/script/contracts/iam.d.ts +0 -13
  156. package/script/contracts/iam.d.ts.map +0 -1
  157. package/script/contracts/iam.js +0 -12
@@ -12,24 +12,11 @@ const responseSchema = Type.Object({
12
12
  * Ingest an event
13
13
  */
14
14
  export class IngestEventCommand extends Command {
15
- constructor() {
16
- super(...arguments);
17
- /**
18
- * The dedicated subdomain for the command
19
- */
20
- Object.defineProperty(this, "dedicatedSubdomain", {
21
- enumerable: true,
22
- configurable: true,
23
- writable: true,
24
- value: "webhook"
25
- });
26
- Object.defineProperty(this, "allowedModes", {
27
- enumerable: true,
28
- configurable: true,
29
- writable: true,
30
- value: ["apiKey"]
31
- });
32
- }
15
+ /**
16
+ * The dedicated subdomain for the command
17
+ */
18
+ dedicatedSubdomain = "webhook";
19
+ allowedModes = ["apiKey"];
33
20
  getMethod() {
34
21
  return "POST";
35
22
  }
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Create a scenario
6
6
  */
7
7
  export class ScenarioCreateCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -8,18 +8,10 @@ const ScenarioDeleteOutputSchema = Type.Object({
8
8
  * Delete a scenario
9
9
  */
10
10
  export class ScenarioDeleteCommand extends Command {
11
- constructor() {
12
- super(...arguments);
13
- /**
14
- * Whether the command should retry on failure
15
- */
16
- Object.defineProperty(this, "retryOnFailure", {
17
- enumerable: true,
18
- configurable: true,
19
- writable: true,
20
- value: false
21
- });
22
- }
11
+ /**
12
+ * Whether the command should retry on failure
13
+ */
14
+ retryOnFailure = false;
23
15
  /**
24
16
  * Get the method
25
17
  */
@@ -1,12 +1,26 @@
1
1
  import { Command } from "../../common/command.js";
2
2
  import { type Scenario } from "../../contracts/scenario.js";
3
- /**
4
- * The input for the scenario fetch command
5
- */
6
- export interface ScenarioFetchInput {
3
+ import type { ClientError } from "../../exceptions/client-error.js";
4
+ export interface ScenarioFetchByIdInput {
7
5
  /** The scenario id */
8
6
  scenarioId: string;
7
+ /** The tenant id */
8
+ tenantId?: never;
9
+ /** scenario name */
10
+ name?: never;
11
+ }
12
+ export interface ScenarioFetchByNameInput {
13
+ /** The scenario id */
14
+ scenarioId?: never;
15
+ /** The tenant id */
16
+ tenantId: string;
17
+ /** scenario name */
18
+ name: string;
9
19
  }
20
+ /**
21
+ * The input for the scenario fetch command
22
+ */
23
+ export type ScenarioFetchInput = ScenarioFetchByIdInput | ScenarioFetchByNameInput;
10
24
  /**
11
25
  * fetch a scenario
12
26
  */
@@ -31,5 +45,9 @@ export declare class ScenarioFetchCommand extends Command<ScenarioFetchInput, Sc
31
45
  * Parse the response
32
46
  */
33
47
  protected parseResponse(rawResponse: unknown): Scenario;
48
+ /**
49
+ * Handle the client error
50
+ */
51
+ protected handleClientError(error: ClientError): void;
34
52
  }
35
53
  //# sourceMappingURL=scenario.fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scenario.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,6BAA6B,CAAA;AAG3E;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC7E;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
1
+ {"version":3,"file":"scenario.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,6BAA6B,CAAA;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAInE,MAAM,WAAW,sBAAsB;IACrC,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,oBAAoB;IACpB,IAAI,CAAC,EAAE,KAAK,CAAA;CACb;AAED,MAAM,WAAW,wBAAwB;IACvC,sBAAsB;IACtB,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;CACb;AAUD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,wBAAwB,CAAA;AAElF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC7E;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAOpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;IAIhE;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;CAU/D"}
@@ -1,22 +1,21 @@
1
1
  import { Command } from "../../common/command.js";
2
2
  import { ScenarioSchema } from "../../contracts/scenario.js";
3
+ import { NotFoundException } from "../../exceptions/not-found.js";
3
4
  import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
+ function isScenarioFetchByIdInput(input) {
6
+ return "scenarioId" in input;
7
+ }
8
+ function isScenarioFetchByNameAndTenantInput(input) {
9
+ return "tenantId" in input;
10
+ }
4
11
  /**
5
12
  * fetch a scenario
6
13
  */
7
14
  export class ScenarioFetchCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
15
+ /**
16
+ * Whether the command should retry on failure
17
+ */
18
+ retryOnFailure = false;
20
19
  /**
21
20
  * Get the method
22
21
  */
@@ -33,7 +32,10 @@ export class ScenarioFetchCommand extends Command {
33
32
  * Get the path
34
33
  */
35
34
  getPath() {
36
- return `/api/v1/scenarios/${this.input.scenarioId}`;
35
+ if (this.input.scenarioId) {
36
+ return `/api/v1/scenarios/${this.input.scenarioId}`;
37
+ }
38
+ return `/api/v1/scenarios/tenant/${this.input.tenantId}/name/${this.input.name}`;
37
39
  }
38
40
  /**
39
41
  * Parse the response
@@ -41,4 +43,18 @@ export class ScenarioFetchCommand extends Command {
41
43
  parseResponse(rawResponse) {
42
44
  return parseResponseHelper(ScenarioSchema, rawResponse);
43
45
  }
46
+ /**
47
+ * Handle the client error
48
+ */
49
+ handleClientError(error) {
50
+ if (error.status === 404) {
51
+ if (isScenarioFetchByIdInput(this.input)) {
52
+ throw new NotFoundException("Scenario", { id: this.input.scenarioId });
53
+ }
54
+ else if (isScenarioFetchByNameAndTenantInput(this.input)) {
55
+ throw new NotFoundException("Scenario", { name: this.input.name, tenantId: this.input.tenantId });
56
+ }
57
+ }
58
+ throw error;
59
+ }
44
60
  }
@@ -10,18 +10,10 @@ const ScenarioListOutputSchema = Type.Object({
10
10
  * list all scenarios
11
11
  */
12
12
  export class ScenarioListCommand extends Command {
13
- constructor() {
14
- super(...arguments);
15
- /**
16
- * Whether the command should retry on failure
17
- */
18
- Object.defineProperty(this, "retryOnFailure", {
19
- enumerable: true,
20
- configurable: true,
21
- writable: true,
22
- value: false
23
- });
24
- }
13
+ /**
14
+ * Whether the command should retry on failure
15
+ */
16
+ retryOnFailure = false;
25
17
  /**
26
18
  * Get the method
27
19
  */
@@ -4,8 +4,6 @@ import { type Scenario } from "../../contracts/scenario.js";
4
4
  * The input for the scenario update command
5
5
  */
6
6
  export interface ScenarioUpdateInput {
7
- /** The tenant id */
8
- tenantId: string;
9
7
  /** The scenario id */
10
8
  scenarioId: string;
11
9
  /** The description of the scenario */
@@ -29,6 +27,10 @@ export declare class ScenarioUpdateCommand extends Command<ScenarioUpdateInput,
29
27
  * Get the base url
30
28
  */
31
29
  protected getBaseUrl(): string;
30
+ /**
31
+ * Get the body
32
+ */
33
+ protected getBody(): Record<string, unknown> | Array<unknown> | undefined;
32
34
  /**
33
35
  * Get the path
34
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"scenario.update.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,6BAA6B,CAAA;AAG3E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAC/E;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
1
+ {"version":3,"file":"scenario.update.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,6BAA6B,CAAA;AAG3E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAC/E;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,SAAS;IAOlF;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Update a scenario
6
6
  */
7
7
  export class ScenarioUpdateCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -29,6 +21,15 @@ export class ScenarioUpdateCommand extends Command {
29
21
  getBaseUrl() {
30
22
  return "https://scenario-2.api.flowcore.io";
31
23
  }
24
+ /**
25
+ * Get the body
26
+ */
27
+ getBody() {
28
+ return {
29
+ ...(this.input.description && { description: this.input.description }),
30
+ ...(this.input.displayName && { displayName: this.input.displayName }),
31
+ };
32
+ }
32
33
  /**
33
34
  * Get the path
34
35
  */
@@ -23,18 +23,10 @@ const responseSchema = Type.Object({
23
23
  * List secrets
24
24
  */
25
25
  export class SecretCreateCommand extends GraphQlCommand {
26
- constructor() {
27
- super(...arguments);
28
- /**
29
- * The allowed modes for the command
30
- */
31
- Object.defineProperty(this, "allowedModes", {
32
- enumerable: true,
33
- configurable: true,
34
- writable: true,
35
- value: ["bearer"]
36
- });
37
- }
26
+ /**
27
+ * The allowed modes for the command
28
+ */
29
+ allowedModes = ["bearer"];
38
30
  /**
39
31
  * Parse the response
40
32
  */
@@ -23,18 +23,10 @@ const responseSchema = Type.Object({
23
23
  * List secrets
24
24
  */
25
25
  export class SecretDeleteCommand extends GraphQlCommand {
26
- constructor() {
27
- super(...arguments);
28
- /**
29
- * The allowed modes for the command
30
- */
31
- Object.defineProperty(this, "allowedModes", {
32
- enumerable: true,
33
- configurable: true,
34
- writable: true,
35
- value: ["bearer"]
36
- });
37
- }
26
+ /**
27
+ * The allowed modes for the command
28
+ */
29
+ allowedModes = ["bearer"];
38
30
  /**
39
31
  * Parse the response
40
32
  */
@@ -26,18 +26,10 @@ const responseSchema = Type.Object({
26
26
  * List secrets
27
27
  */
28
28
  export class SecretListCommand extends GraphQlCommand {
29
- constructor() {
30
- super(...arguments);
31
- /**
32
- * The allowed modes for the command
33
- */
34
- Object.defineProperty(this, "allowedModes", {
35
- enumerable: true,
36
- configurable: true,
37
- writable: true,
38
- value: ["bearer"]
39
- });
40
- }
29
+ /**
30
+ * The allowed modes for the command
31
+ */
32
+ allowedModes = ["bearer"];
41
33
  /**
42
34
  * Parse the response
43
35
  */
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Create a Personal Access Token (PAT)
6
6
  */
7
7
  export class SecurityCreatePATCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Delete a Personal Access Token (PAT)
6
6
  */
7
7
  export class SecurityDeletePATCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Exchange a Personal Access Token (PAT) for an access token
6
6
  */
7
7
  export class SecurityExchangePATCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Get a Personal Access Token (PAT)
6
6
  */
7
7
  export class SecurityGetPATCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -6,18 +6,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
6
6
  * List all your Personal Access Token (PAT)
7
7
  */
8
8
  export class SecurityListPATCommand extends Command {
9
- constructor() {
10
- super(...arguments);
11
- /**
12
- * Whether the command should retry on failure
13
- */
14
- Object.defineProperty(this, "retryOnFailure", {
15
- enumerable: true,
16
- configurable: true,
17
- writable: true,
18
- value: false
19
- });
20
- }
9
+ /**
10
+ * Whether the command should retry on failure
11
+ */
12
+ retryOnFailure = false;
21
13
  /**
22
14
  * Get the method
23
15
  */
@@ -45,18 +45,10 @@ const responseSchema = Type.Object({
45
45
  * List tenants
46
46
  */
47
47
  export class TenantListCommand extends GraphQlCommand {
48
- constructor() {
49
- super(...arguments);
50
- /**
51
- * The allowed modes for the command
52
- */
53
- Object.defineProperty(this, "allowedModes", {
54
- enumerable: true,
55
- configurable: true,
56
- writable: true,
57
- value: ["bearer"]
58
- });
59
- }
48
+ /**
49
+ * The allowed modes for the command
50
+ */
51
+ allowedModes = ["bearer"];
60
52
  /**
61
53
  * Parse the response
62
54
  */
@@ -26,18 +26,10 @@ const responseSchema = Type.Object({
26
26
  * Create a variable
27
27
  */
28
28
  export class VariableCreateCommand extends GraphQlCommand {
29
- constructor() {
30
- super(...arguments);
31
- /**
32
- * The allowed modes for the command
33
- */
34
- Object.defineProperty(this, "allowedModes", {
35
- enumerable: true,
36
- configurable: true,
37
- writable: true,
38
- value: ["bearer"]
39
- });
40
- }
29
+ /**
30
+ * The allowed modes for the command
31
+ */
32
+ allowedModes = ["bearer"];
41
33
  /**
42
34
  * Parse the response
43
35
  */
@@ -26,18 +26,10 @@ const responseSchema = Type.Object({
26
26
  * Create a variable
27
27
  */
28
28
  export class VariableDeleteCommand extends GraphQlCommand {
29
- constructor() {
30
- super(...arguments);
31
- /**
32
- * The allowed modes for the command
33
- */
34
- Object.defineProperty(this, "allowedModes", {
35
- enumerable: true,
36
- configurable: true,
37
- writable: true,
38
- value: ["bearer"]
39
- });
40
- }
29
+ /**
30
+ * The allowed modes for the command
31
+ */
32
+ allowedModes = ["bearer"];
41
33
  /**
42
34
  * Parse the response
43
35
  */
@@ -32,18 +32,10 @@ const responseSchema = Type.Object({
32
32
  * List variables
33
33
  */
34
34
  export class VariableListCommand extends GraphQlCommand {
35
- constructor() {
36
- super(...arguments);
37
- /**
38
- * The allowed modes for the command
39
- */
40
- Object.defineProperty(this, "allowedModes", {
41
- enumerable: true,
42
- configurable: true,
43
- writable: true,
44
- value: ["bearer"]
45
- });
46
- }
35
+ /**
36
+ * The allowed modes for the command
37
+ */
38
+ allowedModes = ["bearer"];
47
39
  /**
48
40
  * Parse the response
49
41
  */
@@ -3,18 +3,10 @@ import { Command } from "./command.js";
3
3
  * Abstract command for executing GraphQL requests
4
4
  */
5
5
  export class GraphQlCommand extends Command {
6
- constructor() {
7
- super(...arguments);
8
- /**
9
- * The allowed modes for the command
10
- */
11
- Object.defineProperty(this, "allowedModes", {
12
- enumerable: true,
13
- configurable: true,
14
- writable: true,
15
- value: ["bearer"]
16
- });
17
- }
6
+ /**
7
+ * The allowed modes for the command
8
+ */
9
+ allowedModes = ["bearer"];
18
10
  /**
19
11
  * Get the base URL for the request
20
12
  */
@@ -5,52 +5,27 @@ import { tenantCache } from "./tenant.cache.js";
5
5
  * Abstract command for executing requests
6
6
  */
7
7
  export class Command {
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = true;
12
+ /**
13
+ * The dedicated subdomain for the command
14
+ */
15
+ dedicatedSubdomain;
16
+ /**
17
+ * The allowed modes for the command
18
+ */
19
+ allowedModes = ["apiKey", "bearer"];
20
+ /**
21
+ * The input for the command
22
+ */
23
+ input;
24
+ /**
25
+ * The client auth options
26
+ */
27
+ clientAuthOptions = {};
8
28
  constructor(input) {
9
- /**
10
- * Whether the command should retry on failure
11
- */
12
- Object.defineProperty(this, "retryOnFailure", {
13
- enumerable: true,
14
- configurable: true,
15
- writable: true,
16
- value: true
17
- });
18
- /**
19
- * The dedicated subdomain for the command
20
- */
21
- Object.defineProperty(this, "dedicatedSubdomain", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: void 0
26
- });
27
- /**
28
- * The allowed modes for the command
29
- */
30
- Object.defineProperty(this, "allowedModes", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: ["apiKey", "bearer"]
35
- });
36
- /**
37
- * The input for the command
38
- */
39
- Object.defineProperty(this, "input", {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: void 0
44
- });
45
- /**
46
- * The client auth options
47
- */
48
- Object.defineProperty(this, "clientAuthOptions", {
49
- enumerable: true,
50
- configurable: true,
51
- writable: true,
52
- value: {}
53
- });
54
29
  /**
55
30
  * The input for the command
56
31
  */