@flowcore/sdk 1.9.3 → 1.10.1

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 (180) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/esm/commands/api-key/api-key.create.d.ts +15 -3
  3. package/esm/commands/api-key/api-key.create.d.ts.map +1 -1
  4. package/esm/commands/api-key/api-key.create.js +31 -11
  5. package/esm/commands/api-key/api-key.delete.d.ts +1 -1
  6. package/esm/commands/api-key/api-key.delete.d.ts.map +1 -1
  7. package/esm/commands/api-key/api-key.delete.js +2 -2
  8. package/esm/commands/api-key/api-key.list.d.ts +1 -1
  9. package/esm/commands/api-key/api-key.list.d.ts.map +1 -1
  10. package/esm/commands/api-key/api-key.list.js +2 -2
  11. package/esm/commands/data-core/data-core.create.d.ts +6 -2
  12. package/esm/commands/data-core/data-core.create.d.ts.map +1 -1
  13. package/esm/commands/data-core/data-core.create.js +12 -0
  14. package/esm/commands/data-core/data-core.delete-request.d.ts +6 -6
  15. package/esm/commands/data-core/data-core.delete-request.d.ts.map +1 -1
  16. package/esm/commands/data-core/data-core.delete-request.js +7 -7
  17. package/esm/commands/data-core/data-core.fetch.d.ts +8 -4
  18. package/esm/commands/data-core/data-core.fetch.d.ts.map +1 -1
  19. package/esm/commands/data-core/data-core.fetch.js +12 -1
  20. package/esm/commands/data-core/data-core.list.d.ts +2 -2
  21. package/esm/commands/data-core/data-core.list.d.ts.map +1 -1
  22. package/esm/commands/data-core/data-core.update.d.ts +3 -3
  23. package/esm/commands/data-core/data-core.update.d.ts.map +1 -1
  24. package/esm/commands/data-core/data-core.update.js +1 -1
  25. package/esm/commands/event-type/event-type.create.d.ts +6 -2
  26. package/esm/commands/event-type/event-type.create.d.ts.map +1 -1
  27. package/esm/commands/event-type/event-type.create.js +12 -0
  28. package/esm/commands/event-type/event-type.delete-request.d.ts +8 -4
  29. package/esm/commands/event-type/event-type.delete-request.d.ts.map +1 -1
  30. package/esm/commands/event-type/event-type.delete-request.js +13 -4
  31. package/esm/commands/event-type/event-type.fetch.d.ts +7 -3
  32. package/esm/commands/event-type/event-type.fetch.d.ts.map +1 -1
  33. package/esm/commands/event-type/event-type.fetch.js +12 -1
  34. package/esm/commands/event-type/event-type.list.d.ts +2 -2
  35. package/esm/commands/event-type/event-type.list.d.ts.map +1 -1
  36. package/esm/commands/event-type/event-type.update.d.ts +1 -1
  37. package/esm/commands/event-type/event-type.update.d.ts.map +1 -1
  38. package/esm/commands/event-type/event-type.update.js +2 -2
  39. package/esm/commands/events/events.fetch-time-buckets-by-names.d.ts +1 -1
  40. package/esm/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -1
  41. package/esm/commands/events/events.fetch-time-buckets-by-names.js +2 -1
  42. package/esm/commands/events/events.fetch.d.ts +1 -1
  43. package/esm/commands/events/events.fetch.d.ts.map +1 -1
  44. package/esm/commands/events/events.fetch.js +2 -2
  45. package/esm/commands/flow-type/flow-type.create.d.ts +6 -2
  46. package/esm/commands/flow-type/flow-type.create.d.ts.map +1 -1
  47. package/esm/commands/flow-type/flow-type.create.js +12 -0
  48. package/esm/commands/flow-type/flow-type.delete-request.d.ts +13 -6
  49. package/esm/commands/flow-type/flow-type.delete-request.d.ts.map +1 -1
  50. package/esm/commands/flow-type/flow-type.delete-request.js +13 -4
  51. package/esm/commands/flow-type/flow-type.fetch.d.ts +9 -5
  52. package/esm/commands/flow-type/flow-type.fetch.d.ts.map +1 -1
  53. package/esm/commands/flow-type/flow-type.fetch.js +12 -1
  54. package/esm/commands/flow-type/flow-type.list.d.ts +2 -2
  55. package/esm/commands/flow-type/flow-type.list.d.ts.map +1 -1
  56. package/esm/commands/flow-type/flow-type.update.d.ts +3 -3
  57. package/esm/commands/flow-type/flow-type.update.d.ts.map +1 -1
  58. package/esm/commands/flow-type/flow-type.update.js +1 -1
  59. package/esm/commands/secret/secret.create.d.ts +1 -1
  60. package/esm/commands/secret/secret.create.d.ts.map +1 -1
  61. package/esm/commands/secret/secret.create.js +2 -2
  62. package/esm/commands/secret/secret.delete.d.ts +1 -1
  63. package/esm/commands/secret/secret.delete.d.ts.map +1 -1
  64. package/esm/commands/secret/secret.delete.js +2 -3
  65. package/esm/commands/secret/secret.list.d.ts +1 -1
  66. package/esm/commands/secret/secret.list.d.ts.map +1 -1
  67. package/esm/commands/secret/secret.list.js +2 -2
  68. package/esm/commands/tenant/tenant.fetch.d.ts +5 -6
  69. package/esm/commands/tenant/tenant.fetch.d.ts.map +1 -1
  70. package/esm/commands/tenant/tenant.fetch.js +7 -5
  71. package/esm/commands/tenant/tenant.list.d.ts +1 -1
  72. package/esm/commands/tenant/tenant.list.d.ts.map +1 -1
  73. package/esm/commands/tenant/tenant.list.js +2 -2
  74. package/esm/commands/variable/variable.create.d.ts +1 -1
  75. package/esm/commands/variable/variable.create.d.ts.map +1 -1
  76. package/esm/commands/variable/variable.create.js +2 -2
  77. package/esm/commands/variable/variable.delete.d.ts +1 -1
  78. package/esm/commands/variable/variable.delete.d.ts.map +1 -1
  79. package/esm/commands/variable/variable.delete.js +2 -2
  80. package/esm/commands/variable/variable.list.d.ts +1 -1
  81. package/esm/commands/variable/variable.list.d.ts.map +1 -1
  82. package/esm/commands/variable/variable.list.js +2 -2
  83. package/esm/common/command.d.ts +28 -6
  84. package/esm/common/command.d.ts.map +1 -1
  85. package/esm/common/command.js +43 -5
  86. package/esm/common/flowcore-client.d.ts.map +1 -1
  87. package/esm/common/flowcore-client.js +18 -11
  88. package/esm/exceptions/not-found.d.ts +1 -1
  89. package/esm/exceptions/not-found.d.ts.map +1 -1
  90. package/esm/exceptions/not-found.js +2 -2
  91. package/package.json +1 -1
  92. package/script/commands/api-key/api-key.create.d.ts +15 -3
  93. package/script/commands/api-key/api-key.create.d.ts.map +1 -1
  94. package/script/commands/api-key/api-key.create.js +31 -11
  95. package/script/commands/api-key/api-key.delete.d.ts +1 -1
  96. package/script/commands/api-key/api-key.delete.d.ts.map +1 -1
  97. package/script/commands/api-key/api-key.delete.js +2 -2
  98. package/script/commands/api-key/api-key.list.d.ts +1 -1
  99. package/script/commands/api-key/api-key.list.d.ts.map +1 -1
  100. package/script/commands/api-key/api-key.list.js +2 -2
  101. package/script/commands/data-core/data-core.create.d.ts +6 -2
  102. package/script/commands/data-core/data-core.create.d.ts.map +1 -1
  103. package/script/commands/data-core/data-core.create.js +12 -0
  104. package/script/commands/data-core/data-core.delete-request.d.ts +6 -6
  105. package/script/commands/data-core/data-core.delete-request.d.ts.map +1 -1
  106. package/script/commands/data-core/data-core.delete-request.js +7 -7
  107. package/script/commands/data-core/data-core.fetch.d.ts +8 -4
  108. package/script/commands/data-core/data-core.fetch.d.ts.map +1 -1
  109. package/script/commands/data-core/data-core.fetch.js +12 -1
  110. package/script/commands/data-core/data-core.list.d.ts +2 -2
  111. package/script/commands/data-core/data-core.list.d.ts.map +1 -1
  112. package/script/commands/data-core/data-core.update.d.ts +3 -3
  113. package/script/commands/data-core/data-core.update.d.ts.map +1 -1
  114. package/script/commands/data-core/data-core.update.js +1 -1
  115. package/script/commands/event-type/event-type.create.d.ts +6 -2
  116. package/script/commands/event-type/event-type.create.d.ts.map +1 -1
  117. package/script/commands/event-type/event-type.create.js +12 -0
  118. package/script/commands/event-type/event-type.delete-request.d.ts +8 -4
  119. package/script/commands/event-type/event-type.delete-request.d.ts.map +1 -1
  120. package/script/commands/event-type/event-type.delete-request.js +13 -4
  121. package/script/commands/event-type/event-type.fetch.d.ts +7 -3
  122. package/script/commands/event-type/event-type.fetch.d.ts.map +1 -1
  123. package/script/commands/event-type/event-type.fetch.js +12 -1
  124. package/script/commands/event-type/event-type.list.d.ts +2 -2
  125. package/script/commands/event-type/event-type.list.d.ts.map +1 -1
  126. package/script/commands/event-type/event-type.update.d.ts +1 -1
  127. package/script/commands/event-type/event-type.update.d.ts.map +1 -1
  128. package/script/commands/event-type/event-type.update.js +2 -2
  129. package/script/commands/events/events.fetch-time-buckets-by-names.d.ts +1 -1
  130. package/script/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -1
  131. package/script/commands/events/events.fetch-time-buckets-by-names.js +2 -1
  132. package/script/commands/events/events.fetch.d.ts +1 -1
  133. package/script/commands/events/events.fetch.d.ts.map +1 -1
  134. package/script/commands/events/events.fetch.js +2 -2
  135. package/script/commands/flow-type/flow-type.create.d.ts +6 -2
  136. package/script/commands/flow-type/flow-type.create.d.ts.map +1 -1
  137. package/script/commands/flow-type/flow-type.create.js +12 -0
  138. package/script/commands/flow-type/flow-type.delete-request.d.ts +13 -6
  139. package/script/commands/flow-type/flow-type.delete-request.d.ts.map +1 -1
  140. package/script/commands/flow-type/flow-type.delete-request.js +13 -4
  141. package/script/commands/flow-type/flow-type.fetch.d.ts +9 -5
  142. package/script/commands/flow-type/flow-type.fetch.d.ts.map +1 -1
  143. package/script/commands/flow-type/flow-type.fetch.js +12 -1
  144. package/script/commands/flow-type/flow-type.list.d.ts +2 -2
  145. package/script/commands/flow-type/flow-type.list.d.ts.map +1 -1
  146. package/script/commands/flow-type/flow-type.update.d.ts +3 -3
  147. package/script/commands/flow-type/flow-type.update.d.ts.map +1 -1
  148. package/script/commands/flow-type/flow-type.update.js +1 -1
  149. package/script/commands/secret/secret.create.d.ts +1 -1
  150. package/script/commands/secret/secret.create.d.ts.map +1 -1
  151. package/script/commands/secret/secret.create.js +2 -2
  152. package/script/commands/secret/secret.delete.d.ts +1 -1
  153. package/script/commands/secret/secret.delete.d.ts.map +1 -1
  154. package/script/commands/secret/secret.delete.js +2 -3
  155. package/script/commands/secret/secret.list.d.ts +1 -1
  156. package/script/commands/secret/secret.list.d.ts.map +1 -1
  157. package/script/commands/secret/secret.list.js +2 -2
  158. package/script/commands/tenant/tenant.fetch.d.ts +5 -6
  159. package/script/commands/tenant/tenant.fetch.d.ts.map +1 -1
  160. package/script/commands/tenant/tenant.fetch.js +7 -5
  161. package/script/commands/tenant/tenant.list.d.ts +1 -1
  162. package/script/commands/tenant/tenant.list.d.ts.map +1 -1
  163. package/script/commands/tenant/tenant.list.js +2 -2
  164. package/script/commands/variable/variable.create.d.ts +1 -1
  165. package/script/commands/variable/variable.create.d.ts.map +1 -1
  166. package/script/commands/variable/variable.create.js +2 -2
  167. package/script/commands/variable/variable.delete.d.ts +1 -1
  168. package/script/commands/variable/variable.delete.d.ts.map +1 -1
  169. package/script/commands/variable/variable.delete.js +2 -2
  170. package/script/commands/variable/variable.list.d.ts +1 -1
  171. package/script/commands/variable/variable.list.d.ts.map +1 -1
  172. package/script/commands/variable/variable.list.js +2 -2
  173. package/script/common/command.d.ts +28 -6
  174. package/script/common/command.d.ts.map +1 -1
  175. package/script/common/command.js +43 -5
  176. package/script/common/flowcore-client.d.ts.map +1 -1
  177. package/script/common/flowcore-client.js +18 -11
  178. package/script/exceptions/not-found.d.ts +1 -1
  179. package/script/exceptions/not-found.d.ts.map +1 -1
  180. package/script/exceptions/not-found.js +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.10.1](https://github.com/flowcore-io/flowcore-sdk/compare/v1.10.0...v1.10.1) (2025-02-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * disable retry for create resource commands ([c97f990](https://github.com/flowcore-io/flowcore-sdk/commit/c97f99017aaf6deef7ca431a61b5b4c322c3788f))
9
+
10
+ ## [1.10.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.9.3...v1.10.0) (2025-02-03)
11
+
12
+
13
+ ### Features
14
+
15
+ * add tests ([9590ea8](https://github.com/flowcore-io/flowcore-sdk/commit/9590ea8f95b23e219615c3219ae52c042925893f))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add explicit return ([5b30642](https://github.com/flowcore-io/flowcore-sdk/commit/5b3064238fd0c353c43ce9b7af5d42a434ff6e6f))
21
+ * add more tests ([814cb94](https://github.com/flowcore-io/flowcore-sdk/commit/814cb943df9cf5934530dfeec8db7167c4cc1273))
22
+
3
23
  ## [1.9.3](https://github.com/flowcore-io/flowcore-sdk/compare/v1.9.2...v1.9.3) (2025-02-03)
4
24
 
5
25
 
@@ -16,6 +16,10 @@ export interface ApiKeyCreateInput {
16
16
  export declare class ApiKeyCreateCommand extends GraphQlCommand<ApiKeyCreateInput, ApiKey & {
17
17
  value: string;
18
18
  }> {
19
+ /**
20
+ * Whether the command should retry on failure
21
+ */
22
+ protected retryOnFailure: boolean;
19
23
  /**
20
24
  * The allowed modes for the command
21
25
  */
@@ -23,12 +27,20 @@ export declare class ApiKeyCreateCommand extends GraphQlCommand<ApiKeyCreateInpu
23
27
  /**
24
28
  * Parse the response
25
29
  */
26
- protected parseResponse(rawResponse: unknown, flowcoreClient: FlowcoreClient): Promise<ApiKey & {
30
+ protected parseResponse(rawResponse: unknown): ApiKey & {
27
31
  value: string;
28
- }>;
32
+ };
29
33
  /**
30
34
  * Get the body for the request
31
35
  */
32
- protected getBody(): string;
36
+ protected getBody(): Record<string, unknown>;
37
+ /**
38
+ * Fill in the missing fields
39
+ */
40
+ protected processResponse(flowcoreClient: FlowcoreClient, response: ApiKey & {
41
+ value: string;
42
+ }): Promise<ApiKey & {
43
+ value: string;
44
+ }>;
33
45
  }
34
46
  //# sourceMappingURL=api-key.create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-key.create.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAIrE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAA;CACb;AA4BD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;IACpG;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACsB,aAAa,CACpC,WAAW,EAAE,OAAO,EACpB,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IA0BtC;;OAEG;cACgB,OAAO,IAAI,MAAM;CAMrC"}
1
+ {"version":3,"file":"api-key.create.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAIrE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAA;CACb;AA4BD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;IACpG;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAC9B,WAAW,EAAE,OAAO,GACnB,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;IAiB7B;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAOrD;;OAEG;cACsB,eAAe,CACtC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GACnC,OAAO,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAevC"}
@@ -29,6 +29,15 @@ const responseSchema = Type.Object({
29
29
  export class ApiKeyCreateCommand extends GraphQlCommand {
30
30
  constructor() {
31
31
  super(...arguments);
32
+ /**
33
+ * Whether the command should retry on failure
34
+ */
35
+ Object.defineProperty(this, "retryOnFailure", {
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true,
39
+ value: false
40
+ });
32
41
  /**
33
42
  * The allowed modes for the command
34
43
  */
@@ -42,7 +51,7 @@ export class ApiKeyCreateCommand extends GraphQlCommand {
42
51
  /**
43
52
  * Parse the response
44
53
  */
45
- async parseResponse(rawResponse, flowcoreClient) {
54
+ parseResponse(rawResponse) {
46
55
  const response = parseResponseHelper(responseSchema, rawResponse);
47
56
  if (response.errors) {
48
57
  throw new CommandError(this.constructor.name, response.errors[0].message);
@@ -50,15 +59,10 @@ export class ApiKeyCreateCommand extends GraphQlCommand {
50
59
  if (!response.data || response.data?.organization.createApiKey === null) {
51
60
  throw new CommandError(this.constructor.name, "Failed to create API key");
52
61
  }
53
- const apiKeys = await flowcoreClient.execute(new ApiKeyListCommand({
54
- tenantId: this.input.tenantId,
55
- }));
56
- const apiKey = apiKeys.find((apiKey) => apiKey.name === this.input.name);
57
- if (!apiKey) {
58
- throw new Error("API key not found");
59
- }
60
62
  return {
61
- ...apiKey,
63
+ id: "",
64
+ name: "",
65
+ createdAt: "",
62
66
  value: response.data.organization.createApiKey,
63
67
  };
64
68
  }
@@ -66,9 +70,25 @@ export class ApiKeyCreateCommand extends GraphQlCommand {
66
70
  * Get the body for the request
67
71
  */
68
72
  getBody() {
69
- return JSON.stringify({
73
+ return {
70
74
  query: graphQlQueryById,
71
75
  variables: this.input,
72
- });
76
+ };
77
+ }
78
+ /**
79
+ * Fill in the missing fields
80
+ */
81
+ async processResponse(flowcoreClient, response) {
82
+ const apiKeys = await flowcoreClient.execute(new ApiKeyListCommand({
83
+ tenantId: this.input.tenantId,
84
+ }));
85
+ const apiKey = apiKeys.find((apiKey) => apiKey.name === this.input.name);
86
+ if (!apiKey) {
87
+ throw new Error("API key not found");
88
+ }
89
+ return {
90
+ ...apiKey,
91
+ value: response.value,
92
+ };
73
93
  }
74
94
  }
@@ -23,6 +23,6 @@ export declare class ApiKeyDeleteCommand extends GraphQlCommand<ApiKeyDeleteInpu
23
23
  /**
24
24
  * Get the body for the request
25
25
  */
26
- protected getBody(): string;
26
+ protected getBody(): Record<string, unknown>;
27
27
  }
28
28
  //# sourceMappingURL=api-key.delete.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-key.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIxD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAA;CACjB;AAyBD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACjF;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO;IAW/D;;OAEG;cACgB,OAAO,IAAI,MAAM;CAMrC"}
1
+ {"version":3,"file":"api-key.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIxD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAA;CACjB;AAyBD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACjF;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO;IAW/D;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMtD"}
@@ -52,9 +52,9 @@ export class ApiKeyDeleteCommand extends GraphQlCommand {
52
52
  * Get the body for the request
53
53
  */
54
54
  getBody() {
55
- return JSON.stringify({
55
+ return {
56
56
  query: graphQlQueryById,
57
57
  variables: this.input,
58
- });
58
+ };
59
59
  }
60
60
  }
@@ -22,6 +22,6 @@ export declare class ApiKeyListCommand extends GraphQlCommand<ApiKeyListInput, A
22
22
  /**
23
23
  * Get the body for the request
24
24
  */
25
- protected getBody(): string;
25
+ protected getBody(): Record<string, unknown>;
26
26
  }
27
27
  //# sourceMappingURL=api-key.list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-key.list.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AA0BD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC9E;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE;IAKhE;;OAEG;cACgB,OAAO,IAAI,MAAM;CAMrC"}
1
+ {"version":3,"file":"api-key.list.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AA0BD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC9E;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE;IAKhE;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMtD"}
@@ -50,9 +50,9 @@ export class ApiKeyListCommand extends GraphQlCommand {
50
50
  * Get the body for the request
51
51
  */
52
52
  getBody() {
53
- return JSON.stringify({
53
+ return {
54
54
  query: graphQlQueryById,
55
55
  variables: this.input,
56
- });
56
+ };
57
57
  }
58
58
  }
@@ -3,7 +3,7 @@ import { type DataCore } from "../../contracts/data-core.js";
3
3
  /**
4
4
  * The input for the data core create command
5
5
  */
6
- export type DataCoreCreateInput = {
6
+ export interface DataCoreCreateInput {
7
7
  /** The tenant id */
8
8
  tenantId: string;
9
9
  /** The name of the data core */
@@ -14,11 +14,15 @@ export type DataCoreCreateInput = {
14
14
  accessControl: "public" | "private";
15
15
  /** Whether the data core is delete protected */
16
16
  deleteProtection: boolean;
17
- };
17
+ }
18
18
  /**
19
19
  * Create a data core
20
20
  */
21
21
  export declare class DataCoreCreateCommand extends Command<DataCoreCreateInput, DataCore> {
22
+ /**
23
+ * Whether the command should retry on failure
24
+ */
25
+ protected retryOnFailure: boolean;
22
26
  /**
23
27
  * Get the method
24
28
  */
@@ -1 +1 @@
1
- {"version":3,"file":"data-core.create.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,0CAA0C;IAC1C,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAA;IACnC,gDAAgD;IAChD,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAC/E;;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":"data-core.create.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,0CAA0C;IAC1C,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAA;IACnC,gDAAgD;IAChD,gBAAgB,EAAE,OAAO,CAAA;CAC1B;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"}
@@ -5,6 +5,18 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Create a data core
6
6
  */
7
7
  export class DataCoreCreateCommand 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
20
  /**
9
21
  * Get the method
10
22
  */
@@ -3,20 +3,20 @@ import type { FlowcoreClient } from "../../common/flowcore-client.js";
3
3
  /**
4
4
  * The input for the data core delete request command
5
5
  */
6
- export type DataCoreDeleteRequestInput = {
6
+ export interface DataCoreDeleteRequestInput {
7
7
  /** The id of the data core */
8
8
  dataCoreId: string;
9
9
  /** Wait for the data core to be deleted (default: true) */
10
10
  waitForDelete?: boolean;
11
- };
11
+ }
12
12
  /**
13
13
  * Request to delete a data core
14
14
  */
15
15
  export declare class DataCoreDeleteRequestCommand extends GraphQlCommand<DataCoreDeleteRequestInput, boolean> {
16
16
  /**
17
- * The allowed modes for the command
17
+ * Whether the command should retry on failure
18
18
  */
19
- protected allowedModes: ("apiKey" | "bearer")[];
19
+ protected retryOnFailure: boolean;
20
20
  /**
21
21
  * Create a new data core delete request command
22
22
  */
@@ -28,10 +28,10 @@ export declare class DataCoreDeleteRequestCommand extends GraphQlCommand<DataCor
28
28
  /**
29
29
  * Get the body for the request
30
30
  */
31
- protected getBody(): string;
31
+ protected getBody(): Record<string, unknown>;
32
32
  /**
33
33
  * Wait for the response (timeout: 25 seconds)
34
34
  */
35
- protected waitForResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
35
+ protected processResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
36
36
  }
37
37
  //# sourceMappingURL=data-core.delete-request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-core.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAKxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAErE;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AA4BD;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,0BAA0B,EAAE,OAAO,CAAC;IACnG;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;gBACS,KAAK,EAAE,0BAA0B;IAO7C;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAW5D;;OAEG;cACgB,OAAO,IAAI,MAAM;IAOpC;;OAEG;cACsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBtG"}
1
+ {"version":3,"file":"data-core.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAKxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAErE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AA4BD;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,0BAA0B,EAAE,OAAO,CAAC;IACnG;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;gBACS,KAAK,EAAE,0BAA0B;IAO7C;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAW5D;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAOrD;;OAEG;cACsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBtG"}
@@ -41,13 +41,13 @@ export class DataCoreDeleteRequestCommand extends GraphQlCommand {
41
41
  waitForDelete: input.waitForDelete ?? true,
42
42
  });
43
43
  /**
44
- * The allowed modes for the command
44
+ * Whether the command should retry on failure
45
45
  */
46
- Object.defineProperty(this, "allowedModes", {
46
+ Object.defineProperty(this, "retryOnFailure", {
47
47
  enumerable: true,
48
48
  configurable: true,
49
49
  writable: true,
50
- value: ["bearer"]
50
+ value: false
51
51
  });
52
52
  }
53
53
  /**
@@ -59,7 +59,7 @@ export class DataCoreDeleteRequestCommand extends GraphQlCommand {
59
59
  throw new CommandError(this.constructor.name, parsedResponse.errors[0].message);
60
60
  }
61
61
  if (!parsedResponse.data.datacore?.requestDelete) {
62
- throw new NotFoundException("DataCore", this.input.dataCoreId);
62
+ throw new NotFoundException("DataCore", { id: this.input.dataCoreId });
63
63
  }
64
64
  return parsedResponse.data.datacore.requestDelete.deleting;
65
65
  }
@@ -67,15 +67,15 @@ export class DataCoreDeleteRequestCommand extends GraphQlCommand {
67
67
  * Get the body for the request
68
68
  */
69
69
  getBody() {
70
- return JSON.stringify({
70
+ return {
71
71
  query: graphQlQuery,
72
72
  variables: this.input,
73
- });
73
+ };
74
74
  }
75
75
  /**
76
76
  * Wait for the response (timeout: 25 seconds)
77
77
  */
78
- async waitForResponse(client, response) {
78
+ async processResponse(client, response) {
79
79
  if (!this.input.waitForDelete) {
80
80
  return response;
81
81
  }
@@ -1,20 +1,21 @@
1
1
  import { Command } from "../../common/command.js";
2
2
  import { type DataCore } from "../../contracts/data-core.js";
3
+ import type { ClientError } from "../../exceptions/client-error.js";
3
4
  /**
4
5
  * The input for the data core fetch by id command
5
6
  */
6
- type DataCoreFetchByIdInput = {
7
+ export interface DataCoreFetchByIdInput {
7
8
  /** The id of the data core */
8
9
  dataCoreId: string;
9
10
  /** The name of the data core */
10
11
  dataCore?: never;
11
12
  /** The tenant id */
12
13
  tenantId?: never;
13
- };
14
+ }
14
15
  /**
15
16
  * The input for the data core fetch by name command
16
17
  */
17
- interface DataCoreFetchByNameInput {
18
+ export interface DataCoreFetchByNameInput {
18
19
  /** The tenant id */
19
20
  tenantId: string;
20
21
  /** The name of the data core */
@@ -46,6 +47,9 @@ export declare class DataCoreFetchCommand extends Command<DataCoreFetchInput, Da
46
47
  * Parse the response
47
48
  */
48
49
  protected parseResponse(rawResponse: unknown): DataCore;
50
+ /**
51
+ * Handle the client error
52
+ */
53
+ protected handleClientError(error: ClientError): void;
49
54
  }
50
- export {};
51
55
  //# sourceMappingURL=data-core.fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-core.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAI5E;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC5B,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CAAA;AAED;;GAEG;AACH,UAAU,wBAAwB;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,wBAAwB,CAAA;AAElF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC7E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAUpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAWjE"}
1
+ {"version":3,"file":"data-core.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,wBAAwB,CAAA;AAElF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC7E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAUpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;IAYhE;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;CAQ/D"}
@@ -41,8 +41,19 @@ export class DataCoreFetchCommand extends Command {
41
41
  }
42
42
  const response = parseResponseHelper(Type.Array(DataCoreSchema), rawResponse);
43
43
  if (response.length === 0) {
44
- throw new NotFoundException("DataCore", this.input.dataCore);
44
+ throw new NotFoundException("DataCore", { name: this.input.dataCore });
45
45
  }
46
46
  return response[0];
47
47
  }
48
+ /**
49
+ * Handle the client error
50
+ */
51
+ handleClientError(error) {
52
+ if (error.status === 404) {
53
+ throw new NotFoundException("DataCore", {
54
+ [this.input.dataCoreId ? "id" : "name"]: this.input.dataCoreId ?? this.input.dataCore,
55
+ });
56
+ }
57
+ throw error;
58
+ }
48
59
  }
@@ -3,12 +3,12 @@ import { type DataCore } from "../../contracts/data-core.js";
3
3
  /**
4
4
  * The input for the data core fetch by name command
5
5
  */
6
- export type DataCoreListInput = {
6
+ export interface DataCoreListInput {
7
7
  /** The tenant id */
8
8
  tenantId?: string;
9
9
  /** The tenant name */
10
10
  tenant?: string;
11
- };
11
+ }
12
12
  /**
13
13
  * Fetch all data cores for a tenant
14
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"data-core.list.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC7E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAWpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ,EAAE;CAGnE"}
1
+ {"version":3,"file":"data-core.list.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC7E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAWpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ,EAAE;CAGnE"}
@@ -3,7 +3,7 @@ import { type DataCore } from "../../contracts/data-core.js";
3
3
  /**
4
4
  * The input for the data core update command
5
5
  */
6
- export type DataCoreUpdateInput = {
6
+ export interface DataCoreUpdateInput {
7
7
  /** The id of the data core */
8
8
  dataCoreId: string;
9
9
  /** The description of the data core */
@@ -12,7 +12,7 @@ export type DataCoreUpdateInput = {
12
12
  accessControl?: "public" | "private";
13
13
  /** Whether the data core is delete protected */
14
14
  deleteProtection?: boolean;
15
- };
15
+ }
16
16
  /**
17
17
  * Update a data core
18
18
  */
@@ -32,7 +32,7 @@ export declare class DataCoreUpdateCommand extends Command<DataCoreUpdateInput,
32
32
  /**
33
33
  * Get the body for the request
34
34
  */
35
- protected getBody(): string | undefined;
35
+ protected getBody(): Record<string, unknown>;
36
36
  /**
37
37
  * Parse the response
38
38
  */
@@ -1 +1 @@
1
- {"version":3,"file":"data-core.update.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IACpC,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAC/E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,GAAG,SAAS;IAQhD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
1
+ {"version":3,"file":"data-core.update.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IACpC,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAC/E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAQrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
@@ -32,7 +32,7 @@ export class DataCoreUpdateCommand extends Command {
32
32
  if (Object.keys(payload).length === 0) {
33
33
  throw new CommandError(this.constructor.name, "No fields to update");
34
34
  }
35
- return JSON.stringify(payload);
35
+ return payload;
36
36
  }
37
37
  /**
38
38
  * Parse the response
@@ -3,18 +3,22 @@ import { type EventType } from "../../contracts/event-type.js";
3
3
  /**
4
4
  * The input for the event type create command
5
5
  */
6
- export type EventTypeCreateInput = {
6
+ export interface EventTypeCreateInput {
7
7
  /** The id of the flow type */
8
8
  flowTypeId: string;
9
9
  /** The name of the event type */
10
10
  name: string;
11
11
  /** The description of the event type */
12
12
  description: string;
13
- };
13
+ }
14
14
  /**
15
15
  * Create an event type
16
16
  */
17
17
  export declare class EventTypeCreateCommand extends Command<EventTypeCreateInput, EventType> {
18
+ /**
19
+ * Whether the command should retry on failure
20
+ */
21
+ protected retryOnFailure: boolean;
18
22
  /**
19
23
  * Get the method
20
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"event-type.create.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,+BAA+B,CAAA;AAG/E;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC;IAClF;;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,SAAS;CAGlE"}
1
+ {"version":3,"file":"event-type.create.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,+BAA+B,CAAA;AAG/E;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC;IAClF;;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,SAAS;CAGlE"}
@@ -5,6 +5,18 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Create an event type
6
6
  */
7
7
  export class EventTypeCreateCommand 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
20
  /**
9
21
  * Get the method
10
22
  */
@@ -3,16 +3,20 @@ import type { FlowcoreClient } from "../../common/flowcore-client.js";
3
3
  /**
4
4
  * The input for the event type delete request command
5
5
  */
6
- export type EventTypeDeleteRequestInput = {
6
+ export interface EventTypeDeleteRequestInput {
7
7
  /** The id of the event type */
8
8
  eventTypeId: string;
9
9
  /** Wait for the event type to be deleted (default: true) */
10
10
  waitForDelete?: boolean;
11
- };
11
+ }
12
12
  /**
13
13
  * Request to delete a event type
14
14
  */
15
15
  export declare class EventTypeDeleteRequestCommand extends GraphQlCommand<EventTypeDeleteRequestInput, boolean> {
16
+ /**
17
+ * Whether the command should retry on failure
18
+ */
19
+ protected retryOnFailure: boolean;
16
20
  /**
17
21
  * The allowed modes for the command
18
22
  */
@@ -28,10 +32,10 @@ export declare class EventTypeDeleteRequestCommand extends GraphQlCommand<EventT
28
32
  /**
29
33
  * Get the body for the request
30
34
  */
31
- protected getBody(): string;
35
+ protected getBody(): Record<string, unknown>;
32
36
  /**
33
37
  * Wait for the response (timeout: 25 seconds)
34
38
  */
35
- protected waitForResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
39
+ protected processResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
36
40
  }
37
41
  //# sourceMappingURL=event-type.delete-request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-type.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IAEnB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AA+BD;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,cAAc,CAAC,2BAA2B,EAAE,OAAO,CAAC;IACrG;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;gBACS,KAAK,EAAE,2BAA2B;IAO9C;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAW5D;;OAEG;cACgB,OAAO,IAAI,MAAM;IAQpC;;OAEG;cACsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBtG"}
1
+ {"version":3,"file":"event-type.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IAEnB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AA+BD;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,cAAc,CAAC,2BAA2B,EAAE,OAAO,CAAC;IACrG;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;gBACS,KAAK,EAAE,2BAA2B;IAO9C;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAW5D;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAQrD;;OAEG;cACsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBtG"}
@@ -43,6 +43,15 @@ export class EventTypeDeleteRequestCommand extends GraphQlCommand {
43
43
  ...input,
44
44
  waitForDelete: input.waitForDelete ?? true,
45
45
  });
46
+ /**
47
+ * Whether the command should retry on failure
48
+ */
49
+ Object.defineProperty(this, "retryOnFailure", {
50
+ enumerable: true,
51
+ configurable: true,
52
+ writable: true,
53
+ value: false
54
+ });
46
55
  /**
47
56
  * The allowed modes for the command
48
57
  */
@@ -62,7 +71,7 @@ export class EventTypeDeleteRequestCommand extends GraphQlCommand {
62
71
  throw new CommandError(this.constructor.name, parsedResponse.errors[0].message);
63
72
  }
64
73
  if (!parsedResponse.data?.eventType?.requestDelete) {
65
- throw new NotFoundException("EventType", this.input.eventTypeId);
74
+ throw new NotFoundException("EventType", { id: this.input.eventTypeId });
66
75
  }
67
76
  return parsedResponse.data.eventType.requestDelete.deleting;
68
77
  }
@@ -71,15 +80,15 @@ export class EventTypeDeleteRequestCommand extends GraphQlCommand {
71
80
  */
72
81
  getBody() {
73
82
  const { waitForDelete: _, ...rest } = this.input;
74
- return JSON.stringify({
83
+ return {
75
84
  query: graphQlQuery,
76
85
  variables: rest,
77
- });
86
+ };
78
87
  }
79
88
  /**
80
89
  * Wait for the response (timeout: 25 seconds)
81
90
  */
82
- async waitForResponse(client, response) {
91
+ async processResponse(client, response) {
83
92
  if (!this.input.waitForDelete) {
84
93
  return response;
85
94
  }
@@ -1,6 +1,7 @@
1
1
  import { Command } from "../../common/command.js";
2
2
  import { type EventType } from "../../contracts/event-type.js";
3
- interface EventTypeFetchByIdInput {
3
+ import type { ClientError } from "../../exceptions/client-error.js";
4
+ export interface EventTypeFetchByIdInput {
4
5
  /** The id of the event type */
5
6
  eventTypeId: string;
6
7
  /** The id of the flow type */
@@ -8,7 +9,7 @@ interface EventTypeFetchByIdInput {
8
9
  /** The name of the event type */
9
10
  eventType?: never;
10
11
  }
11
- interface EventTypeFetchByNameInput {
12
+ export interface EventTypeFetchByNameInput {
12
13
  /** The id of the flow type */
13
14
  flowTypeId: string;
14
15
  /** The name of the event type */
@@ -40,6 +41,9 @@ export declare class EventTypeFetchCommand extends Command<EventTypeFetchInput,
40
41
  * Parse the response
41
42
  */
42
43
  protected parseResponse(rawResponse: unknown): EventType;
44
+ /**
45
+ * Handle the client error
46
+ */
47
+ protected handleClientError(error: ClientError): void;
43
48
  }
44
- export {};
45
49
  //# sourceMappingURL=event-type.fetch.d.ts.map