@mbc-cqrs-serverless/cli 0.1.49-beta.0 → 0.1.51-beta.0
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/README.md +94 -63
- package/dist/actions/generate.action.js +44 -0
- package/dist/actions/new.action.get-package-version.spec.js +29 -0
- package/dist/actions/new.action.is-latest-version.spec.js +36 -0
- package/dist/actions/new.action.js +12 -6
- package/dist/actions/new.action.spec.js +84 -0
- package/dist/actions/new.action.update-env-local.spec.js +35 -0
- package/dist/actions/new.action.use-package-version.spec.js +46 -0
- package/dist/actions/ui.action.js +7 -5
- package/dist/commands/command.input.js +2 -0
- package/dist/commands/generate.command.js +24 -0
- package/dist/commands/index.js +2 -0
- package/dist/index.js +13 -2
- package/dist/runners/abstract.runner.js +44 -0
- package/dist/runners/schematic.runner.js +21 -0
- package/dist/schematics/collection.json +34 -0
- package/dist/schematics/index.js +17 -0
- package/dist/schematics/lib/controller/controller.factory.js +40 -0
- package/dist/schematics/lib/controller/controller.factory.spec.js +79 -0
- package/dist/schematics/lib/controller/files/__name@dasherize__.controller.ts +11 -0
- package/dist/schematics/lib/controller/schema.json +18 -0
- package/dist/schematics/lib/controller/units/__name@dasherize__.controller.__specFileSuffix__.ts +19 -0
- package/dist/schematics/lib/dto/dto.factory.js +32 -0
- package/dist/schematics/lib/dto/dto.factory.spec.js +128 -0
- package/dist/schematics/lib/dto/files/dto/__name@dasherize__-attributes.dto.ts +6 -0
- package/dist/schematics/lib/dto/files/dto/__name@dasherize__-command.dto.ts +16 -0
- package/dist/schematics/lib/dto/files/dto/__name@dasherize__-create.dto.ts +18 -0
- package/dist/schematics/lib/dto/files/dto/__name@dasherize__-search.dto.ts +2 -0
- package/dist/schematics/lib/dto/files/dto/__name@dasherize__-update.dto.ts +34 -0
- package/dist/schematics/lib/dto/schema.json +18 -0
- package/dist/schematics/lib/entity/entity.factory.js +30 -0
- package/dist/schematics/lib/entity/entity.factory.spec.js +86 -0
- package/dist/schematics/lib/entity/files/entity/__name@dasherize__-command.entity.ts +12 -0
- package/dist/schematics/lib/entity/files/entity/__name@dasherize__-data-list.entity.ts +12 -0
- package/dist/schematics/lib/entity/files/entity/__name@dasherize__-data.entity.ts +12 -0
- package/dist/schematics/lib/entity/schema.json +18 -0
- package/dist/schematics/lib/module/files/async/__name@dasherize__.controller.ts +74 -0
- package/dist/schematics/lib/module/files/async/__name@dasherize__.module.ts +19 -0
- package/dist/schematics/lib/module/files/async/__name@dasherize__.service.ts +164 -0
- package/dist/schematics/lib/module/files/async/dto/__name@dasherize__-attributes.dto.ts +6 -0
- package/dist/schematics/lib/module/files/async/dto/__name@dasherize__-command.dto.ts +16 -0
- package/dist/schematics/lib/module/files/async/dto/__name@dasherize__-create.dto.ts +18 -0
- package/dist/schematics/lib/module/files/async/dto/__name@dasherize__-search.dto.ts +2 -0
- package/dist/schematics/lib/module/files/async/dto/__name@dasherize__-update.dto.ts +34 -0
- package/dist/schematics/lib/module/files/async/entity/__name@dasherize__-command.entity.ts +12 -0
- package/dist/schematics/lib/module/files/async/entity/__name@dasherize__-data-list.entity.ts +12 -0
- package/dist/schematics/lib/module/files/async/entity/__name@dasherize__-data.entity.ts +12 -0
- package/dist/schematics/lib/module/files/async/handler/__name@dasherize__-rds.handler.ts +62 -0
- package/dist/schematics/lib/module/files/sync/__name@dasherize__.controller.ts +74 -0
- package/dist/schematics/lib/module/files/sync/__name@dasherize__.module.ts +19 -0
- package/dist/schematics/lib/module/files/sync/__name@dasherize__.service.ts +164 -0
- package/dist/schematics/lib/module/files/sync/dto/__name@dasherize__-attributes.dto.ts +6 -0
- package/dist/schematics/lib/module/files/sync/dto/__name@dasherize__-command.dto.ts +16 -0
- package/dist/schematics/lib/module/files/sync/dto/__name@dasherize__-create.dto.ts +18 -0
- package/dist/schematics/lib/module/files/sync/dto/__name@dasherize__-search.dto.ts +2 -0
- package/dist/schematics/lib/module/files/sync/dto/__name@dasherize__-update.dto.ts +34 -0
- package/dist/schematics/lib/module/files/sync/entity/__name@dasherize__-command.entity.ts +12 -0
- package/dist/schematics/lib/module/files/sync/entity/__name@dasherize__-data-list.entity.ts +12 -0
- package/dist/schematics/lib/module/files/sync/entity/__name@dasherize__-data.entity.ts +12 -0
- package/dist/schematics/lib/module/files/sync/handler/__name@dasherize__-rds.handler.ts +62 -0
- package/dist/schematics/lib/module/module.factory.js +204 -0
- package/dist/schematics/lib/module/module.factory.spec.js +188 -0
- package/dist/schematics/lib/module/schema.json +28 -0
- package/dist/schematics/lib/module/units/__name@dasherize__.controller.__specFileSuffix__.ts +19 -0
- package/dist/schematics/lib/module/units/__name@dasherize__.service.__specFileSuffix__.ts +19 -0
- package/dist/schematics/lib/service/files/__name@dasherize__.service.ts +12 -0
- package/dist/schematics/lib/service/schema.json +18 -0
- package/dist/schematics/lib/service/service.factory.js +40 -0
- package/dist/schematics/lib/service/service.factory.spec.js +81 -0
- package/dist/schematics/lib/service/units/__name@dasherize__.service.__specFileSuffix__.ts +19 -0
- package/dist/schematics/schematic.colection.js +60 -0
- package/dist/schematics/schematic.option.js +44 -0
- package/dist/schematics/utils/check-files-exist.js +13 -0
- package/dist/schematics/utils/index.js +17 -0
- package/dist/ui/index.js +18 -0
- package/dist/ui/logger.js +54 -0
- package/dist/ui/message.js +6 -0
- package/dist/utils/formatting.js +18 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/local-binaries.js +20 -0
- package/package.json +14 -5
- package/templates/.env.local +1 -1
- package/templates/README.md +1 -1
- package/templates/infra/README.md +6 -1
- package/templates/infra/libs/infra-stack.ts +1 -1
- package/templates/infra-local/docker-compose.yml +1 -1
- package/templates/infra-local/serverless.yml +19 -21
- package/templates/infra-local/swagger.json +396 -0
- package/templates/package.json +1 -0
- package/templates/prisma/dynamodbs/cqrs.json +1 -1
- package/templates/prisma/schema.prisma +4 -7
- package/templates/src/helpers/id.ts +12 -0
- package/templates/src/helpers/index.ts +1 -0
- package/templates/src/main.module.ts +2 -2
- package/templates/src/{master/dto/master-attributes.dto.ts → sample/dto/sample-attributes.dto.ts} +2 -2
- package/templates/src/{master/dto/master-command.dto.ts → sample/dto/sample-command.dto.ts} +4 -4
- package/templates/src/sample/entity/sample-command.entity.ts +13 -0
- package/templates/src/sample/entity/sample-data-list.entity.ts +13 -0
- package/templates/src/sample/entity/sample-data.entity.ts +13 -0
- package/templates/src/{master/handler/master-rds.handler.ts → sample/handler/sample-rds.handler.ts} +5 -7
- package/templates/src/{master/master.controller.ts → sample/sample.controller.ts} +22 -22
- package/templates/src/sample/sample.module.ts +19 -0
- package/templates/src/{master/master.service.ts → sample/sample.service.ts} +12 -12
- package/templates/test/api.http +25 -0
- package/templates/tsconfig.json +1 -1
- package/templates/src/master/entity/master-command.entity.ts +0 -13
- package/templates/src/master/entity/master-data-list.entity.ts +0 -13
- package/templates/src/master/entity/master-data.entity.ts +0 -13
- package/templates/src/master/master.module.ts +0 -19
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeToKebabOrSnakeCase = normalizeToKebabOrSnakeCase;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param str
|
|
7
|
+
* @returns formated string
|
|
8
|
+
* @description normalizes input to supported path and file name format.
|
|
9
|
+
* Changes camelCase strings to kebab-case, replaces spaces with dash and keeps underscores.
|
|
10
|
+
*/
|
|
11
|
+
function normalizeToKebabOrSnakeCase(str) {
|
|
12
|
+
const STRING_DASHERIZE_REGEXP = /\s/g;
|
|
13
|
+
const STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g;
|
|
14
|
+
return str
|
|
15
|
+
.replace(STRING_DECAMELIZE_REGEXP, '$1-$2')
|
|
16
|
+
.toLowerCase()
|
|
17
|
+
.replace(STRING_DASHERIZE_REGEXP, '-');
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./formatting"), exports);
|
|
18
|
+
__exportStar(require("./local-binaries"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.localBinExists = localBinExists;
|
|
4
|
+
exports.loadLocalBinCommandLoader = loadLocalBinCommandLoader;
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const localBinPathSegments = [
|
|
8
|
+
process.cwd(),
|
|
9
|
+
'node_modules',
|
|
10
|
+
'@mbc-cqrs-serverless',
|
|
11
|
+
'cli',
|
|
12
|
+
];
|
|
13
|
+
function localBinExists() {
|
|
14
|
+
return (0, fs_1.existsSync)((0, path_1.join)(...localBinPathSegments));
|
|
15
|
+
}
|
|
16
|
+
function loadLocalBinCommandLoader() {
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
18
|
+
const commandLoader = require(path_1.posix.join(...localBinPathSegments, 'dist', 'commands'));
|
|
19
|
+
return commandLoader;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mbc-cqrs-serverless/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.51-beta.0",
|
|
4
4
|
"description": "a CLI to get started with MBC CQRS serverless framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mbc",
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
"fargate",
|
|
16
16
|
"step-functions",
|
|
17
17
|
"sqs",
|
|
18
|
-
"
|
|
18
|
+
"typescript"
|
|
19
19
|
],
|
|
20
|
+
"schematics": "./dist/schematics/collection.json",
|
|
20
21
|
"bin": {
|
|
21
22
|
"mbc": "./dist/index.js"
|
|
22
23
|
},
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
],
|
|
28
29
|
"scripts": {
|
|
29
30
|
"build": "rm -rf dist && tsc",
|
|
30
|
-
"
|
|
31
|
+
"postbuild": "copyfiles ./schematics/collection.json ./schematics/**/schema.json ./schematics/**/files/** ./schematics/**/units/** dist && copyfiles -u 2 -a dist/src/**/* dist && copyfiles -u 2 -a dist/src/index.js dist && rm -rf dist/src"
|
|
31
32
|
},
|
|
32
33
|
"repository": {
|
|
33
34
|
"type": "git",
|
|
@@ -43,11 +44,19 @@
|
|
|
43
44
|
"access": "public"
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
47
|
+
"@angular-devkit/core": "^17.3.11",
|
|
48
|
+
"@angular-devkit/schematics": "^17.3.11",
|
|
49
|
+
"@angular-devkit/schematics-cli": "^17.3.11",
|
|
50
|
+
"@schematics/angular": "^17.3.11",
|
|
51
|
+
"chalk": "^4.1.2",
|
|
52
|
+
"cli-table3": "^0.6.5",
|
|
46
53
|
"commander": "^11.1.0",
|
|
54
|
+
"js-yaml": "^4.1.0",
|
|
47
55
|
"rimraf": "^5.0.5"
|
|
48
56
|
},
|
|
49
57
|
"devDependencies": {
|
|
50
|
-
"@faker-js/faker": "^8.3.1"
|
|
58
|
+
"@faker-js/faker": "^8.3.1",
|
|
59
|
+
"copyfiles": "^2.4.1"
|
|
51
60
|
},
|
|
52
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "6935a6c2f929944e111d953a06929dcc26321624"
|
|
53
62
|
}
|
package/templates/.env.local
CHANGED
|
@@ -54,4 +54,4 @@ SES_FROM_EMAIL=email@example.com
|
|
|
54
54
|
DATABASE_URL="mysql://root:RootCqrs@localhost:3306/cqrs?schema=public&connection_limit=1"
|
|
55
55
|
|
|
56
56
|
# serverless dynamodb local stream
|
|
57
|
-
|
|
57
|
+
LOCAL_DDB_SAMPLE_STREAM=arn:aws:dynamodb:ddblocal:000000000000:table/local-test-cli-sample-command/stream/2025-01-14T12:05:57.881
|
package/templates/README.md
CHANGED
|
@@ -46,7 +46,7 @@ $ npm run offline:docker
|
|
|
46
46
|
$ npm run migrate
|
|
47
47
|
|
|
48
48
|
# copy dynamodb stream arn to `.env` file
|
|
49
|
-
|
|
49
|
+
#LOCAL_DDB_SAMPLE_STREAM=arn:aws:dynamodb:ddblocal:000000000000:table/local-test-cli-sample-command/stream/2025-01-14T12:05:57.881
|
|
50
50
|
|
|
51
51
|
# serverless, open in other terminal session
|
|
52
52
|
$ npm run offline:sls
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
# Welcome to your CDK TypeScript project
|
|
2
2
|
|
|
3
|
-
This is a
|
|
3
|
+
This is a project for CDK development with TypeScript.
|
|
4
4
|
|
|
5
5
|
The `cdk.json` file tells the CDK Toolkit how to execute your app.
|
|
6
6
|
|
|
7
|
+
## Instruction
|
|
8
|
+
|
|
9
|
+
- Install requirement package by using command `pnpm install`
|
|
10
|
+
- Update test snapshot by using command `npm run test -- --updateSnapshot`
|
|
11
|
+
|
|
7
12
|
## Use SSO profile
|
|
8
13
|
|
|
9
14
|
```bash
|
|
@@ -779,7 +779,7 @@ export class InfraStack extends cdk.Stack {
|
|
|
779
779
|
}),
|
|
780
780
|
)
|
|
781
781
|
// dynamodb event source
|
|
782
|
-
const tableNames = ['tasks', '
|
|
782
|
+
const tableNames = ['tasks', 'sample-command']
|
|
783
783
|
for (const tableName of tableNames) {
|
|
784
784
|
const tableDesc = new cdk.custom_resources.AwsCustomResource(
|
|
785
785
|
this,
|
|
@@ -38,7 +38,7 @@ services:
|
|
|
38
38
|
dynamodb-admin:
|
|
39
39
|
image: aaronshaf/dynamodb-admin
|
|
40
40
|
environment:
|
|
41
|
-
- DYNAMO_ENDPOINT=dynamodb-local:8000
|
|
41
|
+
- DYNAMO_ENDPOINT=http://dynamodb-local:8000
|
|
42
42
|
- AWS_REGION=ap-northeast-1
|
|
43
43
|
- AWS_ACCESS_KEY_ID=local
|
|
44
44
|
- AWS_SECRET_ACCESS_KEY=local
|
|
@@ -29,16 +29,12 @@ custom:
|
|
|
29
29
|
- topic:
|
|
30
30
|
topicName: CqrsSnsTopic
|
|
31
31
|
rawMessageDelivery: 'true'
|
|
32
|
-
filterPolicy: { 'action': ['task-execute'] }
|
|
32
|
+
filterPolicy: { 'action': [ 'task-execute' ] }
|
|
33
33
|
queue: http://localhost:9324/101010101010/task-action-queue
|
|
34
34
|
- topic:
|
|
35
35
|
topicName: CqrsSnsTopic
|
|
36
36
|
rawMessageDelivery: 'true'
|
|
37
|
-
filterPolicy:
|
|
38
|
-
{
|
|
39
|
-
'action':
|
|
40
|
-
['notification-action', 'command-status', 'task-status'],
|
|
41
|
-
}
|
|
37
|
+
filterPolicy: { 'action': [ 'notification-action', 'command-status', 'task-status' ] }
|
|
42
38
|
queue: http://localhost:9324/101010101010/notification-queue
|
|
43
39
|
- topic:
|
|
44
40
|
topicName: AlarmSnsTopic
|
|
@@ -106,35 +102,37 @@ provider:
|
|
|
106
102
|
issuerUrl: http://localhost:9229/local_2G7noHgW
|
|
107
103
|
audience:
|
|
108
104
|
- dnk8y7ii3wled35p3lw0l2cd7
|
|
109
|
-
keycloakAuthorizer:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
105
|
+
# keycloakAuthorizer:
|
|
106
|
+
# type: jwt
|
|
107
|
+
# identitySource: $request.header.Authorization
|
|
108
|
+
# issuerUrl: http://localhost:8180/realms/master
|
|
109
|
+
# # issuerUrl: http://localhost:8180/auth/realms/master # old version
|
|
110
|
+
# audience:
|
|
111
|
+
# - cqrs-demo
|
|
116
112
|
|
|
117
113
|
functions:
|
|
118
114
|
main:
|
|
119
115
|
handler: ../dist/main.handler
|
|
120
116
|
events:
|
|
121
|
-
- httpApi:
|
|
117
|
+
- httpApi:
|
|
118
|
+
# public api
|
|
122
119
|
method: GET
|
|
123
120
|
path: /
|
|
124
121
|
- httpApi:
|
|
125
122
|
method: ANY
|
|
126
123
|
path: '/swagger-ui/{proxy+}'
|
|
127
|
-
- httpApi:
|
|
124
|
+
- httpApi:
|
|
125
|
+
# protected api
|
|
128
126
|
method: ANY
|
|
129
127
|
path: '/{proxy+}'
|
|
130
128
|
authorizer:
|
|
131
129
|
name: localAuthorizer
|
|
132
130
|
# authorizer:
|
|
133
131
|
# name: keycloakAuthorizer
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
# - eventBridge:
|
|
133
|
+
# eventBus: marketing
|
|
134
|
+
# # run every 5 minutes
|
|
135
|
+
# schedule: "cron(0/5 * * * ? *)"
|
|
138
136
|
- sqs:
|
|
139
137
|
arn:
|
|
140
138
|
Fn::GetAtt:
|
|
@@ -148,9 +146,9 @@ functions:
|
|
|
148
146
|
- stream:
|
|
149
147
|
type: dynamodb
|
|
150
148
|
maximumRetryAttempts: 10
|
|
151
|
-
arn: ${env:
|
|
149
|
+
arn: ${env:LOCAL_DDB_SAMPLE_STREAM}
|
|
152
150
|
filterPatterns:
|
|
153
|
-
- eventName: [INSERT]
|
|
151
|
+
- eventName: [ INSERT ]
|
|
154
152
|
|
|
155
153
|
stepFunctions:
|
|
156
154
|
# https://goessner.net/articles/JsonPath/index.html
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.0",
|
|
3
|
+
"paths": {
|
|
4
|
+
"/": {
|
|
5
|
+
"get": {
|
|
6
|
+
"operationId": "AppController_getHello",
|
|
7
|
+
"parameters": [
|
|
8
|
+
{
|
|
9
|
+
"in": "header",
|
|
10
|
+
"required": false,
|
|
11
|
+
"name": "x-tenant-code",
|
|
12
|
+
"schema": {}
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"responses": { "200": { "description": "" } },
|
|
16
|
+
"tags": ["main"]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"/api/sample": {
|
|
20
|
+
"post": {
|
|
21
|
+
"operationId": "SampleController_publishCommand",
|
|
22
|
+
"parameters": [
|
|
23
|
+
{
|
|
24
|
+
"in": "header",
|
|
25
|
+
"required": false,
|
|
26
|
+
"name": "x-tenant-code",
|
|
27
|
+
"schema": {}
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"requestBody": {
|
|
31
|
+
"required": true,
|
|
32
|
+
"content": {
|
|
33
|
+
"application/json": {
|
|
34
|
+
"schema": { "$ref": "#/components/schemas/SampleCommandDto" }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"responses": {
|
|
39
|
+
"201": {
|
|
40
|
+
"description": "",
|
|
41
|
+
"content": {
|
|
42
|
+
"application/json": {
|
|
43
|
+
"schema": { "$ref": "#/components/schemas/SampleDataEntity" }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"tags": ["sample"]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"/api/sample/command/{pk}/{sk}": {
|
|
52
|
+
"get": {
|
|
53
|
+
"operationId": "SampleController_getCommand",
|
|
54
|
+
"parameters": [
|
|
55
|
+
{
|
|
56
|
+
"name": "pk",
|
|
57
|
+
"required": true,
|
|
58
|
+
"in": "path",
|
|
59
|
+
"schema": { "type": "string" }
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "sk",
|
|
63
|
+
"required": true,
|
|
64
|
+
"in": "path",
|
|
65
|
+
"schema": { "type": "string" }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"in": "header",
|
|
69
|
+
"required": false,
|
|
70
|
+
"name": "x-tenant-code",
|
|
71
|
+
"schema": {}
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"responses": {
|
|
75
|
+
"200": {
|
|
76
|
+
"description": "",
|
|
77
|
+
"content": {
|
|
78
|
+
"application/json": {
|
|
79
|
+
"schema": { "$ref": "#/components/schemas/SampleCommandEntity" }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"tags": ["sample"]
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"/api/sample/data/{pk}/{sk}": {
|
|
88
|
+
"get": {
|
|
89
|
+
"operationId": "SampleController_getData",
|
|
90
|
+
"parameters": [
|
|
91
|
+
{
|
|
92
|
+
"name": "pk",
|
|
93
|
+
"required": true,
|
|
94
|
+
"in": "path",
|
|
95
|
+
"schema": { "type": "string" }
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "sk",
|
|
99
|
+
"required": true,
|
|
100
|
+
"in": "path",
|
|
101
|
+
"schema": { "type": "string" }
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"in": "header",
|
|
105
|
+
"required": false,
|
|
106
|
+
"name": "x-tenant-code",
|
|
107
|
+
"schema": {}
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"responses": {
|
|
111
|
+
"200": {
|
|
112
|
+
"description": "",
|
|
113
|
+
"content": {
|
|
114
|
+
"application/json": {
|
|
115
|
+
"schema": { "$ref": "#/components/schemas/SampleDataEntity" }
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"tags": ["sample"]
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"/api/sample/data/{pk}": {
|
|
124
|
+
"get": {
|
|
125
|
+
"operationId": "SampleController_listDataByPk",
|
|
126
|
+
"parameters": [
|
|
127
|
+
{
|
|
128
|
+
"name": "pk",
|
|
129
|
+
"required": true,
|
|
130
|
+
"in": "path",
|
|
131
|
+
"schema": { "type": "string" }
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"in": "header",
|
|
135
|
+
"required": false,
|
|
136
|
+
"name": "x-tenant-code",
|
|
137
|
+
"schema": {}
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"responses": {
|
|
141
|
+
"200": {
|
|
142
|
+
"description": "",
|
|
143
|
+
"content": {
|
|
144
|
+
"application/json": {
|
|
145
|
+
"schema": {
|
|
146
|
+
"$ref": "#/components/schemas/SampleDataListEntity"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"tags": ["sample"]
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"/api/sample/data": {
|
|
156
|
+
"get": {
|
|
157
|
+
"operationId": "SampleController_searchData",
|
|
158
|
+
"parameters": [
|
|
159
|
+
{
|
|
160
|
+
"name": "page",
|
|
161
|
+
"required": false,
|
|
162
|
+
"in": "query",
|
|
163
|
+
"schema": { "type": "number" }
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "pageSize",
|
|
167
|
+
"required": false,
|
|
168
|
+
"in": "query",
|
|
169
|
+
"schema": { "type": "number" }
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "keyword",
|
|
173
|
+
"required": false,
|
|
174
|
+
"in": "query",
|
|
175
|
+
"schema": { "type": "string" }
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "id",
|
|
179
|
+
"required": false,
|
|
180
|
+
"in": "query",
|
|
181
|
+
"schema": { "type": "string" }
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "pk",
|
|
185
|
+
"required": false,
|
|
186
|
+
"in": "query",
|
|
187
|
+
"schema": { "type": "string" }
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "sk",
|
|
191
|
+
"required": false,
|
|
192
|
+
"in": "query",
|
|
193
|
+
"schema": { "type": "string" }
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "orderBys",
|
|
197
|
+
"required": false,
|
|
198
|
+
"in": "query",
|
|
199
|
+
"schema": { "type": "array", "items": { "type": "string" } }
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"in": "header",
|
|
203
|
+
"required": false,
|
|
204
|
+
"name": "x-tenant-code",
|
|
205
|
+
"schema": {}
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"responses": {
|
|
209
|
+
"200": {
|
|
210
|
+
"description": "",
|
|
211
|
+
"content": {
|
|
212
|
+
"application/json": {
|
|
213
|
+
"schema": {
|
|
214
|
+
"$ref": "#/components/schemas/SampleDataListEntity"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"tags": ["sample"]
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"info": {
|
|
225
|
+
"title": "serverless",
|
|
226
|
+
"description": "The serverless API",
|
|
227
|
+
"version": "1.0.0",
|
|
228
|
+
"contact": {}
|
|
229
|
+
},
|
|
230
|
+
"tags": [],
|
|
231
|
+
"servers": [{ "url": "http://localhost:3000/", "description": "local" }],
|
|
232
|
+
"components": {
|
|
233
|
+
"securitySchemes": {
|
|
234
|
+
"Api-Key": { "type": "apiKey", "in": "header", "name": "Authorization" }
|
|
235
|
+
},
|
|
236
|
+
"schemas": {
|
|
237
|
+
"SampleAttributes": {
|
|
238
|
+
"type": "object",
|
|
239
|
+
"properties": { "value": { "type": "object" } },
|
|
240
|
+
"required": ["value"]
|
|
241
|
+
},
|
|
242
|
+
"SampleCommandDto": {
|
|
243
|
+
"type": "object",
|
|
244
|
+
"properties": {
|
|
245
|
+
"pk": { "type": "string" },
|
|
246
|
+
"sk": { "type": "string" },
|
|
247
|
+
"id": { "type": "string" },
|
|
248
|
+
"code": { "type": "string" },
|
|
249
|
+
"name": { "type": "string" },
|
|
250
|
+
"version": { "type": "number" },
|
|
251
|
+
"tenantCode": { "type": "string" },
|
|
252
|
+
"type": { "type": "string" },
|
|
253
|
+
"seq": { "type": "number" },
|
|
254
|
+
"ttl": { "type": "number" },
|
|
255
|
+
"isDeleted": { "type": "boolean" },
|
|
256
|
+
"attributes": { "$ref": "#/components/schemas/SampleAttributes" }
|
|
257
|
+
},
|
|
258
|
+
"required": [
|
|
259
|
+
"pk",
|
|
260
|
+
"sk",
|
|
261
|
+
"id",
|
|
262
|
+
"code",
|
|
263
|
+
"name",
|
|
264
|
+
"version",
|
|
265
|
+
"tenantCode",
|
|
266
|
+
"type",
|
|
267
|
+
"attributes"
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
"SampleDataEntity": {
|
|
271
|
+
"type": "object",
|
|
272
|
+
"properties": {
|
|
273
|
+
"cpk": { "type": "string" },
|
|
274
|
+
"csk": { "type": "string" },
|
|
275
|
+
"source": { "type": "string" },
|
|
276
|
+
"requestId": { "type": "string" },
|
|
277
|
+
"createdAt": { "format": "date-time", "type": "string" },
|
|
278
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
279
|
+
"createdBy": { "type": "string" },
|
|
280
|
+
"updatedBy": { "type": "string" },
|
|
281
|
+
"createdIp": { "type": "string" },
|
|
282
|
+
"updatedIp": { "type": "string" },
|
|
283
|
+
"pk": { "type": "string" },
|
|
284
|
+
"sk": { "type": "string" },
|
|
285
|
+
"id": { "type": "string" },
|
|
286
|
+
"code": { "type": "string" },
|
|
287
|
+
"name": { "type": "string" },
|
|
288
|
+
"version": { "type": "number" },
|
|
289
|
+
"tenantCode": { "type": "string" },
|
|
290
|
+
"type": { "type": "string" },
|
|
291
|
+
"seq": { "type": "number" },
|
|
292
|
+
"ttl": { "type": "number" },
|
|
293
|
+
"isDeleted": { "type": "boolean" },
|
|
294
|
+
"attributes": { "$ref": "#/components/schemas/SampleAttributes" }
|
|
295
|
+
},
|
|
296
|
+
"required": [
|
|
297
|
+
"pk",
|
|
298
|
+
"sk",
|
|
299
|
+
"id",
|
|
300
|
+
"code",
|
|
301
|
+
"name",
|
|
302
|
+
"version",
|
|
303
|
+
"tenantCode",
|
|
304
|
+
"type",
|
|
305
|
+
"attributes"
|
|
306
|
+
]
|
|
307
|
+
},
|
|
308
|
+
"SampleCommandEntity": {
|
|
309
|
+
"type": "object",
|
|
310
|
+
"properties": {
|
|
311
|
+
"source": { "type": "string" },
|
|
312
|
+
"isDeleted": { "type": "boolean" },
|
|
313
|
+
"status": { "type": "string" },
|
|
314
|
+
"requestId": { "type": "string" },
|
|
315
|
+
"createdAt": { "format": "date-time", "type": "string" },
|
|
316
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
317
|
+
"createdBy": { "type": "string" },
|
|
318
|
+
"updatedBy": { "type": "string" },
|
|
319
|
+
"createdIp": { "type": "string" },
|
|
320
|
+
"updatedIp": { "type": "string" },
|
|
321
|
+
"pk": { "type": "string" },
|
|
322
|
+
"sk": { "type": "string" },
|
|
323
|
+
"id": { "type": "string" },
|
|
324
|
+
"code": { "type": "string" },
|
|
325
|
+
"name": { "type": "string" },
|
|
326
|
+
"version": { "type": "number" },
|
|
327
|
+
"tenantCode": { "type": "string" },
|
|
328
|
+
"type": { "type": "string" },
|
|
329
|
+
"seq": { "type": "number" },
|
|
330
|
+
"ttl": { "type": "number" },
|
|
331
|
+
"attributes": { "$ref": "#/components/schemas/SampleAttributes" }
|
|
332
|
+
},
|
|
333
|
+
"required": [
|
|
334
|
+
"pk",
|
|
335
|
+
"sk",
|
|
336
|
+
"id",
|
|
337
|
+
"code",
|
|
338
|
+
"name",
|
|
339
|
+
"version",
|
|
340
|
+
"tenantCode",
|
|
341
|
+
"type",
|
|
342
|
+
"attributes"
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
"DataEntity": {
|
|
346
|
+
"type": "object",
|
|
347
|
+
"properties": {
|
|
348
|
+
"cpk": { "type": "string" },
|
|
349
|
+
"csk": { "type": "string" },
|
|
350
|
+
"source": { "type": "string" },
|
|
351
|
+
"requestId": { "type": "string" },
|
|
352
|
+
"createdAt": { "format": "date-time", "type": "string" },
|
|
353
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
354
|
+
"createdBy": { "type": "string" },
|
|
355
|
+
"updatedBy": { "type": "string" },
|
|
356
|
+
"createdIp": { "type": "string" },
|
|
357
|
+
"updatedIp": { "type": "string" },
|
|
358
|
+
"pk": { "type": "string" },
|
|
359
|
+
"sk": { "type": "string" },
|
|
360
|
+
"id": { "type": "string" },
|
|
361
|
+
"code": { "type": "string" },
|
|
362
|
+
"name": { "type": "string" },
|
|
363
|
+
"version": { "type": "number" },
|
|
364
|
+
"tenantCode": { "type": "string" },
|
|
365
|
+
"type": { "type": "string" },
|
|
366
|
+
"seq": { "type": "number" },
|
|
367
|
+
"ttl": { "type": "number" },
|
|
368
|
+
"isDeleted": { "type": "boolean" }
|
|
369
|
+
},
|
|
370
|
+
"required": [
|
|
371
|
+
"pk",
|
|
372
|
+
"sk",
|
|
373
|
+
"id",
|
|
374
|
+
"code",
|
|
375
|
+
"name",
|
|
376
|
+
"version",
|
|
377
|
+
"tenantCode",
|
|
378
|
+
"type"
|
|
379
|
+
]
|
|
380
|
+
},
|
|
381
|
+
"SampleDataListEntity": {
|
|
382
|
+
"type": "object",
|
|
383
|
+
"properties": {
|
|
384
|
+
"total": { "type": "number" },
|
|
385
|
+
"lastSk": { "type": "string" },
|
|
386
|
+
"items": {
|
|
387
|
+
"type": "array",
|
|
388
|
+
"items": { "$ref": "#/components/schemas/DataEntity" }
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"required": ["items"]
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
"security": [{ "Api-Key": [] }]
|
|
396
|
+
}
|
package/templates/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
["
|
|
1
|
+
["sample"]
|