@flowcore/sdk 1.22.2 → 1.24.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 (74) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/esm/commands/iam/api-key-role-association.create.d.ts +45 -0
  3. package/esm/commands/iam/api-key-role-association.create.d.ts.map +1 -0
  4. package/esm/commands/iam/api-key-role-association.create.js +44 -0
  5. package/esm/commands/iam/api-key-role-association.delete.d.ts +45 -0
  6. package/esm/commands/iam/api-key-role-association.delete.d.ts.map +1 -0
  7. package/esm/commands/iam/api-key-role-association.delete.js +44 -0
  8. package/esm/commands/iam/api-key-role-association.list.d.ts +31 -0
  9. package/esm/commands/iam/api-key-role-association.list.d.ts.map +1 -0
  10. package/esm/commands/iam/api-key-role-association.list.js +37 -0
  11. package/esm/commands/iam/user-role-association.create.d.ts +42 -0
  12. package/esm/commands/iam/user-role-association.create.d.ts.map +1 -0
  13. package/esm/commands/iam/user-role-association.create.js +40 -0
  14. package/esm/commands/iam/user-role-association.delete.d.ts +42 -0
  15. package/esm/commands/iam/user-role-association.delete.d.ts.map +1 -0
  16. package/esm/commands/iam/user-role-association.delete.js +40 -0
  17. package/esm/commands/iam/user-role-association.list.d.ts +33 -0
  18. package/esm/commands/iam/user-role-association.list.d.ts.map +1 -0
  19. package/esm/commands/iam/user-role-association.list.js +39 -0
  20. package/esm/commands/index.d.ts +6 -4
  21. package/esm/commands/index.d.ts.map +1 -1
  22. package/esm/commands/index.js +7 -4
  23. package/esm/contracts/iam.d.ts +13 -0
  24. package/esm/contracts/iam.d.ts.map +1 -0
  25. package/esm/contracts/iam.js +9 -0
  26. package/package.json +1 -1
  27. package/script/commands/iam/api-key-role-association.create.d.ts +45 -0
  28. package/script/commands/iam/api-key-role-association.create.d.ts.map +1 -0
  29. package/script/commands/iam/api-key-role-association.create.js +48 -0
  30. package/script/commands/iam/api-key-role-association.delete.d.ts +45 -0
  31. package/script/commands/iam/api-key-role-association.delete.d.ts.map +1 -0
  32. package/script/commands/iam/api-key-role-association.delete.js +48 -0
  33. package/script/commands/iam/api-key-role-association.list.d.ts +31 -0
  34. package/script/commands/iam/api-key-role-association.list.d.ts.map +1 -0
  35. package/script/commands/iam/api-key-role-association.list.js +41 -0
  36. package/script/commands/iam/user-role-association.create.d.ts +42 -0
  37. package/script/commands/iam/user-role-association.create.d.ts.map +1 -0
  38. package/script/commands/iam/user-role-association.create.js +44 -0
  39. package/script/commands/iam/user-role-association.delete.d.ts +42 -0
  40. package/script/commands/iam/user-role-association.delete.d.ts.map +1 -0
  41. package/script/commands/iam/user-role-association.delete.js +44 -0
  42. package/script/commands/iam/user-role-association.list.d.ts +33 -0
  43. package/script/commands/iam/user-role-association.list.d.ts.map +1 -0
  44. package/script/commands/iam/user-role-association.list.js +43 -0
  45. package/script/commands/index.d.ts +6 -4
  46. package/script/commands/index.d.ts.map +1 -1
  47. package/script/commands/index.js +7 -4
  48. package/script/contracts/iam.d.ts +13 -0
  49. package/script/contracts/iam.d.ts.map +1 -0
  50. package/script/contracts/iam.js +12 -0
  51. package/esm/commands/data-core/data-core.delete-request.d.ts +0 -38
  52. package/esm/commands/data-core/data-core.delete-request.d.ts.map +0 -1
  53. package/esm/commands/data-core/data-core.delete-request.js +0 -95
  54. package/esm/commands/event-type/event-type.delete-request.d.ts +0 -42
  55. package/esm/commands/event-type/event-type.delete-request.d.ts.map +0 -1
  56. package/esm/commands/event-type/event-type.delete-request.js +0 -108
  57. package/esm/commands/event-type/event-type.truncate-request.d.ts +0 -42
  58. package/esm/commands/event-type/event-type.truncate-request.d.ts.map +0 -1
  59. package/esm/commands/event-type/event-type.truncate-request.js +0 -108
  60. package/esm/commands/flow-type/flow-type.delete-request.d.ts +0 -55
  61. package/esm/commands/flow-type/flow-type.delete-request.d.ts.map +0 -1
  62. package/esm/commands/flow-type/flow-type.delete-request.js +0 -128
  63. package/script/commands/data-core/data-core.delete-request.d.ts +0 -38
  64. package/script/commands/data-core/data-core.delete-request.d.ts.map +0 -1
  65. package/script/commands/data-core/data-core.delete-request.js +0 -99
  66. package/script/commands/event-type/event-type.delete-request.d.ts +0 -42
  67. package/script/commands/event-type/event-type.delete-request.d.ts.map +0 -1
  68. package/script/commands/event-type/event-type.delete-request.js +0 -112
  69. package/script/commands/event-type/event-type.truncate-request.d.ts +0 -42
  70. package/script/commands/event-type/event-type.truncate-request.d.ts.map +0 -1
  71. package/script/commands/event-type/event-type.truncate-request.js +0 -112
  72. package/script/commands/flow-type/flow-type.delete-request.d.ts +0 -55
  73. package/script/commands/flow-type/flow-type.delete-request.d.ts.map +0 -1
  74. package/script/commands/flow-type/flow-type.delete-request.js +0 -132
