vona-cli-set-api 1.0.240 → 1.0.244

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.
@@ -19,7 +19,7 @@
19
19
  "scope": "typescript,typescriptreact",
20
20
  "prefix": "aopinit",
21
21
  "body": [
22
- "protected __init__: AopActionInit<BeanClassSome> = (_args, next, _receiver) => {",
22
+ "protected __init__: AopActionInit<ClassSome> = (_args, next, _receiver) => {",
23
23
  " next();",
24
24
  " $0",
25
25
  "}"
@@ -30,7 +30,7 @@
30
30
  "scope": "typescript,typescriptreact",
31
31
  "prefix": "aopdispose",
32
32
  "body": [
33
- "protected __dispose__: AopActionDispose<BeanClassSome> = async (_args, next, _receiver) => {",
33
+ "protected __dispose__: AopActionDispose<ClassSome> = async (_args, next, _receiver) => {",
34
34
  " $0",
35
35
  " await next();",
36
36
  "}"
@@ -62,7 +62,7 @@
62
62
  "scope": "typescript,typescriptreact",
63
63
  "prefix": "aopgetter",
64
64
  "body": [
65
- "protected __get_xxx__: AopActionGetter<BeanClassSome, 'xxx'> = function (next, _receiver) {",
65
+ "protected __get_xxx__: AopActionGetter<ClassSome, 'xxx'> = function (next, _receiver) {",
66
66
  " const value = next();",
67
67
  " return value;",
68
68
  "}"
@@ -73,7 +73,7 @@
73
73
  "scope": "typescript,typescriptreact",
74
74
  "prefix": "aopsetter",
75
75
  "body": [
76
- "protected __set_xxx__: AopActionSetter<BeanClassSome, 'xxx'> = function (value, next, _receiver) {",
76
+ "protected __set_xxx__: AopActionSetter<ClassSome, 'xxx'> = function (value, next, _receiver) {",
77
77
  " return next(value);",
78
78
  "}"
79
79
  ],
@@ -83,7 +83,7 @@
83
83
  "scope": "typescript,typescriptreact",
84
84
  "prefix": "aopaction",
85
85
  "body": [
86
- "action: AopAction<BeanClassSome, 'action'> = async (_args, next, _receiver) => {",
86
+ "action: AopAction<ClassSome, 'action'> = async (_args, next, _receiver) => {",
87
87
  " $0",
88
88
  " return await next();",
89
89
  "}"
@@ -94,7 +94,7 @@
94
94
  "scope": "typescript,typescriptreact",
95
95
  "prefix": "aopactionsync",
96
96
  "body": [
97
- "action: AopAction<BeanClassSome, 'action'> = (_args, next, _receiver) => {",
97
+ "action: AopAction<ClassSome, 'action'> = (_args, next, _receiver) => {",
98
98
  " $0",
99
99
  " return next();",
100
100
  "}"
@@ -45,7 +45,7 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "vona": "^5.0.142"
48
+ "vona": "^5.0.144"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@cabloy/lint": "^5.0.16",
@@ -22,6 +22,7 @@ declare module 'vona-module-home-base' {
22
22
  export interface ServiceMenu {
23
23
  get $beanFullName(): 'home-base.service.menu';
24
24
  get $onionName(): 'home-base:menu';
25
+
25
26
  }
26
27
  }
27
28
  /** service: end */
@@ -62,6 +63,7 @@ declare module 'vona-module-home-base' {
62
63
  export interface ControllerMenu {
63
64
  get $beanFullName(): 'home-base.controller.menu';
64
65
  get $onionName(): 'home-base:menu';
66
+ get $onionOptions(): IControllerOptionsMenu;
65
67
  }
66
68
  }
67
69
  /** controller: end */
@@ -22,6 +22,7 @@ declare module 'vona-module-home-index' {
22
22
  export interface MetaPrintTip {
23
23
  get $beanFullName(): 'home-index.meta.printTip';
24
24
  get $onionName(): 'home-index:printTip';
25
+
25
26
  }
26
27
  }
27
28
  /** meta: end */
@@ -47,6 +48,7 @@ declare module 'vona-module-home-index' {
47
48
  export interface ControllerHome {
48
49
  get $beanFullName(): 'home-index.controller.home';
49
50
  get $onionName(): 'home-index:home';
51
+ get $onionOptions(): IControllerOptionsHome;
50
52
  }
51
53
  }
52
54
  /** controller: end */
@@ -91,6 +91,7 @@ declare module 'vona-module-home-user' {
91
91
  export interface ModelRole {
92
92
  get $beanFullName(): 'home-user.model.role';
93
93
  get $onionName(): 'home-user:role';
94
+ get $onionOptions(): IModelOptionsRole;
94
95
  }
95
96
 
96
97
  export interface ModelRoleUser {
@@ -101,6 +102,7 @@ declare module 'vona-module-home-user' {
101
102
  export interface ModelRoleUser {
102
103
  get $beanFullName(): 'home-user.model.roleUser';
103
104
  get $onionName(): 'home-user:roleUser';
105
+ get $onionOptions(): IModelOptionsRoleUser;
104
106
  }
105
107
 
106
108
  export interface ModelUser {
@@ -111,6 +113,7 @@ declare module 'vona-module-home-user' {
111
113
  export interface ModelUser {
112
114
  get $beanFullName(): 'home-user.model.user';
113
115
  get $onionName(): 'home-user:user';
116
+ get $onionOptions(): IModelOptionsUser;
114
117
  }
115
118
  }
116
119
  /** model: end */
@@ -256,6 +259,7 @@ declare module 'vona-module-home-user' {
256
259
  export interface ServicePassportAdapter {
257
260
  get $beanFullName(): 'home-user.service.passportAdapter';
258
261
  get $onionName(): 'home-user:passportAdapter';
262
+
259
263
  }
260
264
 
261
265
  export interface ServiceRoleAdapter {
@@ -266,6 +270,7 @@ declare module 'vona-module-home-user' {
266
270
  export interface ServiceRoleAdapter {
267
271
  get $beanFullName(): 'home-user.service.roleAdapter';
268
272
  get $onionName(): 'home-user:roleAdapter';
273
+
269
274
  }
270
275
 
271
276
  export interface ServiceUserAdapter {
@@ -276,6 +281,7 @@ declare module 'vona-module-home-user' {
276
281
  export interface ServiceUserAdapter {
277
282
  get $beanFullName(): 'home-user.service.userAdapter';
278
283
  get $onionName(): 'home-user:userAdapter';
284
+
279
285
  }
280
286
  }
281
287
  /** service: end */
@@ -328,6 +334,7 @@ declare module 'vona-module-home-user' {
328
334
  export interface EventListenerActivate {
329
335
  get $beanFullName(): 'home-user.eventListener.activate';
330
336
  get $onionName(): 'home-user:activate';
337
+ get $onionOptions(): IDecoratorEventListenerOptions;
331
338
  }
332
339
 
333
340
  export interface EventListenerEmailConfirmCallback {
@@ -338,6 +345,7 @@ declare module 'vona-module-home-user' {
338
345
  export interface EventListenerEmailConfirmCallback {
339
346
  get $beanFullName(): 'home-user.eventListener.emailConfirmCallback';
340
347
  get $onionName(): 'home-user:emailConfirmCallback';
348
+ get $onionOptions(): IDecoratorEventListenerOptions;
341
349
  }
342
350
 
343
351
  export interface EventListenerPasswordResetCallback {
@@ -348,6 +356,7 @@ declare module 'vona-module-home-user' {
348
356
  export interface EventListenerPasswordResetCallback {
349
357
  get $beanFullName(): 'home-user.eventListener.passwordResetCallback';
350
358
  get $onionName(): 'home-user:passwordResetCallback';
359
+ get $onionOptions(): IDecoratorEventListenerOptions;
351
360
  }
352
361
 
353
362
  export interface EventListenerRegister {
@@ -358,6 +367,7 @@ declare module 'vona-module-home-user' {
358
367
  export interface EventListenerRegister {
359
368
  get $beanFullName(): 'home-user.eventListener.register';
360
369
  get $onionName(): 'home-user:register';
370
+ get $onionOptions(): IDecoratorEventListenerOptions;
361
371
  }
362
372
  }
363
373
  /** eventListener: end */
@@ -385,6 +395,7 @@ declare module 'vona-module-home-user' {
385
395
  export interface MetaIndex {
386
396
  get $beanFullName(): 'home-user.meta.index';
387
397
  get $onionName(): 'home-user:index';
398
+ get $onionOptions(): IMetaOptionsIndex;
388
399
  }
389
400
 
390
401
  export interface MetaVersion {
@@ -395,6 +406,7 @@ declare module 'vona-module-home-user' {
395
406
  export interface MetaVersion {
396
407
  get $beanFullName(): 'home-user.meta.version';
397
408
  get $onionName(): 'home-user:version';
409
+
398
410
  }
399
411
  }
400
412
  /** meta: end */
@@ -469,6 +481,7 @@ declare module 'vona-module-home-user' {
469
481
  export interface ControllerPassport {
470
482
  get $beanFullName(): 'home-user.controller.passport';
471
483
  get $onionName(): 'home-user:passport';
484
+ get $onionOptions(): IControllerOptionsPassport;
472
485
  }
473
486
  }
474
487
  /** controller: end */
@@ -527,6 +540,7 @@ declare module 'vona-module-home-user' {
527
540
  export interface ZodRefineEmailUnique {
528
541
  get $beanFullName(): 'home-user.zodRefine.emailUnique';
529
542
  get $onionName(): 'home-user:emailUnique';
543
+ get $onionOptions(): IZodRefineOptionsEmailUnique;
530
544
  }
531
545
 
532
546
  export interface ZodRefinePasswordConfirm {
@@ -537,6 +551,7 @@ declare module 'vona-module-home-user' {
537
551
  export interface ZodRefinePasswordConfirm {
538
552
  get $beanFullName(): 'home-user.zodRefine.passwordConfirm';
539
553
  get $onionName(): 'home-user:passwordConfirm';
554
+ get $onionOptions(): IZodRefineOptionsPasswordConfirm;
540
555
  }
541
556
 
542
557
  export interface ZodRefineUsernameUnique {
@@ -547,6 +562,7 @@ declare module 'vona-module-home-user' {
547
562
  export interface ZodRefineUsernameUnique {
548
563
  get $beanFullName(): 'home-user.zodRefine.usernameUnique';
549
564
  get $onionName(): 'home-user:usernameUnique';
565
+ get $onionOptions(): IZodRefineOptionsUsernameUnique;
550
566
  }
551
567
  }
552
568
  /** zodRefine: end */
@@ -21,6 +21,47 @@ export async function generateOnions(sceneName, sceneMeta, moduleName, modulePat
21
21
  contentExports.push(`export * from '${fileNameJSRelative}';`);
22
22
  if (isIgnore)
23
23
  continue; // get scope() also can be ignored
24
+ // options
25
+ let onionOptions;
26
+ if (!sceneMeta.optionsNone) {
27
+ // fileInfo
28
+ const fileInfo = extractBeanInfo(sceneName, fileContent, sceneMeta);
29
+ // import options
30
+ if (fileInfo.optionsCustomInterface) {
31
+ contentImports.push(`import type { ${fileInfo.optionsCustomInterface} } from '${fileInfo.optionsCustomInterfaceFrom || fileNameJSRelative}';`);
32
+ }
33
+ // valueOptionsCustomInterface
34
+ let valueOptionsCustomInterface = fileInfo.optionsCustomInterface;
35
+ if (valueOptionsCustomInterface && sceneMeta.optionsCustomInterfaceTemplate) {
36
+ valueOptionsCustomInterface = replaceTemplate(sceneMeta.optionsCustomInterfaceTemplate, { optionsCustomInterface: valueOptionsCustomInterface });
37
+ }
38
+ // record
39
+ if (fileInfo.isGlobal) {
40
+ if (valueOptionsCustomInterface) {
41
+ onionOptions = valueOptionsCustomInterface;
42
+ contentRecordsGlobal.push(`'${beanNameFull}': ${valueOptionsCustomInterface};`);
43
+ }
44
+ else {
45
+ if (sceneMeta.optionsGlobalInterfaceName) {
46
+ onionOptions = sceneMeta.optionsGlobalInterfaceName;
47
+ contentRecordsGlobal.push(`'${beanNameFull}': ${sceneMeta.optionsGlobalInterfaceName};`);
48
+ needImportOptionsGlobalInterface = true;
49
+ }
50
+ else {
51
+ contentRecordsGlobal.push(`'${beanNameFull}': never;`);
52
+ }
53
+ }
54
+ }
55
+ else {
56
+ if (valueOptionsCustomInterface) {
57
+ onionOptions = valueOptionsCustomInterface;
58
+ contentRecordsLocal.push(`'${beanNameFull}': ${valueOptionsCustomInterface};`);
59
+ }
60
+ else {
61
+ contentRecordsLocal.push(`'${beanNameFull}': never;`);
62
+ }
63
+ }
64
+ }
24
65
  // get scope() also can be ignored
25
66
  if (!['entity', 'dto'].includes(sceneName) && !isVirtual) {
26
67
  contentScopes.push(`
@@ -29,49 +70,15 @@ export async function generateOnions(sceneName, sceneMeta, moduleName, modulePat
29
70
  get scope(): ${scopeModuleName};
30
71
  }`);
31
72
  if (!isBeanGlobal) {
73
+ const contentOnionOptions = onionOptions ? `get $onionOptions(): ${onionOptions};` : '';
32
74
  contentScopes.push(`
33
75
  export interface ${className} {
34
76
  get $beanFullName(): '${beanFullNameFromOnionName(beanNameFull, sceneName)}';
35
77
  get $onionName(): '${beanNameFull}';
78
+ ${contentOnionOptions}
36
79
  }`);
37
80
  }
38
81
  }
39
- if (sceneMeta.optionsNone)
40
- continue;
41
- // fileInfo
42
- const fileInfo = extractBeanInfo(sceneName, fileContent, sceneMeta);
43
- // import options
44
- if (fileInfo.optionsCustomInterface) {
45
- contentImports.push(`import type { ${fileInfo.optionsCustomInterface} } from '${fileInfo.optionsCustomInterfaceFrom || fileNameJSRelative}';`);
46
- }
47
- // valueOptionsCustomInterface
48
- let valueOptionsCustomInterface = fileInfo.optionsCustomInterface;
49
- if (valueOptionsCustomInterface && sceneMeta.optionsCustomInterfaceTemplate) {
50
- valueOptionsCustomInterface = replaceTemplate(sceneMeta.optionsCustomInterfaceTemplate, { optionsCustomInterface: valueOptionsCustomInterface });
51
- }
52
- // record
53
- if (fileInfo.isGlobal) {
54
- if (valueOptionsCustomInterface) {
55
- contentRecordsGlobal.push(`'${beanNameFull}': ${valueOptionsCustomInterface};`);
56
- }
57
- else {
58
- if (sceneMeta.optionsGlobalInterfaceName) {
59
- contentRecordsGlobal.push(`'${beanNameFull}': ${sceneMeta.optionsGlobalInterfaceName};`);
60
- needImportOptionsGlobalInterface = true;
61
- }
62
- else {
63
- contentRecordsGlobal.push(`'${beanNameFull}': never;`);
64
- }
65
- }
66
- }
67
- else {
68
- if (valueOptionsCustomInterface) {
69
- contentRecordsLocal.push(`'${beanNameFull}': ${valueOptionsCustomInterface};`);
70
- }
71
- else {
72
- contentRecordsLocal.push(`'${beanNameFull}': never;`);
73
- }
74
- }
75
82
  }
76
83
  // middlewareGlobal
77
84
  const exportRecordsMiddlewareGlobal = `
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-cli-set-api",
3
3
  "type": "module",
4
- "version": "1.0.240",
4
+ "version": "1.0.244",
5
5
  "description": "vona cli-set-api",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -31,7 +31,7 @@
31
31
  "@babel/plugin-proposal-decorators": "^7.25.9",
32
32
  "@babel/plugin-transform-class-properties": "^7.25.9",
33
33
  "@babel/plugin-transform-typescript": "^7.26.8",
34
- "@cabloy/cli": "^3.0.46",
34
+ "@cabloy/cli": "^3.0.47",
35
35
  "@cabloy/dotenv": "^1.1.10",
36
36
  "@cabloy/extend": "^3.1.10",
37
37
  "@cabloy/module-glob": "^5.2.26",
@@ -61,7 +61,7 @@
61
61
  "ts-node": "^10.9.2",
62
62
  "urllib": "^4.6.11",
63
63
  "uuid": "^11.1.0",
64
- "vona-core": "^5.0.64",
64
+ "vona-core": "^5.0.65",
65
65
  "why-is-node-running": "^3.2.2",
66
66
  "yargs-parser": "^21.1.1"
67
67
  },