@flowcore/sdk 1.4.2
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.
- package/README.md +41 -0
- package/esm/commands/api-key/api-key.create.d.ts +34 -0
- package/esm/commands/api-key/api-key.create.d.ts.map +1 -0
- package/esm/commands/api-key/api-key.create.js +74 -0
- package/esm/commands/api-key/api-key.delete.d.ts +28 -0
- package/esm/commands/api-key/api-key.delete.d.ts.map +1 -0
- package/esm/commands/api-key/api-key.delete.js +60 -0
- package/esm/commands/api-key/api-key.list.d.ts +27 -0
- package/esm/commands/api-key/api-key.list.d.ts.map +1 -0
- package/esm/commands/api-key/api-key.list.js +58 -0
- package/esm/commands/data-core/data-core.create.d.ts +39 -0
- package/esm/commands/data-core/data-core.create.d.ts.map +1 -0
- package/esm/commands/data-core/data-core.create.js +32 -0
- package/esm/commands/data-core/data-core.delete-request.d.ts +37 -0
- package/esm/commands/data-core/data-core.delete-request.d.ts.map +1 -0
- package/esm/commands/data-core/data-core.delete-request.js +94 -0
- package/esm/commands/data-core/data-core.exists.d.ts +37 -0
- package/esm/commands/data-core/data-core.exists.d.ts.map +1 -0
- package/esm/commands/data-core/data-core.exists.js +33 -0
- package/esm/commands/data-core/data-core.fetch.d.ts +51 -0
- package/esm/commands/data-core/data-core.fetch.d.ts.map +1 -0
- package/esm/commands/data-core/data-core.fetch.js +48 -0
- package/esm/commands/data-core/data-core.list.d.ts +33 -0
- package/esm/commands/data-core/data-core.list.d.ts.map +1 -0
- package/esm/commands/data-core/data-core.list.js +40 -0
- package/esm/commands/data-core/data-core.update.d.ts +41 -0
- package/esm/commands/data-core/data-core.update.d.ts.map +1 -0
- package/esm/commands/data-core/data-core.update.js +43 -0
- package/esm/commands/event-type/event-type.create.d.ts +35 -0
- package/esm/commands/event-type/event-type.create.d.ts.map +1 -0
- package/esm/commands/event-type/event-type.create.js +32 -0
- package/esm/commands/event-type/event-type.delete-request.d.ts +37 -0
- package/esm/commands/event-type/event-type.delete-request.d.ts.map +1 -0
- package/esm/commands/event-type/event-type.delete-request.js +98 -0
- package/esm/commands/event-type/event-type.exists.d.ts +37 -0
- package/esm/commands/event-type/event-type.exists.d.ts.map +1 -0
- package/esm/commands/event-type/event-type.exists.js +33 -0
- package/esm/commands/event-type/event-type.fetch.d.ts +45 -0
- package/esm/commands/event-type/event-type.fetch.d.ts.map +1 -0
- package/esm/commands/event-type/event-type.fetch.js +48 -0
- package/esm/commands/event-type/event-type.list.d.ts +31 -0
- package/esm/commands/event-type/event-type.list.d.ts.map +1 -0
- package/esm/commands/event-type/event-type.list.js +36 -0
- package/esm/commands/event-type/event-type.update.d.ts +37 -0
- package/esm/commands/event-type/event-type.update.d.ts.map +1 -0
- package/esm/commands/event-type/event-type.update.js +39 -0
- package/esm/commands/events/events.fetch-time-buckets-by-names.d.ts +53 -0
- package/esm/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -0
- package/esm/commands/events/events.fetch-time-buckets-by-names.js +40 -0
- package/esm/commands/events/events.fetch.d.ts +58 -0
- package/esm/commands/events/events.fetch.d.ts.map +1 -0
- package/esm/commands/events/events.fetch.js +54 -0
- package/esm/commands/flow-type/flow-type.create.d.ts +35 -0
- package/esm/commands/flow-type/flow-type.create.d.ts.map +1 -0
- package/esm/commands/flow-type/flow-type.create.js +32 -0
- package/esm/commands/flow-type/flow-type.delete-request.d.ts +47 -0
- package/esm/commands/flow-type/flow-type.delete-request.d.ts.map +1 -0
- package/esm/commands/flow-type/flow-type.delete-request.js +118 -0
- package/esm/commands/flow-type/flow-type.exists.d.ts +39 -0
- package/esm/commands/flow-type/flow-type.exists.d.ts.map +1 -0
- package/esm/commands/flow-type/flow-type.exists.js +33 -0
- package/esm/commands/flow-type/flow-type.fetch.d.ts +51 -0
- package/esm/commands/flow-type/flow-type.fetch.d.ts.map +1 -0
- package/esm/commands/flow-type/flow-type.fetch.js +48 -0
- package/esm/commands/flow-type/flow-type.list.d.ts +31 -0
- package/esm/commands/flow-type/flow-type.list.d.ts.map +1 -0
- package/esm/commands/flow-type/flow-type.list.js +36 -0
- package/esm/commands/flow-type/flow-type.update.d.ts +37 -0
- package/esm/commands/flow-type/flow-type.update.d.ts.map +1 -0
- package/esm/commands/flow-type/flow-type.update.js +39 -0
- package/esm/commands/index.d.ts +32 -0
- package/esm/commands/index.d.ts.map +1 -0
- package/esm/commands/index.js +39 -0
- package/esm/commands/secret/secret.create.d.ts +30 -0
- package/esm/commands/secret/secret.create.d.ts.map +1 -0
- package/esm/commands/secret/secret.create.js +60 -0
- package/esm/commands/secret/secret.delete.d.ts +28 -0
- package/esm/commands/secret/secret.delete.d.ts.map +1 -0
- package/esm/commands/secret/secret.delete.js +61 -0
- package/esm/commands/secret/secret.list.d.ts +26 -0
- package/esm/commands/secret/secret.list.d.ts.map +1 -0
- package/esm/commands/secret/secret.list.js +63 -0
- package/esm/commands/tenant/tenant.fetch.d.ts +43 -0
- package/esm/commands/tenant/tenant.fetch.d.ts.map +1 -0
- package/esm/commands/tenant/tenant.fetch.js +77 -0
- package/esm/commands/tenant/tenant.list.d.ts +20 -0
- package/esm/commands/tenant/tenant.list.d.ts.map +1 -0
- package/esm/commands/tenant/tenant.list.js +65 -0
- package/esm/commands/variable/variable.create.d.ts +31 -0
- package/esm/commands/variable/variable.create.d.ts.map +1 -0
- package/esm/commands/variable/variable.create.js +66 -0
- package/esm/commands/variable/variable.delete.d.ts +28 -0
- package/esm/commands/variable/variable.delete.d.ts.map +1 -0
- package/esm/commands/variable/variable.delete.js +63 -0
- package/esm/commands/variable/variable.list.d.ts +27 -0
- package/esm/commands/variable/variable.list.d.ts.map +1 -0
- package/esm/commands/variable/variable.list.js +69 -0
- package/esm/common/command.d.ts +63 -0
- package/esm/common/command.d.ts.map +1 -0
- package/esm/common/command.js +91 -0
- package/esm/common/flowcore-client.d.ts +39 -0
- package/esm/common/flowcore-client.d.ts.map +1 -0
- package/esm/common/flowcore-client.js +72 -0
- package/esm/contracts/api-key.d.ts +14 -0
- package/esm/contracts/api-key.d.ts.map +1 -0
- package/esm/contracts/api-key.js +9 -0
- package/esm/contracts/data-core.d.ts +38 -0
- package/esm/contracts/data-core.d.ts.map +1 -0
- package/esm/contracts/data-core.js +38 -0
- package/esm/contracts/event-type.d.ts +33 -0
- package/esm/contracts/event-type.d.ts.map +1 -0
- package/esm/contracts/event-type.js +33 -0
- package/esm/contracts/event.d.ts +20 -0
- package/esm/contracts/event.d.ts.map +1 -0
- package/esm/contracts/event.js +15 -0
- package/esm/contracts/flow-type.d.ts +32 -0
- package/esm/contracts/flow-type.d.ts.map +1 -0
- package/esm/contracts/flow-type.js +31 -0
- package/esm/contracts/index.d.ts +4 -0
- package/esm/contracts/index.d.ts.map +1 -0
- package/esm/contracts/index.js +1 -0
- package/esm/contracts/tenant.d.ts +50 -0
- package/esm/contracts/tenant.d.ts.map +1 -0
- package/esm/contracts/tenant.js +33 -0
- package/esm/contracts/variable.d.ts +13 -0
- package/esm/contracts/variable.d.ts.map +1 -0
- package/esm/contracts/variable.js +8 -0
- package/esm/exceptions/client-error.d.ts +9 -0
- package/esm/exceptions/client-error.d.ts.map +1 -0
- package/esm/exceptions/client-error.js +20 -0
- package/esm/exceptions/command-error.d.ts +7 -0
- package/esm/exceptions/command-error.d.ts.map +1 -0
- package/esm/exceptions/command-error.js +8 -0
- package/esm/exceptions/index.d.ts +4 -0
- package/esm/exceptions/index.d.ts.map +1 -0
- package/esm/exceptions/index.js +3 -0
- package/esm/exceptions/invalid-response.d.ts +8 -0
- package/esm/exceptions/invalid-response.d.ts.map +1 -0
- package/esm/exceptions/invalid-response.js +15 -0
- package/esm/exceptions/not-found.d.ts +7 -0
- package/esm/exceptions/not-found.d.ts.map +1 -0
- package/esm/exceptions/not-found.js +8 -0
- package/esm/mod.d.ts +6 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +5 -0
- package/esm/package.json +3 -0
- package/esm/utils/parse-response-helper.d.ts +6 -0
- package/esm/utils/parse-response-helper.d.ts.map +1 -0
- package/esm/utils/parse-response-helper.js +16 -0
- package/package.json +28 -0
- package/script/commands/api-key/api-key.create.d.ts +34 -0
- package/script/commands/api-key/api-key.create.d.ts.map +1 -0
- package/script/commands/api-key/api-key.create.js +78 -0
- package/script/commands/api-key/api-key.delete.d.ts +28 -0
- package/script/commands/api-key/api-key.delete.d.ts.map +1 -0
- package/script/commands/api-key/api-key.delete.js +64 -0
- package/script/commands/api-key/api-key.list.d.ts +27 -0
- package/script/commands/api-key/api-key.list.d.ts.map +1 -0
- package/script/commands/api-key/api-key.list.js +62 -0
- package/script/commands/data-core/data-core.create.d.ts +39 -0
- package/script/commands/data-core/data-core.create.d.ts.map +1 -0
- package/script/commands/data-core/data-core.create.js +36 -0
- package/script/commands/data-core/data-core.delete-request.d.ts +37 -0
- package/script/commands/data-core/data-core.delete-request.d.ts.map +1 -0
- package/script/commands/data-core/data-core.delete-request.js +98 -0
- package/script/commands/data-core/data-core.exists.d.ts +37 -0
- package/script/commands/data-core/data-core.exists.d.ts.map +1 -0
- package/script/commands/data-core/data-core.exists.js +37 -0
- package/script/commands/data-core/data-core.fetch.d.ts +51 -0
- package/script/commands/data-core/data-core.fetch.d.ts.map +1 -0
- package/script/commands/data-core/data-core.fetch.js +52 -0
- package/script/commands/data-core/data-core.list.d.ts +33 -0
- package/script/commands/data-core/data-core.list.d.ts.map +1 -0
- package/script/commands/data-core/data-core.list.js +44 -0
- package/script/commands/data-core/data-core.update.d.ts +41 -0
- package/script/commands/data-core/data-core.update.d.ts.map +1 -0
- package/script/commands/data-core/data-core.update.js +47 -0
- package/script/commands/event-type/event-type.create.d.ts +35 -0
- package/script/commands/event-type/event-type.create.d.ts.map +1 -0
- package/script/commands/event-type/event-type.create.js +36 -0
- package/script/commands/event-type/event-type.delete-request.d.ts +37 -0
- package/script/commands/event-type/event-type.delete-request.d.ts.map +1 -0
- package/script/commands/event-type/event-type.delete-request.js +102 -0
- package/script/commands/event-type/event-type.exists.d.ts +37 -0
- package/script/commands/event-type/event-type.exists.d.ts.map +1 -0
- package/script/commands/event-type/event-type.exists.js +37 -0
- package/script/commands/event-type/event-type.fetch.d.ts +45 -0
- package/script/commands/event-type/event-type.fetch.d.ts.map +1 -0
- package/script/commands/event-type/event-type.fetch.js +52 -0
- package/script/commands/event-type/event-type.list.d.ts +31 -0
- package/script/commands/event-type/event-type.list.d.ts.map +1 -0
- package/script/commands/event-type/event-type.list.js +40 -0
- package/script/commands/event-type/event-type.update.d.ts +37 -0
- package/script/commands/event-type/event-type.update.d.ts.map +1 -0
- package/script/commands/event-type/event-type.update.js +43 -0
- package/script/commands/events/events.fetch-time-buckets-by-names.d.ts +53 -0
- package/script/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -0
- package/script/commands/events/events.fetch-time-buckets-by-names.js +44 -0
- package/script/commands/events/events.fetch.d.ts +58 -0
- package/script/commands/events/events.fetch.d.ts.map +1 -0
- package/script/commands/events/events.fetch.js +58 -0
- package/script/commands/flow-type/flow-type.create.d.ts +35 -0
- package/script/commands/flow-type/flow-type.create.d.ts.map +1 -0
- package/script/commands/flow-type/flow-type.create.js +36 -0
- package/script/commands/flow-type/flow-type.delete-request.d.ts +47 -0
- package/script/commands/flow-type/flow-type.delete-request.d.ts.map +1 -0
- package/script/commands/flow-type/flow-type.delete-request.js +122 -0
- package/script/commands/flow-type/flow-type.exists.d.ts +39 -0
- package/script/commands/flow-type/flow-type.exists.d.ts.map +1 -0
- package/script/commands/flow-type/flow-type.exists.js +37 -0
- package/script/commands/flow-type/flow-type.fetch.d.ts +51 -0
- package/script/commands/flow-type/flow-type.fetch.d.ts.map +1 -0
- package/script/commands/flow-type/flow-type.fetch.js +52 -0
- package/script/commands/flow-type/flow-type.list.d.ts +31 -0
- package/script/commands/flow-type/flow-type.list.d.ts.map +1 -0
- package/script/commands/flow-type/flow-type.list.js +40 -0
- package/script/commands/flow-type/flow-type.update.d.ts +37 -0
- package/script/commands/flow-type/flow-type.update.d.ts.map +1 -0
- package/script/commands/flow-type/flow-type.update.js +43 -0
- package/script/commands/index.d.ts +32 -0
- package/script/commands/index.d.ts.map +1 -0
- package/script/commands/index.js +55 -0
- package/script/commands/secret/secret.create.d.ts +30 -0
- package/script/commands/secret/secret.create.d.ts.map +1 -0
- package/script/commands/secret/secret.create.js +64 -0
- package/script/commands/secret/secret.delete.d.ts +28 -0
- package/script/commands/secret/secret.delete.d.ts.map +1 -0
- package/script/commands/secret/secret.delete.js +65 -0
- package/script/commands/secret/secret.list.d.ts +26 -0
- package/script/commands/secret/secret.list.d.ts.map +1 -0
- package/script/commands/secret/secret.list.js +67 -0
- package/script/commands/tenant/tenant.fetch.d.ts +43 -0
- package/script/commands/tenant/tenant.fetch.d.ts.map +1 -0
- package/script/commands/tenant/tenant.fetch.js +81 -0
- package/script/commands/tenant/tenant.list.d.ts +20 -0
- package/script/commands/tenant/tenant.list.d.ts.map +1 -0
- package/script/commands/tenant/tenant.list.js +69 -0
- package/script/commands/variable/variable.create.d.ts +31 -0
- package/script/commands/variable/variable.create.d.ts.map +1 -0
- package/script/commands/variable/variable.create.js +70 -0
- package/script/commands/variable/variable.delete.d.ts +28 -0
- package/script/commands/variable/variable.delete.d.ts.map +1 -0
- package/script/commands/variable/variable.delete.js +67 -0
- package/script/commands/variable/variable.list.d.ts +27 -0
- package/script/commands/variable/variable.list.d.ts.map +1 -0
- package/script/commands/variable/variable.list.js +73 -0
- package/script/common/command.d.ts +63 -0
- package/script/common/command.d.ts.map +1 -0
- package/script/common/command.js +96 -0
- package/script/common/flowcore-client.d.ts +39 -0
- package/script/common/flowcore-client.d.ts.map +1 -0
- package/script/common/flowcore-client.js +76 -0
- package/script/contracts/api-key.d.ts +14 -0
- package/script/contracts/api-key.d.ts.map +1 -0
- package/script/contracts/api-key.js +12 -0
- package/script/contracts/data-core.d.ts +38 -0
- package/script/contracts/data-core.d.ts.map +1 -0
- package/script/contracts/data-core.js +42 -0
- package/script/contracts/event-type.d.ts +33 -0
- package/script/contracts/event-type.d.ts.map +1 -0
- package/script/contracts/event-type.js +37 -0
- package/script/contracts/event.d.ts +20 -0
- package/script/contracts/event.d.ts.map +1 -0
- package/script/contracts/event.js +18 -0
- package/script/contracts/flow-type.d.ts +32 -0
- package/script/contracts/flow-type.d.ts.map +1 -0
- package/script/contracts/flow-type.js +35 -0
- package/script/contracts/index.d.ts +4 -0
- package/script/contracts/index.d.ts.map +1 -0
- package/script/contracts/index.js +2 -0
- package/script/contracts/tenant.d.ts +50 -0
- package/script/contracts/tenant.d.ts.map +1 -0
- package/script/contracts/tenant.js +37 -0
- package/script/contracts/variable.d.ts +13 -0
- package/script/contracts/variable.d.ts.map +1 -0
- package/script/contracts/variable.js +11 -0
- package/script/exceptions/client-error.d.ts +9 -0
- package/script/exceptions/client-error.d.ts.map +1 -0
- package/script/exceptions/client-error.js +24 -0
- package/script/exceptions/command-error.d.ts +7 -0
- package/script/exceptions/command-error.d.ts.map +1 -0
- package/script/exceptions/command-error.js +12 -0
- package/script/exceptions/index.d.ts +4 -0
- package/script/exceptions/index.d.ts.map +1 -0
- package/script/exceptions/index.js +19 -0
- package/script/exceptions/invalid-response.d.ts +8 -0
- package/script/exceptions/invalid-response.d.ts.map +1 -0
- package/script/exceptions/invalid-response.js +19 -0
- package/script/exceptions/not-found.d.ts +7 -0
- package/script/exceptions/not-found.d.ts.map +1 -0
- package/script/exceptions/not-found.js +12 -0
- package/script/mod.d.ts +6 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +21 -0
- package/script/package.json +3 -0
- package/script/utils/parse-response-helper.d.ts +6 -0
- package/script/utils/parse-response-helper.d.ts.map +1 -0
- package/script/utils/parse-response-helper.js +20 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { Type } from "@sinclair/typebox";
|
|
3
|
+
import { EventTypeSchema } from "../../contracts/event-type.js";
|
|
4
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
5
|
+
/**
|
|
6
|
+
* Fetch all event types for a flow type
|
|
7
|
+
*/
|
|
8
|
+
export class EventTypeListCommand extends Command {
|
|
9
|
+
/**
|
|
10
|
+
* Get the method
|
|
11
|
+
*/
|
|
12
|
+
getMethod() {
|
|
13
|
+
return "GET";
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get the base url
|
|
17
|
+
*/
|
|
18
|
+
getBaseUrl() {
|
|
19
|
+
return "https://event-type-2.api.flowcore.io";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the path
|
|
23
|
+
*/
|
|
24
|
+
getPath() {
|
|
25
|
+
const queryParams = new URLSearchParams();
|
|
26
|
+
queryParams.set("flowTypeId", this.input.flowTypeId);
|
|
27
|
+
return `/api/v1/event-types?${queryParams.toString()}`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse the response
|
|
31
|
+
*/
|
|
32
|
+
parseResponse(rawResponse) {
|
|
33
|
+
const response = parseResponseHelper(Type.Array(EventTypeSchema), rawResponse);
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type EventType } from "../../contracts/event-type.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the event type update command
|
|
5
|
+
*/
|
|
6
|
+
export type EventTypeUpdateInput = {
|
|
7
|
+
/** The id of the event type */
|
|
8
|
+
eventTypeId: string;
|
|
9
|
+
/** The description of the event type */
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Update an event type
|
|
14
|
+
*/
|
|
15
|
+
export declare class EventTypeUpdateCommand extends Command<EventTypeUpdateInput, EventType> {
|
|
16
|
+
/**
|
|
17
|
+
* Get the method
|
|
18
|
+
*/
|
|
19
|
+
protected getMethod(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Get the base url
|
|
22
|
+
*/
|
|
23
|
+
protected getBaseUrl(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the path
|
|
26
|
+
*/
|
|
27
|
+
protected getPath(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the body for the request
|
|
30
|
+
*/
|
|
31
|
+
protected getBody(): string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Parse the response
|
|
34
|
+
*/
|
|
35
|
+
protected parseResponse(rawResponse: unknown): EventType;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=event-type.update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-type.update.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,+BAA+B,CAAA;AAG/E;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC;IAClF;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,GAAG,SAAS;IAKhD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS;CAGlE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { EventTypeSchema } from "../../contracts/event-type.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
/**
|
|
5
|
+
* Update an event type
|
|
6
|
+
*/
|
|
7
|
+
export class EventTypeUpdateCommand extends Command {
|
|
8
|
+
/**
|
|
9
|
+
* Get the method
|
|
10
|
+
*/
|
|
11
|
+
getMethod() {
|
|
12
|
+
return "PATCH";
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get the base url
|
|
16
|
+
*/
|
|
17
|
+
getBaseUrl() {
|
|
18
|
+
return "https://event-type-2.api.flowcore.io";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get the path
|
|
22
|
+
*/
|
|
23
|
+
getPath() {
|
|
24
|
+
return `/api/v1/event-types/${this.input.eventTypeId}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the body for the request
|
|
28
|
+
*/
|
|
29
|
+
getBody() {
|
|
30
|
+
const { eventTypeId: _eventTypeId, ...payload } = this.input;
|
|
31
|
+
return JSON.stringify(payload);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parse the response
|
|
35
|
+
*/
|
|
36
|
+
parseResponse(rawResponse) {
|
|
37
|
+
return parseResponseHelper(EventTypeSchema, rawResponse);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the events fetch indexes command
|
|
4
|
+
*/
|
|
5
|
+
export interface EventsFetchTimeBucketsByNamesInput {
|
|
6
|
+
/** the tenant name */
|
|
7
|
+
tenant: string;
|
|
8
|
+
/** the data core id */
|
|
9
|
+
dataCoreId: string;
|
|
10
|
+
/** the flow type name */
|
|
11
|
+
flowType: string;
|
|
12
|
+
/** the event type names */
|
|
13
|
+
eventTypes: string[];
|
|
14
|
+
/** the paging cursor */
|
|
15
|
+
cursor?: string;
|
|
16
|
+
/** the page size (default is 10.000) */
|
|
17
|
+
pageSize?: number;
|
|
18
|
+
/** start from this time bucket */
|
|
19
|
+
fromTimeBucket?: string;
|
|
20
|
+
/** end at this time bucket */
|
|
21
|
+
toTimeBucket?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The output for the events fetch indexes command
|
|
25
|
+
*/
|
|
26
|
+
export interface EventsFetchTimeBucketsByNamesOutput {
|
|
27
|
+
/** the time buckets */
|
|
28
|
+
timeBuckets: string[];
|
|
29
|
+
/** the next page cursor */
|
|
30
|
+
nextCursor?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Fetch time buckets for an event type
|
|
34
|
+
*/
|
|
35
|
+
export declare class EventsFetchTimeBucketsByNamesCommand extends Command<EventsFetchTimeBucketsByNamesInput, EventsFetchTimeBucketsByNamesOutput> {
|
|
36
|
+
/**
|
|
37
|
+
* Get the base url for the request
|
|
38
|
+
*/
|
|
39
|
+
protected getBaseUrl(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Get the path for the request
|
|
42
|
+
*/
|
|
43
|
+
protected getPath(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Parse the response
|
|
46
|
+
*/
|
|
47
|
+
protected parseResponse(rawResponse: unknown): EventsFetchTimeBucketsByNamesOutput;
|
|
48
|
+
/**
|
|
49
|
+
* Get the body for the request
|
|
50
|
+
*/
|
|
51
|
+
protected getBody(): string;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=events.fetch-time-buckets-by-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.fetch-time-buckets-by-names.d.ts","sourceRoot":"","sources":["../../../src/commands/events/events.fetch-time-buckets-by-names.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kCAAkC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD,uBAAuB;IACvB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,OAAO,CAC/D,kCAAkC,EAClC,mCAAmC,CACpC;IACC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAGpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,mCAAmC;IAK3F;;OAEG;cACgB,OAAO,IAAI,MAAM;CAGrC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
3
|
+
import { Command } from "../../common/command.js";
|
|
4
|
+
/**
|
|
5
|
+
* The response schema for the events fetch time buckets by names command
|
|
6
|
+
*/
|
|
7
|
+
const responseSchema = Type.Object({
|
|
8
|
+
timeBuckets: Type.Array(Type.String()),
|
|
9
|
+
nextCursor: Type.Optional(Type.String()),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Fetch time buckets for an event type
|
|
13
|
+
*/
|
|
14
|
+
export class EventsFetchTimeBucketsByNamesCommand extends Command {
|
|
15
|
+
/**
|
|
16
|
+
* Get the base url for the request
|
|
17
|
+
*/
|
|
18
|
+
getBaseUrl() {
|
|
19
|
+
return "https://event-source.api.flowcore.io";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the path for the request
|
|
23
|
+
*/
|
|
24
|
+
getPath() {
|
|
25
|
+
return "/api/v1/time-buckets/by-names";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parse the response
|
|
29
|
+
*/
|
|
30
|
+
parseResponse(rawResponse) {
|
|
31
|
+
const response = parseResponseHelper(responseSchema, rawResponse);
|
|
32
|
+
return response;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get the body for the request
|
|
36
|
+
*/
|
|
37
|
+
getBody() {
|
|
38
|
+
return JSON.stringify(this.input);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type FlowcoreEvent } from "../../contracts/event.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the events fetch indexes command
|
|
5
|
+
*/
|
|
6
|
+
export interface EventsFetchEventsInput {
|
|
7
|
+
/** the tenant */
|
|
8
|
+
tenant: string;
|
|
9
|
+
/** the data core id */
|
|
10
|
+
dataCoreId: string;
|
|
11
|
+
/** the flow type name */
|
|
12
|
+
flowType: string;
|
|
13
|
+
/** the event type names */
|
|
14
|
+
eventTypes: string[];
|
|
15
|
+
/** the time bucket */
|
|
16
|
+
timeBucket: string;
|
|
17
|
+
/** the paging cursor */
|
|
18
|
+
cursor?: string;
|
|
19
|
+
/** the page size (default is 10.000) */
|
|
20
|
+
pageSize?: number;
|
|
21
|
+
/** start from this event id */
|
|
22
|
+
fromEventId?: string;
|
|
23
|
+
/** after this event id */
|
|
24
|
+
afterEventId?: string;
|
|
25
|
+
/** end at this event id */
|
|
26
|
+
toEventId?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The output for the events fetch indexes command
|
|
30
|
+
*/
|
|
31
|
+
export interface EventsFetchEventsOutput {
|
|
32
|
+
/** the events */
|
|
33
|
+
events: FlowcoreEvent[];
|
|
34
|
+
/** the next page cursor */
|
|
35
|
+
nextCursor?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fetch time buckets for an event type
|
|
39
|
+
*/
|
|
40
|
+
export declare class EventsFetchCommand extends Command<EventsFetchEventsInput, EventsFetchEventsOutput> {
|
|
41
|
+
/**
|
|
42
|
+
* Get the base url for the request
|
|
43
|
+
*/
|
|
44
|
+
protected getBaseUrl(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Get the path for the request
|
|
47
|
+
*/
|
|
48
|
+
protected getPath(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Parse the response
|
|
51
|
+
*/
|
|
52
|
+
protected parseResponse(rawResponse: unknown): EventsFetchEventsOutput;
|
|
53
|
+
/**
|
|
54
|
+
* Get the body for the request
|
|
55
|
+
*/
|
|
56
|
+
protected getBody(): string;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=events.fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/events/events.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,0BAA0B,CAAA;AAElF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,iBAAiB;IACjB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,sBAAsB,EAAE,uBAAuB,CAAC;IAC9F;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAUpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,uBAAuB;IAK/E;;OAEG;cACgB,OAAO,IAAI,MAAM;CASrC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
import { FlowcoreEventSchema } from "../../contracts/event.js";
|
|
5
|
+
/**
|
|
6
|
+
* The response schema for the events fetch command
|
|
7
|
+
*/
|
|
8
|
+
const responseSchema = Type.Object({
|
|
9
|
+
events: Type.Array(FlowcoreEventSchema),
|
|
10
|
+
nextCursor: Type.Optional(Type.String()),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Fetch time buckets for an event type
|
|
14
|
+
*/
|
|
15
|
+
export class EventsFetchCommand extends Command {
|
|
16
|
+
/**
|
|
17
|
+
* Get the base url for the request
|
|
18
|
+
*/
|
|
19
|
+
getBaseUrl() {
|
|
20
|
+
return "https://event-source.api.flowcore.io";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the path for the request
|
|
24
|
+
*/
|
|
25
|
+
getPath() {
|
|
26
|
+
const query = {
|
|
27
|
+
...(this.input.cursor ? { cursor: this.input.cursor.toString() } : {}),
|
|
28
|
+
...(this.input.pageSize ? { pageSize: this.input.pageSize.toString() } : {}),
|
|
29
|
+
...(this.input.fromEventId ? { fromEventId: this.input.fromEventId } : {}),
|
|
30
|
+
...(this.input.afterEventId ? { afterEventId: this.input.afterEventId } : {}),
|
|
31
|
+
...(this.input.toEventId ? { toEventId: this.input.toEventId } : {}),
|
|
32
|
+
};
|
|
33
|
+
return `/api/v1/events?${new URLSearchParams(query).toString()}`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Parse the response
|
|
37
|
+
*/
|
|
38
|
+
parseResponse(rawResponse) {
|
|
39
|
+
const response = parseResponseHelper(responseSchema, rawResponse);
|
|
40
|
+
return response;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get the body for the request
|
|
44
|
+
*/
|
|
45
|
+
getBody() {
|
|
46
|
+
return JSON.stringify({
|
|
47
|
+
tenant: this.input.tenant,
|
|
48
|
+
dataCoreId: this.input.dataCoreId,
|
|
49
|
+
flowType: this.input.flowType,
|
|
50
|
+
eventTypes: this.input.eventTypes,
|
|
51
|
+
timeBucket: this.input.timeBucket,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type FlowType } from "../../contracts/flow-type.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the data core create command
|
|
5
|
+
*/
|
|
6
|
+
export type FlowTypeCreateInput = {
|
|
7
|
+
/** The id of the data core */
|
|
8
|
+
dataCoreId: string;
|
|
9
|
+
/** The name of the flow type */
|
|
10
|
+
name: string;
|
|
11
|
+
/** The description of the flow type */
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Create a flow type
|
|
16
|
+
*/
|
|
17
|
+
export declare class FlowTypeCreateCommand extends Command<FlowTypeCreateInput, FlowType> {
|
|
18
|
+
/**
|
|
19
|
+
* Get the method
|
|
20
|
+
*/
|
|
21
|
+
protected getMethod(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the base url
|
|
24
|
+
*/
|
|
25
|
+
protected getBaseUrl(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get the path
|
|
28
|
+
*/
|
|
29
|
+
protected getPath(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Parse the response
|
|
32
|
+
*/
|
|
33
|
+
protected parseResponse(rawResponse: unknown): FlowType;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=flow-type.create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-type.create.d.ts","sourceRoot":"","sources":["../../../src/commands/flow-type/flow-type.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAC/E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { FlowTypeSchema } from "../../contracts/flow-type.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
/**
|
|
5
|
+
* Create a flow type
|
|
6
|
+
*/
|
|
7
|
+
export class FlowTypeCreateCommand extends Command {
|
|
8
|
+
/**
|
|
9
|
+
* Get the method
|
|
10
|
+
*/
|
|
11
|
+
getMethod() {
|
|
12
|
+
return "POST";
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get the base url
|
|
16
|
+
*/
|
|
17
|
+
getBaseUrl() {
|
|
18
|
+
return "https://flow-type-2.api.flowcore.io";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get the path
|
|
22
|
+
*/
|
|
23
|
+
getPath() {
|
|
24
|
+
return `/api/v1/flow-types`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse the response
|
|
28
|
+
*/
|
|
29
|
+
parseResponse(rawResponse) {
|
|
30
|
+
return parseResponseHelper(FlowTypeSchema, rawResponse);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import type { FlowcoreClient } from "../../common/flowcore-client.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the flow type delete request command
|
|
5
|
+
*/
|
|
6
|
+
export type FlowTypeDeleteRequestInput = {
|
|
7
|
+
/** The id of the flow type */
|
|
8
|
+
flowTypeId: string;
|
|
9
|
+
/** Whether to wait for the flow type to be deleted */
|
|
10
|
+
waitForDelete?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Request to delete a flow type
|
|
14
|
+
*/
|
|
15
|
+
export declare class FlowTypeDeleteRequestCommand extends GraphQlCommand<FlowTypeDeleteRequestInput, boolean> {
|
|
16
|
+
/**
|
|
17
|
+
* The allowed modes for the command
|
|
18
|
+
*/
|
|
19
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
20
|
+
/**
|
|
21
|
+
* Create a new flow type delete request command
|
|
22
|
+
*/
|
|
23
|
+
constructor(input: FlowTypeDeleteRequestInput);
|
|
24
|
+
/**
|
|
25
|
+
* Parse the response
|
|
26
|
+
*/
|
|
27
|
+
protected parseResponse(response: unknown): boolean;
|
|
28
|
+
getRequest(client: FlowcoreClient): Promise<{
|
|
29
|
+
allowedModes: ("apiKey" | "bearer")[];
|
|
30
|
+
body: string | undefined;
|
|
31
|
+
headers: Record<string, string>;
|
|
32
|
+
baseUrl: string;
|
|
33
|
+
path: string;
|
|
34
|
+
method: string;
|
|
35
|
+
parseResponse: (response: unknown, flowcoreClient: FlowcoreClient) => boolean | Promise<boolean>;
|
|
36
|
+
waitForResponse: (client: FlowcoreClient, response: boolean) => Promise<boolean>;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Get the body for the request
|
|
40
|
+
*/
|
|
41
|
+
protected getBody(): string;
|
|
42
|
+
/**
|
|
43
|
+
* Wait for the response (timeout: 25 seconds)
|
|
44
|
+
*/
|
|
45
|
+
protected waitForResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=flow-type.delete-request.d.ts.map
|
|
@@ -0,0 +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;AAOrE;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAmCD;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,0BAA0B,EAAE,OAAO,CAAC;IACnG;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;gBACS,KAAK,EAAE,0BAA0B;IAO7C;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAWtC,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAC/D;QACE,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAA;QACrC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;QACxB,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,EAAE,cAAc,EAAE,cAAc,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAChG,eAAe,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;KACjF,CACF;IAqBD;;OAEG;cACgB,OAAO,IAAI,MAAM;IAOpC;;OAEG;cACsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBtG"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { GraphQlCommand } from "../../common/command.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
|
+
*/
|
|
42
|
+
export class FlowTypeDeleteRequestCommand extends GraphQlCommand {
|
|
43
|
+
/**
|
|
44
|
+
* Create a new flow type delete request command
|
|
45
|
+
*/
|
|
46
|
+
constructor(input) {
|
|
47
|
+
super({
|
|
48
|
+
...input,
|
|
49
|
+
waitForDelete: input.waitForDelete ?? true,
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* The allowed modes for the command
|
|
53
|
+
*/
|
|
54
|
+
Object.defineProperty(this, "allowedModes", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: ["bearer"]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Parse the response
|
|
63
|
+
*/
|
|
64
|
+
parseResponse(response) {
|
|
65
|
+
const parsedResponse = parseResponseHelper(responseSchema, response);
|
|
66
|
+
if (parsedResponse.errors) {
|
|
67
|
+
throw new CommandError(this.constructor.name, parsedResponse.errors[0].message);
|
|
68
|
+
}
|
|
69
|
+
if (!parsedResponse.data?.datacore?.flowtype?.requestDelete) {
|
|
70
|
+
throw new NotFoundException("FlowType", this.input.flowTypeId);
|
|
71
|
+
}
|
|
72
|
+
return parsedResponse.data.datacore.flowtype.requestDelete.deleting;
|
|
73
|
+
}
|
|
74
|
+
async getRequest(client) {
|
|
75
|
+
const request = await super.getRequest(client);
|
|
76
|
+
const response = await client.execute(new FlowTypeFetchCommand({
|
|
77
|
+
flowTypeId: this.input.flowTypeId,
|
|
78
|
+
}));
|
|
79
|
+
return {
|
|
80
|
+
...request,
|
|
81
|
+
body: JSON.stringify({
|
|
82
|
+
query: graphQlQuery,
|
|
83
|
+
variables: {
|
|
84
|
+
flowTypeId: this.input.flowTypeId,
|
|
85
|
+
dataCoreId: response.dataCoreId,
|
|
86
|
+
},
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get the body for the request
|
|
92
|
+
*/
|
|
93
|
+
getBody() {
|
|
94
|
+
return JSON.stringify({
|
|
95
|
+
query: graphQlQuery,
|
|
96
|
+
variables: this.input,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Wait for the response (timeout: 25 seconds)
|
|
101
|
+
*/
|
|
102
|
+
async waitForResponse(client, response) {
|
|
103
|
+
if (!this.input.waitForDelete) {
|
|
104
|
+
return response;
|
|
105
|
+
}
|
|
106
|
+
const start = Date.now();
|
|
107
|
+
while (Date.now() - start < 25_000) {
|
|
108
|
+
const response = await client.execute(new FlowTypeExistsCommand({
|
|
109
|
+
flowTypeId: this.input.flowTypeId,
|
|
110
|
+
}));
|
|
111
|
+
if (!response.exists) {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
115
|
+
}
|
|
116
|
+
return response;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the flow type fetch by name command
|
|
4
|
+
*/
|
|
5
|
+
export interface FlowTypeExistsInput {
|
|
6
|
+
/** The id of the flow type */
|
|
7
|
+
flowTypeId: string;
|
|
8
|
+
/** Wait for the flow type to be deleted */
|
|
9
|
+
waitForDelete?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The output for the flow type exists command
|
|
13
|
+
*/
|
|
14
|
+
export interface FlowTypeExistsOutput {
|
|
15
|
+
/** Whether the flow type exists */
|
|
16
|
+
exists: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Fetch a flow type
|
|
20
|
+
*/
|
|
21
|
+
export declare class FlowTypeExistsCommand extends Command<FlowTypeExistsInput, FlowTypeExistsOutput> {
|
|
22
|
+
/**
|
|
23
|
+
* Get the method
|
|
24
|
+
*/
|
|
25
|
+
protected getMethod(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get the base url
|
|
28
|
+
*/
|
|
29
|
+
protected getBaseUrl(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get the path
|
|
32
|
+
*/
|
|
33
|
+
protected getPath(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Parse the response
|
|
36
|
+
*/
|
|
37
|
+
protected parseResponse(rawResponse: unknown): FlowTypeExistsOutput;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=flow-type.exists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-type.exists.d.ts","sourceRoot":"","sources":["../../../src/commands/flow-type/flow-type.exists.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,mCAAmC;IACnC,MAAM,EAAE,OAAO,CAAA;CAChB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;IAC3F;;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,oBAAoB;CAI7E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
/**
|
|
5
|
+
* Fetch a flow type
|
|
6
|
+
*/
|
|
7
|
+
export class FlowTypeExistsCommand extends Command {
|
|
8
|
+
/**
|
|
9
|
+
* Get the method
|
|
10
|
+
*/
|
|
11
|
+
getMethod() {
|
|
12
|
+
return "GET";
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get the base url
|
|
16
|
+
*/
|
|
17
|
+
getBaseUrl() {
|
|
18
|
+
return "https://flow-type-2.api.flowcore.io";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get the path
|
|
22
|
+
*/
|
|
23
|
+
getPath() {
|
|
24
|
+
return `/api/v1/flow-types/${this.input.flowTypeId}/exists`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse the response
|
|
28
|
+
*/
|
|
29
|
+
parseResponse(rawResponse) {
|
|
30
|
+
const response = parseResponseHelper(Type.Object({ exists: Type.Boolean() }), rawResponse);
|
|
31
|
+
return response;
|
|
32
|
+
}
|
|
33
|
+
}
|