@budibase/frontend-core 2.2.12-alpha.43 → 2.2.12-alpha.45

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/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "2.2.12-alpha.43",
3
+ "version": "2.2.12-alpha.45",
4
4
  "description": "Budibase frontend core libraries used in builder and client",
5
5
  "author": "Budibase",
6
6
  "license": "MPL-2.0",
7
7
  "svelte": "src/index.js",
8
8
  "dependencies": {
9
- "@budibase/bbui": "2.2.12-alpha.43",
9
+ "@budibase/bbui": "2.2.12-alpha.45",
10
10
  "lodash": "^4.17.21",
11
11
  "svelte": "^3.46.2"
12
12
  },
13
- "gitHead": "b15dc542e352e796912be022f778ea931b0cedbe"
13
+ "gitHead": "93274fcdf05bf53c3bbe47d3bf3297912c9c56d0"
14
14
  }
@@ -0,0 +1,36 @@
1
+ export const buildEnvironmentVariableEndpoints = API => ({
2
+ checkEnvironmentVariableStatus: async () => {
3
+ return await API.get({
4
+ url: `/api/env/variables/status`,
5
+ })
6
+ },
7
+
8
+ /**
9
+ * Fetches a list of environment variables
10
+ */
11
+ fetchEnvironmentVariables: async () => {
12
+ return await API.get({
13
+ url: `/api/env/variables`,
14
+ json: false,
15
+ })
16
+ },
17
+
18
+ createEnvironmentVariable: async data => {
19
+ return await API.post({
20
+ url: `/api/env/variables`,
21
+ body: data,
22
+ })
23
+ },
24
+ deleteEnvironmentVariable: async varName => {
25
+ return await API.delete({
26
+ url: `/api/env/variables/${varName}`,
27
+ })
28
+ },
29
+
30
+ updateEnvironmentVariable: async data => {
31
+ return await API.patch({
32
+ url: `/api/env/variables/${data.name}`,
33
+ body: data,
34
+ })
35
+ },
36
+ })
@@ -0,0 +1,13 @@
1
+ export const buildEventEndpoints = API => ({
2
+ /**
3
+ * Publish a specific event to the backend.
4
+ */
5
+ publishEvent: async eventType => {
6
+ return await API.post({
7
+ url: `/api/global/event/publish`,
8
+ body: {
9
+ type: eventType,
10
+ },
11
+ })
12
+ },
13
+ })
package/src/api/index.js CHANGED
@@ -26,7 +26,8 @@ import { buildLicensingEndpoints } from "./licensing"
26
26
  import { buildGroupsEndpoints } from "./groups"
27
27
  import { buildPluginEndpoints } from "./plugins"
28
28
  import { buildBackupsEndpoints } from "./backups"
29
-
29
+ import { buildEnvironmentVariableEndpoints } from "./environmentVariables"
30
+ import { buildEventEndpoints } from "./events"
30
31
  const defaultAPIClientConfig = {
31
32
  /**
32
33
  * Certain definitions can't change at runtime for client apps, such as the
@@ -247,5 +248,7 @@ export const createAPIClient = config => {
247
248
  ...buildGroupsEndpoints(API),
248
249
  ...buildPluginEndpoints(API),
249
250
  ...buildBackupsEndpoints(API),
251
+ ...buildEnvironmentVariableEndpoints(API),
252
+ ...buildEventEndpoints(API),
250
253
  }
251
254
  }
package/src/constants.js CHANGED
@@ -114,6 +114,7 @@ export const ApiVersion = "1"
114
114
  export const Features = {
115
115
  USER_GROUPS: "userGroups",
116
116
  BACKUPS: "appBackups",
117
+ ENVIRONMENT_VARIABLES: "environmentVariables",
117
118
  }
118
119
 
119
120
  // Role IDs
@@ -174,3 +175,7 @@ export const Themes = [
174
175
  base: "darkest",
175
176
  },
176
177
  ]
178
+
179
+ export const EventPublishType = {
180
+ ENV_VAR_UPGRADE_PANEL_OPENED: "environment_variable_upgrade_panel_opened",
181
+ }