@wallentaine/cqrs-schematics 0.0.4 → 0.0.6
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/collection.json +11 -6
- package/{src/schematics/cqrs-command → lib/schematics/command}/files/__name__.http.controller.ts.template +13 -1
- package/lib/schematics/command/index.d.ts.map +1 -0
- package/{src/schematics/cqrs-command → lib/schematics/command}/index.js +0 -1
- package/{src/schematics/cqrs-command → lib/schematics/command}/schema.d.ts +2 -0
- package/lib/schematics/command/schema.d.ts.map +1 -0
- package/lib/schematics/command/schema.json +47 -0
- package/lib/schematics/query/files/__name__.http.controller.ts.template +24 -0
- package/lib/schematics/query/files/__name__.query.ts.template +7 -0
- package/lib/schematics/query/files/__name__.queryHandler.ts.template +12 -0
- package/lib/schematics/query/index.d.ts +4 -0
- package/lib/schematics/query/index.d.ts.map +1 -0
- package/lib/schematics/query/index.js +31 -0
- package/lib/schematics/query/schema.d.ts +18 -0
- package/lib/schematics/query/schema.d.ts.map +1 -0
- package/lib/schematics/query/schema.js +2 -0
- package/lib/schematics/query/schema.json +47 -0
- package/package.json +7 -5
- package/src/schematics/cqrs-command/index.d.ts.map +0 -1
- package/src/schematics/cqrs-command/index.ts +0 -38
- package/src/schematics/cqrs-command/schema.d.ts.map +0 -1
- package/src/schematics/cqrs-command/schema.json +0 -34
- package/src/schematics/cqrs-command/schema.ts +0 -20
- /package/{src/schematics/cqrs-command → lib/schematics/command}/files/__name__.command.ts.template +0 -0
- /package/{src/schematics/cqrs-command → lib/schematics/command}/files/__name__.commandHandler.ts.template +0 -0
- /package/{src/schematics/cqrs-command → lib/schematics/command}/index.d.ts +0 -0
- /package/{src/schematics/cqrs-command → lib/schematics/command}/schema.js +0 -0
package/collection.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
3
|
"schematics": {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
"command": {
|
|
5
|
+
"factory": "./lib/schematics/command",
|
|
6
|
+
"schema": "./lib/schematics/command/schema.json",
|
|
7
|
+
"description": "Generate CQRS Command files"
|
|
8
|
+
},
|
|
9
|
+
"query": {
|
|
10
|
+
"factory": "./lib/schematics/query",
|
|
11
|
+
"schema": "./lib/schematics/query/schema.json",
|
|
12
|
+
"description": "Generate CQRS Query files"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
10
15
|
}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { Controller, Post, Body } from '@nestjs/common';
|
|
1
|
+
import { Controller, Post, Body, HttpCode, UseGuards } from '@nestjs/common';
|
|
2
2
|
import { CommandBus } from '@nestjs/cqrs';
|
|
3
3
|
import { CommandResponse } from '@Libs/types/CQRSResponse.type';
|
|
4
4
|
import { <%= className %>Command } from './<%= name %>.command';
|
|
5
5
|
import { <%= className %>CommandHandler } from './<%= name %>.commandHandler';
|
|
6
|
+
<% if (swagger) { -%>
|
|
7
|
+
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
|
8
|
+
<% } -%>
|
|
6
9
|
|
|
10
|
+
<% if (swagger) { -%>
|
|
11
|
+
@ApiTags('<%= module %>')
|
|
12
|
+
@ApiBearerAuth()
|
|
13
|
+
<% } -%>
|
|
14
|
+
@UseGuards()
|
|
7
15
|
@Controller('')
|
|
8
16
|
export class <%= className %>Controller {
|
|
9
17
|
public constructor(private readonly commandBus: CommandBus) {}
|
|
10
18
|
|
|
19
|
+
@HttpCode(200)
|
|
11
20
|
@Post()
|
|
21
|
+
<% if (swagger) { -%>
|
|
22
|
+
@ApiOperation({ summary: '<%= humanize(name) %>' })
|
|
23
|
+
<% } -%>
|
|
12
24
|
async create(@Body() data: {}): Promise<void> {
|
|
13
25
|
return this.commandBus.execute<
|
|
14
26
|
<%= className %>Command,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schematics/command/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,IAAI,EAIJ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAqBtE"}
|
|
@@ -5,7 +5,6 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
5
5
|
const core_1 = require("@angular-devkit/core");
|
|
6
6
|
function commandSchematic(options) {
|
|
7
7
|
return (tree, context) => {
|
|
8
|
-
console.log(options);
|
|
9
8
|
const classifiedName = core_1.strings.classify(options.name);
|
|
10
9
|
const modulePath = options.module ? `/${options.module}` : "";
|
|
11
10
|
const targetPath = `${options.path}${modulePath}/Commands/${classifiedName}`;
|
|
@@ -3,6 +3,8 @@ export interface Schema {
|
|
|
3
3
|
name: string;
|
|
4
4
|
/** Модуль, в который добавить команду */
|
|
5
5
|
module?: string;
|
|
6
|
+
/** Необходимо ли нам генерировать декораторы для Swagger */
|
|
7
|
+
useSwagger: boolean;
|
|
6
8
|
/** Путь для генерации */
|
|
7
9
|
path?: string;
|
|
8
10
|
/** Пропустить импорт в модуль */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schematics/command/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACtB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IAEb,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,4DAA4D;IAC5D,UAAU,EAAE,OAAO,CAAC;IAEpB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "CqrsCommand",
|
|
4
|
+
"title": "CQRS Command Schematic",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the command",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "What name would you like to use for the Command?"
|
|
15
|
+
},
|
|
16
|
+
"module": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Module name",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "argv",
|
|
21
|
+
"index": 1
|
|
22
|
+
},
|
|
23
|
+
"x-prompt": "What name would you like to use for the Module?"
|
|
24
|
+
},
|
|
25
|
+
"useSwagger": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"description": "Swagger mode",
|
|
28
|
+
"$default": {
|
|
29
|
+
"$source": "argv",
|
|
30
|
+
"index": 2
|
|
31
|
+
},
|
|
32
|
+
"x-prompt": "Do you like to use with Swagger?"
|
|
33
|
+
},
|
|
34
|
+
"path": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "The path where to create the files",
|
|
37
|
+
"default": "src"
|
|
38
|
+
},
|
|
39
|
+
"prefix": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Command prefix (Create, Update, Delete)",
|
|
42
|
+
"default": "Create",
|
|
43
|
+
"x-prompt": "What prefix would you like to use? (Create, Update, Delete)"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": ["name", "module", "useSwagger"]
|
|
47
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Controller, Get, Query, HttpCode, UseGuards } from '@nestjs/common';
|
|
2
|
+
import { QueryBus } from '@nestjs/cqrs';
|
|
3
|
+
import { QueryResponse } from '@Libs/types/CQRSResponse.type';
|
|
4
|
+
import { <%= className %>Query } from './<%= name %>.query';
|
|
5
|
+
import { <%= className %>QueryHandler } from './<%= name %>.queryHandler';
|
|
6
|
+
<% if (useSwagger) { %>import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger'; <% } %>
|
|
7
|
+
|
|
8
|
+
<% if (useSwagger) { %>@ApiTags('<%= module %>')
|
|
9
|
+
@ApiBearerAuth()<% } %>
|
|
10
|
+
@UseGuards()
|
|
11
|
+
@Controller('')
|
|
12
|
+
export class <%= className %>Controller {
|
|
13
|
+
public constructor(private readonly queryBus: QueryBus) {}
|
|
14
|
+
|
|
15
|
+
@HttpCode(200)
|
|
16
|
+
@Get()
|
|
17
|
+
<% if (useSwagger) { %>@ApiOperation({ summary: '<%= humanize(name) %>' })<% } %>
|
|
18
|
+
async create(@Query() query: {}): Promise<void> {
|
|
19
|
+
return this.queryBus.execute<
|
|
20
|
+
<%= className %>Query,
|
|
21
|
+
QueryResponse<<%= className %>QueryHandler>
|
|
22
|
+
>(new <%= className %>Query({}));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { QueryHandler, IQueryHandler } from '@nestjs/cqrs';
|
|
2
|
+
import { <%= className %>Query } from './<%= name %>.query';
|
|
3
|
+
|
|
4
|
+
@QueryHandler(<%= className %>Query)
|
|
5
|
+
export class <%= className %>QueryHandler implements IQueryHandler<<%= className %>Query> {
|
|
6
|
+
|
|
7
|
+
public constructor() {}
|
|
8
|
+
|
|
9
|
+
async execute(query: <%= className %>Query): Promise<any> {
|
|
10
|
+
// Implement your query logic here
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schematics/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,IAAI,EAIJ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAsBtE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = commandSchematic;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
function commandSchematic(options) {
|
|
7
|
+
return (tree, context) => {
|
|
8
|
+
const classifiedName = core_1.strings.classify(options.name);
|
|
9
|
+
const modulePath = options.module ? `/${options.module}` : "";
|
|
10
|
+
const targetPath = `${options.path}${modulePath}/Queries/${classifiedName}`;
|
|
11
|
+
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)("./files"), [
|
|
12
|
+
(0, schematics_1.applyTemplates)({
|
|
13
|
+
...core_1.strings,
|
|
14
|
+
...options,
|
|
15
|
+
humanize,
|
|
16
|
+
name: classifiedName,
|
|
17
|
+
className: classifiedName,
|
|
18
|
+
}),
|
|
19
|
+
(0, schematics_1.move)(targetPath),
|
|
20
|
+
]);
|
|
21
|
+
const rules = [(0, schematics_1.mergeWith)(templateSource)];
|
|
22
|
+
return (0, schematics_1.chain)(rules)(tree, context);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function humanize(str) {
|
|
26
|
+
return str
|
|
27
|
+
.replace(/([A-Z])/g, " $1")
|
|
28
|
+
.replace(/^./, (s) => s.toUpperCase())
|
|
29
|
+
.replace(/(Create|Update|Delete)/, "$1 ")
|
|
30
|
+
.trim();
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface Schema {
|
|
2
|
+
/** Имя команды (например: CreatePost) */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Модуль, в который добавить команду */
|
|
5
|
+
module: string;
|
|
6
|
+
/** Необходимо ли нам генерировать декораторы для Swagger */
|
|
7
|
+
useSwagger: boolean;
|
|
8
|
+
/** Путь для генерации */
|
|
9
|
+
path?: string;
|
|
10
|
+
/** Пропустить импорт в модуль */
|
|
11
|
+
skipImport?: boolean;
|
|
12
|
+
/** Плоская структура файлов */
|
|
13
|
+
flat?: boolean;
|
|
14
|
+
/** Специфические для команды свойства */
|
|
15
|
+
hasDto?: boolean;
|
|
16
|
+
hasResponse?: boolean;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schematics/query/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACtB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IAEb,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IAEf,4DAA4D;IAC5D,UAAU,EAAE,OAAO,CAAC;IAEpB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "CqrsQuery",
|
|
4
|
+
"title": "CQRS Query Schematic",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the command",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "What name would you like to use for the Command?"
|
|
15
|
+
},
|
|
16
|
+
"module": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Module name",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "argv",
|
|
21
|
+
"index": 1
|
|
22
|
+
},
|
|
23
|
+
"x-prompt": "What name would you like to use for the Module?"
|
|
24
|
+
},
|
|
25
|
+
"useSwagger": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"description": "Swagger mode",
|
|
28
|
+
"$default": {
|
|
29
|
+
"$source": "argv",
|
|
30
|
+
"index": 2
|
|
31
|
+
},
|
|
32
|
+
"x-prompt": "Do you like to use with Swagger?"
|
|
33
|
+
},
|
|
34
|
+
"path": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "The path where to create the files",
|
|
37
|
+
"default": "src"
|
|
38
|
+
},
|
|
39
|
+
"prefix": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Command prefix (Create, Update, Delete)",
|
|
42
|
+
"default": "Create",
|
|
43
|
+
"x-prompt": "What prefix would you like to use? (Create, Update, Delete)"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": ["name", "module", "useSwagger"]
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wallentaine/cqrs-schematics",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "tsc",
|
|
7
|
+
"build": "rm -rf lib && tsc && copyfiles -u 1 \"src/**/*.template\" lib",
|
|
8
8
|
"prepublishOnly": "npm run build"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
|
-
"
|
|
12
|
-
|
|
11
|
+
"lib/**/*",
|
|
12
|
+
"collection.json"
|
|
13
13
|
],
|
|
14
14
|
"keywords": [
|
|
15
15
|
"nestjs",
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
"description": "CLI-схематика для утилиты nest generate",
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^25.0.8",
|
|
24
|
+
"copyfiles": "^2.4.1",
|
|
24
25
|
"typescript": "^5.9.3"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"@angular-devkit/schematics": "^19.2.19"
|
|
28
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"schematics": "./collection.json"
|
|
29
31
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,IAAI,EAIJ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAuBtE"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
apply,
|
|
3
|
-
applyTemplates,
|
|
4
|
-
chain,
|
|
5
|
-
mergeWith,
|
|
6
|
-
move,
|
|
7
|
-
Rule,
|
|
8
|
-
SchematicContext,
|
|
9
|
-
Tree,
|
|
10
|
-
url,
|
|
11
|
-
} from "@angular-devkit/schematics";
|
|
12
|
-
import { strings } from "@angular-devkit/core";
|
|
13
|
-
import { Schema as CommandOptions } from "./schema";
|
|
14
|
-
|
|
15
|
-
export default function commandSchematic(options: CommandOptions): Rule {
|
|
16
|
-
return (tree: Tree, context: SchematicContext) => {
|
|
17
|
-
console.log(options);
|
|
18
|
-
|
|
19
|
-
const classifiedName = strings.classify(options.name);
|
|
20
|
-
|
|
21
|
-
const modulePath = options.module ? `/${options.module}` : "";
|
|
22
|
-
const targetPath = `${options.path}${modulePath}/Commands/${classifiedName}`;
|
|
23
|
-
|
|
24
|
-
const templateSource = apply(url("./files"), [
|
|
25
|
-
applyTemplates({
|
|
26
|
-
...strings,
|
|
27
|
-
...options,
|
|
28
|
-
name: classifiedName,
|
|
29
|
-
className: classifiedName,
|
|
30
|
-
}),
|
|
31
|
-
move(targetPath),
|
|
32
|
-
]);
|
|
33
|
-
|
|
34
|
-
const rules: Rule[] = [mergeWith(templateSource)];
|
|
35
|
-
|
|
36
|
-
return chain(rules)(tree, context);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IAEb,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"$id": "CqrsCommand",
|
|
4
|
-
"title": "CQRS Command Schematic",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"name": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "The name of the command",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "argv",
|
|
12
|
-
"index": 0
|
|
13
|
-
},
|
|
14
|
-
"x-prompt": "What name would you like to use for the command?"
|
|
15
|
-
},
|
|
16
|
-
"module": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "Module name",
|
|
19
|
-
"x-prompt": "What name would you like to use for the Module?"
|
|
20
|
-
},
|
|
21
|
-
"path": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"description": "The path where to create the files",
|
|
24
|
-
"default": "src"
|
|
25
|
-
},
|
|
26
|
-
"prefix": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"description": "Command prefix (Create, Update, Delete)",
|
|
29
|
-
"default": "Create",
|
|
30
|
-
"x-prompt": "What prefix would you like to use? (Create, Update, Delete)"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"required": ["name", "module"]
|
|
34
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface Schema {
|
|
2
|
-
/** Имя команды (например: CreatePost) */
|
|
3
|
-
name: string;
|
|
4
|
-
|
|
5
|
-
/** Модуль, в который добавить команду */
|
|
6
|
-
module?: string;
|
|
7
|
-
|
|
8
|
-
/** Путь для генерации */
|
|
9
|
-
path?: string;
|
|
10
|
-
|
|
11
|
-
/** Пропустить импорт в модуль */
|
|
12
|
-
skipImport?: boolean;
|
|
13
|
-
|
|
14
|
-
/** Плоская структура файлов */
|
|
15
|
-
flat?: boolean;
|
|
16
|
-
|
|
17
|
-
/** Специфические для команды свойства */
|
|
18
|
-
hasDto?: boolean;
|
|
19
|
-
hasResponse?: boolean;
|
|
20
|
-
}
|
/package/{src/schematics/cqrs-command → lib/schematics/command}/files/__name__.command.ts.template
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|