@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,51 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type DataCore } from "../../contracts/data-core.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the data core fetch by id command
|
|
5
|
+
*/
|
|
6
|
+
type DataCoreFetchByIdInput = {
|
|
7
|
+
/** The id of the data core */
|
|
8
|
+
dataCoreId: string;
|
|
9
|
+
/** The name of the data core */
|
|
10
|
+
dataCore?: never;
|
|
11
|
+
/** The tenant id */
|
|
12
|
+
tenantId?: never;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The input for the data core fetch by name command
|
|
16
|
+
*/
|
|
17
|
+
interface DataCoreFetchByNameInput {
|
|
18
|
+
/** The tenant id */
|
|
19
|
+
tenantId: string;
|
|
20
|
+
/** The name of the data core */
|
|
21
|
+
dataCore: string;
|
|
22
|
+
/** The id of the data core */
|
|
23
|
+
dataCoreId?: never;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The input for the data core fetch command
|
|
27
|
+
*/
|
|
28
|
+
export type DataCoreFetchInput = DataCoreFetchByIdInput | DataCoreFetchByNameInput;
|
|
29
|
+
/**
|
|
30
|
+
* Fetch a data core
|
|
31
|
+
*/
|
|
32
|
+
export declare class DataCoreFetchCommand extends Command<DataCoreFetchInput, DataCore> {
|
|
33
|
+
/**
|
|
34
|
+
* Get the method
|
|
35
|
+
*/
|
|
36
|
+
protected getMethod(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Get the base url
|
|
39
|
+
*/
|
|
40
|
+
protected getBaseUrl(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Get the path
|
|
43
|
+
*/
|
|
44
|
+
protected getPath(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Parse the response
|
|
47
|
+
*/
|
|
48
|
+
protected parseResponse(rawResponse: unknown): DataCore;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=data-core.fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-core.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAI5E;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC5B,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CAAA;AAED;;GAEG;AACH,UAAU,wBAAwB;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,wBAAwB,CAAA;AAElF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC7E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAUpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAWjE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataCoreFetchCommand = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const command_js_1 = require("../../common/command.js");
|
|
6
|
+
const data_core_js_1 = require("../../contracts/data-core.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
|
+
/**
|
|
10
|
+
* Fetch a data core
|
|
11
|
+
*/
|
|
12
|
+
class DataCoreFetchCommand extends command_js_1.Command {
|
|
13
|
+
/**
|
|
14
|
+
* Get the method
|
|
15
|
+
*/
|
|
16
|
+
getMethod() {
|
|
17
|
+
return "GET";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get the base url
|
|
21
|
+
*/
|
|
22
|
+
getBaseUrl() {
|
|
23
|
+
return "https://data-core-2.api.flowcore.io";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the path
|
|
27
|
+
*/
|
|
28
|
+
getPath() {
|
|
29
|
+
if ("dataCoreId" in this.input) {
|
|
30
|
+
return `/api/v1/data-cores/${this.input.dataCoreId}`;
|
|
31
|
+
}
|
|
32
|
+
const queryParams = new URLSearchParams();
|
|
33
|
+
queryParams.set("tenantId", this.input.tenantId);
|
|
34
|
+
queryParams.set("name", this.input.dataCore);
|
|
35
|
+
return `/api/v1/data-cores?${queryParams.toString()}`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse the response
|
|
39
|
+
*/
|
|
40
|
+
parseResponse(rawResponse) {
|
|
41
|
+
if ("dataCoreId" in this.input) {
|
|
42
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(data_core_js_1.DataCoreSchema, rawResponse);
|
|
43
|
+
return response;
|
|
44
|
+
}
|
|
45
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Array(data_core_js_1.DataCoreSchema), rawResponse);
|
|
46
|
+
if (response.length === 0) {
|
|
47
|
+
throw new not_found_js_1.NotFoundException("DataCore", this.input.dataCore);
|
|
48
|
+
}
|
|
49
|
+
return response[0];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.DataCoreFetchCommand = DataCoreFetchCommand;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type DataCore } from "../../contracts/data-core.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the data core fetch by name command
|
|
5
|
+
*/
|
|
6
|
+
export type DataCoreListInput = {
|
|
7
|
+
/** The tenant id */
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
/** The tenant name */
|
|
10
|
+
tenant?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Fetch all data cores for a tenant
|
|
14
|
+
*/
|
|
15
|
+
export declare class DataCoreListCommand extends Command<DataCoreListInput, DataCore[]> {
|
|
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
|
+
* Parse the response
|
|
30
|
+
*/
|
|
31
|
+
protected parseResponse(rawResponse: unknown): DataCore[];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=data-core.list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-core.list.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC7E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAWpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ,EAAE;CAGnE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataCoreListCommand = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const command_js_1 = require("../../common/command.js");
|
|
6
|
+
const data_core_js_1 = require("../../contracts/data-core.js");
|
|
7
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
8
|
+
/**
|
|
9
|
+
* Fetch all data cores for a tenant
|
|
10
|
+
*/
|
|
11
|
+
class DataCoreListCommand extends command_js_1.Command {
|
|
12
|
+
/**
|
|
13
|
+
* Get the method
|
|
14
|
+
*/
|
|
15
|
+
getMethod() {
|
|
16
|
+
return "GET";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the base url
|
|
20
|
+
*/
|
|
21
|
+
getBaseUrl() {
|
|
22
|
+
return "https://data-core-2.api.flowcore.io";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the path
|
|
26
|
+
*/
|
|
27
|
+
getPath() {
|
|
28
|
+
const queryParams = new URLSearchParams();
|
|
29
|
+
if (this.input.tenantId) {
|
|
30
|
+
queryParams.set("tenantId", this.input.tenantId);
|
|
31
|
+
}
|
|
32
|
+
if (this.input.tenant) {
|
|
33
|
+
queryParams.set("tenant", this.input.tenant);
|
|
34
|
+
}
|
|
35
|
+
return `/api/v1/data-cores?${queryParams.toString()}`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse the response
|
|
39
|
+
*/
|
|
40
|
+
parseResponse(rawResponse) {
|
|
41
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Array(data_core_js_1.DataCoreSchema), rawResponse);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.DataCoreListCommand = DataCoreListCommand;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type DataCore } from "../../contracts/data-core.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the data core update command
|
|
5
|
+
*/
|
|
6
|
+
export type DataCoreUpdateInput = {
|
|
7
|
+
/** The id of the data core */
|
|
8
|
+
dataCoreId: string;
|
|
9
|
+
/** The description of the data core */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** The access control of the data core */
|
|
12
|
+
accessControl?: "public" | "private";
|
|
13
|
+
/** Whether the data core is delete protected */
|
|
14
|
+
deleteProtected?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Update a data core
|
|
18
|
+
*/
|
|
19
|
+
export declare class DataCoreUpdateCommand extends Command<DataCoreUpdateInput, DataCore> {
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
protected getMethod(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the base url
|
|
26
|
+
*/
|
|
27
|
+
protected getBaseUrl(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the path
|
|
30
|
+
*/
|
|
31
|
+
protected getPath(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get the body for the request
|
|
34
|
+
*/
|
|
35
|
+
protected getBody(): string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Parse the response
|
|
38
|
+
*/
|
|
39
|
+
protected parseResponse(rawResponse: unknown): DataCore;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=data-core.update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-core.update.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.update.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,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IACpC,gDAAgD;IAChD,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,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,OAAO,IAAI,MAAM,GAAG,SAAS;IAQhD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataCoreUpdateCommand = void 0;
|
|
4
|
+
const command_js_1 = require("../../common/command.js");
|
|
5
|
+
const data_core_js_1 = require("../../contracts/data-core.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
|
+
/**
|
|
9
|
+
* Update a data core
|
|
10
|
+
*/
|
|
11
|
+
class DataCoreUpdateCommand extends command_js_1.Command {
|
|
12
|
+
/**
|
|
13
|
+
* Get the method
|
|
14
|
+
*/
|
|
15
|
+
getMethod() {
|
|
16
|
+
return "PATCH";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the base url
|
|
20
|
+
*/
|
|
21
|
+
getBaseUrl() {
|
|
22
|
+
return "https://data-core-2.api.flowcore.io";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the path
|
|
26
|
+
*/
|
|
27
|
+
getPath() {
|
|
28
|
+
return `/api/v1/data-cores/${this.input.dataCoreId}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the body for the request
|
|
32
|
+
*/
|
|
33
|
+
getBody() {
|
|
34
|
+
const { dataCoreId: _dataCoreId, ...payload } = this.input;
|
|
35
|
+
if (Object.keys(payload).length === 0) {
|
|
36
|
+
throw new command_error_js_1.CommandError(this.constructor.name, "No fields to update");
|
|
37
|
+
}
|
|
38
|
+
return JSON.stringify(payload);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parse the response
|
|
42
|
+
*/
|
|
43
|
+
parseResponse(rawResponse) {
|
|
44
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(data_core_js_1.DataCoreSchema, rawResponse);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.DataCoreUpdateCommand = DataCoreUpdateCommand;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type EventType } from "../../contracts/event-type.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the event type create command
|
|
5
|
+
*/
|
|
6
|
+
export type EventTypeCreateInput = {
|
|
7
|
+
/** The id of the flow type */
|
|
8
|
+
flowTypeId: string;
|
|
9
|
+
/** The name of the event type */
|
|
10
|
+
name: string;
|
|
11
|
+
/** The description of the event type */
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Create an event type
|
|
16
|
+
*/
|
|
17
|
+
export declare class EventTypeCreateCommand extends Command<EventTypeCreateInput, EventType> {
|
|
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): EventType;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=event-type.create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-type.create.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.create.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,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,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,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS;CAGlE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventTypeCreateCommand = void 0;
|
|
4
|
+
const command_js_1 = require("../../common/command.js");
|
|
5
|
+
const event_type_js_1 = require("../../contracts/event-type.js");
|
|
6
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
7
|
+
/**
|
|
8
|
+
* Create an event type
|
|
9
|
+
*/
|
|
10
|
+
class EventTypeCreateCommand extends command_js_1.Command {
|
|
11
|
+
/**
|
|
12
|
+
* Get the method
|
|
13
|
+
*/
|
|
14
|
+
getMethod() {
|
|
15
|
+
return "POST";
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get the base url
|
|
19
|
+
*/
|
|
20
|
+
getBaseUrl() {
|
|
21
|
+
return "https://event-type-2.api.flowcore.io";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get the path
|
|
25
|
+
*/
|
|
26
|
+
getPath() {
|
|
27
|
+
return `/api/v1/event-types`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse the response
|
|
31
|
+
*/
|
|
32
|
+
parseResponse(rawResponse) {
|
|
33
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(event_type_js_1.EventTypeSchema, rawResponse);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.EventTypeCreateCommand = EventTypeCreateCommand;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import type { FlowcoreClient } from "../../common/flowcore-client.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the event type delete request command
|
|
5
|
+
*/
|
|
6
|
+
export type 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
|
+
*/
|
|
15
|
+
export declare class EventTypeDeleteRequestCommand extends GraphQlCommand<EventTypeDeleteRequestInput, boolean> {
|
|
16
|
+
/**
|
|
17
|
+
* The allowed modes for the command
|
|
18
|
+
*/
|
|
19
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
20
|
+
/**
|
|
21
|
+
* Create a new event type delete request command
|
|
22
|
+
*/
|
|
23
|
+
constructor(input: EventTypeDeleteRequestInput);
|
|
24
|
+
/**
|
|
25
|
+
* Parse the response
|
|
26
|
+
*/
|
|
27
|
+
protected parseResponse(response: unknown): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Get the body for the request
|
|
30
|
+
*/
|
|
31
|
+
protected getBody(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Wait for the response (timeout: 25 seconds)
|
|
34
|
+
*/
|
|
35
|
+
protected waitForResponse(client: FlowcoreClient, response: boolean): Promise<boolean>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=event-type.delete-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-type.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IAEnB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AA+BD;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,cAAc,CAAC,2BAA2B,EAAE,OAAO,CAAC;IACrG;;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;IAQpC;;OAEG;cACsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBtG"}
|
|
@@ -0,0 +1,102 @@
|
|
|
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_js_1 = require("../../common/command.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
|
+
*/
|
|
40
|
+
class EventTypeDeleteRequestCommand extends command_js_1.GraphQlCommand {
|
|
41
|
+
/**
|
|
42
|
+
* Create a new event type delete request command
|
|
43
|
+
*/
|
|
44
|
+
constructor(input) {
|
|
45
|
+
super({
|
|
46
|
+
...input,
|
|
47
|
+
waitForDelete: input.waitForDelete ?? true,
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* The allowed modes for the command
|
|
51
|
+
*/
|
|
52
|
+
Object.defineProperty(this, "allowedModes", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
configurable: true,
|
|
55
|
+
writable: true,
|
|
56
|
+
value: ["bearer"]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Parse the response
|
|
61
|
+
*/
|
|
62
|
+
parseResponse(response) {
|
|
63
|
+
const parsedResponse = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, response);
|
|
64
|
+
if (parsedResponse.errors) {
|
|
65
|
+
throw new command_error_js_1.CommandError(this.constructor.name, parsedResponse.errors[0].message);
|
|
66
|
+
}
|
|
67
|
+
if (!parsedResponse.data?.eventType?.requestDelete) {
|
|
68
|
+
throw new not_found_js_1.NotFoundException("EventType", this.input.eventTypeId);
|
|
69
|
+
}
|
|
70
|
+
return parsedResponse.data.eventType.requestDelete.deleting;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get the body for the request
|
|
74
|
+
*/
|
|
75
|
+
getBody() {
|
|
76
|
+
const { waitForDelete: _, ...rest } = this.input;
|
|
77
|
+
return JSON.stringify({
|
|
78
|
+
query: graphQlQuery,
|
|
79
|
+
variables: rest,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Wait for the response (timeout: 25 seconds)
|
|
84
|
+
*/
|
|
85
|
+
async waitForResponse(client, response) {
|
|
86
|
+
if (!this.input.waitForDelete) {
|
|
87
|
+
return response;
|
|
88
|
+
}
|
|
89
|
+
const start = Date.now();
|
|
90
|
+
while (Date.now() - start < 25_000) {
|
|
91
|
+
const response = await client.execute(new event_type_exists_js_1.EventTypeExistsCommand({
|
|
92
|
+
eventTypeId: this.input.eventTypeId,
|
|
93
|
+
}));
|
|
94
|
+
if (!response.exists) {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
98
|
+
}
|
|
99
|
+
return response;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.EventTypeDeleteRequestCommand = EventTypeDeleteRequestCommand;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the event type exists command
|
|
4
|
+
*/
|
|
5
|
+
export interface EventTypeExistsInput {
|
|
6
|
+
/** The id of the event type */
|
|
7
|
+
eventTypeId: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The output for the event type exists command
|
|
11
|
+
*/
|
|
12
|
+
export interface EventTypeExistsOutput {
|
|
13
|
+
/** Whether the event type exists */
|
|
14
|
+
exists: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Check if an event type exists
|
|
18
|
+
*/
|
|
19
|
+
export declare class EventTypeExistsCommand extends Command<EventTypeExistsInput, EventTypeExistsOutput> {
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
protected getMethod(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the base url
|
|
26
|
+
*/
|
|
27
|
+
protected getBaseUrl(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the path
|
|
30
|
+
*/
|
|
31
|
+
protected getPath(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Parse the response
|
|
34
|
+
*/
|
|
35
|
+
protected parseResponse(rawResponse: unknown): EventTypeExistsOutput;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=event-type.exists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-type.exists.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.exists.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,MAAM,EAAE,OAAO,CAAA;CAChB;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;IAC9F;;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,qBAAqB;CAI9E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventTypeExistsCommand = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const command_js_1 = require("../../common/command.js");
|
|
6
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
7
|
+
/**
|
|
8
|
+
* Check if an event type exists
|
|
9
|
+
*/
|
|
10
|
+
class EventTypeExistsCommand extends command_js_1.Command {
|
|
11
|
+
/**
|
|
12
|
+
* Get the method
|
|
13
|
+
*/
|
|
14
|
+
getMethod() {
|
|
15
|
+
return "GET";
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get the base url
|
|
19
|
+
*/
|
|
20
|
+
getBaseUrl() {
|
|
21
|
+
return "https://event-type-2.api.flowcore.io";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get the path
|
|
25
|
+
*/
|
|
26
|
+
getPath() {
|
|
27
|
+
return `/api/v1/event-types/${this.input.eventTypeId}/exists`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse the response
|
|
31
|
+
*/
|
|
32
|
+
parseResponse(rawResponse) {
|
|
33
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Object({ exists: typebox_1.Type.Boolean() }), rawResponse);
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.EventTypeExistsCommand = EventTypeExistsCommand;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type EventType } from "../../contracts/event-type.js";
|
|
3
|
+
interface EventTypeFetchByIdInput {
|
|
4
|
+
/** The id of the event type */
|
|
5
|
+
eventTypeId: string;
|
|
6
|
+
/** The id of the flow type */
|
|
7
|
+
flowTypeId?: never;
|
|
8
|
+
/** The name of the event type */
|
|
9
|
+
eventType?: never;
|
|
10
|
+
}
|
|
11
|
+
interface EventTypeFetchByNameInput {
|
|
12
|
+
/** The id of the flow type */
|
|
13
|
+
flowTypeId: string;
|
|
14
|
+
/** The name of the event type */
|
|
15
|
+
eventType: string;
|
|
16
|
+
/** The id of the event type */
|
|
17
|
+
eventTypeId?: never;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The input for the event type fetch command
|
|
21
|
+
*/
|
|
22
|
+
export type EventTypeFetchInput = EventTypeFetchByIdInput | EventTypeFetchByNameInput;
|
|
23
|
+
/**
|
|
24
|
+
* Fetch an event type
|
|
25
|
+
*/
|
|
26
|
+
export declare class EventTypeFetchCommand extends Command<EventTypeFetchInput, EventType> {
|
|
27
|
+
/**
|
|
28
|
+
* Get the method
|
|
29
|
+
*/
|
|
30
|
+
protected getMethod(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the base url
|
|
33
|
+
*/
|
|
34
|
+
protected getBaseUrl(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Get the path
|
|
37
|
+
*/
|
|
38
|
+
protected getPath(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Parse the response
|
|
41
|
+
*/
|
|
42
|
+
protected parseResponse(rawResponse: unknown): EventType;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=event-type.fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-type.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,+BAA+B,CAAA;AAI/E,UAAU,uBAAuB;IAC/B,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,iCAAiC;IACjC,SAAS,CAAC,EAAE,KAAK,CAAA;CAClB;AAED,UAAU,yBAAyB;IACjC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,KAAK,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,GAAG,yBAAyB,CAAA;AAErF;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,SAAS,CAAC;IAChF;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAUpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS;CAWlE"}
|