@tachybase/utils 0.23.58 → 1.0.18
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/lib/decorators.d.ts +2 -2
- package/lib/decorators.js +1 -1
- package/lib/i18n.d.ts +2 -0
- package/lib/i18n.js +34 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/package.json +3 -2
package/lib/decorators.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface ActionDef {
|
|
|
4
4
|
actionName?: string;
|
|
5
5
|
method?: string;
|
|
6
6
|
options?: {
|
|
7
|
-
acl?:
|
|
7
|
+
acl?: 'loggedIn' | 'public' | 'private';
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
export declare function App(): Function;
|
|
@@ -12,5 +12,5 @@ export declare function Db(): Function;
|
|
|
12
12
|
export declare function InjectLog(): Function;
|
|
13
13
|
export declare function Controller(name: string): (target: any, context: ClassDecoratorContext) => void;
|
|
14
14
|
export declare function Action(name: string, options?: {
|
|
15
|
-
acl?:
|
|
15
|
+
acl?: 'loggedIn' | 'public' | 'private';
|
|
16
16
|
}): (_: any, context: ClassMethodDecoratorContext) => void;
|
package/lib/decorators.js
CHANGED
package/lib/i18n.d.ts
ADDED
package/lib/i18n.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var i18n_exports = {};
|
|
20
|
+
__export(i18n_exports, {
|
|
21
|
+
tval: () => tval
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(i18n_exports);
|
|
24
|
+
function tval(text, options) {
|
|
25
|
+
if (options) {
|
|
26
|
+
return `{{t(${JSON.stringify(text)}, ${JSON.stringify(options)})}}`;
|
|
27
|
+
}
|
|
28
|
+
return `{{t(${JSON.stringify(text)})}}`;
|
|
29
|
+
}
|
|
30
|
+
__name(tval, "tval");
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
tval
|
|
34
|
+
});
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -62,6 +62,7 @@ __reExport(src_exports, require("./cluster"), module.exports);
|
|
|
62
62
|
__reExport(src_exports, require("./plugin-symlink"), module.exports);
|
|
63
63
|
__reExport(src_exports, require("./currencyUtils"), module.exports);
|
|
64
64
|
__reExport(src_exports, require("./getCurrentStacks"), module.exports);
|
|
65
|
+
__reExport(src_exports, require("./i18n"), module.exports);
|
|
65
66
|
// Annotate the CommonJS export names for ESM import in node:
|
|
66
67
|
0 && (module.exports = {
|
|
67
68
|
dayjs,
|
|
@@ -93,5 +94,6 @@ __reExport(src_exports, require("./getCurrentStacks"), module.exports);
|
|
|
93
94
|
...require("./cluster"),
|
|
94
95
|
...require("./plugin-symlink"),
|
|
95
96
|
...require("./currencyUtils"),
|
|
96
|
-
...require("./getCurrentStacks")
|
|
97
|
+
...require("./getCurrentStacks"),
|
|
98
|
+
...require("./i18n")
|
|
97
99
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/lodash": "4.17.13",
|
|
44
|
-
"@types/node": "20.17.10"
|
|
44
|
+
"@types/node": "20.17.10",
|
|
45
|
+
"i18next": "23.16.8"
|
|
45
46
|
},
|
|
46
47
|
"scripts": {
|
|
47
48
|
"build": "tachybase-build --no-dts @tachybase/utils"
|