vona-cli-set-api 1.1.130 → 1.1.131
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/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoBaseName%>.tsx_ +1 -1
- package/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoMutateName%>.tsx_ +2 -2
- package/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoResItemName%>.tsx_ +10 -10
- package/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoViewName%>.tsx_ +2 -2
- package/dist/index.js +7 -3
- package/dist/lib/bean/cli.tools.masterDetail.d.ts +3 -0
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ import { $makeMetadata } from 'vona-module-a-openapiutils';
|
|
|
4
4
|
import { $Dto } from 'vona-module-a-orm';
|
|
5
5
|
import { Dto } from 'vona-module-a-web';
|
|
6
6
|
import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
|
|
7
|
-
import { ZovaRender } from '
|
|
7
|
+
import { ZovaRender } from '<%=argv.restAdminNpm%>';
|
|
8
8
|
|
|
9
9
|
export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> extends IDecoratorDtoOptions {}
|
|
10
10
|
|
|
@@ -3,14 +3,14 @@ import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
|
3
3
|
import { $Dto } from 'vona-module-a-orm';
|
|
4
4
|
import { Dto } from 'vona-module-a-web';
|
|
5
5
|
import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
|
|
6
|
-
import { ZovaRender } from '
|
|
6
|
+
import { ZovaRender } from '<%=argv.restAdminNpm%>';
|
|
7
7
|
|
|
8
8
|
import { Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> } from './<%=argv.detailDtoBaseName%>.tsx';
|
|
9
9
|
|
|
10
10
|
export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoMutateName)%> extends IDecoratorDtoOptions {}
|
|
11
11
|
|
|
12
12
|
@Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoMutateName)%>>({
|
|
13
|
-
blocks: [ZovaRender.block('
|
|
13
|
+
blocks: [ZovaRender.block('<%=argv.detailsModuleName%>:blockForm')],
|
|
14
14
|
})
|
|
15
15
|
export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoMutateName)%> extends $Dto.mutate(() => Model<%=argv.detailResourceNameCapitalize%>, {
|
|
16
16
|
dtoClass: Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>,
|
package/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoResItemName%>.tsx_
CHANGED
|
@@ -4,7 +4,7 @@ import { $makeMetadata, Api, v } from 'vona-module-a-openapiutils';
|
|
|
4
4
|
import { $Dto } from 'vona-module-a-orm';
|
|
5
5
|
import { Dto } from 'vona-module-a-web';
|
|
6
6
|
import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
|
|
7
|
-
import { ZovaRender } from '
|
|
7
|
+
import { ZovaRender } from '<%=argv.restAdminNpm%>';
|
|
8
8
|
|
|
9
9
|
import { $locale } from '../.metadata/locales.ts';
|
|
10
10
|
import { Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> } from './<%=argv.detailDtoBaseName%>.tsx';
|
|
@@ -13,23 +13,23 @@ export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoRes
|
|
|
13
13
|
|
|
14
14
|
@Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoResItemName)%>>({
|
|
15
15
|
blocks: [
|
|
16
|
-
ZovaRender.block('
|
|
16
|
+
ZovaRender.block('<%=argv.detailsModuleName%>:blockDetails', {
|
|
17
17
|
blocks: [
|
|
18
|
-
ZovaRender.block('
|
|
18
|
+
ZovaRender.block('<%=argv.detailsModuleName%>:blockToolbarBulk', {
|
|
19
19
|
actions: [
|
|
20
|
-
ZovaRender.detailsActionBulk('
|
|
20
|
+
ZovaRender.detailsActionBulk('<%=argv.detailsModuleName%>:actionCreate', {
|
|
21
21
|
dialogOptions: { title: $locale('Add<%=argv.detailDialogTitleCapitalize%>') },
|
|
22
22
|
permission: { formScene: ['create', 'edit'] },
|
|
23
23
|
}),
|
|
24
24
|
],
|
|
25
25
|
}),
|
|
26
|
-
ZovaRender.block('
|
|
26
|
+
ZovaRender.block('<%=argv.detailsModuleName%>:blockTable'),
|
|
27
27
|
],
|
|
28
28
|
}),
|
|
29
29
|
],
|
|
30
30
|
fields: {
|
|
31
31
|
name: $makeMetadata(
|
|
32
|
-
ZovaRender.cell('
|
|
32
|
+
ZovaRender.cell('<%=argv.detailsModuleName%>:actionView', {
|
|
33
33
|
dialogOptions: { title: $locale('View<%=argv.detailDialogTitleCapitalize%>') },
|
|
34
34
|
}),
|
|
35
35
|
),
|
|
@@ -38,19 +38,19 @@ export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoRes
|
|
|
38
38
|
export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoResItemName)%> extends $Dto.get(() => Model<%=argv.detailResourceNameCapitalize%>, {
|
|
39
39
|
dtoClass: Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>,
|
|
40
40
|
}) {
|
|
41
|
-
@Api.field(v.title('#'), ZovaRender.order(1, 'core'), ZovaRender.cell('
|
|
41
|
+
@Api.field(v.title('#'), ZovaRender.order(1, 'core'), ZovaRender.cell('<%=argv.detailsModuleName%>:lineNumber'))
|
|
42
42
|
_lineNumber?: number;
|
|
43
43
|
|
|
44
44
|
@Api.field(
|
|
45
45
|
v.title($locale('Operations')),
|
|
46
46
|
ZovaRender.order(1, 'max'),
|
|
47
|
-
ZovaRender.cell('
|
|
47
|
+
ZovaRender.cell('<%=argv.detailsModuleName%>:actionOperationsRow', {
|
|
48
48
|
actions: [
|
|
49
|
-
ZovaRender.detailsActionRow('
|
|
49
|
+
ZovaRender.detailsActionRow('<%=argv.detailsModuleName%>:actionUpdate', {
|
|
50
50
|
dialogOptions: { title: $locale('Edit<%=argv.detailDialogTitleCapitalize%>') },
|
|
51
51
|
permission: { formScene: ['create', 'edit'] },
|
|
52
52
|
}),
|
|
53
|
-
ZovaRender.detailsActionRow('
|
|
53
|
+
ZovaRender.detailsActionRow('<%=argv.detailsModuleName%>:actionDelete', {
|
|
54
54
|
permission: { formScene: ['create', 'edit'] },
|
|
55
55
|
}),
|
|
56
56
|
],
|
|
@@ -3,14 +3,14 @@ import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
|
3
3
|
import { $Dto } from 'vona-module-a-orm';
|
|
4
4
|
import { Dto } from 'vona-module-a-web';
|
|
5
5
|
import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
|
|
6
|
-
import { ZovaRender } from '
|
|
6
|
+
import { ZovaRender } from '<%=argv.restAdminNpm%>';
|
|
7
7
|
|
|
8
8
|
import { Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> } from './<%=argv.detailDtoBaseName%>.tsx';
|
|
9
9
|
|
|
10
10
|
export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoViewName)%> extends IDecoratorDtoOptions {}
|
|
11
11
|
|
|
12
12
|
@Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoViewName)%>>({
|
|
13
|
-
blocks: [ZovaRender.block('
|
|
13
|
+
blocks: [ZovaRender.block('<%=argv.detailsModuleName%>:blockForm')],
|
|
14
14
|
})
|
|
15
15
|
export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoViewName)%> extends $Dto.get(() => Model<%=argv.detailResourceNameCapitalize%>, {
|
|
16
16
|
dtoClass: Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>,
|
package/dist/index.js
CHANGED
|
@@ -2055,6 +2055,10 @@ class CliToolsMasterDetail extends BeanCliBase {
|
|
|
2055
2055
|
argv.detailDtoResItemName = `detail${argv.detailResourceNameCapitalize}ResItem`;
|
|
2056
2056
|
argv.detailFieldPrivateName = `_${argv.relationName}`;
|
|
2057
2057
|
argv.detailDialogTitleCapitalize = argv.detailModuleCapitalize;
|
|
2058
|
+
const editionName = fs.existsSync(path.join(argv.projectPath, '__CABLOY_START__')) ? 'start' : 'basic';
|
|
2059
|
+
argv.restAdminNpm = `zova-rest-cabloy-${editionName}-admin`;
|
|
2060
|
+
argv.detailsModuleName = `${editionName}-details`;
|
|
2061
|
+
argv.detailCrudCommand = `:tools:crud${this._capitalize(editionName)}`;
|
|
2058
2062
|
}
|
|
2059
2063
|
async _ensureDetailModule() {
|
|
2060
2064
|
const {
|
|
@@ -2339,7 +2343,7 @@ class CliToolsMasterDetail extends BeanCliBase {
|
|
|
2339
2343
|
content = this._replaceStrict(content, "import { $Dto } from 'vona-module-a-orm';", "import { $makeMetadata, Api, v } from 'vona-module-a-openapiutils';\nimport { $Dto } from 'vona-module-a-orm';", fileName);
|
|
2340
2344
|
}
|
|
2341
2345
|
if (!content.includes("import { $locale } from '../.metadata/locales.ts';")) {
|
|
2342
|
-
content = this._replaceStrict(content,
|
|
2346
|
+
content = this._replaceStrict(content, `import { ZovaRender } from '${argv.restAdminNpm}';\n`, `import { ZovaRender } from '${argv.restAdminNpm}';\n\nimport { $locale } from '../.metadata/locales.ts';\n`, fileName);
|
|
2343
2347
|
}
|
|
2344
2348
|
const importMarker = `import { Model${argv.resourceNameCapitalize} } from '../model/${argv.resourceName}.ts';\n`;
|
|
2345
2349
|
if (!content.includes(`import { Dto${detailDtoClassCapitalize} } from './`)) {
|
|
@@ -2375,7 +2379,7 @@ class CliToolsMasterDetail extends BeanCliBase {
|
|
|
2375
2379
|
const {
|
|
2376
2380
|
argv
|
|
2377
2381
|
} = this.context;
|
|
2378
|
-
return ` ${argv.relationName}: $makeMetadata(\n v.title($locale('${argv.relationNameCapitalize}')),\n ZovaRender.order(5),\n ZovaRender.field('
|
|
2382
|
+
return ` ${argv.relationName}: $makeMetadata(\n v.title($locale('${argv.relationNameCapitalize}')),\n ZovaRender.order(5),\n ZovaRender.field('${argv.detailsModuleName}:formFieldDetails'),\n${scene === 'Create' ? ' v.optional(),\n' : ''} ),\n`;
|
|
2379
2383
|
}
|
|
2380
2384
|
_masterDtoClassReplaceSource(scene) {
|
|
2381
2385
|
const {
|
|
@@ -2410,7 +2414,7 @@ class CliToolsMasterDetail extends BeanCliBase {
|
|
|
2410
2414
|
const {
|
|
2411
2415
|
argv
|
|
2412
2416
|
} = this.context;
|
|
2413
|
-
await this.helper.invokeCli([
|
|
2417
|
+
await this.helper.invokeCli([argv.detailCrudCommand, argv.detailResourceName, `--module=${argv.detailModule}`, '--nometadata'], {
|
|
2414
2418
|
cwd: argv.projectPath
|
|
2415
2419
|
});
|
|
2416
2420
|
}
|
|
@@ -27,6 +27,9 @@ declare module '@cabloy/cli' {
|
|
|
27
27
|
detailDialogTitleCapitalize: string;
|
|
28
28
|
createdDetailModule?: boolean;
|
|
29
29
|
createdDetailResource?: boolean;
|
|
30
|
+
restAdminNpm: string;
|
|
31
|
+
detailsModuleName: string;
|
|
32
|
+
detailCrudCommand: string;
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
export declare class CliToolsMasterDetail extends BeanCliBase {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-cli-set-api",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "1.1.131",
|
|
4
|
+
"gitHead": "fac7768bb7db22ff0180dc59d711efba5b853ae7",
|
|
5
5
|
"description": "vona cli-set-api",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"framework",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"ts-node-maintained": "^10.9.6",
|
|
74
74
|
"urllib": "^4.9.0",
|
|
75
75
|
"uuid": "^11.1.0",
|
|
76
|
-
"vona-core": "^5.1.
|
|
76
|
+
"vona-core": "^5.1.34",
|
|
77
77
|
"why-is-node-running": "^3.2.2",
|
|
78
78
|
"yargs-parser": "^22.0.0"
|
|
79
79
|
}
|