From 701e2ff860af721c9944670abb07e9ddc6d15b7b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 6 Jan 2023 16:41:45 +0000 Subject: [PATCH] Types and stubs for environment variables feature. --- packages/backend-core/yarn.lock | 5 ----- .../src/api/web/global/environmentVariables.ts | 14 ++++++++++++++ packages/types/src/api/web/global/index.ts | 1 + packages/types/src/api/web/index.ts | 1 + .../src/documents/global/environmentVariables.ts | 16 ++++++++++++++++ packages/types/src/documents/global/index.ts | 1 + 6 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 packages/types/src/api/web/global/environmentVariables.ts create mode 100644 packages/types/src/api/web/global/index.ts create mode 100644 packages/types/src/documents/global/environmentVariables.ts diff --git a/packages/backend-core/yarn.lock b/packages/backend-core/yarn.lock index db3857101e..5f25c6ba8e 100644 --- a/packages/backend-core/yarn.lock +++ b/packages/backend-core/yarn.lock @@ -482,11 +482,6 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/types@2.2.10-alpha.13": - version "2.2.10-alpha.13" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.10-alpha.13.tgz#abc1a5bd9295a0fa63db67912c6520d12e8d6f66" - integrity sha512-XRmLQXCLKdOADxEoGB3h4QOrHlPIqbk9jOSxyOK2RDQIy8NdQ+aXanPw3TEHkgrDIYxrClVcf4KXrujqNnrk6g== - "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" diff --git a/packages/types/src/api/web/global/environmentVariables.ts b/packages/types/src/api/web/global/environmentVariables.ts new file mode 100644 index 0000000000..9c39f1c239 --- /dev/null +++ b/packages/types/src/api/web/global/environmentVariables.ts @@ -0,0 +1,14 @@ +export interface CreateEnvironmentVariableRequest { + name: string + production: string + development: string +} + +export interface UpdateEnvironmentVariableRequest { + production: string + development: string +} + +export interface GetEnvironmentVariablesResponse { + variables: string[] +} diff --git a/packages/types/src/api/web/global/index.ts b/packages/types/src/api/web/global/index.ts new file mode 100644 index 0000000000..a99934c39c --- /dev/null +++ b/packages/types/src/api/web/global/index.ts @@ -0,0 +1 @@ +export * from "./environmentVariables" diff --git a/packages/types/src/api/web/index.ts b/packages/types/src/api/web/index.ts index 1dbe22aa46..9688a89c7b 100644 --- a/packages/types/src/api/web/index.ts +++ b/packages/types/src/api/web/index.ts @@ -3,3 +3,4 @@ export * from "./user" export * from "./errors" export * from "./schedule" export * from "./app" +export * from "./global" diff --git a/packages/types/src/documents/global/environmentVariables.ts b/packages/types/src/documents/global/environmentVariables.ts new file mode 100644 index 0000000000..62bd1e5633 --- /dev/null +++ b/packages/types/src/documents/global/environmentVariables.ts @@ -0,0 +1,16 @@ +import { Document } from "../document" + +export interface EnvironmentVariablesDoc extends Document { + variables: string +} + +export type EnvironmentVariableValue = { + production: string + development: string +} + +// what comes out of the "variables" when it is decrypted +export type EnvironmentVariablesDecrypted = Record< + string, + EnvironmentVariableValue +> diff --git a/packages/types/src/documents/global/index.ts b/packages/types/src/documents/global/index.ts index 40a30ee477..11ce7513f2 100644 --- a/packages/types/src/documents/global/index.ts +++ b/packages/types/src/documents/global/index.ts @@ -5,3 +5,4 @@ export * from "./plugin" export * from "./quotas" export * from "./schedule" export * from "./templates" +export * from "./environmentVariables"