zova-module-a-zod 5.1.7 → 5.1.9
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/index.js +2 -9
- package/dist/index.js.map +1 -1
- package/package.json +10 -7
package/dist/index.js
CHANGED
|
@@ -22,18 +22,11 @@ var ScopeModuleAZod = (_dec = Scope(), _dec2 = BeanInfo({ module: "a-zod" }), _d
|
|
|
22
22
|
function locale(key) {
|
|
23
23
|
return `a-zod::${key}`;
|
|
24
24
|
}
|
|
25
|
-
/** scope: end */
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/config/locale/en-us.ts
|
|
28
|
-
var en_us_default = { ZodErrorRequired: "Required" };
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/config/locale/zh-cn.ts
|
|
31
|
-
var zh_cn_default = { ZodErrorRequired: "必填项" };
|
|
32
25
|
//#endregion
|
|
33
26
|
//#region src/.metadata/locales.ts
|
|
34
27
|
var locales = {
|
|
35
|
-
"en-us":
|
|
36
|
-
"zh-cn":
|
|
28
|
+
"en-us": { ZodErrorRequired: "Required" },
|
|
29
|
+
"zh-cn": { ZodErrorRequired: "必填项" }
|
|
37
30
|
};
|
|
38
31
|
function $useLocale(key, ...args) {
|
|
39
32
|
const app = useApp();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/bean/tool.v.ts","../src/.metadata/index.ts","../src/config/locale/en-us.ts","../src/config/locale/zh-cn.ts","../src/.metadata/locales.ts"],"sourcesContent":["import z from 'zod';\nimport { BeanBase } from 'zova';\nimport { Tool } from 'zova-module-a-bean';\n\n@Tool()\nexport class ToolV extends BeanBase {\n protected async __init__() {}\n\n required<T extends z.ZodType>(schema: T, params?: string | z.core.$ZodStringParams): T {\n params = params || this.scope.locale.ZodErrorRequired();\n schema._zod.def.error = z.util.normalizeParams(params).error;\n return schema;\n }\n}\n","// eslint-disable\n/** tool: begin */\nexport * from '../bean/tool.v.js';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-zod' {\n \n export interface ToolV {\n /** @internal */\n get scope(): ScopeModuleAZod;\n }\n\n export interface ToolV {\n get $beanFullName(): 'a-zod.tool.v';\n get $onionName(): 'a-zod:v';\n \n } \n}\n/** tool: end */\n/** tool: begin */\nimport { ToolV } from '../bean/tool.v.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-zod.tool.v': ToolV;\n }\n}\n/** tool: end */\n/** locale: begin */\nimport { locales } from './locales.js';\n/** locale: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil, TypeModuleLocales, TypeLocaleBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleAZod extends BeanScopeBase {}\n\nexport interface ScopeModuleAZod {\n util: BeanScopeUtil;\nlocale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-zod': ScopeModuleAZod;\n }\n \n \n\n export interface IBeanScopeLocale {\n 'a-zod': (typeof locales)[TypeLocaleBase];\n }\n\n \n}\n\nexport function locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K): `a-zod::${K}` {\n return `a-zod::${key}`;\n} \n/** scope: end */\n","export default {\n ZodErrorRequired: 'Required',\n};\n","export default {\n ZodErrorRequired: '必填项',\n};\n","import type { TypeLocaleBase } from 'zova';\nimport { useApp, useComputed } from 'zova';\nimport locale_en_us from '../config/locale/en-us.js';\nimport locale_zh_cn from '../config/locale/zh-cn.js';\n\nexport const locales = {\n 'en-us': locale_en_us,\n 'zh-cn': locale_zh_cn,\n};\n\nexport function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K, ...args: any[]) {\n const app = useApp();\n const str = `a-zod::${key}`;\n return useComputed(() => {\n return app.meta.text(str, ...args);\n });\n}\n"],"mappings":";;;;AAAA,IAAA,QAAS,SAAM;AAKf,IAAO,SAAY,SAAQ,MAAA,EAAQ,UAAC,SAAA,EAClC,QAAA,SAAA,CAAA,EAAA,OAAA,WAAA,QAAA,WAAA,MAAA,cAAA,SAAA;CAEA,MAAA,WAAW;CACX,SAAS,QAAQ,QAAQ;AACvB,WAAO,UAAS,KAAQ,MAAM,OAAC,kBAAwB;AACvD,SAAO,KAAA,IAAM,QAAA,EAAA,KAAA,gBAAA,OAAA,CAAA;AACf,SAAA;;;;;;;;;ACZF,IAAG,MAAO,OAAA;AAiBV,IAAU,mBAAoB,OAAO,OAAO,EAAC,QAAA,SAAA,EAC3C,QAAQ,SACT,CAAC,EAAE,KAAK,SAAA,MAAA,SAAA,MAAA,wBAAA,cAAA,GAAA,IAAA,OAAA,IAAA;AAET,SAAA,OAAA,KAAA;AACE,QAAO,UAAM
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/bean/tool.v.ts","../src/.metadata/index.ts","../src/config/locale/en-us.ts","../src/config/locale/zh-cn.ts","../src/.metadata/locales.ts"],"sourcesContent":["import z from 'zod';\nimport { BeanBase } from 'zova';\nimport { Tool } from 'zova-module-a-bean';\n\n@Tool()\nexport class ToolV extends BeanBase {\n protected async __init__() {}\n\n required<T extends z.ZodType>(schema: T, params?: string | z.core.$ZodStringParams): T {\n params = params || this.scope.locale.ZodErrorRequired();\n schema._zod.def.error = z.util.normalizeParams(params).error;\n return schema;\n }\n}\n","// eslint-disable\n/** tool: begin */\nexport * from '../bean/tool.v.js';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-zod' {\n \n export interface ToolV {\n /** @internal */\n get scope(): ScopeModuleAZod;\n }\n\n export interface ToolV {\n get $beanFullName(): 'a-zod.tool.v';\n get $onionName(): 'a-zod:v';\n \n } \n}\n/** tool: end */\n/** tool: begin */\nimport { ToolV } from '../bean/tool.v.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-zod.tool.v': ToolV;\n }\n}\n/** tool: end */\n/** locale: begin */\nimport { locales } from './locales.js';\n/** locale: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil, TypeModuleLocales, TypeLocaleBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleAZod extends BeanScopeBase {}\n\nexport interface ScopeModuleAZod {\n util: BeanScopeUtil;\nlocale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-zod': ScopeModuleAZod;\n }\n \n \n\n export interface IBeanScopeLocale {\n 'a-zod': (typeof locales)[TypeLocaleBase];\n }\n\n \n}\n\nexport function locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K): `a-zod::${K}` {\n return `a-zod::${key}`;\n} \n/** scope: end */\n","export default {\n ZodErrorRequired: 'Required',\n};\n","export default {\n ZodErrorRequired: '必填项',\n};\n","import type { TypeLocaleBase } from 'zova';\nimport { useApp, useComputed } from 'zova';\nimport locale_en_us from '../config/locale/en-us.js';\nimport locale_zh_cn from '../config/locale/zh-cn.js';\n\nexport const locales = {\n 'en-us': locale_en_us,\n 'zh-cn': locale_zh_cn,\n};\n\nexport function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K, ...args: any[]) {\n const app = useApp();\n const str = `a-zod::${key}`;\n return useComputed(() => {\n return app.meta.text(str, ...args);\n });\n}\n"],"mappings":";;;;AAAA,IAAA,QAAS,SAAM;AAKf,IAAO,SAAY,SAAQ,MAAA,EAAQ,UAAC,SAAA,EAClC,QAAA,SAAA,CAAA,EAAA,OAAA,WAAA,QAAA,WAAA,MAAA,cAAA,SAAA;CAEA,MAAA,WAAW;CACX,SAAS,QAAQ,QAAQ;AACvB,WAAO,UAAS,KAAQ,MAAM,OAAC,kBAAwB;AACvD,SAAO,KAAA,IAAM,QAAA,EAAA,KAAA,gBAAA,OAAA,CAAA;AACf,SAAA;;;;;;;;;ACZF,IAAG,MAAO,OAAA;AAiBV,IAAU,mBAAoB,OAAO,OAAO,EAAC,QAAA,SAAA,EAC3C,QAAQ,SACT,CAAC,EAAE,KAAK,SAAA,MAAA,SAAA,MAAA,wBAAA,cAAA,GAAA,IAAA,OAAA,IAAA;AAET,SAAA,OAAA,KAAA;AACE,QAAO,UAAM;;;;AGnBf,IAAO,UAAa;UFHL,EACb,kBAAkB,YACnB;CEGD,SDLe,EACb,kBAAkB,OACnB;CCIA;AACD,SAAW,WAAY,KAAA,GAAA,MAAA;CACtB,MAAA,MAAA,QAAA;;AAED,QAAO,kBAAoB;AACzB,SAAS,IAAG,KAAM,KAAE,KAAA,GAAA,KAAA;GACpB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-zod",
|
|
3
|
-
"version": "5.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "5.1.9",
|
|
4
|
+
"gitHead": "b213f9383f7fc7f4f3ad951f8856f91dbcf56a86",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Zova Module"
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"postpack": "clean-package restore && npm run clean"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@cabloy/zod-errors-custom": "^2.
|
|
35
|
-
"@cabloy/zod-openapi": "^1.
|
|
36
|
-
"@cabloy/zod-query": "^2.
|
|
37
|
-
"zod": "^4.
|
|
34
|
+
"@cabloy/zod-errors-custom": "^2.1.3",
|
|
35
|
+
"@cabloy/zod-openapi": "^1.1.3",
|
|
36
|
+
"@cabloy/zod-query": "^2.1.3",
|
|
37
|
+
"zod": "^4.3.6"
|
|
38
38
|
},
|
|
39
39
|
"title": "a-zod",
|
|
40
40
|
"zovaModule": {
|
|
@@ -51,7 +51,10 @@
|
|
|
51
51
|
"@cabloy/zod-query",
|
|
52
52
|
"zod/locales",
|
|
53
53
|
"zod/v4",
|
|
54
|
-
"~node_modules/zod/index.js"
|
|
54
|
+
"~node_modules/zod/index.js",
|
|
55
|
+
"@cabloy/zod/locales",
|
|
56
|
+
"@cabloy/zod/v4",
|
|
57
|
+
"~node_modules/@cabloy/zod/index.js"
|
|
55
58
|
],
|
|
56
59
|
"output": "zod"
|
|
57
60
|
}
|