@nocobase/plugin-system-settings 1.2.13-alpha → 1.3.0-alpha.20240710084543

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
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "系统设置",
5
5
  "description": "Used to adjust the system title, logo, language, etc.",
6
6
  "description.zh-CN": "用于调整系统的标题、LOGO、语言等。",
7
- "version": "1.2.13-alpha",
7
+ "version": "1.3.0-alpha.20240710084543",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/system-settings",
@@ -15,7 +15,7 @@
15
15
  "@nocobase/server": "1.x",
16
16
  "@nocobase/test": "1.x"
17
17
  },
18
- "gitHead": "b6a1c2ee330b47c2581ea2ce15ee46210e6220f2",
18
+ "gitHead": "07a8b596fc64a9779a194cb9b0dc2ca7570ed9d4",
19
19
  "keywords": [
20
20
  "System management"
21
21
  ]
@@ -1,13 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { Plugin } from '@nocobase/client';
10
- declare class PluginSystemSettingClient extends Plugin {
11
- load(): Promise<void>;
12
- }
13
- export default PluginSystemSettingClient;
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- (function(e,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("@nocobase/client")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client"],n):(e=typeof globalThis!="undefined"?globalThis:e||self,n(e["@nocobase/plugin-system-settings"]={},e["@nocobase/client"]))})(this,function(e,n){"use strict";var l=(e,n,i)=>new Promise((u,d)=>{var c=t=>{try{s(i.next(t))}catch(o){d(o)}},f=t=>{try{s(i.throw(t))}catch(o){d(o)}},s=t=>t.done?u(t.value):Promise.resolve(t.value).then(c,f);s((i=i.apply(e,n)).next())});class i extends n.Plugin{load(){return l(this,null,function*(){})}}e.default=i,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,14 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- module.exports = {
11
- "@nocobase/client": "1.2.13-alpha",
12
- "@nocobase/server": "1.2.13-alpha",
13
- "@nocobase/database": "1.2.13-alpha"
14
- };
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- export * from './server';
10
- export { default } from './server';
package/dist/index.js DELETED
@@ -1,48 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
- // If the importer is in node compatibility mode or this is not an ESM
31
- // file that has been converted to a CommonJS file using a Babel-
32
- // compatible transform (i.e. "__esModule" has not been set), then set
33
- // "default" to the CommonJS "module.exports" for node compatibility.
34
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
- mod
36
- ));
37
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
- var src_exports = {};
39
- __export(src_exports, {
40
- default: () => import_server.default
41
- });
42
- module.exports = __toCommonJS(src_exports);
43
- __reExport(src_exports, require("./server"), module.exports);
44
- var import_server = __toESM(require("./server"));
45
- // Annotate the CommonJS export names for ESM import in node:
46
- 0 && (module.exports = {
47
- ...require("./server")
48
- });
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- declare const _default: import("@nocobase/database").CollectionOptions;
10
- export default _default;
@@ -1,76 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var systemSettings_exports = {};
28
- __export(systemSettings_exports, {
29
- default: () => systemSettings_default
30
- });
31
- module.exports = __toCommonJS(systemSettings_exports);
32
- var import_database = require("@nocobase/database");
33
- var systemSettings_default = (0, import_database.defineCollection)({
34
- dumpRules: "required",
35
- name: "systemSettings",
36
- fields: [
37
- {
38
- type: "string",
39
- name: "title",
40
- translation: true
41
- },
42
- {
43
- type: "boolean",
44
- name: "showLogoOnly"
45
- },
46
- {
47
- type: "boolean",
48
- name: "allowSignUp",
49
- defaultValue: true
50
- },
51
- {
52
- type: "boolean",
53
- name: "smsAuthEnabled",
54
- defaultValue: false
55
- },
56
- {
57
- type: "belongsTo",
58
- name: "logo",
59
- target: "attachments"
60
- },
61
- {
62
- type: "json",
63
- name: "enabledLanguages",
64
- defaultValue: []
65
- },
66
- {
67
- type: "string",
68
- name: "appLang"
69
- },
70
- {
71
- type: "json",
72
- name: "options",
73
- defaultValue: {}
74
- }
75
- ]
76
- });
@@ -1,9 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- export { default } from './server';
@@ -1,42 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var server_exports = {};
38
- __export(server_exports, {
39
- default: () => import_server.default
40
- });
41
- module.exports = __toCommonJS(server_exports);
42
- var import_server = __toESM(require("./server"));
@@ -1,13 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { Migration } from '@nocobase/server';
10
- export default class extends Migration {
11
- appVersion: string;
12
- up(): Promise<void>;
13
- }
@@ -1,48 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var update_enabled_languages_exports = {};
28
- __export(update_enabled_languages_exports, {
29
- default: () => update_enabled_languages_default
30
- });
31
- module.exports = __toCommonJS(update_enabled_languages_exports);
32
- var import_server = require("@nocobase/server");
33
- class update_enabled_languages_default extends import_server.Migration {
34
- appVersion = "<0.7.3-alpha.1";
35
- async up() {
36
- const result = await this.app.version.satisfies("<=0.7.2-alpha.7");
37
- if (!result) {
38
- return;
39
- }
40
- const SystemSetting = this.context.db.getRepository("systemSettings");
41
- const setting = await SystemSetting.findOne();
42
- const enabledLanguages = setting.get("enabledLanguages") || [];
43
- if (Array.isArray(enabledLanguages) && enabledLanguages.length === 0) {
44
- setting.set("enabledLanguages", [setting.get("appLang") || "en-US"]);
45
- await setting.save();
46
- }
47
- }
48
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { InstallOptions, Plugin } from '@nocobase/server';
10
- export declare class PluginSystemSettingsServer extends Plugin {
11
- getInitAppLang(options: any): any;
12
- install(options?: InstallOptions): Promise<void>;
13
- beforeLoad(): void;
14
- load(): Promise<void>;
15
- }
16
- export default PluginSystemSettingsServer;
@@ -1,80 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var server_exports = {};
28
- __export(server_exports, {
29
- PluginSystemSettingsServer: () => PluginSystemSettingsServer,
30
- default: () => server_default
31
- });
32
- module.exports = __toCommonJS(server_exports);
33
- var import_server = require("@nocobase/server");
34
- var import_path = require("path");
35
- class PluginSystemSettingsServer extends import_server.Plugin {
36
- getInitAppLang(options) {
37
- var _a, _b, _c;
38
- return ((_c = (_b = (_a = options == null ? void 0 : options.cliArgs) == null ? void 0 : _a[0]) == null ? void 0 : _b.opts) == null ? void 0 : _c.lang) || process.env.INIT_APP_LANG || "en-US";
39
- }
40
- async install(options) {
41
- await this.db.getRepository("systemSettings").create({
42
- values: {
43
- title: "NocoBase",
44
- appLang: this.getInitAppLang(options),
45
- enabledLanguages: [this.getInitAppLang(options)],
46
- logo: {
47
- title: "nocobase-logo",
48
- filename: "682e5ad037dd02a0fe4800a3e91c283b.png",
49
- extname: ".png",
50
- mimetype: "image/png",
51
- url: "https://nocobase.oss-cn-beijing.aliyuncs.com/682e5ad037dd02a0fe4800a3e91c283b.png"
52
- }
53
- }
54
- });
55
- }
56
- beforeLoad() {
57
- const cmd = this.app.findCommand("install");
58
- if (cmd) {
59
- cmd.option("-l, --lang [lang]");
60
- }
61
- this.app.acl.registerSnippet({
62
- name: `pm.${this.name}.system-settings`,
63
- actions: ["systemSettings:update"]
64
- });
65
- }
66
- async load() {
67
- await this.importCollections((0, import_path.resolve)(__dirname, "collections"));
68
- this.app.acl.addFixedParams("systemSettings", "destroy", () => {
69
- return {
70
- "id.$ne": 1
71
- };
72
- });
73
- this.app.acl.allow("systemSettings", "get", "public");
74
- }
75
- }
76
- var server_default = PluginSystemSettingsServer;
77
- // Annotate the CommonJS export names for ESM import in node:
78
- 0 && (module.exports = {
79
- PluginSystemSettingsServer
80
- });
@@ -1,31 +0,0 @@
1
- {
2
- "openapi": "3.0.2",
3
- "info": {
4
- "title": "NocoBase API - System settings plugin"
5
- },
6
- "tags": [],
7
- "paths": {
8
- "/systemSettings:get": {
9
- "get": {
10
- "description": "",
11
- "parameters": [],
12
- "responses": {
13
- "200": {
14
- "description": "OK"
15
- }
16
- }
17
- }
18
- },
19
- "/systemSettings:update": {
20
- "post": {
21
- "description": "",
22
- "parameters": [],
23
- "responses": {
24
- "200": {
25
- "description": "OK"
26
- }
27
- }
28
- }
29
- }
30
- }
31
- }