@nestia/migrate 0.1.11 → 0.2.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/lib/NestiaMigrateApplication.js +74 -9
- package/lib/NestiaMigrateApplication.js.map +1 -1
- package/lib/archivers/FileArchiver.js +0 -1
- package/lib/archivers/FileArchiver.js.map +1 -1
- package/lib/bundles/TEMPLATE.js +10 -5
- package/lib/bundles/TEMPLATE.js.map +1 -1
- package/lib/programmers/RouteProgrammer.js +58 -30
- package/lib/programmers/RouteProgrammer.js.map +1 -1
- package/lib/structures/IMigrateRoute.d.ts +3 -0
- package/lib/structures/ISwaggerRoute.d.ts +3 -1
- package/package.json +4 -4
- package/src/NestiaMigrateApplication.ts +22 -1
- package/src/archivers/FileArchiver.ts +0 -1
- package/src/bundles/TEMPLATE.ts +10 -5
- package/src/programmers/RouteProgrammer.ts +64 -26
- package/src/structures/IMigrateRoute.ts +4 -0
- package/src/structures/ISwaggerRoute.ts +4 -1
@@ -8,9 +8,9 @@ const SchemaProgrammer_1 = require("./SchemaProgrammer");
|
|
8
8
|
var RouteProgrammer;
|
9
9
|
(function (RouteProgrammer) {
|
10
10
|
RouteProgrammer.analyze = (swagger) => (props) => (route) => {
|
11
|
-
var _a, _b, _c, _d, _e
|
12
|
-
const body = emplaceBodySchema(emplaceReference(swagger)("body"))(
|
13
|
-
const response = emplaceBodySchema(emplaceReference(swagger)("response"))((
|
11
|
+
var _a, _b, _c, _d, _e;
|
12
|
+
const body = emplaceBodySchema(emplaceReference(swagger)("body"))(route.requestBody);
|
13
|
+
const response = emplaceBodySchema(emplaceReference(swagger)("response"))((_b = (_a = route.responses) === null || _a === void 0 ? void 0 : _a["201"]) !== null && _b !== void 0 ? _b : (_c = route.responses) === null || _c === void 0 ? void 0 : _c["200"]);
|
14
14
|
if (body === false || response === false) {
|
15
15
|
console.log(`Failed to migrate ${props.method.toUpperCase()} ${props.path}: @nestia/migrate supports only application/json or text/plain format yet.`);
|
16
16
|
return null;
|
@@ -105,7 +105,7 @@ var RouteProgrammer;
|
|
105
105
|
? str.substring(1, str.length - 1)
|
106
106
|
: str.substring(1));
|
107
107
|
if (parameterNames.length !==
|
108
|
-
((
|
108
|
+
((_d = route.parameters) !== null && _d !== void 0 ? _d : []).filter((p) => p.in === "path").length) {
|
109
109
|
console.log(`Failed to migrate ${props.method.toUpperCase()} ${props.path}: number of path parameters are not matched with its full path.`);
|
110
110
|
return null;
|
111
111
|
}
|
@@ -114,7 +114,7 @@ var RouteProgrammer;
|
|
114
114
|
path: props.path,
|
115
115
|
method: props.method,
|
116
116
|
headers,
|
117
|
-
parameters: ((
|
117
|
+
parameters: ((_e = route.parameters) !== null && _e !== void 0 ? _e : [])
|
118
118
|
.filter((p) => p.in === "path")
|
119
119
|
.map((p, i) => {
|
120
120
|
var _a;
|
@@ -136,23 +136,25 @@ var RouteProgrammer;
|
|
136
136
|
body,
|
137
137
|
response,
|
138
138
|
description: describe(route),
|
139
|
+
"x-nestia-jsDocTags": route["x-nestia-jsDocTags"],
|
139
140
|
};
|
140
141
|
};
|
141
142
|
const describe = (route) => {
|
142
|
-
var _a, _b;
|
143
|
-
const
|
143
|
+
var _a, _b, _c, _d;
|
144
|
+
const commentTags = [];
|
144
145
|
const add = (text) => {
|
145
|
-
if (
|
146
|
-
|
146
|
+
if (commentTags.every((line) => line !== text))
|
147
|
+
commentTags.push(text);
|
147
148
|
};
|
148
|
-
|
149
|
-
|
149
|
+
let description = route.description;
|
150
|
+
if (route.summary) {
|
151
|
+
const emended = route.summary.endsWith(".")
|
150
152
|
? route.summary
|
151
|
-
: route.summary + "."
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
153
|
+
: route.summary + ".";
|
154
|
+
if (description !== undefined &&
|
155
|
+
!(description === null || description === void 0 ? void 0 : description.startsWith(route.summary)) &&
|
156
|
+
!((_a = route["x-nestia-jsDocTags"]) === null || _a === void 0 ? void 0 : _a.some((t) => t.name === "summary")))
|
157
|
+
description = `${emended}\n${description}`;
|
156
158
|
}
|
157
159
|
if (route.tags)
|
158
160
|
route.tags.forEach((name) => add(`@tag ${name}`));
|
@@ -161,7 +163,18 @@ var RouteProgrammer;
|
|
161
163
|
for (const security of (_b = route.security) !== null && _b !== void 0 ? _b : [])
|
162
164
|
for (const [name, scopes] of Object.entries(security))
|
163
165
|
add(`@security ${[name, ...scopes].join("")}`);
|
164
|
-
|
166
|
+
for (const jsDocTag of (_c = route["x-nestia-jsDocTags"]) !== null && _c !== void 0 ? _c : [])
|
167
|
+
if ((_d = jsDocTag.text) === null || _d === void 0 ? void 0 : _d.length)
|
168
|
+
add(`@${jsDocTag.name} ${jsDocTag.text
|
169
|
+
.map((text) => text.text)
|
170
|
+
.join("")}`);
|
171
|
+
else
|
172
|
+
add(`@${jsDocTag.name}`);
|
173
|
+
return (description === null || description === void 0 ? void 0 : description.length)
|
174
|
+
? commentTags.length
|
175
|
+
? `${description}\n\n${commentTags.join("\n")}`
|
176
|
+
: description
|
177
|
+
: commentTags.join("\n");
|
165
178
|
};
|
166
179
|
const isNotObjectLiteral = (schema) => JsonTypeChecker_1.JsonTypeChecker.isReference(schema) ||
|
167
180
|
JsonTypeChecker_1.JsonTypeChecker.isBoolean(schema) ||
|
@@ -173,11 +186,14 @@ var RouteProgrammer;
|
|
173
186
|
(JsonTypeChecker_1.JsonTypeChecker.isOneOf(schema) &&
|
174
187
|
schema.oneOf.every(isNotObjectLiteral)) ||
|
175
188
|
(JsonTypeChecker_1.JsonTypeChecker.isArray(schema) && isNotObjectLiteral(schema.items));
|
176
|
-
const emplaceBodySchema = (emplacer) => (
|
177
|
-
if (!content)
|
189
|
+
const emplaceBodySchema = (emplacer) => (meta) => {
|
190
|
+
if (!(meta === null || meta === void 0 ? void 0 : meta.content))
|
178
191
|
return null;
|
179
|
-
const entries = Object.entries(content);
|
180
|
-
const json = entries.find((e) =>
|
192
|
+
const entries = Object.entries(meta.content);
|
193
|
+
const json = entries.find((e) => meta["x-nestia-encrypted"] === true
|
194
|
+
? e[0].includes("text/plain") ||
|
195
|
+
e[0].includes("application/json")
|
196
|
+
: e[0].includes("application/json"));
|
181
197
|
if (json) {
|
182
198
|
const { schema } = json[1];
|
183
199
|
return {
|
@@ -185,6 +201,7 @@ var RouteProgrammer;
|
|
185
201
|
schema: isNotObjectLiteral(schema)
|
186
202
|
? schema
|
187
203
|
: emplacer(schema),
|
204
|
+
"x-nestia-encrypted": meta["x-nestia-encrypted"],
|
188
205
|
};
|
189
206
|
}
|
190
207
|
const text = entries.find((e) => e[0].includes("text/plain"));
|
@@ -200,13 +217,15 @@ var RouteProgrammer;
|
|
200
217
|
return { $ref: `#/components/schemas/${name}` };
|
201
218
|
};
|
202
219
|
RouteProgrammer.write = (references) => (route) => {
|
203
|
-
var _a;
|
220
|
+
var _a, _b;
|
204
221
|
const output = route.response
|
205
222
|
? SchemaProgrammer_1.SchemaProgrammer.write(references)(route.response.schema)
|
206
223
|
: "void";
|
207
|
-
const decorator = ((_a = route.body) === null || _a === void 0 ? void 0 : _a
|
208
|
-
?
|
209
|
-
:
|
224
|
+
const decorator = ((_a = route.body) === null || _a === void 0 ? void 0 : _a["x-nestia-encrypted"]) === true
|
225
|
+
? "@core.EncryptedRoute."
|
226
|
+
: ((_b = route.body) === null || _b === void 0 ? void 0 : _b.type) === "text/plain"
|
227
|
+
? [`@Header("Content-Type", "text/plain")`, `@`].join("\n")
|
228
|
+
: "@core.TypedRoute.";
|
210
229
|
const content = [
|
211
230
|
...(route.description
|
212
231
|
? [
|
@@ -220,21 +239,30 @@ var RouteProgrammer;
|
|
220
239
|
`${decorator}${StringUtil_1.StringUtil.capitalize(route.method)}${route.path.length ? `(${JSON.stringify(route.path)})` : "()"}`,
|
221
240
|
`public async ${route.name}(`,
|
222
241
|
...route.parameters.map((p) => ` ${writeParameter(p)},`),
|
242
|
+
...(route.headers
|
243
|
+
? [
|
244
|
+
` @core.TypedHeaders() headers: ${SchemaProgrammer_1.SchemaProgrammer.write(references)(route.headers)},`,
|
245
|
+
]
|
246
|
+
: []),
|
223
247
|
...(route.query
|
224
248
|
? [
|
225
|
-
` @core.TypedQuery() query: ${SchemaProgrammer_1.SchemaProgrammer.write(references)(route.query)}
|
249
|
+
` @core.TypedQuery() query: ${SchemaProgrammer_1.SchemaProgrammer.write(references)(route.query)},`,
|
226
250
|
]
|
227
251
|
: []),
|
228
252
|
...(route.body
|
229
|
-
? route.body
|
253
|
+
? route.body["x-nestia-encrypted"] === true
|
230
254
|
? [
|
231
|
-
` @core.
|
255
|
+
` @core.EncryptedBody() body: ${SchemaProgrammer_1.SchemaProgrammer.write(references)(route.body.schema)},`,
|
232
256
|
]
|
233
|
-
:
|
257
|
+
: route.body.type === "application/json"
|
258
|
+
? [
|
259
|
+
` @core.TypedBody() body: ${SchemaProgrammer_1.SchemaProgrammer.write(references)(route.body.schema)},`,
|
260
|
+
]
|
261
|
+
: [` @core.PlainBody() body: string,`]
|
234
262
|
: []),
|
235
263
|
`): Promise<${output}> {`,
|
236
264
|
...route.parameters.map((p) => ` ${StringUtil_1.StringUtil.normalize(p.key)};`),
|
237
|
-
|
265
|
+
...(route.headers ? [" headers;"] : []),
|
238
266
|
...(route.query ? [" query;"] : []),
|
239
267
|
...(route.body ? [" body;"] : []),
|
240
268
|
...(output !== "void"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RouteProgrammer.js","sourceRoot":"","sources":["../../src/programmers/RouteProgrammer.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAMlD,8DAA2D;AAC3D,oDAAiD;AACjD,yDAAsD;AAEtD,IAAiB,eAAe,CA0U/B;AA1UD,WAAiB,eAAe;IACf,uBAAO,GAChB,CAAC,OAAiB,EAAE,EAAE,CACtB,CAAC,KAAuC,EAAE,EAAE,CAC5C,CAAC,KAAoB,EAAwB,EAAE;;QAC3C,MAAM,IAAI,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAC7D,MAA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adata/IJsDocTagInfo";
|
1
2
|
import { ISwaggerSchema } from "./ISwaggeSchema";
|
2
3
|
export interface IMigrateRoute {
|
3
4
|
name: string;
|
@@ -9,6 +10,7 @@ export interface IMigrateRoute {
|
|
9
10
|
body: IMigrateRoute.IBody | null;
|
10
11
|
response: IMigrateRoute.IBody | null;
|
11
12
|
description?: string;
|
13
|
+
"x-nestia-jsDocTags"?: IJsDocTagInfo[];
|
12
14
|
}
|
13
15
|
export declare namespace IMigrateRoute {
|
14
16
|
interface IParameter {
|
@@ -19,5 +21,6 @@ export declare namespace IMigrateRoute {
|
|
19
21
|
interface IBody {
|
20
22
|
type: "text/plain" | "application/json";
|
21
23
|
schema: ISwaggerSchema;
|
24
|
+
"x-nestia-encrypted"?: boolean;
|
22
25
|
}
|
23
26
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { IJsDocTagInfo } from "typia/lib/metadata/IJsDocTagInfo";
|
1
2
|
import { ISwaggerSchema } from "./ISwaggeSchema";
|
2
3
|
export interface ISwaggerRoute {
|
3
4
|
parameters?: ISwaggerRoute.IParameter[];
|
@@ -8,6 +9,7 @@ export interface ISwaggerRoute {
|
|
8
9
|
deprecated?: boolean;
|
9
10
|
security?: Record<string, string[]>[];
|
10
11
|
tags?: string[];
|
12
|
+
"x-nestia-jsDocTags"?: IJsDocTagInfo[];
|
11
13
|
}
|
12
14
|
export declare namespace ISwaggerRoute {
|
13
15
|
interface IParameter {
|
@@ -30,7 +32,7 @@ export declare namespace ISwaggerRoute {
|
|
30
32
|
}>;
|
31
33
|
interface IContent {
|
32
34
|
"text/plain"?: {
|
33
|
-
schema: ISwaggerSchema
|
35
|
+
schema: ISwaggerSchema;
|
34
36
|
};
|
35
37
|
"application/json"?: {
|
36
38
|
schema: ISwaggerSchema;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nestia/migrate",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.2.0",
|
4
4
|
"description": "Migration program from swagger to NestJS",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"typings": "lib/index.d.ts",
|
@@ -30,8 +30,8 @@
|
|
30
30
|
},
|
31
31
|
"homepage": "https://github.com/samchon/nestia#readme",
|
32
32
|
"devDependencies": {
|
33
|
-
"@nestia/core": "^1.
|
34
|
-
"@nestia/fetcher": "^1.
|
33
|
+
"@nestia/core": "^1.5.1",
|
34
|
+
"@nestia/fetcher": "^1.5.1",
|
35
35
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
36
36
|
"@types/node": "^20.3.3",
|
37
37
|
"prettier": "^2.8.8",
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"typescript-transform-paths": "^3.4.6"
|
46
46
|
},
|
47
47
|
"dependencies": {
|
48
|
-
"typia": "^4.1.
|
48
|
+
"typia": "^4.1.13"
|
49
49
|
},
|
50
50
|
"files": [
|
51
51
|
"lib",
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import cp from "child_process";
|
2
|
+
|
1
3
|
import typia from "typia";
|
2
4
|
|
3
5
|
import { FileArchiver } from "./archivers/FileArchiver";
|
@@ -37,7 +39,26 @@ export class NestiaMigrateApplication {
|
|
37
39
|
(output: string): void => {
|
38
40
|
const program: IMigrateProgram = this.analyze();
|
39
41
|
const files: IMigrateFile[] = MigrateProgrammer.write(program);
|
40
|
-
|
42
|
+
|
43
|
+
try {
|
44
|
+
cp.execSync(
|
45
|
+
`git clone https://github.com/samchon/nestia-template "${output}"`,
|
46
|
+
{ stdio: "ignore" },
|
47
|
+
);
|
48
|
+
for (const path of [
|
49
|
+
"/.git",
|
50
|
+
"/src/api",
|
51
|
+
"/src/controllers",
|
52
|
+
"/src/providers",
|
53
|
+
"/test/features",
|
54
|
+
])
|
55
|
+
cp.execSync(`rm -rf "${output}${path}"`, {
|
56
|
+
stdio: "ignore",
|
57
|
+
});
|
58
|
+
} catch {
|
59
|
+
FileArchiver.archive(archiver)(output)(TEMPLATE);
|
60
|
+
}
|
61
|
+
FileArchiver.archive(archiver)(output)(files);
|
41
62
|
};
|
42
63
|
}
|
43
64
|
export namespace NestiaMigrateApplication {
|
@@ -10,7 +10,6 @@ export namespace FileArchiver {
|
|
10
10
|
(operator: IOperator) =>
|
11
11
|
(output: string) =>
|
12
12
|
(files: IMigrateFile[]): void => {
|
13
|
-
operator.mkdir(output);
|
14
13
|
const visited: Set<string> = new Set();
|
15
14
|
for (const f of files) {
|
16
15
|
mkdir(operator.mkdir)(output)(visited)(f.location);
|
package/src/bundles/TEMPLATE.ts
CHANGED
@@ -27,7 +27,7 @@ export const TEMPLATE = [
|
|
27
27
|
{
|
28
28
|
"location": "/.vscode",
|
29
29
|
"file": "launch.json",
|
30
|
-
"content": "{\r\n // Use IntelliSense to learn about possible Node.js debug attributes.\r\n // Hover to view descriptions of existing attributes.\r\n // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\r\n \"version\": \"0.2.0\",\r\n \"configurations\": [\r\n {\r\n \"type\": \"node\",\r\n \"request\": \"launch\",\r\n \"name\": \"
|
30
|
+
"content": "{\r\n // Use IntelliSense to learn about possible Node.js debug attributes.\r\n // Hover to view descriptions of existing attributes.\r\n // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\r\n \"version\": \"0.2.0\",\r\n \"configurations\": [\r\n {\r\n \"type\": \"node\",\r\n \"request\": \"launch\",\r\n \"name\": \"Backend Test\",\r\n \"program\": \"${workspaceRoot}/test/index.ts\",\r\n \"cwd\": \"${workspaceRoot}\",\r\n \"args\": [\r\n // //----\r\n // // Not possible to reset DB in debugging mode\r\n // //\r\n // // Therefore, if you need DB reset, then do it \r\n // // through `npm run reset-for-debugging` command\r\n // //----\r\n // \"--reset\", \"false\",\r\n // \"--mode\", \"local\",\r\n\r\n //----\r\n // You can run specific test functions\r\n //\r\n // If you want to include or exclude multiple words,\r\n // then separate them with space character\r\n //----\r\n // \"--include\", \"some-words-to-include\",\r\n // \"--exclude\", \"some-word another-word\",\r\n ],\r\n \"outFiles\": [\"${workspaceRoot}/bin/**/*.js\"],\r\n }\r\n ]\r\n}"
|
31
31
|
},
|
32
32
|
{
|
33
33
|
"location": "/.vscode",
|
@@ -47,7 +47,7 @@ export const TEMPLATE = [
|
|
47
47
|
{
|
48
48
|
"location": "",
|
49
49
|
"file": "package.json",
|
50
|
-
"content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"----------------------------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"-----------------------------------------------\": \"\",\r\n \"start\": \"node lib/executable/server\",\r\n \"test\": \"node bin/test\",\r\n \"------------------------------------------------\": \"\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.3.6\",\r\n \"@nestia/sdk\": \"^1.
|
50
|
+
"content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"----------------------------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"prepare\": \"ts-patch install\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"-----------------------------------------------\": \"\",\r\n \"start\": \"node lib/executable/server\",\r\n \"test\": \"node bin/test\",\r\n \"------------------------------------------------\": \"\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.3.6\",\r\n \"@nestia/sdk\": \"^1.5.1\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^3.3.1\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^5.40.0\",\r\n \"@typescript-eslint/parser\": \"^5.40.0\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"eslint-plugin-deprecation\": \"^1.4.1\",\r\n \"nestia\": \"^4.3.2\",\r\n \"prettier\": \"^2.7.1\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.0\",\r\n \"typescript\": \"^5.1.3\",\r\n \"typescript-transform-paths\": \"^3.4.6\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^1.5.1\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^4.1.13\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}\r\n"
|
51
51
|
},
|
52
52
|
{
|
53
53
|
"location": "/packages/api",
|
@@ -57,7 +57,7 @@ export const TEMPLATE = [
|
|
57
57
|
{
|
58
58
|
"location": "/packages/api",
|
59
59
|
"file": "package.json",
|
60
|
-
"content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.0.0\",\r\n \"description\": \"API for PROJECT\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^1.
|
60
|
+
"content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.0.0\",\r\n \"description\": \"API for PROJECT\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-template\"\r\n },\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-template/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-template#readme\",\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^1.5.1\",\r\n \"typia\": \"^4.1.13\"\r\n }\r\n}\r\n"
|
61
61
|
},
|
62
62
|
{
|
63
63
|
"location": "/packages/api",
|
@@ -67,7 +67,7 @@ export const TEMPLATE = [
|
|
67
67
|
{
|
68
68
|
"location": "/packages/api",
|
69
69
|
"file": "swagger.json",
|
70
|
-
"content": "{\r\n \"openapi\": \"3.0.1\",\r\n \"servers\": [\r\n {\r\n \"url\": \"http://localhost:37001\",\r\n \"description\": \"Local Server\"\r\n }\r\n ],\r\n \"info\": {\r\n \"version\": \"0.1.0\",\r\n \"title\": \"@ORGANIZATION/PROJECT\",\r\n \"description\": \"Starter kit of Nestia\"\r\n },\r\n \"paths\": {\r\n \"/bbs/articles/{section}\": {\r\n \"patch\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"description\": \"Target section\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"Pagination request info with searching and sorting options\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IRequest\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Paged articles witb summarization\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IPage_lt_IBbsArticle.ISummary_gt_\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"List up entire articles, but paginated and summarized\",\r\n \"description\": \"List up entire articles, but paginated and summarized.\\n\\nThis method is for listing up summarized articles with pagination.\\n\\nIf you want, you can search and sort articles with specific conditions.\\n\\n@param section Target section\\n@param input Pagination request info with searching and sorting options\\n@returns Paged articles witb summarization\",\r\n \"x-nestia-namespace\": \"bbs.articles.index\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Pagination request info with searching and sorting options\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Paged articles witb summarization\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n \"post\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"description\": \"Target section\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"New article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IStore\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Newly created article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Store a new article\",\r\n \"description\": \"Store a new article.\\n\\nStore a new article and returns its detailed record info.\\n\\n@param section Target section\\n@param input New article info\\n@returns Newly created article info\",\r\n \"x-nestia-namespace\": \"bbs.articles.store\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"New article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Newly created article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/bbs/articles/{section}/{id}\": {\r\n \"get\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"description\": \"Target section\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n },\r\n {\r\n \"name\": \"id\",\r\n \"in\": \"path\",\r\n \"description\": \"Target articles id\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Detailed article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Get an article with detailed info\",\r\n \"description\": \"Get an article with detailed info.\\n\\nOpen an article with detailed info, increasing reading count.\\n\\n@param section Target section\\n@param id Target articles id\\n@returns Detailed article info\",\r\n \"x-nestia-namespace\": \"bbs.articles.at\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"id\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target articles id\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Detailed article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n \"put\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"description\": \"Target section\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n },\r\n {\r\n \"name\": \"id\",\r\n \"in\": \"path\",\r\n \"description\": \"Target articles id\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"Content to update\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IUpdate\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Newly created content info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISnapshot\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Update article\",\r\n \"description\": \"Update article.\\n\\nWhen updating, this BBS system does not overwrite the content, but accumulate it.\\nTherefore, whenever an article being updated, length of {@link IBbsArticle.snapshots}\\nwould be increased and accumulated.\\n\\n@param section Target section\\n@param id Target articles id\\n@param input Content to update\\n@returns Newly created content info\",\r\n \"x-nestia-namespace\": \"bbs.articles.update\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"id\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target articles id\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Content to update\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Newly created content info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n }\r\n },\r\n \"components\": {\r\n \"schemas\": {\r\n \"IBbsArticle.IRequest\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"search\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IRequest.ISearch\"\r\n },\r\n \"sort\": {\r\n \"$ref\": \"#/components/schemas/IPage.Sort_lt_IBbsArticle.IRequest.SortableColumns_gt_\"\r\n },\r\n \"page\": {\r\n \"description\": \"Page number.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"number\"\r\n },\r\n \"limit\": {\r\n \"description\": \"Limitation of records per a page.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"number\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"description\": \"Sorting options.\\n\\nThe plus sign means ASC and minus sign means DESC.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IRequest.ISearch\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"writer\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"description\": \"Searching options.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IPage.Sort_lt_IBbsArticle.IRequest.SortableColumns_gt_\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"-writer\",\r\n \"-title\",\r\n \"-created_at\",\r\n \"-updated_at\",\r\n \"+writer\",\r\n \"+title\",\r\n \"+created_at\",\r\n \"+updated_at\"\r\n ]\r\n }\r\n },\r\n \"IPage_lt_IBbsArticle.ISummary_gt_\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"pagination\": {\r\n \"$ref\": \"#/components/schemas/IPage.IPagination\"\r\n },\r\n \"data\": {\r\n \"description\": \"List of records.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISummary\"\r\n }\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"pagination\",\r\n \"data\"\r\n ],\r\n \"description\": \"List of records.\",\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"author\",\r\n \"text\": [\r\n {\r\n \"text\": \"Samchon\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n \"IPage.IPagination\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"current\": {\r\n \"description\": \"Current page number.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"number\"\r\n },\r\n \"limit\": {\r\n \"description\": \"Limitation of records per a page.\\n\\n@default 100\",\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"default\",\r\n \"text\": [\r\n {\r\n \"text\": \"100\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"number\",\r\n \"default\": 100\r\n },\r\n \"records\": {\r\n \"description\": \"Count of total records in database.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"number\"\r\n },\r\n \"pages\": {\r\n \"description\": \"Number of total pages.\\n\\nEqual to {@link records} / {@link limit} with ceiling.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"number\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"current\",\r\n \"limit\",\r\n \"records\",\r\n \"pages\"\r\n ],\r\n \"description\": \"Number of total pages.\\n\\nEqual to {@link records} / {@link limit} with ceiling.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.ISummary\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"writer\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"created_at\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"updated_at\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"writer\",\r\n \"title\",\r\n \"created_at\",\r\n \"updated_at\"\r\n ],\r\n \"description\": \"Summarized info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"description\": \"Primary Key.\\n\\n@format uuid\",\r\n \"x-typia-metaTags\": [\r\n {\r\n \"kind\": \"format\",\r\n \"value\": \"uuid\"\r\n }\r\n ],\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"format\",\r\n \"text\": [\r\n {\r\n \"text\": \"uuid\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"section\": {\r\n \"description\": \"Section code.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"writer\": {\r\n \"description\": \"Name of nickname of writer.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"snapshots\": {\r\n \"description\": \"List of snapshot contents.\\n\\nWhenever updating an article, its contents would be accumulated.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISnapshot\"\r\n }\r\n },\r\n \"created_at\": {\r\n \"description\": \"Creation time of the article.\\n\\n@format date-time\",\r\n \"x-typia-metaTags\": [\r\n {\r\n \"kind\": \"format\",\r\n \"value\": \"datetime\"\r\n }\r\n ],\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"format\",\r\n \"text\": [\r\n {\r\n \"text\": \"date-time\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"section\",\r\n \"writer\",\r\n \"snapshots\",\r\n \"created_at\"\r\n ],\r\n \"description\": \"Creation time of the article.\\n\\n@format date-time\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.ISnapshot\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"description\": \"Primary key of individual content.\\n\\n@format uuid\",\r\n \"x-typia-metaTags\": [\r\n {\r\n \"kind\": \"format\",\r\n \"value\": \"uuid\"\r\n }\r\n ],\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"format\",\r\n \"text\": [\r\n {\r\n \"text\": \"uuid\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"created_at\": {\r\n \"description\": \"Creation time of this content.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"created_at\",\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\"\r\n ],\r\n \"description\": \"Creation time of this content.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IAttachmentFile\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"extension\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"url\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"name\",\r\n \"extension\",\r\n \"url\"\r\n ],\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IStore\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"writer\": {\r\n \"description\": \"Name or nickname of the writer.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n },\r\n \"password\": {\r\n \"description\": \"Password of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"writer\",\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\",\r\n \"password\"\r\n ],\r\n \"description\": \"Name or nickname of the writer.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IUpdate\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n },\r\n \"password\": {\r\n \"description\": \"Password of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\",\r\n \"password\"\r\n ],\r\n \"description\": \"Password of the article.\",\r\n \"x-typia-jsDocTags\": []\r\n }\r\n }\r\n }\r\n}"
|
70
|
+
"content": "{\r\n \"openapi\": \"3.0.1\",\r\n \"servers\": [\r\n {\r\n \"url\": \"http://localhost:37001\",\r\n \"description\": \"Local Server\"\r\n }\r\n ],\r\n \"info\": {\r\n \"version\": \"0.1.0\",\r\n \"title\": \"@ORGANIZATION/PROJECT\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"license\": {\r\n \"name\": \"MIT\"\r\n }\r\n },\r\n \"paths\": {\r\n \"/bbs/articles/{section}\": {\r\n \"patch\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"description\": \"Target section\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"Pagination request info with searching and sorting options\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IRequest\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Paged articles witb summarization\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IPage_lt_IBbsArticle.ISummary_gt_\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"List up entire articles, but paginated and summarized\",\r\n \"description\": \"List up entire articles, but paginated and summarized.\\n\\nThis method is for listing up summarized articles with pagination.\\n\\nIf you want, you can search and sort articles with specific conditions.\",\r\n \"x-nestia-namespace\": \"bbs.articles.index\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Pagination request info with searching and sorting options\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Paged articles witb summarization\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"PATCH\"\r\n },\r\n \"post\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"description\": \"Target section\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"New article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IStore\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Newly created article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Store a new article\",\r\n \"description\": \"Store a new article.\\n\\nStore a new article and returns its detailed record info.\",\r\n \"x-nestia-namespace\": \"bbs.articles.store\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"New article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Newly created article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"POST\"\r\n }\r\n },\r\n \"/bbs/articles/{section}/{id}\": {\r\n \"get\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"description\": \"Target section\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n },\r\n {\r\n \"name\": \"id\",\r\n \"in\": \"path\",\r\n \"description\": \"Target articles id\",\r\n \"schema\": {\r\n \"format\": \"uuid\",\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Detailed article info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Get an article with detailed info\",\r\n \"description\": \"Get an article with detailed info.\\n\\nOpen an article with detailed info, increasing reading count.\",\r\n \"x-nestia-namespace\": \"bbs.articles.at\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"id\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target articles id\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Detailed article info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"GET\"\r\n },\r\n \"put\": {\r\n \"tags\": [],\r\n \"parameters\": [\r\n {\r\n \"name\": \"section\",\r\n \"in\": \"path\",\r\n \"description\": \"Target section\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n },\r\n {\r\n \"name\": \"id\",\r\n \"in\": \"path\",\r\n \"description\": \"Target articles id\",\r\n \"schema\": {\r\n \"format\": \"uuid\",\r\n \"type\": \"string\"\r\n },\r\n \"required\": true\r\n }\r\n ],\r\n \"requestBody\": {\r\n \"description\": \"Content to update\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IUpdate\"\r\n }\r\n }\r\n },\r\n \"required\": true,\r\n \"x-nestia-encrypted\": false\r\n },\r\n \"responses\": {\r\n \"201\": {\r\n \"description\": \"Newly created content info\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISnapshot\"\r\n }\r\n }\r\n },\r\n \"x-nestia-encrypted\": false\r\n }\r\n },\r\n \"summary\": \"Update article\",\r\n \"description\": \"Update article.\\n\\nWhen updating, this BBS system does not overwrite the content, but accumulate it.\\nTherefore, whenever an article being updated, length of {@link IBbsArticle.snapshots }\\nwould be increased and accumulated.\",\r\n \"x-nestia-namespace\": \"bbs.articles.update\",\r\n \"x-nestia-jsDocTags\": [\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"section\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target section\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"id\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Target articles id\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"param\",\r\n \"text\": [\r\n {\r\n \"text\": \"input\",\r\n \"kind\": \"parameterName\"\r\n },\r\n {\r\n \"text\": \" \",\r\n \"kind\": \"space\"\r\n },\r\n {\r\n \"text\": \"Content to update\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n },\r\n {\r\n \"name\": \"returns\",\r\n \"text\": [\r\n {\r\n \"text\": \"Newly created content info\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-nestia-method\": \"PUT\"\r\n }\r\n }\r\n },\r\n \"components\": {\r\n \"schemas\": {\r\n \"IBbsArticle.IRequest\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"search\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.IRequest.ISearch\"\r\n },\r\n \"sort\": {\r\n \"$ref\": \"#/components/schemas/IPage.Sort_lt_IBbsArticle.IRequest.SortableColumns_gt_\"\r\n },\r\n \"page\": {\r\n \"description\": \"Page number.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"number\"\r\n },\r\n \"limit\": {\r\n \"description\": \"Limitation of records per a page.\",\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"number\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"description\": \"Page request info with some options.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IRequest.ISearch\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"writer\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"x-typia-required\": false,\r\n \"x-typia-optional\": true,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"description\": \"Searching options.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IPage.Sort_lt_IBbsArticle.IRequest.SortableColumns_gt_\": {\r\n \"description\": \"Sorting column specialization.\\n\\nThe plus means ascending order and the minus means descending order.\",\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"description\": \"Sorting column specialization.\\n\\nThe plus means ascending order and the minus means descending order.\",\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"-writer\",\r\n \"-title\",\r\n \"-created_at\",\r\n \"-updated_at\",\r\n \"+writer\",\r\n \"+title\",\r\n \"+created_at\",\r\n \"+updated_at\"\r\n ]\r\n }\r\n },\r\n \"IPage_lt_IBbsArticle.ISummary_gt_\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"pagination\": {\r\n \"$ref\": \"#/components/schemas/IPage.IPagination\"\r\n },\r\n \"data\": {\r\n \"description\": \"List of records.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISummary\"\r\n }\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"pagination\",\r\n \"data\"\r\n ],\r\n \"description\": \"A page.\\n\\nCollection of records with pagination indformation.\",\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"author\",\r\n \"text\": [\r\n {\r\n \"text\": \"Samchon\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n \"IPage.IPagination\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"current\": {\r\n \"description\": \"Current page number.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"number\"\r\n },\r\n \"limit\": {\r\n \"description\": \"Limitation of records per a page.\",\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"default\",\r\n \"text\": [\r\n {\r\n \"text\": \"100\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"number\",\r\n \"default\": 100\r\n },\r\n \"records\": {\r\n \"description\": \"Count of total records in database.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"number\"\r\n },\r\n \"pages\": {\r\n \"description\": \"Number of total pages.\\n\\nEqual to {@link records } / {@link limit } with ceiling.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"number\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"current\",\r\n \"limit\",\r\n \"records\",\r\n \"pages\"\r\n ],\r\n \"description\": \"Page information.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.ISummary\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"writer\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"created_at\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"updated_at\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"writer\",\r\n \"title\",\r\n \"created_at\",\r\n \"updated_at\"\r\n ],\r\n \"description\": \"Summarized info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"description\": \"Primary Key.\",\r\n \"x-typia-metaTags\": [\r\n {\r\n \"kind\": \"format\",\r\n \"value\": \"uuid\"\r\n }\r\n ],\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"format\",\r\n \"text\": [\r\n {\r\n \"text\": \"uuid\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"section\": {\r\n \"description\": \"Section code.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"writer\": {\r\n \"description\": \"Name of nickname of writer.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"snapshots\": {\r\n \"description\": \"List of snapshot contents.\\n\\nWhenever updating an article, its contents would be accumulated.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IBbsArticle.ISnapshot\"\r\n }\r\n },\r\n \"created_at\": {\r\n \"description\": \"Creation time of the article.\",\r\n \"x-typia-metaTags\": [\r\n {\r\n \"kind\": \"format\",\r\n \"value\": \"datetime\"\r\n }\r\n ],\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"format\",\r\n \"text\": [\r\n {\r\n \"text\": \"date-time\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"section\",\r\n \"writer\",\r\n \"snapshots\",\r\n \"created_at\"\r\n ],\r\n \"description\": \"BBS article.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.ISnapshot\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"description\": \"Primary key of individual content.\",\r\n \"x-typia-metaTags\": [\r\n {\r\n \"kind\": \"format\",\r\n \"value\": \"uuid\"\r\n }\r\n ],\r\n \"x-typia-jsDocTags\": [\r\n {\r\n \"name\": \"format\",\r\n \"text\": [\r\n {\r\n \"text\": \"uuid\",\r\n \"kind\": \"text\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"format\": \"uuid\"\r\n },\r\n \"created_at\": {\r\n \"description\": \"Creation time of this content.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"id\",\r\n \"created_at\",\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\"\r\n ],\r\n \"description\": \"Content info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IAttachmentFile\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"name\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"extension\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"nullable\": true\r\n },\r\n \"url\": {\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"name\",\r\n \"extension\",\r\n \"url\"\r\n ],\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IStore\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"writer\": {\r\n \"description\": \"Name or nickname of the writer.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n },\r\n \"password\": {\r\n \"description\": \"Password of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"writer\",\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\",\r\n \"password\"\r\n ],\r\n \"description\": \"Store info.\",\r\n \"x-typia-jsDocTags\": []\r\n },\r\n \"IBbsArticle.IUpdate\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"title\": {\r\n \"description\": \"Title of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"body\": {\r\n \"description\": \"Content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n },\r\n \"format\": {\r\n \"description\": \"Format of the content body.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\",\r\n \"enum\": [\r\n \"md\",\r\n \"html\",\r\n \"txt\"\r\n ]\r\n },\r\n \"files\": {\r\n \"description\": \"List of files (to be) attached.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"#/components/schemas/IAttachmentFile\"\r\n }\r\n },\r\n \"password\": {\r\n \"description\": \"Password of the article.\",\r\n \"x-typia-required\": true,\r\n \"x-typia-optional\": false,\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"nullable\": false,\r\n \"required\": [\r\n \"title\",\r\n \"body\",\r\n \"format\",\r\n \"files\",\r\n \"password\"\r\n ],\r\n \"description\": \"Update info.\",\r\n \"x-typia-jsDocTags\": []\r\n }\r\n }\r\n }\r\n}"
|
71
71
|
},
|
72
72
|
{
|
73
73
|
"location": "/packages/api",
|
@@ -114,10 +114,15 @@ export const TEMPLATE = [
|
|
114
114
|
"file": "MapUtil.ts",
|
115
115
|
"content": "export namespace MapUtil {\r\n export function take<Key, T>(\r\n dict: Map<Key, T>,\r\n key: Key,\r\n generator: () => T,\r\n ): T {\r\n const oldbie: T | undefined = dict.get(key);\r\n if (oldbie) return oldbie;\r\n\r\n const value: T = generator();\r\n dict.set(key, value);\r\n return value;\r\n }\r\n}\r\n"
|
116
116
|
},
|
117
|
+
{
|
118
|
+
"location": "/test/helpers",
|
119
|
+
"file": "ArgumentParser.ts",
|
120
|
+
"content": "import commander from 'commander';\r\nimport * as inquirer from 'inquirer';\r\n\r\nexport namespace ArgumentParser {\r\n export type Inquiry<T> = (\r\n command: commander.Command,\r\n prompt: (opt?: inquirer.StreamOptions) => inquirer.PromptModule,\r\n action: (closure: (options: Partial<T>) => Promise<T>) => Promise<T>,\r\n ) => Promise<T>;\r\n\r\n export interface Prompt {\r\n select: (\r\n name: string,\r\n ) => (\r\n message: string,\r\n ) => <Choice extends string>(choices: Choice[]) => Promise<Choice>;\r\n boolean: (name: string) => (message: string) => Promise<boolean>;\r\n }\r\n\r\n export const parse = async <T>(\r\n inquiry: (\r\n command: commander.Command,\r\n prompt: Prompt,\r\n action: (\r\n closure: (options: Partial<T>) => Promise<T>,\r\n ) => Promise<T>,\r\n ) => Promise<T>,\r\n ): Promise<T> => {\r\n // TAKE OPTIONS\r\n const action = (closure: (options: Partial<T>) => Promise<T>) =>\r\n new Promise<T>((resolve, reject) => {\r\n commander.program.action(async (options) => {\r\n try {\r\n resolve(await closure(options));\r\n } catch (exp) {\r\n reject(exp);\r\n }\r\n });\r\n commander.program.parseAsync().catch(reject);\r\n });\r\n\r\n const select =\r\n (name: string) =>\r\n (message: string) =>\r\n async <Choice extends string>(choices: Choice[]): Promise<Choice> =>\r\n (\r\n await inquirer.createPromptModule()({\r\n type: 'list',\r\n name,\r\n message,\r\n choices,\r\n })\r\n )[name];\r\n const boolean = (name: string) => async (message: string) =>\r\n (\r\n await inquirer.createPromptModule()({\r\n type: 'confirm',\r\n name,\r\n message,\r\n })\r\n )[name] as boolean;\r\n\r\n const output: T | Error = await (async () => {\r\n try {\r\n return await inquiry(\r\n commander.program,\r\n { select, boolean },\r\n action,\r\n );\r\n } catch (error) {\r\n return error as Error;\r\n }\r\n })();\r\n\r\n // RETURNS\r\n if (output instanceof Error) throw output;\r\n return output;\r\n };\r\n}\r\n"
|
121
|
+
},
|
117
122
|
{
|
118
123
|
"location": "/test",
|
119
124
|
"file": "index.ts",
|
120
|
-
"content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nimport { Backend } from \"../src/Backend\";\r\nimport { Configuration } from \"../src/Configuration\";\r\nimport { SGlobal } from \"../src/SGlobal\";\r\n\r\nasync function main(): Promise<void> {\r\n SGlobal.testing = true;\r\n\r\n // BACKEND SERVER\r\n const backend: Backend = new Backend();\r\n await backend.open();\r\n\r\n //----\r\n // CLINET CONNECTOR\r\n //----\r\n // DO TEST\r\n const connection: api.IConnection = {\r\n host: `http://127.0.0.1:${await Configuration.API_PORT()}`,\r\n };\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [connection],\r\n })(__dirname + \"/features\");\r\n\r\n await backend.close();\r\n\r\n const failures: DynamicExecutor.IReport.IExecution[] =\r\n report.executions.filter((exec) => exec.error !== null);\r\n if (failures.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n for (const f of failures) console.log(f.error);\r\n process.exit(-1);\r\n }\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
|
125
|
+
"content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nimport { Backend } from \"../src/Backend\";\r\nimport { Configuration } from \"../src/Configuration\";\r\nimport { SGlobal } from \"../src/SGlobal\";\r\nimport { ArgumentParser } from \"./helpers/ArgumentParser\";\r\n\r\ninterface IOptions {\r\n include?: string[];\r\n exclude?: string[];\r\n}\r\n\r\nconst getOptions = () =>\r\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\r\n // command.option(\"--mode <string>\", \"target mode\");\r\n // command.option(\"--reset <true|false>\", \"reset local DB or not\");\r\n command.option(\"--include <string...>\", \"include feature files\");\r\n command.option(\"--exclude <string...>\", \"exclude feature files\");\r\n\r\n prompt;\r\n\r\n return action(async (options) => {\r\n // if (typeof options.reset === \"string\")\r\n // options.reset = options.reset === \"true\";\r\n // options.mode ??= await prompt.select(\"mode\")(\"Select mode\")([\r\n // \"LOCAL\",\r\n // \"DEV\",\r\n // \"REAL\",\r\n // ]);\r\n // options.reset ??= await prompt.boolean(\"reset\")(\"Reset local DB\");\r\n return options as IOptions;\r\n });\r\n });\r\n\r\nasync function main(): Promise<void> {\r\n const options: IOptions = await getOptions();\r\n SGlobal.testing = true;\r\n\r\n // BACKEND SERVER\r\n const backend: Backend = new Backend();\r\n await backend.open();\r\n\r\n //----\r\n // CLINET CONNECTOR\r\n //----\r\n // DO TEST\r\n const connection: api.IConnection = {\r\n host: `http://127.0.0.1:${await Configuration.API_PORT()}`,\r\n };\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [\r\n {\r\n host: connection.host,\r\n encryption: connection.encryption,\r\n },\r\n ],\r\n filter: (func) =>\r\n (!options.include?.length ||\r\n (options.include ?? []).some((str) => func.includes(str))) &&\r\n (!options.exclude?.length ||\r\n (options.exclude ?? []).every((str) => !func.includes(str))),\r\n })(__dirname + \"/features\");\r\n\r\n await backend.close();\r\n\r\n const failures: DynamicExecutor.IReport.IExecution[] =\r\n report.executions.filter((exec) => exec.error !== null);\r\n if (failures.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n for (const f of failures) console.log(f.error);\r\n process.exit(-1);\r\n }\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
|
121
126
|
},
|
122
127
|
{
|
123
128
|
"location": "/test",
|