@nocobase/plugin-system-settings 0.7.0-alpha.8 → 0.7.0-alpha.82

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.
@@ -1,31 +1,40 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const database_1 = require("@nocobase/database");
4
- exports.default = (0, database_1.defineCollection)({
5
- name: 'systemSettings',
6
- fields: [
7
- {
8
- type: 'string',
9
- name: 'title',
10
- },
11
- {
12
- type: 'boolean',
13
- name: 'showLogoOnly',
14
- },
15
- {
16
- type: 'boolean',
17
- name: 'allowSignUp',
18
- defaultValue: true,
19
- },
20
- {
21
- type: 'belongsTo',
22
- name: 'logo',
23
- target: 'attachments',
24
- },
25
- {
26
- type: 'string',
27
- name: 'appLang',
28
- },
29
- ],
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
30
5
  });
31
- //# sourceMappingURL=systemSettings.js.map
6
+ exports.default = void 0;
7
+
8
+ function _database() {
9
+ const data = require("@nocobase/database");
10
+
11
+ _database = function _database() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ var _default = (0, _database().defineCollection)({
19
+ name: 'systemSettings',
20
+ fields: [{
21
+ type: 'string',
22
+ name: 'title'
23
+ }, {
24
+ type: 'boolean',
25
+ name: 'showLogoOnly'
26
+ }, {
27
+ type: 'boolean',
28
+ name: 'allowSignUp',
29
+ defaultValue: true
30
+ }, {
31
+ type: 'belongsTo',
32
+ name: 'logo',
33
+ target: 'attachments'
34
+ }, {
35
+ type: 'string',
36
+ name: 'appLang'
37
+ }]
38
+ });
39
+
40
+ exports.default = _default;
package/lib/index.js CHANGED
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = void 0;
7
- var plugin_1 = require("./plugin");
8
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(plugin_1).default; } });
9
- //# sourceMappingURL=index.js.map
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _plugin.default;
10
+ }
11
+ });
12
+
13
+ var _plugin = _interopRequireDefault(require("./plugin"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
package/lib/plugin.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { InstallOptions, Plugin } from '@nocobase/server';
2
2
  export declare class SystemSettingsPlugin extends Plugin {
3
+ getInitAppLang(options: any): any;
3
4
  install(options?: InstallOptions): Promise<void>;
4
5
  beforeLoad(): void;
5
6
  load(): Promise<void>;
package/lib/plugin.js CHANGED
@@ -1,58 +1,100 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SystemSettingsPlugin = void 0;
13
- const acl_1 = require("@nocobase/acl");
14
- const server_1 = require("@nocobase/server");
15
- const path_1 = require("path");
16
- class SystemSettingsPlugin extends server_1.Plugin {
17
- install(options) {
18
- var _a, _b, _c;
19
- return __awaiter(this, void 0, void 0, function* () {
20
- yield this.db.getRepository('systemSettings').create({
21
- values: {
22
- title: 'NocoBase',
23
- appLang: ((_c = (_b = (_a = options === null || options === void 0 ? void 0 : options.cliArgs) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.opts) === null || _c === void 0 ? void 0 : _c.lang) || process.env.APP_LANG || 'en-US',
24
- logo: {
25
- title: 'nocobase-logo',
26
- filename: '682e5ad037dd02a0fe4800a3e91c283b.png',
27
- extname: '.png',
28
- mimetype: 'image/png',
29
- url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/682e5ad037dd02a0fe4800a3e91c283b.png',
30
- },
31
- },
32
- });
33
- });
34
- }
35
- beforeLoad() {
36
- const cmd = this.app.findCommand('install');
37
- if (cmd) {
38
- cmd.option('--lang [lang]');
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.SystemSettingsPlugin = void 0;
7
+
8
+ function _acl() {
9
+ const data = require("@nocobase/acl");
10
+
11
+ _acl = function _acl() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _server() {
19
+ const data = require("@nocobase/server");
20
+
21
+ _server = function _server() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ function _path() {
29
+ const data = require("path");
30
+
31
+ _path = function _path() {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
39
+
40
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
41
+
42
+ class SystemSettingsPlugin extends _server().Plugin {
43
+ getInitAppLang(options) {
44
+ var _options$cliArgs, _options$cliArgs$, _options$cliArgs$$opt;
45
+
46
+ return (options === null || options === void 0 ? void 0 : (_options$cliArgs = options.cliArgs) === null || _options$cliArgs === void 0 ? void 0 : (_options$cliArgs$ = _options$cliArgs[0]) === null || _options$cliArgs$ === void 0 ? void 0 : (_options$cliArgs$$opt = _options$cliArgs$.opts) === null || _options$cliArgs$$opt === void 0 ? void 0 : _options$cliArgs$$opt.lang) || process.env.INIT_APP_LANG || 'en-US';
47
+ }
48
+
49
+ install(options) {
50
+ var _this = this;
51
+
52
+ return _asyncToGenerator(function* () {
53
+ yield _this.db.getRepository('systemSettings').create({
54
+ values: {
55
+ title: 'NocoBase',
56
+ appLang: _this.getInitAppLang(options),
57
+ logo: {
58
+ title: 'nocobase-logo',
59
+ filename: '682e5ad037dd02a0fe4800a3e91c283b.png',
60
+ extname: '.png',
61
+ mimetype: 'image/png',
62
+ url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/682e5ad037dd02a0fe4800a3e91c283b.png'
63
+ }
39
64
  }
65
+ });
66
+ })();
67
+ }
68
+
69
+ beforeLoad() {
70
+ const cmd = this.app.findCommand('install');
71
+
72
+ if (cmd) {
73
+ cmd.option('-l, --lang [lang]');
40
74
  }
41
- load() {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- yield this.app.db.import({
44
- directory: (0, path_1.resolve)(__dirname, 'collections'),
45
- });
46
- this.app.acl.use((0, acl_1.skip)({
47
- resourceName: 'systemSettings',
48
- actionName: 'get',
49
- }));
50
- });
51
- }
52
- getName() {
53
- return this.getPackageName(__dirname);
54
- }
75
+ }
76
+
77
+ load() {
78
+ var _this2 = this;
79
+
80
+ return _asyncToGenerator(function* () {
81
+ yield _this2.app.db.import({
82
+ directory: (0, _path().resolve)(__dirname, 'collections')
83
+ });
84
+
85
+ _this2.app.acl.use((0, _acl().skip)({
86
+ resourceName: 'systemSettings',
87
+ actionName: 'get'
88
+ }));
89
+ })();
90
+ }
91
+
92
+ getName() {
93
+ return this.getPackageName(__dirname);
94
+ }
95
+
55
96
  }
97
+
56
98
  exports.SystemSettingsPlugin = SystemSettingsPlugin;
57
- exports.default = SystemSettingsPlugin;
58
- //# sourceMappingURL=plugin.js.map
99
+ var _default = SystemSettingsPlugin;
100
+ exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-system-settings",
3
- "version": "0.7.0-alpha.8",
3
+ "version": "0.7.0-alpha.82",
4
4
  "main": "lib/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "licenses": [
@@ -9,13 +9,8 @@
9
9
  "url": "http://www.apache.org/licenses/LICENSE-2.0"
10
10
  }
11
11
  ],
12
- "scripts": {
13
- "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm",
14
- "build:cjs": "tsc --project tsconfig.build.json",
15
- "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
16
- },
17
12
  "devDependencies": {
18
- "@nocobase/test": "0.7.0-alpha.8"
13
+ "@nocobase/test": "0.7.0-alpha.82"
19
14
  },
20
- "gitHead": "f4a12279b43669f2c0dcb3c98b87ebf03d8dab0b"
15
+ "gitHead": "4820fd09375c7200d1ea0bb0aab1bd4783b80d3d"
21
16
  }
@@ -1,2 +0,0 @@
1
- declare const _default: import("@nocobase/database").CollectionOptions;
2
- export default _default;
@@ -1,29 +0,0 @@
1
- import { defineCollection } from '@nocobase/database';
2
- export default defineCollection({
3
- name: 'systemSettings',
4
- fields: [
5
- {
6
- type: 'string',
7
- name: 'title',
8
- },
9
- {
10
- type: 'boolean',
11
- name: 'showLogoOnly',
12
- },
13
- {
14
- type: 'boolean',
15
- name: 'allowSignUp',
16
- defaultValue: true,
17
- },
18
- {
19
- type: 'belongsTo',
20
- name: 'logo',
21
- target: 'attachments',
22
- },
23
- {
24
- type: 'string',
25
- name: 'appLang',
26
- },
27
- ],
28
- });
29
- //# sourceMappingURL=systemSettings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"systemSettings.js","sourceRoot":"","sources":["../../src/collections/systemSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,eAAe,gBAAgB,CAAC;IAC9B,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;SACd;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,aAAa;YACnB,YAAY,EAAE,IAAI;SACnB;QACD;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,aAAa;SACtB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,SAAS;SAChB;KACF;CACF,CAAC,CAAC","sourcesContent":["import { defineCollection } from '@nocobase/database';\n\nexport default defineCollection({\n name: 'systemSettings',\n fields: [\n {\n type: 'string',\n name: 'title',\n },\n {\n type: 'boolean',\n name: 'showLogoOnly',\n },\n {\n type: 'boolean',\n name: 'allowSignUp',\n defaultValue: true,\n },\n {\n type: 'belongsTo',\n name: 'logo',\n target: 'attachments',\n },\n {\n type: 'string',\n name: 'appLang',\n },\n ],\n});\n\n"]}
package/esm/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export { default } from './plugin';
package/esm/index.js DELETED
@@ -1,2 +0,0 @@
1
- export { default } from './plugin';
2
- //# sourceMappingURL=index.js.map
package/esm/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default } from './plugin';\n"]}
package/esm/plugin.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { InstallOptions, Plugin } from '@nocobase/server';
2
- export declare class SystemSettingsPlugin extends Plugin {
3
- install(options?: InstallOptions): Promise<void>;
4
- beforeLoad(): void;
5
- load(): Promise<void>;
6
- getName(): string;
7
- }
8
- export default SystemSettingsPlugin;
package/esm/plugin.js DELETED
@@ -1,54 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { skip } from '@nocobase/acl';
11
- import { Plugin } from '@nocobase/server';
12
- import { resolve } from 'path';
13
- export class SystemSettingsPlugin extends Plugin {
14
- install(options) {
15
- var _a, _b, _c;
16
- return __awaiter(this, void 0, void 0, function* () {
17
- yield this.db.getRepository('systemSettings').create({
18
- values: {
19
- title: 'NocoBase',
20
- appLang: ((_c = (_b = (_a = options === null || options === void 0 ? void 0 : options.cliArgs) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.opts) === null || _c === void 0 ? void 0 : _c.lang) || process.env.APP_LANG || 'en-US',
21
- logo: {
22
- title: 'nocobase-logo',
23
- filename: '682e5ad037dd02a0fe4800a3e91c283b.png',
24
- extname: '.png',
25
- mimetype: 'image/png',
26
- url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/682e5ad037dd02a0fe4800a3e91c283b.png',
27
- },
28
- },
29
- });
30
- });
31
- }
32
- beforeLoad() {
33
- const cmd = this.app.findCommand('install');
34
- if (cmd) {
35
- cmd.option('--lang [lang]');
36
- }
37
- }
38
- load() {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- yield this.app.db.import({
41
- directory: resolve(__dirname, 'collections'),
42
- });
43
- this.app.acl.use(skip({
44
- resourceName: 'systemSettings',
45
- actionName: 'get',
46
- }));
47
- });
48
- }
49
- getName() {
50
- return this.getPackageName(__dirname);
51
- }
52
- }
53
- export default SystemSettingsPlugin;
54
- //# sourceMappingURL=plugin.js.map
package/esm/plugin.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAkB,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,MAAM,OAAO,oBAAqB,SAAQ,MAAM;IACxC,OAAO,CAAC,OAAwB;;;YACpC,MAAM,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC;gBACnD,MAAM,EAAE;oBACN,KAAK,EAAE,UAAU;oBACjB,OAAO,EAAE,CAAA,MAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAG,CAAC,CAAC,0CAAE,IAAI,0CAAE,IAAI,KAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO;oBAC7E,IAAI,EAAE;wBACJ,KAAK,EAAE,eAAe;wBACtB,QAAQ,EAAE,sCAAsC;wBAChD,OAAO,EAAE,MAAM;wBACf,QAAQ,EAAE,WAAW;wBACrB,GAAG,EAAE,mFAAmF;qBACzF;iBACF;aACF,CAAC,CAAC;;KACJ;IAED,UAAU;QACR,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAI,GAAG,EAAE;YACP,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;SAC7B;IACH,CAAC;IAEK,IAAI;;YACR,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC;gBACvB,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC;aAC7C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CACd,IAAI,CAAC;gBACH,YAAY,EAAE,gBAAgB;gBAC9B,UAAU,EAAE,KAAK;aAClB,CAAC,CACH,CAAC;QACJ,CAAC;KAAA;IAED,OAAO;QACL,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;CACF;AAED,eAAe,oBAAoB,CAAC","sourcesContent":["import { skip } from '@nocobase/acl';\nimport { InstallOptions, Plugin } from '@nocobase/server';\nimport { resolve } from 'path';\n\nexport class SystemSettingsPlugin extends Plugin {\n async install(options?: InstallOptions) {\n await this.db.getRepository('systemSettings').create({\n values: {\n title: 'NocoBase',\n appLang: options?.cliArgs?.[0]?.opts?.lang || process.env.APP_LANG || 'en-US',\n logo: {\n title: 'nocobase-logo',\n filename: '682e5ad037dd02a0fe4800a3e91c283b.png',\n extname: '.png',\n mimetype: 'image/png',\n url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/682e5ad037dd02a0fe4800a3e91c283b.png',\n },\n },\n });\n }\n\n beforeLoad() {\n const cmd = this.app.findCommand('install');\n if (cmd) {\n cmd.option('--lang [lang]');\n }\n }\n\n async load() {\n await this.app.db.import({\n directory: resolve(__dirname, 'collections'),\n });\n this.app.acl.use(\n skip({\n resourceName: 'systemSettings',\n actionName: 'get',\n }),\n );\n }\n\n getName(): string {\n return this.getPackageName(__dirname);\n }\n}\n\nexport default SystemSettingsPlugin;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"systemSettings.js","sourceRoot":"","sources":["../../src/collections/systemSettings.ts"],"names":[],"mappings":";;AAAA,iDAAsD;AAEtD,kBAAe,IAAA,2BAAgB,EAAC;IAC9B,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;SACd;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,aAAa;YACnB,YAAY,EAAE,IAAI;SACnB;QACD;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,aAAa;SACtB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,SAAS;SAChB;KACF;CACF,CAAC,CAAC","sourcesContent":["import { defineCollection } from '@nocobase/database';\n\nexport default defineCollection({\n name: 'systemSettings',\n fields: [\n {\n type: 'string',\n name: 'title',\n },\n {\n type: 'boolean',\n name: 'showLogoOnly',\n },\n {\n type: 'boolean',\n name: 'allowSignUp',\n defaultValue: true,\n },\n {\n type: 'belongsTo',\n name: 'logo',\n target: 'attachments',\n },\n {\n type: 'string',\n name: 'appLang',\n },\n ],\n});\n\n"]}
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAmC;AAA1B,kHAAA,OAAO,OAAA","sourcesContent":["export { default } from './plugin';\n"]}
package/lib/plugin.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAqC;AACrC,6CAA0D;AAC1D,+BAA+B;AAE/B,MAAa,oBAAqB,SAAQ,eAAM;IACxC,OAAO,CAAC,OAAwB;;;YACpC,MAAM,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC;gBACnD,MAAM,EAAE;oBACN,KAAK,EAAE,UAAU;oBACjB,OAAO,EAAE,CAAA,MAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAG,CAAC,CAAC,0CAAE,IAAI,0CAAE,IAAI,KAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO;oBAC7E,IAAI,EAAE;wBACJ,KAAK,EAAE,eAAe;wBACtB,QAAQ,EAAE,sCAAsC;wBAChD,OAAO,EAAE,MAAM;wBACf,QAAQ,EAAE,WAAW;wBACrB,GAAG,EAAE,mFAAmF;qBACzF;iBACF;aACF,CAAC,CAAC;;KACJ;IAED,UAAU;QACR,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAI,GAAG,EAAE;YACP,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;SAC7B;IACH,CAAC;IAEK,IAAI;;YACR,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC;gBACvB,SAAS,EAAE,IAAA,cAAO,EAAC,SAAS,EAAE,aAAa,CAAC;aAC7C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CACd,IAAA,UAAI,EAAC;gBACH,YAAY,EAAE,gBAAgB;gBAC9B,UAAU,EAAE,KAAK;aAClB,CAAC,CACH,CAAC;QACJ,CAAC;KAAA;IAED,OAAO;QACL,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;CACF;AAvCD,oDAuCC;AAED,kBAAe,oBAAoB,CAAC","sourcesContent":["import { skip } from '@nocobase/acl';\nimport { InstallOptions, Plugin } from '@nocobase/server';\nimport { resolve } from 'path';\n\nexport class SystemSettingsPlugin extends Plugin {\n async install(options?: InstallOptions) {\n await this.db.getRepository('systemSettings').create({\n values: {\n title: 'NocoBase',\n appLang: options?.cliArgs?.[0]?.opts?.lang || process.env.APP_LANG || 'en-US',\n logo: {\n title: 'nocobase-logo',\n filename: '682e5ad037dd02a0fe4800a3e91c283b.png',\n extname: '.png',\n mimetype: 'image/png',\n url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/682e5ad037dd02a0fe4800a3e91c283b.png',\n },\n },\n });\n }\n\n beforeLoad() {\n const cmd = this.app.findCommand('install');\n if (cmd) {\n cmd.option('--lang [lang]');\n }\n }\n\n async load() {\n await this.app.db.import({\n directory: resolve(__dirname, 'collections'),\n });\n this.app.acl.use(\n skip({\n resourceName: 'systemSettings',\n actionName: 'get',\n }),\n );\n }\n\n getName(): string {\n return this.getPackageName(__dirname);\n }\n}\n\nexport default SystemSettingsPlugin;\n"]}
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.build.json",
3
- "compilerOptions": {
4
- "outDir": "./lib",
5
- "declaration": true
6
- },
7
- "include": ["./src/**/*.ts", "./src/**/*.tsx"],
8
- "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"]
9
- }