@nocobase/server 2.3.0-beta.10 → 2.3.0-beta.11

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.
@@ -8,10 +8,14 @@
8
8
  */
9
9
  export declare class Environment {
10
10
  private vars;
11
- setVariable(key: string, value: string): void;
11
+ private secretKeys;
12
+ setVariable(key: string, value: string, options?: {
13
+ isSecret?: boolean;
14
+ }): void;
12
15
  removeVariable(key: string): void;
13
16
  getVariablesAndSecrets(): {};
14
17
  getVariables(): {};
18
+ getNonSecretVariables(): {};
15
19
  renderJsonTemplate(template: any, options?: {
16
20
  omit?: string[];
17
21
  }): any;
@@ -44,11 +44,18 @@ var import_utils = require("@nocobase/utils");
44
44
  var import_lodash = __toESM(require("lodash"));
45
45
  const _Environment = class _Environment {
46
46
  vars = {};
47
- setVariable(key, value) {
47
+ secretKeys = /* @__PURE__ */ new Set();
48
+ setVariable(key, value, options) {
48
49
  this.vars[key] = value;
50
+ if ((options == null ? void 0 : options.isSecret) === true) {
51
+ this.secretKeys.add(key);
52
+ } else if ((options == null ? void 0 : options.isSecret) === false) {
53
+ this.secretKeys.delete(key);
54
+ }
49
55
  }
50
56
  removeVariable(key) {
51
57
  delete this.vars[key];
58
+ this.secretKeys.delete(key);
52
59
  }
53
60
  getVariablesAndSecrets() {
54
61
  return this.vars;
@@ -56,6 +63,15 @@ const _Environment = class _Environment {
56
63
  getVariables() {
57
64
  return this.vars;
58
65
  }
66
+ getNonSecretVariables() {
67
+ const result = {};
68
+ for (const key of Object.keys(this.vars)) {
69
+ if (!this.secretKeys.has(key)) {
70
+ result[key] = this.vars[key];
71
+ }
72
+ }
73
+ return result;
74
+ }
59
75
  renderJsonTemplate(template, options) {
60
76
  if (options == null ? void 0 : options.omit) {
61
77
  const omitTemplate = import_lodash.default.omit(template, options.omit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "2.3.0-beta.10",
3
+ "version": "2.3.0-beta.11",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -10,21 +10,21 @@
10
10
  "@koa/cors": "^5.0.0",
11
11
  "@koa/multer": "^3.1.0",
12
12
  "@koa/router": "^13.1.0",
13
- "@nocobase/acl": "2.3.0-beta.10",
14
- "@nocobase/actions": "2.3.0-beta.10",
15
- "@nocobase/ai": "2.3.0-beta.10",
16
- "@nocobase/auth": "2.3.0-beta.10",
17
- "@nocobase/cache": "2.3.0-beta.10",
18
- "@nocobase/data-source-manager": "2.3.0-beta.10",
19
- "@nocobase/database": "2.3.0-beta.10",
20
- "@nocobase/evaluators": "2.3.0-beta.10",
21
- "@nocobase/lock-manager": "2.3.0-beta.10",
22
- "@nocobase/logger": "2.3.0-beta.10",
23
- "@nocobase/resourcer": "2.3.0-beta.10",
24
- "@nocobase/sdk": "2.3.0-beta.10",
25
- "@nocobase/snowflake-id": "2.3.0-beta.10",
26
- "@nocobase/telemetry": "2.3.0-beta.10",
27
- "@nocobase/utils": "2.3.0-beta.10",
13
+ "@nocobase/acl": "2.3.0-beta.11",
14
+ "@nocobase/actions": "2.3.0-beta.11",
15
+ "@nocobase/ai": "2.3.0-beta.11",
16
+ "@nocobase/auth": "2.3.0-beta.11",
17
+ "@nocobase/cache": "2.3.0-beta.11",
18
+ "@nocobase/data-source-manager": "2.3.0-beta.11",
19
+ "@nocobase/database": "2.3.0-beta.11",
20
+ "@nocobase/evaluators": "2.3.0-beta.11",
21
+ "@nocobase/lock-manager": "2.3.0-beta.11",
22
+ "@nocobase/logger": "2.3.0-beta.11",
23
+ "@nocobase/resourcer": "2.3.0-beta.11",
24
+ "@nocobase/sdk": "2.3.0-beta.11",
25
+ "@nocobase/snowflake-id": "2.3.0-beta.11",
26
+ "@nocobase/telemetry": "2.3.0-beta.11",
27
+ "@nocobase/utils": "2.3.0-beta.11",
28
28
  "@types/decompress": "4.2.7",
29
29
  "@types/ini": "^1.3.31",
30
30
  "@types/koa-send": "^4.1.3",
@@ -61,5 +61,5 @@
61
61
  "@types/serve-handler": "^6.1.1",
62
62
  "@types/ws": "^8.5.5"
63
63
  },
64
- "gitHead": "7aa3dce6cf3201752882f7012c72997898015d89"
64
+ "gitHead": "e81c2c69d55f13e4d237c420a51ebad1e9dae515"
65
65
  }