@flowcore/sdk 1.22.2 → 1.23.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 (32) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/esm/commands/index.d.ts +0 -4
  3. package/esm/commands/index.d.ts.map +1 -1
  4. package/esm/commands/index.js +0 -4
  5. package/package.json +1 -1
  6. package/script/commands/index.d.ts +0 -4
  7. package/script/commands/index.d.ts.map +1 -1
  8. package/script/commands/index.js +0 -4
  9. package/esm/commands/data-core/data-core.delete-request.d.ts +0 -38
  10. package/esm/commands/data-core/data-core.delete-request.d.ts.map +0 -1
  11. package/esm/commands/data-core/data-core.delete-request.js +0 -95
  12. package/esm/commands/event-type/event-type.delete-request.d.ts +0 -42
  13. package/esm/commands/event-type/event-type.delete-request.d.ts.map +0 -1
  14. package/esm/commands/event-type/event-type.delete-request.js +0 -108
  15. package/esm/commands/event-type/event-type.truncate-request.d.ts +0 -42
  16. package/esm/commands/event-type/event-type.truncate-request.d.ts.map +0 -1
  17. package/esm/commands/event-type/event-type.truncate-request.js +0 -108
  18. package/esm/commands/flow-type/flow-type.delete-request.d.ts +0 -55
  19. package/esm/commands/flow-type/flow-type.delete-request.d.ts.map +0 -1
  20. package/esm/commands/flow-type/flow-type.delete-request.js +0 -128
  21. package/script/commands/data-core/data-core.delete-request.d.ts +0 -38
  22. package/script/commands/data-core/data-core.delete-request.d.ts.map +0 -1
  23. package/script/commands/data-core/data-core.delete-request.js +0 -99
  24. package/script/commands/event-type/event-type.delete-request.d.ts +0 -42
  25. package/script/commands/event-type/event-type.delete-request.d.ts.map +0 -1
  26. package/script/commands/event-type/event-type.delete-request.js +0 -112
  27. package/script/commands/event-type/event-type.truncate-request.d.ts +0 -42
  28. package/script/commands/event-type/event-type.truncate-request.d.ts.map +0 -1
  29. package/script/commands/event-type/event-type.truncate-request.js +0 -112
  30. package/script/commands/flow-type/flow-type.delete-request.d.ts +0 -55
  31. package/script/commands/flow-type/flow-type.delete-request.d.ts.map +0 -1
  32. package/script/commands/flow-type/flow-type.delete-request.js +0 -132
@@ -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"}
@@ -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"}