@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,99 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataCoreDeleteRequestCommand = void 0;
4
- const typebox_1 = require("@sinclair/typebox");
5
- const command_graphql_js_1 = require("../../common/command-graphql.js");
6
- const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
7
- const command_error_js_1 = require("../../exceptions/command-error.js");
8
- const not_found_js_1 = require("../../exceptions/not-found.js");
9
- const data_core_exists_js_1 = require("./data-core.exists.js");
10
- const graphQlQuery = `
11
- mutation FLOWCORE_SDK_DATA_CORE_DELETE_REQUEST($dataCoreId: ID!) {
12
- datacore(id: $dataCoreId) {
13
- requestDelete {
14
- deleting
15
- }
16
- }
17
- }
18
- `;
19
- const responseSchema = typebox_1.Type.Object({
20
- errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
21
- message: typebox_1.Type.String(),
22
- }))),
23
- data: typebox_1.Type.Object({
24
- datacore: typebox_1.Type.Object({
25
- requestDelete: typebox_1.Type.Union([
26
- typebox_1.Type.Object({
27
- deleting: typebox_1.Type.Boolean(),
28
- }),
29
- typebox_1.Type.Null(),
30
- ]),
31
- }),
32
- }),
33
- });
34
- /**
35
- * Request to delete a data core
36
- * @deprecated Use `DataCoreRequestDeleteCommand` instead
37
- */
38
- class DataCoreDeleteRequestCommand extends command_graphql_js_1.GraphQlCommand {
39
- /**
40
- * Create a new data core 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
- /**
58
- * Parse the response
59
- */
60
- parseResponse(response) {
61
- const parsedResponse = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, response);
62
- if (parsedResponse.errors) {
63
- throw new command_error_js_1.CommandError(this.constructor.name, parsedResponse.errors[0].message);
64
- }
65
- if (!parsedResponse.data.datacore?.requestDelete) {
66
- throw new not_found_js_1.NotFoundException("DataCore", { id: this.input.dataCoreId });
67
- }
68
- return parsedResponse.data.datacore.requestDelete.deleting;
69
- }
70
- /**
71
- * Get the body for the request
72
- */
73
- getBody() {
74
- return {
75
- query: graphQlQuery,
76
- variables: this.input,
77
- };
78
- }
79
- /**
80
- * Wait for the response (timeout: 25 seconds)
81
- */
82
- async processResponse(client, response) {
83
- if (!this.input.waitForDelete) {
84
- return response;
85
- }
86
- const start = Date.now();
87
- while (Date.now() - start < 25_000) {
88
- const response = await client.execute(new data_core_exists_js_1.DataCoreExistsCommand({
89
- dataCoreId: this.input.dataCoreId,
90
- }));
91
- if (!response.exists) {
92
- break;
93
- }
94
- await new Promise((resolve) => setTimeout(resolve, 100));
95
- }
96
- return response;
97
- }
98
- }
99
- exports.DataCoreDeleteRequestCommand = DataCoreDeleteRequestCommand;
@@ -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,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EventTypeDeleteRequestCommand = void 0;
4
- const typebox_1 = require("@sinclair/typebox");
5
- const command_graphql_js_1 = require("../../common/command-graphql.js");
6
- const command_error_js_1 = require("../../exceptions/command-error.js");
7
- const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
8
- const not_found_js_1 = require("../../exceptions/not-found.js");
9
- const event_type_exists_js_1 = require("./event-type.exists.js");
10
- const graphQlQuery = `
11
- mutation FLOWCORE_SDK_EVENT_TYPE_DELETE_REQUEST($eventTypeId: ID!) {
12
- eventType(id: $eventTypeId) {
13
- requestDelete {
14
- deleting
15
- }
16
- }
17
- }
18
- `;
19
- const responseSchema = typebox_1.Type.Object({
20
- errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
21
- message: typebox_1.Type.String(),
22
- }))),
23
- data: typebox_1.Type.Union([
24
- typebox_1.Type.Object({
25
- eventType: typebox_1.Type.Object({
26
- requestDelete: typebox_1.Type.Union([
27
- typebox_1.Type.Object({
28
- deleting: typebox_1.Type.Boolean(),
29
- }),
30
- typebox_1.Type.Null(),
31
- ]),
32
- }),
33
- }),
34
- typebox_1.Type.Null(),
35
- ]),
36
- });
37
- /**
38
- * Request to delete a event type
39
- * @deprecated Use `EventTypeRequestDeleteCommand` instead
40
- */
41
- class EventTypeDeleteRequestCommand extends command_graphql_js_1.GraphQlCommand {
42
- /**
43
- * Create a new event type delete request command
44
- */
45
- constructor(input) {
46
- super({
47
- ...input,
48
- waitForDelete: input.waitForDelete ?? true,
49
- });
50
- /**
51
- * Whether the command should retry on failure
52
- */
53
- Object.defineProperty(this, "retryOnFailure", {
54
- enumerable: true,
55
- configurable: true,
56
- writable: true,
57
- value: false
58
- });
59
- /**
60
- * The allowed modes for the command
61
- */
62
- Object.defineProperty(this, "allowedModes", {
63
- enumerable: true,
64
- configurable: true,
65
- writable: true,
66
- value: ["bearer"]
67
- });
68
- }
69
- /**
70
- * Parse the response
71
- */
72
- parseResponse(response) {
73
- const parsedResponse = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, response);
74
- if (parsedResponse.errors) {
75
- throw new command_error_js_1.CommandError(this.constructor.name, parsedResponse.errors[0].message);
76
- }
77
- if (!parsedResponse.data?.eventType?.requestDelete) {
78
- throw new not_found_js_1.NotFoundException("EventType", { id: this.input.eventTypeId });
79
- }
80
- return parsedResponse.data.eventType.requestDelete.deleting;
81
- }
82
- /**
83
- * Get the body for the request
84
- */
85
- getBody() {
86
- const { waitForDelete: _, ...rest } = this.input;
87
- return {
88
- query: graphQlQuery,
89
- variables: rest,
90
- };
91
- }
92
- /**
93
- * Wait for the response (timeout: 25 seconds)
94
- */
95
- async processResponse(client, response) {
96
- if (!this.input.waitForDelete) {
97
- return response;
98
- }
99
- const start = Date.now();
100
- while (Date.now() - start < 25_000) {
101
- const response = await client.execute(new event_type_exists_js_1.EventTypeExistsCommand({
102
- eventTypeId: this.input.eventTypeId,
103
- }));
104
- if (!response.exists) {
105
- break;
106
- }
107
- await new Promise((resolve) => setTimeout(resolve, 100));
108
- }
109
- return response;
110
- }
111
- }
112
- exports.EventTypeDeleteRequestCommand = EventTypeDeleteRequestCommand;
@@ -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,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EventTypeTruncateRequestCommand = void 0;
4
- const typebox_1 = require("@sinclair/typebox");
5
- const command_graphql_js_1 = require("../../common/command-graphql.js");
6
- const command_error_js_1 = require("../../exceptions/command-error.js");
7
- const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
8
- const not_found_js_1 = require("../../exceptions/not-found.js");
9
- const event_type_fetch_js_1 = require("./event-type.fetch.js");
10
- const graphQlQuery = `
11
- mutation FLOWCORE_SDK_EVENT_TYPE_TRUNCATE_REQUEST($eventTypeId: ID!) {
12
- eventType(id: $eventTypeId) {
13
- requestTruncate {
14
- truncating
15
- }
16
- }
17
- }
18
- `;
19
- const responseSchema = typebox_1.Type.Object({
20
- errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
21
- message: typebox_1.Type.String(),
22
- }))),
23
- data: typebox_1.Type.Union([
24
- typebox_1.Type.Object({
25
- eventType: typebox_1.Type.Object({
26
- requestTruncate: typebox_1.Type.Union([
27
- typebox_1.Type.Object({
28
- truncating: typebox_1.Type.Boolean(),
29
- }),
30
- typebox_1.Type.Null(),
31
- ]),
32
- }),
33
- }),
34
- typebox_1.Type.Null(),
35
- ]),
36
- });
37
- /**
38
- * Request to truncate a event type
39
- * @deprecated Use `EventTypeRequestTruncateCommand` instead
40
- */
41
- class EventTypeTruncateRequestCommand extends command_graphql_js_1.GraphQlCommand {
42
- /**
43
- * Create a new event type truncate request command
44
- */
45
- constructor(input) {
46
- super({
47
- ...input,
48
- waitForTruncate: input.waitForTruncate ?? true,
49
- });
50
- /**
51
- * Whether the command should retry on failure
52
- */
53
- Object.defineProperty(this, "retryOnFailure", {
54
- enumerable: true,
55
- configurable: true,
56
- writable: true,
57
- value: false
58
- });
59
- /**
60
- * The allowed modes for the command
61
- */
62
- Object.defineProperty(this, "allowedModes", {
63
- enumerable: true,
64
- configurable: true,
65
- writable: true,
66
- value: ["bearer"]
67
- });
68
- }
69
- /**
70
- * Parse the response
71
- */
72
- parseResponse(response) {
73
- const parsedResponse = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, response);
74
- if (parsedResponse.errors) {
75
- throw new command_error_js_1.CommandError(this.constructor.name, parsedResponse.errors[0].message);
76
- }
77
- if (!parsedResponse.data?.eventType?.requestTruncate) {
78
- throw new not_found_js_1.NotFoundException("EventType", { id: this.input.eventTypeId });
79
- }
80
- return parsedResponse.data.eventType.requestTruncate.truncating;
81
- }
82
- /**
83
- * Get the body for the request
84
- */
85
- getBody() {
86
- const { waitForTruncate: _, ...rest } = this.input;
87
- return {
88
- query: graphQlQuery,
89
- variables: rest,
90
- };
91
- }
92
- /**
93
- * Wait for the response (timeout: 25 seconds)
94
- */
95
- async processResponse(client, response) {
96
- if (!this.input.waitForTruncate) {
97
- return response;
98
- }
99
- const start = Date.now();
100
- while (Date.now() - start < 25_000) {
101
- const response = await client.execute(new event_type_fetch_js_1.EventTypeFetchCommand({
102
- eventTypeId: this.input.eventTypeId,
103
- }));
104
- if (response.isTruncating) {
105
- break;
106
- }
107
- await new Promise((resolve) => setTimeout(resolve, 100));
108
- }
109
- return response;
110
- }
111
- }
112
- exports.EventTypeTruncateRequestCommand = EventTypeTruncateRequestCommand;
@@ -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,132 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowTypeDeleteRequestCommand = void 0;
4
- const typebox_1 = require("@sinclair/typebox");
5
- const command_graphql_js_1 = require("../../common/command-graphql.js");
6
- const flow_type_fetch_js_1 = require("./flow-type.fetch.js");
7
- const command_error_js_1 = require("../../exceptions/command-error.js");
8
- const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
9
- const not_found_js_1 = require("../../exceptions/not-found.js");
10
- const flow_type_exists_js_1 = require("./flow-type.exists.js");
11
- const graphQlQuery = `
12
- mutation FLOWCORE_SDK_FLOW_TYPE_DELETE_REQUEST($flowTypeId: ID!, $dataCoreId: ID!) {
13
- datacore(id: $dataCoreId) {
14
- flowtype(id: $flowTypeId) {
15
- requestDelete {
16
- deleting
17
- }
18
- }
19
- }
20
- }
21
- `;
22
- const responseSchema = typebox_1.Type.Object({
23
- errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
24
- message: typebox_1.Type.String(),
25
- }))),
26
- data: typebox_1.Type.Union([
27
- typebox_1.Type.Object({
28
- datacore: typebox_1.Type.Object({
29
- flowtype: typebox_1.Type.Object({
30
- requestDelete: typebox_1.Type.Union([
31
- typebox_1.Type.Object({
32
- deleting: typebox_1.Type.Boolean(),
33
- }),
34
- typebox_1.Type.Null(),
35
- ]),
36
- }),
37
- }),
38
- }),
39
- typebox_1.Type.Null(),
40
- ]),
41
- });
42
- /**
43
- * Request to delete a flow type
44
- * @deprecated Use `FlowTypeRequestDeleteCommand` instead
45
- */
46
- class FlowTypeDeleteRequestCommand extends command_graphql_js_1.GraphQlCommand {
47
- /**
48
- * Create a new flow type delete request command
49
- */
50
- constructor(input) {
51
- super({
52
- ...input,
53
- waitForDelete: input.waitForDelete ?? true,
54
- });
55
- /**
56
- * Whether the command should retry on failure
57
- */
58
- Object.defineProperty(this, "retryOnFailure", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: false
63
- });
64
- /**
65
- * The allowed modes for the command
66
- */
67
- Object.defineProperty(this, "allowedModes", {
68
- enumerable: true,
69
- configurable: true,
70
- writable: true,
71
- value: ["bearer"]
72
- });
73
- }
74
- /**
75
- * Parse the response
76
- */
77
- parseResponse(response) {
78
- const parsedResponse = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, response);
79
- if (parsedResponse.errors) {
80
- throw new command_error_js_1.CommandError(this.constructor.name, parsedResponse.errors[0].message);
81
- }
82
- if (!parsedResponse.data?.datacore?.flowtype?.requestDelete) {
83
- throw new not_found_js_1.NotFoundException("FlowType", { id: this.input.flowTypeId });
84
- }
85
- return parsedResponse.data.datacore.flowtype.requestDelete.deleting;
86
- }
87
- async getRequest(client) {
88
- const request = await super.getRequest(client);
89
- const response = await client.execute(new flow_type_fetch_js_1.FlowTypeFetchCommand({
90
- flowTypeId: this.input.flowTypeId,
91
- }));
92
- return {
93
- ...request,
94
- body: {
95
- query: graphQlQuery,
96
- variables: {
97
- flowTypeId: this.input.flowTypeId,
98
- dataCoreId: response.dataCoreId,
99
- },
100
- },
101
- };
102
- }
103
- /**
104
- * Get the body for the request
105
- */
106
- getBody() {
107
- return {
108
- query: graphQlQuery,
109
- variables: this.input,
110
- };
111
- }
112
- /**
113
- * Wait for the response (timeout: 25 seconds)
114
- */
115
- async processResponse(client, response) {
116
- if (!this.input.waitForDelete) {
117
- return response;
118
- }
119
- const start = Date.now();
120
- while (Date.now() - start < 25_000) {
121
- const response = await client.execute(new flow_type_exists_js_1.FlowTypeExistsCommand({
122
- flowTypeId: this.input.flowTypeId,
123
- }));
124
- if (!response.exists) {
125
- break;
126
- }
127
- await new Promise((resolve) => setTimeout(resolve, 100));
128
- }
129
- return response;
130
- }
131
- }
132
- exports.FlowTypeDeleteRequestCommand = FlowTypeDeleteRequestCommand;