@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,28 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the secret delete command
|
|
4
|
+
*/
|
|
5
|
+
export interface SecretDeleteInput {
|
|
6
|
+
/** The tenant id */
|
|
7
|
+
tenantId: string;
|
|
8
|
+
/** The key of the secret */
|
|
9
|
+
key: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* List secrets
|
|
13
|
+
*/
|
|
14
|
+
export declare class SecretDeleteCommand extends GraphQlCommand<SecretDeleteInput, boolean> {
|
|
15
|
+
/**
|
|
16
|
+
* The allowed modes for the command
|
|
17
|
+
*/
|
|
18
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
19
|
+
/**
|
|
20
|
+
* Parse the response
|
|
21
|
+
*/
|
|
22
|
+
protected parseResponse(rawResponse: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Get the body for the request
|
|
25
|
+
*/
|
|
26
|
+
protected getBody(): string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=secret.delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/secret/secret.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIxD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAA;CACZ;AAyBD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACjF;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO;IAY/D;;OAEG;cACgB,OAAO,IAAI,MAAM;CAMrC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SecretDeleteCommand = 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
|
+
const command_error_js_1 = require("../../exceptions/command-error.js");
|
|
8
|
+
const graphQlQueryById = `
|
|
9
|
+
mutation FLOWCORE_SDK_SECRET_DELETE($tenantId: ID!, $key: String!) {
|
|
10
|
+
organization(id: $tenantId) {
|
|
11
|
+
removeSecret(key: $key)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const responseSchema = typebox_1.Type.Object({
|
|
16
|
+
errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
17
|
+
message: typebox_1.Type.String(),
|
|
18
|
+
}))),
|
|
19
|
+
data: typebox_1.Type.Object({
|
|
20
|
+
organization: typebox_1.Type.Object({
|
|
21
|
+
removeSecret: typebox_1.Type.Union([typebox_1.Type.Boolean(), typebox_1.Type.Null()]),
|
|
22
|
+
}),
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* List secrets
|
|
27
|
+
*/
|
|
28
|
+
class SecretDeleteCommand extends command_js_1.GraphQlCommand {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
/**
|
|
32
|
+
* The allowed modes for the command
|
|
33
|
+
*/
|
|
34
|
+
Object.defineProperty(this, "allowedModes", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
configurable: true,
|
|
37
|
+
writable: true,
|
|
38
|
+
value: ["bearer"]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parse the response
|
|
43
|
+
*/
|
|
44
|
+
parseResponse(rawResponse) {
|
|
45
|
+
console.log("rawResponse", rawResponse);
|
|
46
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, rawResponse);
|
|
47
|
+
if (response.errors) {
|
|
48
|
+
throw new command_error_js_1.CommandError(this.constructor.name, response.errors[0].message);
|
|
49
|
+
}
|
|
50
|
+
if (response.data.organization.removeSecret !== true) {
|
|
51
|
+
throw new command_error_js_1.CommandError(this.constructor.name, "Failed to delete secret");
|
|
52
|
+
}
|
|
53
|
+
return response.data.organization.removeSecret;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get the body for the request
|
|
57
|
+
*/
|
|
58
|
+
getBody() {
|
|
59
|
+
return JSON.stringify({
|
|
60
|
+
query: graphQlQueryById,
|
|
61
|
+
variables: this.input,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.SecretDeleteCommand = SecretDeleteCommand;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the secret list command
|
|
4
|
+
*/
|
|
5
|
+
export interface SecretListInput {
|
|
6
|
+
/** The tenant id */
|
|
7
|
+
tenantId: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List secrets
|
|
11
|
+
*/
|
|
12
|
+
export declare class SecretListCommand extends GraphQlCommand<SecretListInput, string[]> {
|
|
13
|
+
/**
|
|
14
|
+
* The allowed modes for the command
|
|
15
|
+
*/
|
|
16
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
17
|
+
/**
|
|
18
|
+
* Parse the response
|
|
19
|
+
*/
|
|
20
|
+
protected parseResponse(rawResponse: unknown): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Get the body for the request
|
|
23
|
+
*/
|
|
24
|
+
protected getBody(): string;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=secret.list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret.list.d.ts","sourceRoot":"","sources":["../../../src/commands/secret/secret.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIxD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AA4BD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC9E;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE;IAWhE;;OAEG;cACgB,OAAO,IAAI,MAAM;CAMrC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SecretListCommand = 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
|
+
const command_error_js_1 = require("../../exceptions/command-error.js");
|
|
8
|
+
const graphQlQueryById = `
|
|
9
|
+
query FLOWCORE_SDK_SECRET_LIST($tenantId: ID!) {
|
|
10
|
+
organization(search: {id: $tenantId}) {
|
|
11
|
+
secrets
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const responseSchema = typebox_1.Type.Object({
|
|
16
|
+
errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
17
|
+
message: typebox_1.Type.String(),
|
|
18
|
+
}))),
|
|
19
|
+
data: typebox_1.Type.Object({
|
|
20
|
+
organization: typebox_1.Type.Object({
|
|
21
|
+
secrets: typebox_1.Type.Union([
|
|
22
|
+
typebox_1.Type.Array(typebox_1.Type.String()),
|
|
23
|
+
typebox_1.Type.Null(),
|
|
24
|
+
]),
|
|
25
|
+
}),
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* List secrets
|
|
30
|
+
*/
|
|
31
|
+
class SecretListCommand extends command_js_1.GraphQlCommand {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
/**
|
|
35
|
+
* The allowed modes for the command
|
|
36
|
+
*/
|
|
37
|
+
Object.defineProperty(this, "allowedModes", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: ["bearer"]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse the response
|
|
46
|
+
*/
|
|
47
|
+
parseResponse(rawResponse) {
|
|
48
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, rawResponse);
|
|
49
|
+
if (response.errors) {
|
|
50
|
+
throw new command_error_js_1.CommandError(this.constructor.name, response.errors[0].message);
|
|
51
|
+
}
|
|
52
|
+
if (response.data.organization.secrets === null) {
|
|
53
|
+
throw new command_error_js_1.CommandError(this.constructor.name, "Failed to list secrets");
|
|
54
|
+
}
|
|
55
|
+
return response.data.organization.secrets;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the body for the request
|
|
59
|
+
*/
|
|
60
|
+
getBody() {
|
|
61
|
+
return JSON.stringify({
|
|
62
|
+
query: graphQlQueryById,
|
|
63
|
+
variables: this.input,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.SecretListCommand = SecretListCommand;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import { type Tenant } from "../../contracts/tenant.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the tenant fetch by id command
|
|
5
|
+
*/
|
|
6
|
+
type TenantFetchByIdInput = {
|
|
7
|
+
/** The id of the tenant */
|
|
8
|
+
tenantId: string;
|
|
9
|
+
/** The name of the tenant */
|
|
10
|
+
tenant?: never;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The input for the tenant fetch by name command
|
|
14
|
+
*/
|
|
15
|
+
type TenantFetchByNameInput = {
|
|
16
|
+
/** The name of the tenant */
|
|
17
|
+
tenant: string;
|
|
18
|
+
/** The id of the tenant */
|
|
19
|
+
tenantId?: never;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The input for the tenant fetch command
|
|
23
|
+
*/
|
|
24
|
+
export type TenantFetchInput = TenantFetchByIdInput | TenantFetchByNameInput;
|
|
25
|
+
/**
|
|
26
|
+
* Fetch a tenant
|
|
27
|
+
*/
|
|
28
|
+
export declare class TenantFetchCommand extends GraphQlCommand<TenantFetchInput, Tenant> {
|
|
29
|
+
/**
|
|
30
|
+
* The allowed modes for the command
|
|
31
|
+
*/
|
|
32
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
33
|
+
/**
|
|
34
|
+
* Parse the response
|
|
35
|
+
*/
|
|
36
|
+
protected parseResponse(rawResponse: unknown): Tenant;
|
|
37
|
+
/**
|
|
38
|
+
* Get the body for the request
|
|
39
|
+
*/
|
|
40
|
+
protected getBody(): string;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=tenant.fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/tenant/tenant.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,KAAK,MAAM,EAAoC,MAAM,2BAA2B,CAAA;AAIzF;;GAEG;AACH,KAAK,oBAAoB,GAAG;IAC1B,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,KAAK,CAAA;CACf,CAAA;AAED;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC5B,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,sBAAsB,CAAA;AAmC5E;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAC9E;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM;IAQ9D;;OAEG;cACgB,OAAO,IAAI,MAAM;CAYrC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TenantFetchCommand = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const command_js_1 = require("../../common/command.js");
|
|
6
|
+
const tenant_js_1 = require("../../contracts/tenant.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 graphQlQueryById = `
|
|
10
|
+
query FLOWCORE_SDK_TENANT_FETCH($tenantId: ID!) {
|
|
11
|
+
organization(search: {id: $tenantId}) {
|
|
12
|
+
id
|
|
13
|
+
org
|
|
14
|
+
displayName
|
|
15
|
+
description
|
|
16
|
+
website
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
const graphQlQueryByName = `
|
|
21
|
+
query FLOWCORE_SDK_TENANT_FETCH($tenant: String) {
|
|
22
|
+
organization(search: {org: $tenant}) {
|
|
23
|
+
id
|
|
24
|
+
org
|
|
25
|
+
displayName
|
|
26
|
+
description
|
|
27
|
+
website
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
const responseSchema = typebox_1.Type.Object({
|
|
32
|
+
data: typebox_1.Type.Object({
|
|
33
|
+
organization: typebox_1.Type.Union([
|
|
34
|
+
tenant_js_1.TenantV0Schema,
|
|
35
|
+
typebox_1.Type.Null(),
|
|
36
|
+
]),
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Fetch a tenant
|
|
41
|
+
*/
|
|
42
|
+
class TenantFetchCommand extends command_js_1.GraphQlCommand {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
/**
|
|
46
|
+
* The allowed modes for the command
|
|
47
|
+
*/
|
|
48
|
+
Object.defineProperty(this, "allowedModes", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: ["bearer"]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Parse the response
|
|
57
|
+
*/
|
|
58
|
+
parseResponse(rawResponse) {
|
|
59
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, rawResponse);
|
|
60
|
+
if (!response.data.organization) {
|
|
61
|
+
throw new not_found_js_1.NotFoundException("Tenant", this.input.tenantId ?? this.input.tenant);
|
|
62
|
+
}
|
|
63
|
+
return (0, tenant_js_1.tenantV0ToTenant)(response.data.organization);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get the body for the request
|
|
67
|
+
*/
|
|
68
|
+
getBody() {
|
|
69
|
+
if ("tenantId" in this.input) {
|
|
70
|
+
return JSON.stringify({
|
|
71
|
+
query: graphQlQueryById,
|
|
72
|
+
variables: this.input,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return JSON.stringify({
|
|
76
|
+
query: graphQlQueryByName,
|
|
77
|
+
variables: this.input,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.TenantFetchCommand = TenantFetchCommand;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import { type TenantWithLinkType } from "../../contracts/tenant.js";
|
|
3
|
+
/**
|
|
4
|
+
* List tenants
|
|
5
|
+
*/
|
|
6
|
+
export declare class TenantListCommand extends GraphQlCommand<Record<string, never>, TenantWithLinkType[]> {
|
|
7
|
+
/**
|
|
8
|
+
* The allowed modes for the command
|
|
9
|
+
*/
|
|
10
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
11
|
+
/**
|
|
12
|
+
* Parse the response
|
|
13
|
+
*/
|
|
14
|
+
protected parseResponse(rawResponse: unknown): TenantWithLinkType[];
|
|
15
|
+
/**
|
|
16
|
+
* Get the body for the request
|
|
17
|
+
*/
|
|
18
|
+
protected getBody(): string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=tenant.list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant.list.d.ts","sourceRoot":"","sources":["../../../src/commands/tenant/tenant.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAoC,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AA+BrG;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAChG;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,kBAAkB,EAAE;IAQ5E;;OAEG;cACgB,OAAO,IAAI,MAAM;CAKrC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TenantListCommand = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const command_js_1 = require("../../common/command.js");
|
|
6
|
+
const tenant_js_1 = require("../../contracts/tenant.js");
|
|
7
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
8
|
+
const graphQlQueryById = `
|
|
9
|
+
query FLOWCORE_SDK_TENANT_LIST {
|
|
10
|
+
me {
|
|
11
|
+
organizations {
|
|
12
|
+
linkType
|
|
13
|
+
organization {
|
|
14
|
+
id
|
|
15
|
+
org
|
|
16
|
+
displayName
|
|
17
|
+
description
|
|
18
|
+
website
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const responseSchema = typebox_1.Type.Object({
|
|
25
|
+
data: typebox_1.Type.Object({
|
|
26
|
+
me: typebox_1.Type.Object({
|
|
27
|
+
organizations: typebox_1.Type.Array(typebox_1.Type.Object({
|
|
28
|
+
linkType: typebox_1.Type.Union([typebox_1.Type.Literal("OWNER"), typebox_1.Type.Literal("COLLABORATOR")]),
|
|
29
|
+
organization: tenant_js_1.TenantV0Schema,
|
|
30
|
+
})),
|
|
31
|
+
}),
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* List tenants
|
|
36
|
+
*/
|
|
37
|
+
class TenantListCommand extends command_js_1.GraphQlCommand {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
/**
|
|
41
|
+
* The allowed modes for the command
|
|
42
|
+
*/
|
|
43
|
+
Object.defineProperty(this, "allowedModes", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: ["bearer"]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parse the response
|
|
52
|
+
*/
|
|
53
|
+
parseResponse(rawResponse) {
|
|
54
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, rawResponse);
|
|
55
|
+
return response.data.me.organizations.flatMap((organization) => ({
|
|
56
|
+
...(0, tenant_js_1.tenantV0ToTenant)(organization.organization),
|
|
57
|
+
linkType: organization.linkType,
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get the body for the request
|
|
62
|
+
*/
|
|
63
|
+
getBody() {
|
|
64
|
+
return JSON.stringify({
|
|
65
|
+
query: graphQlQueryById,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.TenantListCommand = TenantListCommand;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import type { Variable } from "../../contracts/variable.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the variable create command
|
|
5
|
+
*/
|
|
6
|
+
export interface VariableCreateInput {
|
|
7
|
+
/** The tenant id */
|
|
8
|
+
tenantId: string;
|
|
9
|
+
/** The key of the variable */
|
|
10
|
+
key: string;
|
|
11
|
+
/** The value of the variable */
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a variable
|
|
16
|
+
*/
|
|
17
|
+
export declare class VariableCreateCommand extends GraphQlCommand<VariableCreateInput, Variable> {
|
|
18
|
+
/**
|
|
19
|
+
* The allowed modes for the command
|
|
20
|
+
*/
|
|
21
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
22
|
+
/**
|
|
23
|
+
* Parse the response
|
|
24
|
+
*/
|
|
25
|
+
protected parseResponse(rawResponse: unknown): Variable;
|
|
26
|
+
/**
|
|
27
|
+
* Get the body for the request
|
|
28
|
+
*/
|
|
29
|
+
protected getBody(): string;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=variable.create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable.create.d.ts","sourceRoot":"","sources":["../../../src/commands/variable/variable.create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAG3D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;CACd;AA4BD;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IACtF;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;IAchE;;OAEG;cACgB,OAAO,IAAI,MAAM;CAMrC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VariableCreateCommand = 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
|
+
const command_error_js_1 = require("../../exceptions/command-error.js");
|
|
8
|
+
const graphQlQueryById = `
|
|
9
|
+
mutation FLOWCORE_SDK_VARIABLE_CREATE($tenantId: ID!, $key: String!, $value: String!) {
|
|
10
|
+
organization(id: $tenantId) {
|
|
11
|
+
createVariable(key: $key, value: $value)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const responseSchema = typebox_1.Type.Object({
|
|
16
|
+
errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
17
|
+
message: typebox_1.Type.String(),
|
|
18
|
+
}))),
|
|
19
|
+
data: typebox_1.Type.Union([
|
|
20
|
+
typebox_1.Type.Object({
|
|
21
|
+
organization: typebox_1.Type.Object({
|
|
22
|
+
createVariable: typebox_1.Type.Union([typebox_1.Type.Boolean(), typebox_1.Type.Null()]),
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
typebox_1.Type.Null(),
|
|
26
|
+
]),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Create a variable
|
|
30
|
+
*/
|
|
31
|
+
class VariableCreateCommand extends command_js_1.GraphQlCommand {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
/**
|
|
35
|
+
* The allowed modes for the command
|
|
36
|
+
*/
|
|
37
|
+
Object.defineProperty(this, "allowedModes", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: ["bearer"]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse the response
|
|
46
|
+
*/
|
|
47
|
+
parseResponse(rawResponse) {
|
|
48
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, rawResponse);
|
|
49
|
+
if (response.errors) {
|
|
50
|
+
throw new command_error_js_1.CommandError(this.constructor.name, response.errors[0].message);
|
|
51
|
+
}
|
|
52
|
+
if (!response.data || response.data.organization.createVariable !== true) {
|
|
53
|
+
throw new command_error_js_1.CommandError(this.constructor.name, "Failed to create variable");
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
key: this.input.key,
|
|
57
|
+
value: this.input.value,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get the body for the request
|
|
62
|
+
*/
|
|
63
|
+
getBody() {
|
|
64
|
+
return JSON.stringify({
|
|
65
|
+
query: graphQlQueryById,
|
|
66
|
+
variables: this.input,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.VariableCreateCommand = VariableCreateCommand;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the variable delete command
|
|
4
|
+
*/
|
|
5
|
+
export interface VariableDeleteInput {
|
|
6
|
+
/** The tenant id */
|
|
7
|
+
tenantId: string;
|
|
8
|
+
/** The key of the variable */
|
|
9
|
+
key: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create a variable
|
|
13
|
+
*/
|
|
14
|
+
export declare class VariableDeleteCommand extends GraphQlCommand<VariableDeleteInput, boolean> {
|
|
15
|
+
/**
|
|
16
|
+
* The allowed modes for the command
|
|
17
|
+
*/
|
|
18
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
19
|
+
/**
|
|
20
|
+
* Parse the response
|
|
21
|
+
*/
|
|
22
|
+
protected parseResponse(rawResponse: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Get the body for the request
|
|
25
|
+
*/
|
|
26
|
+
protected getBody(): string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=variable.delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/variable/variable.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAIxD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAA;CACZ;AA4BD;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACrF;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO;IAW/D;;OAEG;cACgB,OAAO,IAAI,MAAM;CAMrC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VariableDeleteCommand = 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
|
+
const command_error_js_1 = require("../../exceptions/command-error.js");
|
|
8
|
+
const graphQlQueryById = `
|
|
9
|
+
mutation FLOWCORE_SDK_VARIABLE_DELETE($tenantId: ID!, $key: String!) {
|
|
10
|
+
organization(id: $tenantId) {
|
|
11
|
+
removeVariable(key: $key)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const responseSchema = typebox_1.Type.Object({
|
|
16
|
+
errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
17
|
+
message: typebox_1.Type.String(),
|
|
18
|
+
}))),
|
|
19
|
+
data: typebox_1.Type.Union([
|
|
20
|
+
typebox_1.Type.Object({
|
|
21
|
+
organization: typebox_1.Type.Object({
|
|
22
|
+
removeVariable: typebox_1.Type.Union([typebox_1.Type.Boolean(), typebox_1.Type.Null()]),
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
typebox_1.Type.Null(),
|
|
26
|
+
]),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Create a variable
|
|
30
|
+
*/
|
|
31
|
+
class VariableDeleteCommand extends command_js_1.GraphQlCommand {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
/**
|
|
35
|
+
* The allowed modes for the command
|
|
36
|
+
*/
|
|
37
|
+
Object.defineProperty(this, "allowedModes", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: ["bearer"]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse the response
|
|
46
|
+
*/
|
|
47
|
+
parseResponse(rawResponse) {
|
|
48
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, rawResponse);
|
|
49
|
+
if (response.errors) {
|
|
50
|
+
throw new command_error_js_1.CommandError(this.constructor.name, response.errors[0].message);
|
|
51
|
+
}
|
|
52
|
+
if (!response.data || response.data.organization.removeVariable !== true) {
|
|
53
|
+
throw new command_error_js_1.CommandError(this.constructor.name, "Failed to delete variable");
|
|
54
|
+
}
|
|
55
|
+
return response.data.organization.removeVariable;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the body for the request
|
|
59
|
+
*/
|
|
60
|
+
getBody() {
|
|
61
|
+
return JSON.stringify({
|
|
62
|
+
query: graphQlQueryById,
|
|
63
|
+
variables: this.input,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.VariableDeleteCommand = VariableDeleteCommand;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import type { Variable } from "../../contracts/variable.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the variable list command
|
|
5
|
+
*/
|
|
6
|
+
export interface VariableListInput {
|
|
7
|
+
/** The tenant id */
|
|
8
|
+
tenantId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List variables
|
|
12
|
+
*/
|
|
13
|
+
export declare class VariableListCommand extends GraphQlCommand<VariableListInput, Variable[]> {
|
|
14
|
+
/**
|
|
15
|
+
* The allowed modes for the command
|
|
16
|
+
*/
|
|
17
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
18
|
+
/**
|
|
19
|
+
* Parse the response
|
|
20
|
+
*/
|
|
21
|
+
protected parseResponse(rawResponse: unknown): Variable[];
|
|
22
|
+
/**
|
|
23
|
+
* Get the body for the request
|
|
24
|
+
*/
|
|
25
|
+
protected getBody(): string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=variable.list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable.list.d.ts","sourceRoot":"","sources":["../../../src/commands/variable/variable.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAG3D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAkCD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IACpF;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ,EAAE;IAWlE;;OAEG;cACgB,OAAO,IAAI,MAAM;CAMrC"}
|