@@ -1,38 +0,0 @@
1
- import { GraphQlCommand } from "../../common/command-graphql.js";
2
- import type { FlowcoreClient } from "../../common/flowcore-client.js";
3
- /**
4
- * The input for the data core delete request command
5
- */
6
- export interface DataCoreDeleteRequestInput {
7
- /** The id of the data core */
8
- dataCoreId: string;
9
- /** Wait for the data core to be deleted (default: true) */
10
- waitForDelete?: boolean;
11
- }
12
- /**
13
- * Request to delete a data core
14
- * @deprecated Use `DataCoreRequestDeleteCommand` instead
15
- */
16
- export declare class DataCoreDeleteRequestCommand extends GraphQlCommand<DataCoreDeleteRequestInput, boolean> {
17
- /**
18
- * Whether the command should retry on failure
19
- */
20
- protected retryOnFailure: boolean;
21
- /**
22
- * Create a new data core delete request command
23
- */
24
- constructor(input: DataCoreDeleteRequestInput);
25
- /**
26
- * Parse the response
27
- */
28
- protected parseResponse(response: unknown): boolean;
29
- /**
30
- * Get the body for the request
31
- */
32
- protected getBody(): Record<string, unknown>;
33
- /**
34
- * Wait for the response (timeout: 25 seconds)
35
- */
36
- protected processResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
37
- }
38
- //# sourceMappingURL=data-core.delete-request.d.ts.map
@@ -1 +0,0 @@
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,iCAAiC,CAAA;AAKhE,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"}
@@ -1,95 +0,0 @@
1
- import { Type } from "@sinclair/typebox";
2
- import { GraphQlCommand } from "../../common/command-graphql.js";
3
- import { parseResponseHelper } from "../../utils/parse-response-helper.js";
4
- import { CommandError } from "../../exceptions/command-error.js";
5
- import { NotFoundException } from "../../exceptions/not-found.js";
6
- import { DataCoreExistsCommand } from "./data-core.exists.js";
7
- const graphQlQuery = `
8
- mutation FLOWCORE_SDK_DATA_CORE_DELETE_REQUEST($dataCoreId: ID!) {
9
- datacore(id: $dataCoreId) {
10
- requestDelete {
11
- deleting
12
- }
13
- }
14
- }
15
- `;
16
- const responseSchema = Type.Object({
17
- errors: Type.Optional(Type.Array(Type.Object({
18
- message: Type.String(),
19
- }))),
20
- data: Type.Object({
21
- datacore: Type.Object({
22
- requestDelete: Type.Union([
23
- Type.Object({
24
- deleting: Type.Boolean(),
25
- }),
26
- Type.Null(),
27
- ]),
28
- }),
29
- }),
30
- });
31
- /**
32
- * Request to delete a data core
33
- * @deprecated Use `DataCoreRequestDeleteCommand` instead
34
- */
35
- export class DataCoreDeleteRequestCommand extends GraphQlCommand {
36
- /**
37
- * Create a new data core delete request command
38
- */
39
- constructor(input) {
40
- super({
41
- ...input,
42
- waitForDelete: input.waitForDelete ?? true,
43
- });
44
- /**
45
- * Whether the command should retry on failure
46
- */
47
- Object.defineProperty(this, "retryOnFailure", {
48
- enumerable: true,
49
- configurable: true,
50
- writable: true,
51
- value: false
52
- });
53
- }
54
- /**
55
- * Parse the response
56
- */
57
- parseResponse(response) {
58
- const parsedResponse = parseResponseHelper(responseSchema, response);
59
- if (parsedResponse.errors) {
60
- throw new CommandError(this.constructor.name, parsedResponse.errors[0].message);
61
- }
62
- if (!parsedResponse.data.datacore?.requestDelete) {
63
- throw new NotFoundException("DataCore", { id: this.input.dataCoreId });
64
- }
65
- return parsedResponse.data.datacore.requestDelete.deleting;
66
- }
67
- /**
68
- * Get the body for the request
69
- */
70
- getBody() {
71
- return {
72
- query: graphQlQuery,
73
- variables: this.input,
74
- };
75
- }
76
- /**
77
- * Wait for the response (timeout: 25 seconds)
78
- */
79
- async processResponse(client, response) {
80
- if (!this.input.waitForDelete) {
81
- return response;
82
- }
83
- const start = Date.now();
84
- while (Date.now() - start < 25_000) {
85
- const response = await client.execute(new DataCoreExistsCommand({
86
- dataCoreId: this.input.dataCoreId,
87
- }));
88
- if (!response.exists) {
89
- break;
90
- }
91
- await new Promise((resolve) => setTimeout(resolve, 100));
92
- }
93
- return response;
94
- }
95
- }
@@ -1,42 +0,0 @@
1
- import { GraphQlCommand } from "../../common/command-graphql.js";
2
- import type { FlowcoreClient } from "../../common/flowcore-client.js";
3
- /**
4
- * The input for the event type delete request command
5
- */
6
- export interface EventTypeDeleteRequestInput {
7
- /** The id of the event type */
8
- eventTypeId: string;
9
- /** Wait for the event type to be deleted (default: true) */
10
- waitForDelete?: boolean;
11
- }
12
- /**
13
- * Request to delete a event type
14
- * @deprecated Use `EventTypeRequestDeleteCommand` instead
15
- */
16
- export declare class EventTypeDeleteRequestCommand extends GraphQlCommand<EventTypeDeleteRequestInput, boolean> {
17
- /**
18
- * Whether the command should retry on failure
19
- */
20
- protected retryOnFailure: boolean;
21
- /**
22
- * The allowed modes for the command
23
- */
24
- protected allowedModes: ("apiKey" | "bearer")[];
25
- /**
26
- * Create a new event type delete request command
27
- */
28
- constructor(input: EventTypeDeleteRequestInput);
29
- /**
30
- * Parse the response
31
- */
32
- protected parseResponse(response: unknown): boolean;
33
- /**
34
- * Get the body for the request
35
- */
36
- protected getBody(): Record<string, unknown>;
37
- /**
38
- * Wait for the response (timeout: 25 seconds)
39
- */
40
- protected processResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
41
- }
42
- //# sourceMappingURL=event-type.delete-request.d.ts.map
@@ -1 +0,0 @@
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,iCAAiC,CAAA;AAIhE,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"}
@@ -1,108 +0,0 @@
1
- import { Type } from "@sinclair/typebox";
2
- import { GraphQlCommand } from "../../common/command-graphql.js";
3
- import { CommandError } from "../../exceptions/command-error.js";
4
- import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
- import { NotFoundException } from "../../exceptions/not-found.js";
6
- import { EventTypeExistsCommand } from "./event-type.exists.js";
7
- const graphQlQuery = `
8
- mutation FLOWCORE_SDK_EVENT_TYPE_DELETE_REQUEST($eventTypeId: ID!) {
9
- eventType(id: $eventTypeId) {
10
- requestDelete {
11
- deleting
12
- }
13
- }
14
- }
15
- `;
16
- const responseSchema = Type.Object({
17
- errors: Type.Optional(Type.Array(Type.Object({
18
- message: Type.String(),
19
- }))),
20
- data: Type.Union([
21
- Type.Object({
22
- eventType: Type.Object({
23
- requestDelete: Type.Union([
24
- Type.Object({
25
- deleting: Type.Boolean(),
26
- }),
27
- Type.Null(),
28
- ]),
29
- }),
30
- }),
31
- Type.Null(),
32
- ]),
33
- });
34
- /**
35
- * Request to delete a event type
36
- * @deprecated Use `EventTypeRequestDeleteCommand` instead
37
- */
38
- export class EventTypeDeleteRequestCommand extends GraphQlCommand {
39
- /**
40
- * Create a new event type delete request command
41
- */
42
- constructor(input) {
43
- super({
44
- ...input,
45
- waitForDelete: input.waitForDelete ?? true,
46
- });
47
- /**
48
- * Whether the command should retry on failure
49
- */
50
- Object.defineProperty(this, "retryOnFailure", {
51
- enumerable: true,
52
- configurable: true,
53
- writable: true,
54
- value: false
55
- });
56
- /**
57
- * The allowed modes for the command
58
- */
59
- Object.defineProperty(this, "allowedModes", {
60
- enumerable: true,
61
- configurable: true,
62
- writable: true,
63
- value: ["bearer"]
64
- });
65
- }
66
- /**
67
- * Parse the response
68
- */
69
- parseResponse(response) {
70
- const parsedResponse = parseResponseHelper(responseSchema, response);
71
- if (parsedResponse.errors) {
72
- throw new CommandError(this.constructor.name, parsedResponse.errors[0].message);
73
- }
74
- if (!parsedResponse.data?.eventType?.requestDelete) {
75
- throw new NotFoundException("EventType", { id: this.input.eventTypeId });
76
- }
77
- return parsedResponse.data.eventType.requestDelete.deleting;
78
- }
79
- /**
80
- * Get the body for the request
81
- */
82
- getBody() {
83
- const { waitForDelete: _, ...rest } = this.input;
84
- return {
85
- query: graphQlQuery,
86
- variables: rest,
87
- };
88
- }
89
- /**
90
- * Wait for the response (timeout: 25 seconds)
91
- */
92
- async processResponse(client, response) {
93
- if (!this.input.waitForDelete) {
94
- return response;
95
- }
96
- const start = Date.now();
97
- while (Date.now() - start < 25_000) {
98
- const response = await client.execute(new EventTypeExistsCommand({
99
- eventTypeId: this.input.eventTypeId,
100
- }));
101
- if (!response.exists) {
102
- break;
103
- }
104
- await new Promise((resolve) => setTimeout(resolve, 100));
105
- }
106
- return response;
107
- }
108
- }
@@ -1,42 +0,0 @@
1
- import { GraphQlCommand } from "../../common/command-graphql.js";
2
- import type { FlowcoreClient } from "../../common/flowcore-client.js";
3
- /**
4
- * The input for the event type truncate request command
5
- */
6
- export interface EventTypeTruncateRequestInput {
7
- /** The id of the event type */
8
- eventTypeId: string;
9
- /** Wait for the event type to be truncated (default: true) */
10
- waitForTruncate?: boolean;
11
- }
12
- /**
13
- * Request to truncate a event type
14
- * @deprecated Use `EventTypeRequestTruncateCommand` instead
15
- */
16
- export declare class EventTypeTruncateRequestCommand extends GraphQlCommand<EventTypeTruncateRequestInput, boolean> {
17
- /**
18
- * Whether the command should retry on failure
19
- */
20
- protected retryOnFailure: boolean;
21
- /**
22
- * The allowed modes for the command
23
- */
24
- protected allowedModes: ("apiKey" | "bearer")[];
25
- /**
26
- * Create a new event type truncate request command
27
- */
28
- constructor(input: EventTypeTruncateRequestInput);
29
- /**
30
- * Parse the response
31
- */
32
- protected parseResponse(response: unknown): boolean;
33
- /**
34
- * Get the body for the request
35
- */
36
- protected getBody(): Record<string, unknown>;
37
- /**
38
- * Wait for the response (timeout: 25 seconds)
39
- */
40
- protected processResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
41
- }
42
- //# sourceMappingURL=event-type.truncate-request.d.ts.map
@@ -1 +0,0 @@
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,iCAAiC,CAAA;AAIhE,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"}
@@ -1,108 +0,0 @@
1
- import { Type } from "@sinclair/typebox";
2
- import { GraphQlCommand } from "../../common/command-graphql.js";
3
- import { CommandError } from "../../exceptions/command-error.js";
4
- import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
- import { NotFoundException } from "../../exceptions/not-found.js";
6
- import { EventTypeFetchCommand } from "./event-type.fetch.js";
7
- const graphQlQuery = `
8
- mutation FLOWCORE_SDK_EVENT_TYPE_TRUNCATE_REQUEST($eventTypeId: ID!) {
9
- eventType(id: $eventTypeId) {
10
- requestTruncate {
11
- truncating
12
- }
13
- }
14
- }
15
- `;
16
- const responseSchema = Type.Object({
17
- errors: Type.Optional(Type.Array(Type.Object({
18
- message: Type.String(),
19
- }))),
20
- data: Type.Union([
21
- Type.Object({
22
- eventType: Type.Object({
23
- requestTruncate: Type.Union([
24
- Type.Object({
25
- truncating: Type.Boolean(),
26
- }),
27
- Type.Null(),
28
- ]),
29
- }),
30
- }),
31
- Type.Null(),
32
- ]),
33
- });
34
- /**
35
- * Request to truncate a event type
36
- * @deprecated Use `EventTypeRequestTruncateCommand` instead
37
- */
38
- export class EventTypeTruncateRequestCommand extends GraphQlCommand {
39
- /**
40
- * Create a new event type truncate request command
41
- */
42
- constructor(input) {
43
- super({
44
- ...input,
45
- waitForTruncate: input.waitForTruncate ?? true,
46
- });
47
- /**
48
- * Whether the command should retry on failure
49
- */
50
- Object.defineProperty(this, "retryOnFailure", {
51
- enumerable: true,
52
- configurable: true,
53
- writable: true,
54
- value: false
55
- });
56
- /**
57
- * The allowed modes for the command
58
- */
59
- Object.defineProperty(this, "allowedModes", {
60
- enumerable: true,
61
- configurable: true,
62
- writable: true,
63
- value: ["bearer"]
64
- });
65
- }
66
- /**
67
- * Parse the response
68
- */
69
- parseResponse(response) {
70
- const parsedResponse = parseResponseHelper(responseSchema, response);
71
- if (parsedResponse.errors) {
72
- throw new CommandError(this.constructor.name, parsedResponse.errors[0].message);
73
- }
74
- if (!parsedResponse.data?.eventType?.requestTruncate) {
75
- throw new NotFoundException("EventType", { id: this.input.eventTypeId });
76
- }
77
- return parsedResponse.data.eventType.requestTruncate.truncating;
78
- }
79
- /**
80
- * Get the body for the request
81
- */
82
- getBody() {
83
- const { waitForTruncate: _, ...rest } = this.input;
84
- return {
85
- query: graphQlQuery,
86
- variables: rest,
87
- };
88
- }
89
- /**
90
- * Wait for the response (timeout: 25 seconds)
91
- */
92
- async processResponse(client, response) {
93
- if (!this.input.waitForTruncate) {
94
- return response;
95
- }
96
- const start = Date.now();
97
- while (Date.now() - start < 25_000) {
98
- const response = await client.execute(new EventTypeFetchCommand({
99
- eventTypeId: this.input.eventTypeId,
100
- }));
101
- if (response.isTruncating) {
102
- break;
103
- }
104
- await new Promise((resolve) => setTimeout(resolve, 100));
105
- }
106
- return response;
107
- }
108
- }
@@ -1,55 +0,0 @@
1
- import { GraphQlCommand } from "../../common/command-graphql.js";
2
- import type { FlowcoreClient } from "../../common/flowcore-client.js";
3
- import type { ClientError } from "../../exceptions/client-error.js";
4
- /**
5
- * The input for the flow type delete request command
6
- */
7
- export interface FlowTypeDeleteRequestInput {
8
- /** The id of the flow type */
9
- flowTypeId: string;
10
- /** Whether to wait for the flow type to be deleted */
11
- waitForDelete?: boolean;
12
- }
13
- /**
14
- * Request to delete a flow type
15
- * @deprecated Use `FlowTypeRequestDeleteCommand` instead
16
- */
17
- export declare class FlowTypeDeleteRequestCommand extends GraphQlCommand<FlowTypeDeleteRequestInput, boolean> {
18
- /**
19
- * Whether the command should retry on failure
20
- */
21
- protected retryOnFailure: boolean;
22
- /**
23
- * The allowed modes for the command
24
- */
25
- protected allowedModes: ("apiKey" | "bearer")[];
26
- /**
27
- * Create a new flow type delete request command
28
- */
29
- constructor(input: FlowTypeDeleteRequestInput);
30
- /**
31
- * Parse the response
32
- */
33
- protected parseResponse(response: unknown): boolean;
34
- getRequest(client: FlowcoreClient): Promise<{
35
- allowedModes: ("apiKey" | "bearer")[];
36
- body: Record<string, unknown>;
37
- headers: Record<string, string>;
38
- baseUrl: string;
39
- path: string;
40
- method: string;
41
- parseResponse: (response: unknown) => boolean | Promise<boolean>;
42
- processResponse: (client: FlowcoreClient, response: boolean) => Promise<boolean>;
43
- handleClientError: (error: ClientError) => void;
44
- retryOnFailure: boolean;
45
- }>;
46
- /**
47
- * Get the body for the request
48
- */
49
- protected getBody(): Record<string, unknown>;
50
- /**
51
- * Wait for the response (timeout: 25 seconds)
52
- */
53
- protected processResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
54
- }
55
- //# sourceMappingURL=flow-type.delete-request.d.ts.map
@@ -1 +0,0 @@
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,iCAAiC,CAAA;AAChE,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"}
@@ -1,128 +0,0 @@
1
- import { Type } from "@sinclair/typebox";
2
- import { GraphQlCommand } from "../../common/command-graphql.js";
3
- import { FlowTypeFetchCommand } from "./flow-type.fetch.js";
4
- import { CommandError } from "../../exceptions/command-error.js";
5
- import { parseResponseHelper } from "../../utils/parse-response-helper.js";
6
- import { NotFoundException } from "../../exceptions/not-found.js";
7
- import { FlowTypeExistsCommand } from "./flow-type.exists.js";
8
- const graphQlQuery = `
9
- mutation FLOWCORE_SDK_FLOW_TYPE_DELETE_REQUEST($flowTypeId: ID!, $dataCoreId: ID!) {
10
- datacore(id: $dataCoreId) {
11
- flowtype(id: $flowTypeId) {
12
- requestDelete {
13
- deleting
14
- }
15
- }
16
- }
17
- }
18
- `;
19
- const responseSchema = Type.Object({
20
- errors: Type.Optional(Type.Array(Type.Object({
21
- message: Type.String(),
22
- }))),
23
- data: Type.Union([
24
- Type.Object({
25
- datacore: Type.Object({
26
- flowtype: Type.Object({
27
- requestDelete: Type.Union([
28
- Type.Object({
29
- deleting: Type.Boolean(),
30
- }),
31
- Type.Null(),
32
- ]),
33
- }),
34
- }),
35
- }),
36
- Type.Null(),
37
- ]),
38
- });
39
- /**
40
- * Request to delete a flow type
41
- * @deprecated Use `FlowTypeRequestDeleteCommand` instead
42
- */
43
- export class FlowTypeDeleteRequestCommand extends GraphQlCommand {
44
- /**
45
- * Create a new flow type delete request command
46
- */
47
- constructor(input) {
48
- super({
49
- ...input,
50
- waitForDelete: input.waitForDelete ?? true,
51
- });
52
- /**
53
- * Whether the command should retry on failure
54
- */
55
- Object.defineProperty(this, "retryOnFailure", {
56
- enumerable: true,
57
- configurable: true,
58
- writable: true,
59
- value: false
60
- });
61
- /**
62
- * The allowed modes for the command
63
- */
64
- Object.defineProperty(this, "allowedModes", {
65
- enumerable: true,
66
- configurable: true,
67
- writable: true,
68
- value: ["bearer"]
69
- });
70
- }
71
- /**
72
- * Parse the response
73
- */
74
- parseResponse(response) {
75
- const parsedResponse = parseResponseHelper(responseSchema, response);
76
- if (parsedResponse.errors) {
77
- throw new CommandError(this.constructor.name, parsedResponse.errors[0].message);
78
- }
79
- if (!parsedResponse.data?.datacore?.flowtype?.requestDelete) {
80
- throw new NotFoundException("FlowType", { id: this.input.flowTypeId });
81
- }
82
- return parsedResponse.data.datacore.flowtype.requestDelete.deleting;
83
- }
84
- async getRequest(client) {
85
- const request = await super.getRequest(client);
86
- const response = await client.execute(new FlowTypeFetchCommand({
87
- flowTypeId: this.input.flowTypeId,
88
- }));
89
- return {
90
- ...request,
91
- body: {
92
- query: graphQlQuery,
93
- variables: {
94
- flowTypeId: this.input.flowTypeId,
95
- dataCoreId: response.dataCoreId,
96
- },
97
- },
98
- };
99
- }
100
- /**
101
- * Get the body for the request
102
- */
103
- getBody() {
104
- return {
105
- query: graphQlQuery,
106
- variables: this.input,
107
- };
108
- }
109
- /**
110
- * Wait for the response (timeout: 25 seconds)
111
- */
112
- async processResponse(client, response) {
113
- if (!this.input.waitForDelete) {
114
- return response;
115
- }
116
- const start = Date.now();
117
- while (Date.now() - start < 25_000) {
118
- const response = await client.execute(new FlowTypeExistsCommand({
119
- flowTypeId: this.input.flowTypeId,
120
- }));
121
- if (!response.exists) {
122
- break;
123
- }
124
- await new Promise((resolve) => setTimeout(resolve, 100));
125
- }
126
- return response;
127
- }
128
- }
@@ -1,38 +0,0 @@
1
- import { GraphQlCommand } from "../../common/command-graphql.js";
2
- import type { FlowcoreClient } from "../../common/flowcore-client.js";
3
- /**
4
- * The input for the data core delete request command
5
- */
6
- export interface DataCoreDeleteRequestInput {
7
- /** The id of the data core */
8
- dataCoreId: string;
9
- /** Wait for the data core to be deleted (default: true) */
10
- waitForDelete?: boolean;
11
- }
12
- /**
13
- * Request to delete a data core
14
- * @deprecated Use `DataCoreRequestDeleteCommand` instead
15
- */
16
- export declare class DataCoreDeleteRequestCommand extends GraphQlCommand<DataCoreDeleteRequestInput, boolean> {
17
- /**
18
- * Whether the command should retry on failure
19
- */
20
- protected retryOnFailure: boolean;
21
- /**
22
- * Create a new data core delete request command
23
- */
24
- constructor(input: DataCoreDeleteRequestInput);
25
- /**
26
- * Parse the response
27
- */
28
- protected parseResponse(response: unknown): boolean;
29
- /**
30
- * Get the body for the request
31
- */
32
- protected getBody(): Record<string, unknown>;
33
- /**
34
- * Wait for the response (timeout: 25 seconds)
35
- */
36
- protected processResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
37
- }
38
- //# sourceMappingURL=data-core.delete-request.d.ts.map
@@ -1 +0,0 @@
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,iCAAiC,CAAA;AAKhE,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"}