@flowcore/sdk 1.12.1 → 1.14.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 (80) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/esm/commands/container-registry/container-registry.delete.d.ts.map +1 -1
  3. package/esm/commands/container-registry/container-registry.delete.js +0 -1
  4. package/esm/commands/container-registry/container-registry.update.d.ts.map +1 -1
  5. package/esm/commands/container-registry/container-registry.update.js +0 -1
  6. package/esm/commands/data-core/data-core.delete-request.d.ts +1 -0
  7. package/esm/commands/data-core/data-core.delete-request.d.ts.map +1 -1
  8. package/esm/commands/data-core/data-core.delete-request.js +1 -0
  9. package/esm/commands/data-core/data-core.request-delete.d.ts +49 -0
  10. package/esm/commands/data-core/data-core.request-delete.d.ts.map +1 -0
  11. package/esm/commands/data-core/data-core.request-delete.js +67 -0
  12. package/esm/commands/event-type/event-type.delete-request.d.ts +1 -0
  13. package/esm/commands/event-type/event-type.delete-request.d.ts.map +1 -1
  14. package/esm/commands/event-type/event-type.delete-request.js +1 -0
  15. package/esm/commands/event-type/event-type.request-delete.d.ts +48 -0
  16. package/esm/commands/event-type/event-type.request-delete.d.ts.map +1 -0
  17. package/esm/commands/event-type/event-type.request-delete.js +67 -0
  18. package/esm/commands/event-type/event-type.request-truncate.d.ts +48 -0
  19. package/esm/commands/event-type/event-type.request-truncate.d.ts.map +1 -0
  20. package/esm/commands/event-type/event-type.request-truncate.js +68 -0
  21. package/esm/commands/event-type/event-type.truncate-request.d.ts +1 -0
  22. package/esm/commands/event-type/event-type.truncate-request.d.ts.map +1 -1
  23. package/esm/commands/event-type/event-type.truncate-request.js +1 -0
  24. package/esm/commands/flow-type/flow-type.delete-request.d.ts +1 -0
  25. package/esm/commands/flow-type/flow-type.delete-request.d.ts.map +1 -1
  26. package/esm/commands/flow-type/flow-type.delete-request.js +1 -0
  27. package/esm/commands/flow-type/flow-type.request-delete.d.ts +48 -0
  28. package/esm/commands/flow-type/flow-type.request-delete.d.ts.map +1 -0
  29. package/esm/commands/flow-type/flow-type.request-delete.js +67 -0
  30. package/esm/commands/index.d.ts +17 -12
  31. package/esm/commands/index.d.ts.map +1 -1
  32. package/esm/commands/index.js +17 -12
  33. package/esm/commands/tenant/tenant.translate-name-to-id.d.ts +44 -0
  34. package/esm/commands/tenant/tenant.translate-name-to-id.d.ts.map +1 -0
  35. package/esm/commands/tenant/tenant.translate-name-to-id.js +52 -0
  36. package/esm/common/flowcore-client.js +1 -1
  37. package/esm/contracts/container.d.ts +2 -2
  38. package/esm/contracts/container.d.ts.map +1 -1
  39. package/esm/contracts/container.js +4 -2
  40. package/esm/exceptions/client-error.js +1 -1
  41. package/package.json +1 -1
  42. package/script/commands/container-registry/container-registry.delete.d.ts.map +1 -1
  43. package/script/commands/container-registry/container-registry.delete.js +0 -1
  44. package/script/commands/container-registry/container-registry.update.d.ts.map +1 -1
  45. package/script/commands/container-registry/container-registry.update.js +0 -1
  46. package/script/commands/data-core/data-core.delete-request.d.ts +1 -0
  47. package/script/commands/data-core/data-core.delete-request.d.ts.map +1 -1
  48. package/script/commands/data-core/data-core.delete-request.js +1 -0
  49. package/script/commands/data-core/data-core.request-delete.d.ts +49 -0
  50. package/script/commands/data-core/data-core.request-delete.d.ts.map +1 -0
  51. package/script/commands/data-core/data-core.request-delete.js +71 -0
  52. package/script/commands/event-type/event-type.delete-request.d.ts +1 -0
  53. package/script/commands/event-type/event-type.delete-request.d.ts.map +1 -1
  54. package/script/commands/event-type/event-type.delete-request.js +1 -0
  55. package/script/commands/event-type/event-type.request-delete.d.ts +48 -0
  56. package/script/commands/event-type/event-type.request-delete.d.ts.map +1 -0
  57. package/script/commands/event-type/event-type.request-delete.js +71 -0
  58. package/script/commands/event-type/event-type.request-truncate.d.ts +48 -0
  59. package/script/commands/event-type/event-type.request-truncate.d.ts.map +1 -0
  60. package/script/commands/event-type/event-type.request-truncate.js +72 -0
  61. package/script/commands/event-type/event-type.truncate-request.d.ts +1 -0
  62. package/script/commands/event-type/event-type.truncate-request.d.ts.map +1 -1
  63. package/script/commands/event-type/event-type.truncate-request.js +1 -0
  64. package/script/commands/flow-type/flow-type.delete-request.d.ts +1 -0
  65. package/script/commands/flow-type/flow-type.delete-request.d.ts.map +1 -1
  66. package/script/commands/flow-type/flow-type.delete-request.js +1 -0
  67. package/script/commands/flow-type/flow-type.request-delete.d.ts +48 -0
  68. package/script/commands/flow-type/flow-type.request-delete.d.ts.map +1 -0
  69. package/script/commands/flow-type/flow-type.request-delete.js +71 -0
  70. package/script/commands/index.d.ts +17 -12
  71. package/script/commands/index.d.ts.map +1 -1
  72. package/script/commands/index.js +17 -12
  73. package/script/commands/tenant/tenant.translate-name-to-id.d.ts +44 -0
  74. package/script/commands/tenant/tenant.translate-name-to-id.d.ts.map +1 -0
  75. package/script/commands/tenant/tenant.translate-name-to-id.js +56 -0
  76. package/script/common/flowcore-client.js +1 -1
  77. package/script/contracts/container.d.ts +2 -2
  78. package/script/contracts/container.d.ts.map +1 -1
  79. package/script/contracts/container.js +3 -1
  80. package/script/exceptions/client-error.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.14.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.13.0...v1.14.0) (2025-03-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * **tenant:** :sparkles: Add tenant name to ID translation command ([7d16207](https://github.com/flowcore-io/flowcore-sdk/commit/7d1620762a5b99b9ae9cb9b25d07b9222fdd5e9f))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **tenant:** :art: Improve type definitions for tenant translate name to ID schema ([232c441](https://github.com/flowcore-io/flowcore-sdk/commit/232c4417b34b42130f093a10f0daf7657e011c32))
14
+
15
+ ## [1.13.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.12.1...v1.13.0) (2025-03-05)
16
+
17
+
18
+ ### Features
19
+
20
+ * change client error message to include response body ([67ee317](https://github.com/flowcore-io/flowcore-sdk/commit/67ee31700dc48022f98f403a984eae28a0648cc2))
21
+ * **commands:** :sparkles: Add waitfordelete and waitfortruncate to new delete/truncate commands ([3ffcf57](https://github.com/flowcore-io/flowcore-sdk/commit/3ffcf5748f641df185bf8dc6984b8b7fdd7509a8))
22
+ * **commands:** :sparkles: Delete/truncate request commands for datacore, flowtype and eventtype ([418708c](https://github.com/flowcore-io/flowcore-sdk/commit/418708c91e3a5893618f059648f540be01bae8cc))
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * export new commands ([84264cd](https://github.com/flowcore-io/flowcore-sdk/commit/84264cd136c1b03ab10a83e5f59b777193f927a4))
28
+ * force ([388db43](https://github.com/flowcore-io/flowcore-sdk/commit/388db43bd22bbe4ccd724f34ca1956bb8c42b192))
29
+
3
30
  ## [1.12.1](https://github.com/flowcore-io/flowcore-sdk/compare/v1.12.0...v1.12.1) (2025-03-03)
4
31
 
5
32
 
@@ -1 +1 @@
1
- {"version":3,"file":"container-registry.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAiC,MAAM,8BAA8B,CAAA;AAC1G,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAA;AAE3D,MAAM,WAAW,4BAA4B;IAC3C,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,4BAA4B,EAAE,uBAAuB,CAAC;cAC7F,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,uBAAuB;CAI7E"}
1
+ {"version":3,"file":"container-registry.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAiC,MAAM,8BAA8B,CAAA;AAC1G,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAA;AAE3D,MAAM,WAAW,4BAA4B;IAC3C,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,4BAA4B,EAAE,uBAAuB,CAAC;cAC7F,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,uBAAuB;CAG7E"}
@@ -20,7 +20,6 @@ export class ContainerRegistryDeleteCommand extends Command {
20
20
  * Parse the response
21
21
  */
22
22
  parseResponse(response) {
23
- console.log(response);
24
23
  return parseResponseHelper(ContainerRegistryDeleteSchema, response);
25
24
  }
26
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"container-registry.update.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,8BAA8B,CAAA;AAG9F,UAAU,4BAA4B;IACpC,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sBAAsB;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,4BAA4B,EAAE,iBAAiB,CAAC;cACvF,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,iBAAiB;CAIvE"}
1
+ {"version":3,"file":"container-registry.update.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,8BAA8B,CAAA;AAG9F,UAAU,4BAA4B;IACpC,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sBAAsB;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,4BAA4B,EAAE,iBAAiB,CAAC;cACvF,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,iBAAiB;CAGvE"}
@@ -21,7 +21,6 @@ export class ContainerRegistryUpdateCommand extends Command {
21
21
  * Parse the response
22
22
  */
23
23
  parseResponse(response) {
24
- //console.log(response)
25
24
  return parseResponseHelper(ContainerRegistrySchema, response);
26
25
  }
27
26
  }
@@ -11,6 +11,7 @@ export interface DataCoreDeleteRequestInput {
11
11
  }
12
12
  /**
13
13
  * Request to delete a data core
14
+ * @deprecated Use `DataCoreRequestDeleteCommand` instead
14
15
  */
15
16
  export declare class DataCoreDeleteRequestCommand extends GraphQlCommand<DataCoreDeleteRequestInput, boolean> {
16
17
  /**
@@ -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,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"}
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;;;GAGG;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"}
@@ -30,6 +30,7 @@ const responseSchema = Type.Object({
30
30
  });
31
31
  /**
32
32
  * Request to delete a data core
33
+ * @deprecated Use `DataCoreRequestDeleteCommand` instead
33
34
  */
34
35
  export class DataCoreDeleteRequestCommand extends GraphQlCommand {
35
36
  /**
@@ -0,0 +1,49 @@
1
+ import { Command } from "../../common/command.js";
2
+ import type { ClientError } from "../../exceptions/client-error.js";
3
+ import type { FlowcoreClient } from "../../common/flowcore-client.js";
4
+ /**
5
+ * The input for the data core request delete command
6
+ */
7
+ export interface DataCoreRequestDeleteInput {
8
+ /** The id of the data core */
9
+ dataCoreId: string;
10
+ /** Wait for the data core to be deleted (default: false) */
11
+ waitForDelete?: boolean;
12
+ }
13
+ /**
14
+ * The output for the data core request delete command
15
+ */
16
+ export interface DataCoreRequestDeleteOutput {
17
+ /** The success of the data core delete request */
18
+ success: boolean;
19
+ }
20
+ /**
21
+ * Request to delete a data core
22
+ */
23
+ export declare class DataCoreRequestDeleteCommand extends Command<DataCoreRequestDeleteInput, DataCoreRequestDeleteOutput> {
24
+ /**
25
+ * Get the method
26
+ */
27
+ protected getMethod(): string;
28
+ /**
29
+ * Get the base url
30
+ */
31
+ protected getBaseUrl(): string;
32
+ /**
33
+ * Get the path
34
+ */
35
+ protected getPath(): string;
36
+ /**
37
+ * Parse the response
38
+ */
39
+ protected parseResponse(rawResponse: unknown): DataCoreRequestDeleteOutput;
40
+ /**
41
+ * Handle the client error
42
+ */
43
+ protected handleClientError(error: ClientError): void;
44
+ /**
45
+ * Wait for the response (timeout: 25 seconds)
46
+ */
47
+ protected processResponse(client: FlowcoreClient, response: DataCoreRequestDeleteOutput): Promise<DataCoreRequestDeleteOutput>;
48
+ }
49
+ //# sourceMappingURL=data-core.request-delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-core.request-delete.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.request-delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,OAAO,CAAC,0BAA0B,EAAE,2BAA2B,CAAC;IAChH;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,2BAA2B;IAUnF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,2BAA2B,GACpC,OAAO,CAAC,2BAA2B,CAAC;CAkBxC"}
@@ -0,0 +1,67 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { Command } from "../../common/command.js";
3
+ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
4
+ import { NotFoundException } from "../../exceptions/not-found.js";
5
+ import { DataCoreExistsCommand } from "./data-core.exists.js";
6
+ /**
7
+ * Request to delete a data core
8
+ */
9
+ export class DataCoreRequestDeleteCommand extends Command {
10
+ /**
11
+ * Get the method
12
+ */
13
+ getMethod() {
14
+ return "DELETE";
15
+ }
16
+ /**
17
+ * Get the base url
18
+ */
19
+ getBaseUrl() {
20
+ return "https://delete-manager.api.flowcore.io";
21
+ }
22
+ /**
23
+ * Get the path
24
+ */
25
+ getPath() {
26
+ return `/api/v1/data-cores/${this.input.dataCoreId}/request-delete`;
27
+ }
28
+ /**
29
+ * Parse the response
30
+ */
31
+ parseResponse(rawResponse) {
32
+ const response = parseResponseHelper(Type.Object({
33
+ success: Type.Boolean(),
34
+ }), rawResponse);
35
+ return response;
36
+ }
37
+ /**
38
+ * Handle the client error
39
+ */
40
+ handleClientError(error) {
41
+ if (error.status === 404) {
42
+ throw new NotFoundException("DataCore", {
43
+ "id": this.input.dataCoreId,
44
+ });
45
+ }
46
+ throw error;
47
+ }
48
+ /**
49
+ * Wait for the response (timeout: 25 seconds)
50
+ */
51
+ async processResponse(client, response) {
52
+ if (!this.input.waitForDelete) {
53
+ return response;
54
+ }
55
+ const start = Date.now();
56
+ while (Date.now() - start < 25_000) {
57
+ const response = await client.execute(new DataCoreExistsCommand({
58
+ dataCoreId: this.input.dataCoreId,
59
+ }));
60
+ if (!response.exists) {
61
+ break;
62
+ }
63
+ await new Promise((resolve) => setTimeout(resolve, 100));
64
+ }
65
+ return response;
66
+ }
67
+ }
@@ -11,6 +11,7 @@ export interface EventTypeDeleteRequestInput {
11
11
  }
12
12
  /**
13
13
  * Request to delete a event type
14
+ * @deprecated Use `EventTypeRequestDeleteCommand` instead
14
15
  */
15
16
  export declare class EventTypeDeleteRequestCommand extends GraphQlCommand<EventTypeDeleteRequestInput, boolean> {
16
17
  /**
@@ -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,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"}
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;;;GAGG;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"}
@@ -33,6 +33,7 @@ const responseSchema = Type.Object({
33
33
  });
34
34
  /**
35
35
  * Request to delete a event type
36
+ * @deprecated Use `EventTypeRequestDeleteCommand` instead
36
37
  */
37
38
  export class EventTypeDeleteRequestCommand extends GraphQlCommand {
38
39
  /**
@@ -0,0 +1,48 @@
1
+ import { Command } from "../../common/command.js";
2
+ import type { ClientError } from "../../exceptions/client-error.js";
3
+ import type { FlowcoreClient } from "../../common/flowcore-client.js";
4
+ /**
5
+ * The input for the event type request delete command
6
+ */
7
+ export interface EventTypeRequestDeleteInput {
8
+ /** The id of the event type */
9
+ eventTypeId: string;
10
+ /** Wait for the event type to be deleted (default: false) */
11
+ waitForDelete?: boolean;
12
+ }
13
+ /**
14
+ * The output for the event type request delete command
15
+ */
16
+ export interface EventTypeRequestDeleteOutput {
17
+ success: boolean;
18
+ }
19
+ /**
20
+ * Request to delete an event type
21
+ */
22
+ export declare class EventTypeRequestDeleteCommand extends Command<EventTypeRequestDeleteInput, EventTypeRequestDeleteOutput> {
23
+ /**
24
+ * Get the method
25
+ */
26
+ protected getMethod(): string;
27
+ /**
28
+ * Get the base url
29
+ */
30
+ protected getBaseUrl(): string;
31
+ /**
32
+ * Get the path
33
+ */
34
+ protected getPath(): string;
35
+ /**
36
+ * Parse the response
37
+ */
38
+ protected parseResponse(rawResponse: unknown): EventTypeRequestDeleteOutput;
39
+ /**
40
+ * Handle the client error
41
+ */
42
+ protected handleClientError(error: ClientError): void;
43
+ /**
44
+ * Wait for the response (timeout: 25 seconds)
45
+ */
46
+ protected processResponse(client: FlowcoreClient, response: EventTypeRequestDeleteOutput): Promise<EventTypeRequestDeleteOutput>;
47
+ }
48
+ //# sourceMappingURL=event-type.request-delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-type.request-delete.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.request-delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAErE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,OAAO,CAAC,2BAA2B,EAAE,4BAA4B,CAAC;IACnH;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,4BAA4B;IAUpF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,4BAA4B,GACrC,OAAO,CAAC,4BAA4B,CAAC;CAkBzC"}
@@ -0,0 +1,67 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { Command } from "../../common/command.js";
3
+ import { NotFoundException } from "../../exceptions/not-found.js";
4
+ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
+ import { EventTypeExistsCommand } from "./event-type.exists.js";
6
+ /**
7
+ * Request to delete an event type
8
+ */
9
+ export class EventTypeRequestDeleteCommand extends Command {
10
+ /**
11
+ * Get the method
12
+ */
13
+ getMethod() {
14
+ return "DELETE";
15
+ }
16
+ /**
17
+ * Get the base url
18
+ */
19
+ getBaseUrl() {
20
+ return "https://delete-manager.api.flowcore.io";
21
+ }
22
+ /**
23
+ * Get the path
24
+ */
25
+ getPath() {
26
+ return `/api/v1/event-types/${this.input.eventTypeId}/request-delete`;
27
+ }
28
+ /**
29
+ * Parse the response
30
+ */
31
+ parseResponse(rawResponse) {
32
+ const response = parseResponseHelper(Type.Object({
33
+ success: Type.Boolean(),
34
+ }), rawResponse);
35
+ return response;
36
+ }
37
+ /**
38
+ * Handle the client error
39
+ */
40
+ handleClientError(error) {
41
+ if (error.status === 404) {
42
+ throw new NotFoundException("EventType", {
43
+ [this.input.eventTypeId ? "id" : "name"]: this.input.eventTypeId ?? this.input.eventTypeId,
44
+ });
45
+ }
46
+ throw error;
47
+ }
48
+ /**
49
+ * Wait for the response (timeout: 25 seconds)
50
+ */
51
+ async processResponse(client, response) {
52
+ if (!this.input.waitForDelete) {
53
+ return response;
54
+ }
55
+ const start = Date.now();
56
+ while (Date.now() - start < 25_000) {
57
+ const response = await client.execute(new EventTypeExistsCommand({
58
+ eventTypeId: this.input.eventTypeId,
59
+ }));
60
+ if (!response.exists) {
61
+ break;
62
+ }
63
+ await new Promise((resolve) => setTimeout(resolve, 100));
64
+ }
65
+ return response;
66
+ }
67
+ }
@@ -0,0 +1,48 @@
1
+ import { Command } from "../../common/command.js";
2
+ import type { ClientError } from "../../exceptions/client-error.js";
3
+ import type { FlowcoreClient } from "../../common/flowcore-client.js";
4
+ /**
5
+ * The input for the event type request truncate command
6
+ */
7
+ export interface EventTypeRequestTruncateInput {
8
+ /** The id of the event type */
9
+ eventTypeId: string;
10
+ /** Wait for the event type to be truncated (default: false) */
11
+ waitForTruncate?: boolean;
12
+ }
13
+ /**
14
+ * The output for the event type request truncate command
15
+ */
16
+ export interface EventTypeRequestTruncateOutput {
17
+ success: boolean;
18
+ }
19
+ /**
20
+ * Request to truncate an event type
21
+ */
22
+ export declare class EventTypeRequestTruncateCommand extends Command<EventTypeRequestTruncateInput, EventTypeRequestTruncateOutput> {
23
+ /**
24
+ * Get the method
25
+ */
26
+ protected getMethod(): string;
27
+ /**
28
+ * Get the base url
29
+ */
30
+ protected getBaseUrl(): string;
31
+ /**
32
+ * Get the path
33
+ */
34
+ protected getPath(): string;
35
+ /**
36
+ * Parse the response
37
+ */
38
+ protected parseResponse(rawResponse: unknown): EventTypeRequestTruncateOutput;
39
+ /**
40
+ * Handle the client error
41
+ */
42
+ protected handleClientError(error: ClientError): void;
43
+ /**
44
+ * Wait for the response (timeout: 25 seconds)
45
+ */
46
+ protected processResponse(client: FlowcoreClient, response: EventTypeRequestTruncateOutput): Promise<EventTypeRequestTruncateOutput>;
47
+ }
48
+ //# sourceMappingURL=event-type.request-truncate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-type.request-truncate.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.request-truncate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IAEnB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,+BACX,SAAQ,OAAO,CAAC,6BAA6B,EAAE,8BAA8B,CAAC;IAC9E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,8BAA8B;IAUtF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,8BAA8B,GACvC,OAAO,CAAC,8BAA8B,CAAC;CAmB3C"}
@@ -0,0 +1,68 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { Command } from "../../common/command.js";
3
+ import { NotFoundException } from "../../exceptions/not-found.js";
4
+ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
+ import { EventTypeFetchCommand } from "./event-type.fetch.js";
6
+ /**
7
+ * Request to truncate an event type
8
+ */
9
+ export class EventTypeRequestTruncateCommand extends Command {
10
+ /**
11
+ * Get the method
12
+ */
13
+ getMethod() {
14
+ return "DELETE";
15
+ }
16
+ /**
17
+ * Get the base url
18
+ */
19
+ getBaseUrl() {
20
+ return "https://delete-manager.api.flowcore.io";
21
+ }
22
+ /**
23
+ * Get the path
24
+ */
25
+ getPath() {
26
+ return `/api/v1/event-types/${this.input.eventTypeId}/request-truncate`;
27
+ }
28
+ /**
29
+ * Parse the response
30
+ */
31
+ parseResponse(rawResponse) {
32
+ const response = parseResponseHelper(Type.Object({
33
+ success: Type.Boolean(),
34
+ }), rawResponse);
35
+ return response;
36
+ }
37
+ /**
38
+ * Handle the client error
39
+ */
40
+ handleClientError(error) {
41
+ if (error.status === 404) {
42
+ throw new NotFoundException("EventType", {
43
+ [this.input.eventTypeId ? "id" : "name"]: this.input.eventTypeId ?? this.input.eventTypeId,
44
+ });
45
+ }
46
+ throw error;
47
+ }
48
+ /**
49
+ * Wait for the response (timeout: 25 seconds)
50
+ */
51
+ async processResponse(client, response) {
52
+ if (!this.input.waitForTruncate) {
53
+ return response;
54
+ }
55
+ await new Promise((resolve) => setTimeout(resolve, 1_000));
56
+ const start = Date.now();
57
+ while (Date.now() - start < 25_000) {
58
+ const response = await client.execute(new EventTypeFetchCommand({
59
+ eventTypeId: this.input.eventTypeId,
60
+ }));
61
+ if (response.isTruncating) {
62
+ break;
63
+ }
64
+ await new Promise((resolve) => setTimeout(resolve, 100));
65
+ }
66
+ return response;
67
+ }
68
+ }
@@ -11,6 +11,7 @@ export interface EventTypeTruncateRequestInput {
11
11
  }
12
12
  /**
13
13
  * Request to truncate a event type
14
+ * @deprecated Use `EventTypeRequestTruncateCommand` instead
14
15
  */
15
16
  export declare class EventTypeTruncateRequestCommand extends GraphQlCommand<EventTypeTruncateRequestInput, boolean> {
16
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"event-type.truncate-request.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.truncate-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,6BAA6B;IAC5C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IAEnB,8DAA8D;IAC9D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AA+BD;;GAEG;AACH,qBAAa,+BAAgC,SAAQ,cAAc,CAAC,6BAA6B,EAAE,OAAO,CAAC;IACzG;;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,6BAA6B;IAOhD;;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"}
1
+ {"version":3,"file":"event-type.truncate-request.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.truncate-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,6BAA6B;IAC5C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IAEnB,8DAA8D;IAC9D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AA+BD;;;GAGG;AACH,qBAAa,+BAAgC,SAAQ,cAAc,CAAC,6BAA6B,EAAE,OAAO,CAAC;IACzG;;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,6BAA6B;IAOhD;;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"}
@@ -33,6 +33,7 @@ const responseSchema = Type.Object({
33
33
  });
34
34
  /**
35
35
  * Request to truncate a event type
36
+ * @deprecated Use `EventTypeRequestTruncateCommand` instead
36
37
  */
37
38
  export class EventTypeTruncateRequestCommand extends GraphQlCommand {
38
39
  /**
@@ -12,6 +12,7 @@ export interface FlowTypeDeleteRequestInput {
12
12
  }
13
13
  /**
14
14
  * Request to delete a flow type
15
+ * @deprecated Use `FlowTypeRequestDeleteCommand` instead
15
16
  */
16
17
  export declare class FlowTypeDeleteRequestCommand extends GraphQlCommand<FlowTypeDeleteRequestInput, boolean> {
17
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"flow-type.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/flow-type/flow-type.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAmCD;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,0BAA0B,EAAE,OAAO,CAAC;IACnG;;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,0BAA0B;IAO7C;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAWtC,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAC/D;QACE,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAA;QACrC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAC/B,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,aAAa,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAChE,eAAe,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;QAChF,iBAAiB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;QAC/C,cAAc,EAAE,OAAO,CAAA;KACxB,CACF;IAqBD;;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"}
1
+ {"version":3,"file":"flow-type.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/flow-type/flow-type.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAmCD;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,0BAA0B,EAAE,OAAO,CAAC;IACnG;;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,0BAA0B;IAO7C;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAWtC,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAC/D;QACE,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAA;QACrC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAC/B,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,aAAa,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAChE,eAAe,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;QAChF,iBAAiB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;QAC/C,cAAc,EAAE,OAAO,CAAA;KACxB,CACF;IAqBD;;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"}
@@ -38,6 +38,7 @@ const responseSchema = Type.Object({
38
38
  });
39
39
  /**
40
40
  * Request to delete a flow type
41
+ * @deprecated Use `FlowTypeRequestDeleteCommand` instead
41
42
  */
42
43
  export class FlowTypeDeleteRequestCommand extends GraphQlCommand {
43
44
  /**
@@ -0,0 +1,48 @@
1
+ import { Command } from "../../common/command.js";
2
+ import type { ClientError } from "../../exceptions/client-error.js";
3
+ import type { FlowcoreClient } from "../../common/flowcore-client.js";
4
+ /**
5
+ * The input for the flow type request delete command
6
+ */
7
+ export interface FlowTypeRequestDeleteInput {
8
+ /** The id of the flow type */
9
+ flowTypeId: string;
10
+ /** Wait for the flow type to be deleted (default: false) */
11
+ waitForDelete?: boolean;
12
+ }
13
+ /**
14
+ * The output for the flow type request delete command
15
+ */
16
+ export interface FlowTypeRequestDeleteOutput {
17
+ success: boolean;
18
+ }
19
+ /**
20
+ * Request to delete a flow type
21
+ */
22
+ export declare class FlowTypeRequestDeleteCommand extends Command<FlowTypeRequestDeleteInput, FlowTypeRequestDeleteOutput> {
23
+ /**
24
+ * Get the method
25
+ */
26
+ protected getMethod(): string;
27
+ /**
28
+ * Get the base url
29
+ */
30
+ protected getBaseUrl(): string;
31
+ /**
32
+ * Get the path
33
+ */
34
+ protected getPath(): string;
35
+ /**
36
+ * Parse the response
37
+ */
38
+ protected parseResponse(rawResponse: unknown): FlowTypeRequestDeleteOutput;
39
+ /**
40
+ * Handle the client error
41
+ */
42
+ protected handleClientError(error: ClientError): void;
43
+ /**
44
+ * Wait for the response (timeout: 25 seconds)
45
+ */
46
+ protected processResponse(client: FlowcoreClient, response: FlowTypeRequestDeleteOutput): Promise<FlowTypeRequestDeleteOutput>;
47
+ }
48
+ //# sourceMappingURL=flow-type.request-delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-type.request-delete.d.ts","sourceRoot":"","sources":["../../../src/commands/flow-type/flow-type.request-delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,OAAO,CAAC,0BAA0B,EAAE,2BAA2B,CAAC;IAChH;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,2BAA2B;IAUnF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,2BAA2B,GACpC,OAAO,CAAC,2BAA2B,CAAC;CAkBxC"}
@@ -0,0 +1,67 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { Command } from "../../common/command.js";
3
+ import { NotFoundException } from "../../exceptions/not-found.js";
4
+ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
+ import { FlowTypeExistsCommand } from "./flow-type.exists.js";
6
+ /**
7
+ * Request to delete a flow type
8
+ */
9
+ export class FlowTypeRequestDeleteCommand extends Command {
10
+ /**
11
+ * Get the method
12
+ */
13
+ getMethod() {
14
+ return "DELETE";
15
+ }
16
+ /**
17
+ * Get the base url
18
+ */
19
+ getBaseUrl() {
20
+ return "https://delete-manager.api.flowcore.io";
21
+ }
22
+ /**
23
+ * Get the path
24
+ */
25
+ getPath() {
26
+ return `/api/v1/flow-types/${this.input.flowTypeId}/request-delete`;
27
+ }
28
+ /**
29
+ * Parse the response
30
+ */
31
+ parseResponse(rawResponse) {
32
+ const response = parseResponseHelper(Type.Object({
33
+ success: Type.Boolean(),
34
+ }), rawResponse);
35
+ return response;
36
+ }
37
+ /**
38
+ * Handle the client error
39
+ */
40
+ handleClientError(error) {
41
+ if (error.status === 404) {
42
+ throw new NotFoundException("FlowType", {
43
+ "id": this.input.flowTypeId,
44
+ });
45
+ }
46
+ throw error;
47
+ }
48
+ /**
49
+ * Wait for the response (timeout: 25 seconds)
50
+ */
51
+ async processResponse(client, response) {
52
+ if (!this.input.waitForDelete) {
53
+ return response;
54
+ }
55
+ const start = Date.now();
56
+ while (Date.now() - start < 25_000) {
57
+ const response = await client.execute(new FlowTypeExistsCommand({
58
+ flowTypeId: this.input.flowTypeId,
59
+ }));
60
+ if (!response.exists) {
61
+ break;
62
+ }
63
+ await new Promise((resolve) => setTimeout(resolve, 100));
64
+ }
65
+ return response;
66
+ }
67
+ }