@nocobase/plugin-client 2.2.0-beta.15 → 2.2.0-beta.16
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/dist/externalVersion.js +5 -5
- package/dist/locale/en-US.json +3 -0
- package/dist/locale/index.js +2 -0
- package/dist/locale/zh-CN.json +3 -0
- package/dist/node_modules/cronstrue/package.json +1 -1
- package/dist/server/localeResources.d.ts +12 -0
- package/dist/server/localeResources.js +56 -0
- package/dist/server/server.js +2 -1
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"react-i18next": "11.18.6",
|
|
13
|
-
"@nocobase/client": "2.2.0-beta.
|
|
13
|
+
"@nocobase/client": "2.2.0-beta.16",
|
|
14
14
|
"antd": "5.24.2",
|
|
15
15
|
"@ant-design/icons": "5.6.1",
|
|
16
16
|
"@formily/react": "2.3.7",
|
|
17
|
-
"@nocobase/utils": "2.2.0-beta.
|
|
17
|
+
"@nocobase/utils": "2.2.0-beta.16",
|
|
18
18
|
"lodash": "4.18.1",
|
|
19
|
-
"@nocobase/database": "2.2.0-beta.
|
|
20
|
-
"@nocobase/client-v2": "2.2.0-beta.
|
|
21
|
-
"@nocobase/server": "2.2.0-beta.
|
|
19
|
+
"@nocobase/database": "2.2.0-beta.16",
|
|
20
|
+
"@nocobase/client-v2": "2.2.0-beta.16",
|
|
21
|
+
"@nocobase/server": "2.2.0-beta.16"
|
|
22
22
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -962,6 +962,7 @@
|
|
|
962
962
|
"Open in new window": "Open in new window",
|
|
963
963
|
"Open in<1><0>Modal</0><1>Drawer</1><2>Window</2></1>": "Open in<1><0>Modal</0><1>Drawer</1><2>Window</2></1>",
|
|
964
964
|
"Open classic page access": "Open classic page access",
|
|
965
|
+
"Open from the original entry": "Open from the original entry",
|
|
965
966
|
"Open mode": "Open mode",
|
|
966
967
|
"Open mode configuration": "Open mode configuration",
|
|
967
968
|
"Operate on existing data": "Operate on existing data",
|
|
@@ -1415,6 +1416,7 @@
|
|
|
1415
1416
|
"The following field types are not compatible and do not support output and display": "The following field types are not compatible and do not support output and display",
|
|
1416
1417
|
"The selected fields will automatically populate the form": "The selected fields will automatically populate the form",
|
|
1417
1418
|
"The title field is used to identify the template record": "The title field is used to identify the template record",
|
|
1419
|
+
"The {{modernClientPath}} branch only supports new pages. This page is a legacy page. Please open it from the original entry.": "The {{modernClientPath}} branch only supports new pages. This page is a legacy page. Please open it from the original entry.",
|
|
1418
1420
|
"The value of this variable is derived from the query string of the page URL. This variable can only be used normally when the page has a query string.": "The value of this variable is derived from the query string of the page URL. This variable can only be used normally when the page has a query string.",
|
|
1419
1421
|
"The will interrupt service, it may take a few seconds to restart. Are you sure to continue?": "The will interrupt service, it may take a few seconds to restart. Are you sure to continue?",
|
|
1420
1422
|
"The {{type}} \"{{name}}\" may have been deleted. Please remove this {{blockType}}.": "The {{type}} \"{{name}}\" may have been deleted. Please remove this {{blockType}}.",
|
|
@@ -1431,6 +1433,7 @@
|
|
|
1431
1433
|
"This field is required": "This field is required",
|
|
1432
1434
|
"This is a demo text, **supports Markdown syntax**.": "This is a demo text, **supports Markdown syntax**.",
|
|
1433
1435
|
"This is likely a NocoBase internals bug. Please open an issue at <1>here</1>": "This is likely a NocoBase internals bug. Please open an issue at <1>here</1>",
|
|
1436
|
+
"This page is not supported in the {{modernClientPath}} branch": "This page is not supported in the {{modernClientPath}} branch",
|
|
1434
1437
|
"This month": "This month",
|
|
1435
1438
|
"This quarter": "This quarter",
|
|
1436
1439
|
"This variable has been deprecated and can be replaced with \"Current form\"": "This variable has been deprecated and can be replaced with \"Current form\"",
|
package/dist/locale/index.js
CHANGED
|
@@ -75,6 +75,7 @@ const dayjsLocale = {
|
|
|
75
75
|
"ml-IN": "ml",
|
|
76
76
|
"mn-MN": "mn",
|
|
77
77
|
"ms-MY": "ms",
|
|
78
|
+
"my-MM": "my",
|
|
78
79
|
"nb-NO": "nb",
|
|
79
80
|
"ne-NP": "ne",
|
|
80
81
|
"nl-BE": "nl-be",
|
|
@@ -144,6 +145,7 @@ const languageCodes = {
|
|
|
144
145
|
"ml-IN": { label: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02" },
|
|
145
146
|
"mn-MN": { label: "\u041C\u043E\u043D\u0433\u043E\u043B \u0445\u044D\u043B" },
|
|
146
147
|
"ms-MY": { label: "\u0628\u0647\u0627\u0633 \u0645\u0644\u0627\u064A\u0648" },
|
|
148
|
+
"my-MM": { label: "\u1019\u103C\u1014\u103A\u1019\u102C\u1018\u102C\u101E\u102C" },
|
|
147
149
|
"nb-NO": { label: "Norsk bokm\xE5l" },
|
|
148
150
|
"ne-NP": { label: "\u0928\u0947\u092A\u093E\u0932\u0940" },
|
|
149
151
|
"nl-BE": { label: "Vlaams" },
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -959,6 +959,7 @@
|
|
|
959
959
|
"Open in new window": "新窗口打开",
|
|
960
960
|
"Open in<1><0>Modal</0><1>Drawer</1><2>Window</2></1>": "在 <1><0>对话框</0><1>抽屉</1><2>窗口</2></1> 内打开",
|
|
961
961
|
"Open classic page access": "跳转到旧版页面",
|
|
962
|
+
"Open from the original entry": "返回原入口访问",
|
|
962
963
|
"Open mode": "打开方式",
|
|
963
964
|
"Open mode configuration": "打开方式配置",
|
|
964
965
|
"Operate on existing data": "对已有数据操作",
|
|
@@ -1416,6 +1417,7 @@
|
|
|
1416
1417
|
"The following field types are not compatible and do not support output and display": "以下字段类型未适配,不支持输出和显示",
|
|
1417
1418
|
"The selected fields will automatically populate the form": "用于自动填充到表单",
|
|
1418
1419
|
"The title field is used to identify the template record": "用于识别模板数据",
|
|
1420
|
+
"The {{modernClientPath}} branch only supports new pages. This page is a legacy page. Please open it from the original entry.": "{{modernClientPath}} 分支仅支持新版页面,当前页面属于旧版页面。请返回原入口访问。",
|
|
1419
1421
|
"The value of this variable is derived from the query string of the page URL. This variable can only be used normally when the page has a query string.": "该变量的值是根据页面 URL 的 query string 得来的,只有当页面存在 query string 的时候,该变量才能正常使用。",
|
|
1420
1422
|
"The will interrupt service, it may take a few seconds to restart. Are you sure to continue?": "重启将会中断当前服务,这个过程可能需要一点时间,确定要继续吗?",
|
|
1421
1423
|
"The {{type}} \"{{name}}\" may have been deleted. Please remove this {{blockType}}.": "{{type}} \"{{name}}\" 可能已被删除。请删除当前{{blockType}}.",
|
|
@@ -1432,6 +1434,7 @@
|
|
|
1432
1434
|
"This field is required": "此字段为必填项",
|
|
1433
1435
|
"This is a demo text, **supports Markdown syntax**.": "这是一段演示文本,**支持 Markdown 语法**。",
|
|
1434
1436
|
"This is likely a NocoBase internals bug. Please open an issue at <1>here</1>": "这可能是 NocoBase 内部的问题,你可以在<1>这里</1>将该错误反馈给我们,我们会尽快修复",
|
|
1437
|
+
"This page is not supported in the {{modernClientPath}} branch": "此页面不支持在 {{modernClientPath}} 分支中使用",
|
|
1435
1438
|
"This month": "本月",
|
|
1436
1439
|
"This quarter": "本季度",
|
|
1437
1440
|
"This variable has been deprecated and can be replaced with \"Current form\"": "该变量已被弃用,可以使用“当前表单”替代",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cronstrue","title":"cRonstrue","version":"2.47.0","description":"Convert cron expressions into human readable descriptions","author":"Brady Holt","license":"MIT","bugs":{"url":"https://github.com/bradymholt/cronstrue/issues"},"homepage":"https://github.com/bradymholt/cronstrue","keywords":["cron","cronjob","crontab","schedule","parser","cron expression","cron description","pretty cron","cron for humans","cron translated","cron english","cron schedule","cron english","cron schedule"],"main":"dist/cronstrue.js","bin":{"cronstrue":"bin/cli.js"},"typings":"dist/cronstrue.d.ts","files":["dist/","locales/","i18n.js","i18n.d.ts"],"repository":{"type":"git","url":"git+https://github.com/bradymholt/cronstrue.git"},"publishConfig":{"access":"public"},"prettier":{"printWidth":120},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^8.0.0","chai":"^4.2.0","handlebars":"^4.7.6","marked":"^4.0.10","mocha":"^10.1.0","pixl-xml":"^1.0.13","prettier":"^2.1.1","terser-webpack-plugin":"^5.3.1","ts-loader":"^9.2.6","ts-node":"^10.5.0","typescript":"^4.6.2","webpack":"^5.69.1","webpack-cli":"^4.9.2","xml2js":"^0.5.0"},"scripts":{"start":"npm run build","build":"npx tsc -p ./src --emitDeclarationOnly","test":"npx mocha --reporter spec --require ts-node/register \"./test/**/*.ts\"","prepublishOnly":"rm -rf ./dist && ./node_modules/webpack-cli/bin/cli.js && git add -A"},"dependencies":{},"_lastModified":"2026-07-
|
|
1
|
+
{"name":"cronstrue","title":"cRonstrue","version":"2.47.0","description":"Convert cron expressions into human readable descriptions","author":"Brady Holt","license":"MIT","bugs":{"url":"https://github.com/bradymholt/cronstrue/issues"},"homepage":"https://github.com/bradymholt/cronstrue","keywords":["cron","cronjob","crontab","schedule","parser","cron expression","cron description","pretty cron","cron for humans","cron translated","cron english","cron schedule","cron english","cron schedule"],"main":"dist/cronstrue.js","bin":{"cronstrue":"bin/cli.js"},"typings":"dist/cronstrue.d.ts","files":["dist/","locales/","i18n.js","i18n.d.ts"],"repository":{"type":"git","url":"git+https://github.com/bradymholt/cronstrue.git"},"publishConfig":{"access":"public"},"prettier":{"printWidth":120},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^8.0.0","chai":"^4.2.0","handlebars":"^4.7.6","marked":"^4.0.10","mocha":"^10.1.0","pixl-xml":"^1.0.13","prettier":"^2.1.1","terser-webpack-plugin":"^5.3.1","ts-loader":"^9.2.6","ts-node":"^10.5.0","typescript":"^4.6.2","webpack":"^5.69.1","webpack-cli":"^4.9.2","xml2js":"^0.5.0"},"scripts":{"start":"npm run build","build":"npx tsc -p ./src --emitDeclarationOnly","test":"npx mocha --reporter spec --require ts-node/register \"./test/**/*.ts\"","prepublishOnly":"rm -rf ./dist && ./node_modules/webpack-cli/bin/cli.js && git add -A"},"dependencies":{},"_lastModified":"2026-07-31T07:44:55.639Z"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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 declare function parseLocaleResourceNamespaces(value: unknown): string[];
|
|
10
|
+
export declare function filterLocaleResources<T extends {
|
|
11
|
+
resources?: Record<string, unknown>;
|
|
12
|
+
}>(payload: T, namespaceQuery: unknown): T;
|
|
@@ -0,0 +1,56 @@
|
|
|
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 localeResources_exports = {};
|
|
28
|
+
__export(localeResources_exports, {
|
|
29
|
+
filterLocaleResources: () => filterLocaleResources,
|
|
30
|
+
parseLocaleResourceNamespaces: () => parseLocaleResourceNamespaces
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(localeResources_exports);
|
|
33
|
+
function parseLocaleResourceNamespaces(value) {
|
|
34
|
+
const values = Array.isArray(value) ? value : [value];
|
|
35
|
+
return [
|
|
36
|
+
...new Set(
|
|
37
|
+
values.flatMap((item) => typeof item === "string" ? item.split(",") : []).map((item) => item.trim()).filter(Boolean)
|
|
38
|
+
)
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
function filterLocaleResources(payload, namespaceQuery) {
|
|
42
|
+
const namespaces = parseLocaleResourceNamespaces(namespaceQuery);
|
|
43
|
+
if (!namespaces.length) return payload;
|
|
44
|
+
const resources = payload.resources || {};
|
|
45
|
+
return {
|
|
46
|
+
...payload,
|
|
47
|
+
resources: Object.fromEntries(
|
|
48
|
+
namespaces.filter((namespace) => Object.prototype.hasOwnProperty.call(resources, namespace)).map((namespace) => [namespace, resources[namespace]])
|
|
49
|
+
)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
filterLocaleResources,
|
|
55
|
+
parseLocaleResourceNamespaces
|
|
56
|
+
});
|
package/dist/server/server.js
CHANGED
|
@@ -49,6 +49,7 @@ var import_appPortals = require("./appPortals");
|
|
|
49
49
|
var import_antd = require("./antd");
|
|
50
50
|
var import_cron = require("./cron");
|
|
51
51
|
var import_cronstrue = require("./cronstrue");
|
|
52
|
+
var import_localeResources = require("./localeResources");
|
|
52
53
|
async function getLang(ctx) {
|
|
53
54
|
const SystemSetting = ctx.db.getRepository("systemSettings");
|
|
54
55
|
const systemSetting = await SystemSetting.findOne();
|
|
@@ -123,7 +124,7 @@ class PluginClientServer extends import_server.Plugin {
|
|
|
123
124
|
},
|
|
124
125
|
async getLang(ctx, next) {
|
|
125
126
|
const lang = await getLang(ctx);
|
|
126
|
-
const resources = await ctx.app.localeManager.get(lang);
|
|
127
|
+
const resources = (0, import_localeResources.filterLocaleResources)(await ctx.app.localeManager.get(lang), ctx.request.query.ns);
|
|
127
128
|
ctx.body = {
|
|
128
129
|
lang,
|
|
129
130
|
...resources
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Provides a client interface for the NocoBase server",
|
|
7
7
|
"description.ru-RU": "Предоставляет клиентский интерфейс для сервера NocoBase",
|
|
8
8
|
"description.zh-CN": "为 NocoBase 服务端提供客户端界面",
|
|
9
|
-
"version": "2.2.0-beta.
|
|
9
|
+
"version": "2.2.0-beta.16",
|
|
10
10
|
"main": "./dist/server/index.js",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"devDependencies": {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"@nocobase/test": "2.x",
|
|
24
24
|
"@nocobase/utils": "2.x"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "49d9bd2e21122eab9435f128375828b8c5bb4c07"
|
|
27
27
|
}
|