@nestia/core 0.1.6 → 0.1.8

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 Jeongho Nam
3
+ Copyright (c) 2022 Jeongho Nam
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md ADDED
@@ -0,0 +1,339 @@
1
+ # Nestia Core
2
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)
3
+ [![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)
4
+ [![Downloads](https://img.shields.io/npm/dm/typia.svg)](https://www.npmjs.com/package/@nestia/core)
5
+ [![Build Status](https://github.com/samchon/typia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)
6
+ [![Guide Documents](https://img.shields.io/badge/wiki-documentation-forestgreen)](https://github.com/samchon/nestia/wiki)
7
+
8
+ ```bash
9
+ npx nestia setup
10
+ ```
11
+
12
+ Super-easy and super-fast validator decorators for NestJS.
13
+
14
+ `@nestia/core` is a transformer library of NestJS, supporing super-easy and super-fast validation decorators, by using [typia](https://github.com/samchon/typia). Comparing validation speed with `class-validator`, `@nestia/core` is maximum **15,000x times faster** and it even supports every TypeScript types.
15
+
16
+ Furthermore, `@nestia/core` can use pure interface typed DTO with **only one line**. Therefore, it does not require any extra dedication like defining JSON schema (`@nestjs/swagger`) or using class definition with decorator function calls (`class-validator`). Just enjoy **super-easy** and **super-fast** through with pure TypeScript types.
17
+
18
+ #### `BbsArticlesController.ts`
19
+ ```typescript
20
+ import { Controller } from "@nestjs/common";
21
+ import { TypedBody, TypedRoute } from "@nestia/core";
22
+
23
+ import { IBbsArticle } from "@bbs-api/structures/IBbsArticle";
24
+
25
+ @Controller("bbs/articles")
26
+ export class BbsArticlesController {
27
+ /**
28
+ * `TypedRoute.Post()`: safe `JSON.stringify()` with type validation.
29
+ *
30
+ * Furthermore, its 10x times faster than native `JSON.stringify()` function.
31
+ */
32
+ @TypedRoute.Post()
33
+ public async store(
34
+ /**
35
+ * Super-fast request body validator through `TypedBody()`.
36
+ *
37
+ * It also requires only one line.
38
+ */
39
+ @TypedBody() input: IBbsArticle.IStore
40
+ ): Promise<IBbsArticle>;
41
+ }
42
+ ```
43
+
44
+ #### `IBbsArticle.ts`
45
+ ```typescript
46
+ /**
47
+ * You don't need any extra dedication like:
48
+ *
49
+ * - `@nestjs/swagger`: JSON schema definition
50
+ * - `class-transformer`: class definition with decorator function class
51
+ *
52
+ * Just enjoy the pure interface type as DTO
53
+ */
54
+ export interface IBbsArticle {
55
+ /**
56
+ * @format uuid
57
+ */
58
+ id: string;
59
+ writer: string;
60
+ title: string;
61
+ content: string;
62
+ created_at: string;
63
+ }
64
+ export namespace IBbsArticle {
65
+ export interface IStore {
66
+ writer: string;
67
+ title: string;
68
+ content: string;
69
+ }
70
+ }
71
+ ```
72
+
73
+ #### `typia` vs. `class-validator`
74
+ ![Benchmark](https://github.com/samchon/typia/raw/master/benchmark/results/11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz/images/is.svg)
75
+
76
+ > Measured on [Intel i5-1135g7, Surface Pro 8](https://github.com/samchon/typia/tree/master/benchmark/results/11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz#is)
77
+
78
+
79
+
80
+
81
+
82
+ ## Setup
83
+ ### Setup Wizard
84
+ ```bash
85
+ # setup both @nestia/core and @nestia/sdk
86
+ npx nestia setup
87
+
88
+ # setup @nestia/core only
89
+ npx nestia setup
90
+ ```
91
+
92
+ When you run `npx nestia setup` command, all installation and configuration processes would be automatically done. If you want to setup `@nestia/core` only, run `npx @nestia/core setup` command instead.
93
+
94
+ After the setup has been completed, you can compile your backend server code by using `ttsc` command. If you want to run your TypeScript file directly through `ts-node`, add `-C ttypescript` argument like below:
95
+
96
+ ```bash
97
+ npx ttsc
98
+ npx ts-node -C ttypescript src/index.ts
99
+ ```
100
+
101
+ > In the automated setup process, you can specialize package manager like `yarn` instead of `npm` by adding `--module yarn` argument. You also can specialize transformation compiler by using [`--module ts-patch`](https://github.com/nonara/ts-patch) argument. Default compiler is [`ttypescrpit`](https://github.com/cevek/ttypescript).
102
+ >
103
+ > ```bash
104
+ > npx nestia setup \
105
+ > --compiler (ttypescript|ts-patch)
106
+ > --module (npm|pnpm|yarn)
107
+ >
108
+ > npx nestia setup
109
+ > npx nestia setup --module yarn
110
+ > npx nestia setup --compiler ts-patch
111
+ > ```
112
+
113
+ ### NPM Packages
114
+ If you want to install and configure manually, install `@nestia/core` module first.
115
+
116
+ Also, you need additional devDependencies to compile the TypeScript code with transformation. Therefore, install those all libraries `typescript`, `ttypescript` and `ts-node`. Inform that, `ttypescript` is not mis-writing. Do not forget to install the `ttypescript`.
117
+
118
+ ```bash
119
+ npm install --save @nestia/core
120
+
121
+ # ENSURE THOSE PACKAGES ARE INSTALLED
122
+ npm install --save-dev typescript
123
+ npm install --save-dev ttypescript
124
+ npm install --save-dev ts-node
125
+ ```
126
+
127
+ ### `tsconfig.json`
128
+ After the installation, you've to configure `tsconfig.json` file like below.
129
+
130
+ Add a property transform and its value as `@nestia/core/lib/transform` into `compilerOptions.plugins` array. Also, do same thing on `typia/lib/transform` value. When configuring, I recommend you to use the strict option, to enforce developers to distinguish whether each property is nullable or undefindable.
131
+
132
+ ```json
133
+ {
134
+ "compilerOptions": {
135
+ "strict": true,
136
+ "plugins": [
137
+ {
138
+ "transform": "@nestia/core/lib/transform",
139
+ // "validate": "assert", // "assert" | "is" | "validate"
140
+ // "stringify": "is", // null | "stringify" | "assert" | "is" | "validate"
141
+ },
142
+ { "transform": "typia/lib/transform" }
143
+ ]
144
+ }
145
+ }
146
+ ```
147
+
148
+ Also, you can configure additional properties like `validate` and `stringify`.
149
+
150
+ Through the `validate` property, you can specialize which validation algorithm of [typia](https://github.com/samchon/typia) to be used. Default is `assert` function and if you choose `is` function instead, the validation speed would be extremely faster, but any reason why would be provided when wrong typed data comes. Otherwise you select `validate` function, its validation speed would be slower, but most detailed reasons would be provided.
151
+
152
+ By specializing `stringify` property, you can specialize which JSON stringify function of [typia](https://github.com/samchon/typia) would be used. Default is `assert`, but if choose `null` instead, it would be replaced to `JSON.stringify()` function. Otherwise you configure it as `stringify`, fastest logic would be used, but unexpected behavior would be happend when wrong typed data comes.
153
+
154
+ ```typescript
155
+ // RUNTIME VALIDATORS
156
+ export function is<T>(input: unknown | T): boolean; // returns boolean
157
+ export function assert<T>(input: unknown | T): T; // throws TypeGuardError
158
+ export function validate<T>(input: unknown | T): IValidation<T>; // detailed
159
+
160
+ // FAST STRINGIFY FUNCTIONS
161
+ export function stringify<T>(input: T): string; // unsafe, but very fast
162
+ export function assertStringify<T>(input: T): string; // assert + stringify
163
+ export function isStringify<T>(input: T): string | null; // is + stringify
164
+ export function validateStringify<T>(input: T): IValidation<T>; // validate +
165
+ ```
166
+
167
+
168
+
169
+
170
+ ## Features
171
+ ```typescript
172
+ import { Controller } from "@nestjs/common";
173
+ import { TypedBody, TypedRoute } from "@nestia/core";
174
+
175
+ import { IBbsArticle } from "@bbs-api/structures/IBbsArticle";
176
+
177
+ @Controller("bbs/articles")
178
+ export class BbsArticlesController {
179
+ /**
180
+ * `TypedRoute.Post()`: safe `JSON.stringify()` with type validation.
181
+ *
182
+ * Furthermore, its 10x times faster than native `JSON.stringify()` function.
183
+ */
184
+ @TypedRoute.Post()
185
+ public async store(
186
+ /**
187
+ * Super-fast request body validator through `TypedBody()`.
188
+ *
189
+ * It also requires only one line.
190
+ */
191
+ @TypedBody() input: IBbsArticle.IStore
192
+ ): Promise<IBbsArticle>;
193
+ }
194
+ ```
195
+
196
+ ### TypedBody
197
+ `TypedBody` is a decorator function for `application/json` typed request body.
198
+
199
+ Also, it supports super-fast validation pipe, which is 15,000x times faster then ordinary `nest.Body()` decorator using `class-validator`.
200
+
201
+ ### TypedRoute
202
+ `TypedRoute` is a decorator function for `application/json` typed reponse body.
203
+
204
+ Also, it supports safe and fast JSON stringify pipe, which is maximum 10x times faster than native `JSON.stringify()` function and it is even type safe.
205
+
206
+ ### Encryption
207
+ `@nestia/core` supports special decorator functions `EncryptedBody` and `EncryptedRout`. They're almost same with [TypedBody](#typedbody) and [TypedRoute](#typedroute), but there's only one thing different - it encrypts JSON data through AES-128/256 algorithm.
208
+
209
+ - AES-128/256
210
+ - CBC mode
211
+ - PKCS #5 Padding
212
+ - Base64 Encoding
213
+
214
+
215
+
216
+
217
+
218
+ ## Appendix
219
+ ### Nestia SDK
220
+ ```bash
221
+ npx nestia swagger
222
+ npx nestia sdk
223
+ ```
224
+
225
+ When you adapt this `@nestia/core`, you can't use `@nestjs/swagger` more. Instead, I support `@nestia/sdk`, which is much more stable and powerful then before. Through this `@nestia/sdk` module, you can generate `swagger.json` and even generating SDK library is possible.
226
+
227
+ For reference, SDK (Software Development Kit) library means a library which can be utilized by TypeScript client developer conveniently. When you generate SDK library through `@nestia/sdk`, `@nestia/sdk` will analyze your backend server code and generate codes like below:
228
+
229
+ #### `BbsArticlesController.ts`
230
+ ```typescript
231
+ import { Controller } from "@nestjs/common";
232
+ import { TypedBody, TypedRoute } from "@nestia/core";
233
+
234
+ import { IBbsArticle } from "@bbs-api/structures/IBbsArticle";
235
+
236
+ @Controller("bbs/articles")
237
+ export class BbsArticlesController {
238
+ /**
239
+ * Store a new article.
240
+ *
241
+ * @param input content to store
242
+ * @returns new article
243
+ */
244
+ @TypedRoute.Post()
245
+ public async store(
246
+ @TypedBody() input: IBbsArticle.IStore
247
+ ): Promise<IBbsArticle>;
248
+ }
249
+ ```
250
+
251
+ #### `src/functional/bbs/articles/index.ts`
252
+ ```typescript
253
+ import { Fetcher, IConnection } from "@nestia/fetcher";
254
+ import { IBbsArticle } from "../../../structures/IBbsArticle";
255
+
256
+ /**
257
+ * Store a new content.
258
+ *
259
+ * @param input content to store
260
+ * @returns new article
261
+ */
262
+ export function store(
263
+ connection: api.IConnection,
264
+ input: IBbsArticle.IStore
265
+ ): Promise<IBbsArticle> {
266
+ return Fetcher.fetch(
267
+ connection,
268
+ store.ENCRYPTED,
269
+ store.METHOD,
270
+ store.path(),
271
+ input
272
+ );
273
+ }
274
+ export namespace store {
275
+ export const METHOD = "POST" as const;
276
+ export function path(): string {
277
+ return "/bbs/articles";
278
+ }
279
+ }
280
+ ```
281
+
282
+ #### SDK utilization code
283
+ ```typescript
284
+ import api from "@bbs-api";
285
+ import typia from "typia";
286
+
287
+ export async function test_bbs_article_store(connection: api.IConnection) {
288
+ const article: IBbsArticle = await api.functional.bbs.articles.store(
289
+ connection,
290
+ {
291
+ name: "John Doe",
292
+ title: "some title",
293
+ content: "some content",
294
+ }
295
+ );
296
+ typia.assert(article);
297
+ console.log(article);
298
+ }
299
+ ```
300
+
301
+ ### Typia
302
+ > https://github.com/samchon/typia
303
+ >
304
+ > `@nestia/core` is wrapping `typia` and the `typia` is:
305
+
306
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/typia/blob/master/LICENSE)
307
+ [![npm version](https://img.shields.io/npm/v/typia.svg)](https://www.npmjs.com/package/typia)
308
+ [![Downloads](https://img.shields.io/npm/dm/typia.svg)](https://www.npmjs.com/package/typia)
309
+ [![Build Status](https://github.com/samchon/typia/workflows/build/badge.svg)](https://github.com/samchon/typia/actions?query=workflow%3Abuild)
310
+ [![Guide Documents](https://img.shields.io/badge/wiki-documentation-forestgreen)](https://github.com/samchon/typia/wiki)
311
+
312
+ ```typescript
313
+ // RUNTIME VALIDATORS
314
+ export function is<T>(input: unknown | T): input is T; // returns boolean
315
+ export function assert<T>(input: unknown | T): T; // throws TypeGuardError
316
+ export function validate<T>(input: unknown | T): IValidation<T>; // detailed
317
+
318
+ // STRICT VALIDATORS
319
+ export function equals<T>(input: unknown | T): input is T;
320
+ export function assertEquals<T>(input: unknown | T): T;
321
+ export function validateEquals<T>(input: unknown | T): IValidation<T>;
322
+
323
+ // JSON
324
+ export function application<T>(): IJsonApplication; // JSON schema
325
+ export function assertParse<T>(input: string): T; // type safe parser
326
+ export function assertStringify<T>(input: T): string; // safe and faster
327
+ // +) isParse, validateParse
328
+ // +) stringify, isStringify, validateStringify
329
+ ```
330
+
331
+ `typia` is a transformer library of TypeScript, supporting below features:
332
+
333
+ - Super-fast Runtime Validators
334
+ - Safe JSON parse and fast stringify functions
335
+ - JSON schema generator
336
+
337
+ All functions in `typia` require **only one line**. You don't need any extra dedication like JSON schema definitions or decorator function calls. Just call `typia` function with only one line like `typia.assert<T>(input)`.
338
+
339
+ Also, as `typia` performs AOT (Ahead of Time) compilation skill, its performance is much faster than other competitive libaries. For an example, when comparing validate function `is()` with other competitive libraries, `typia` is maximum **15,000x times faster** than `class-validator`.
@@ -208,7 +208,10 @@ var CoreSetupWizard;
208
208
  plugins.push({
209
209
  transform: "@nestia/core/lib/transform",
210
210
  });
211
- if (!(typia === undefined)) return [3 /*break*/, 5];
211
+ if (typia === undefined)
212
+ plugins.push({
213
+ transform: "typia/lib/transform",
214
+ });
212
215
  return [4 /*yield*/, fs_1.default.promises.writeFile("tsconfig.json", Comment.stringify(config, null, 2))];
213
216
  case 4:
214
217
  _c.sent();
@@ -1 +1 @@
1
- {"version":3,"file":"CoreSetupWizard.js","sourceRoot":"","sources":["../../../src/executable/internal/CoreSetupWizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAA+B;AAE/B,0CAAoB;AAEpB,IAAiB,eAAe,CAqI/B;AArID,WAAiB,eAAe;;IAC5B,SAAsB,WAAW,CAAC,OAAe;;;;;4BAE3B,qBAAM,OAAO,CAAC,OAAO,CAAC,EAAA;;wBAAlC,IAAI,GAAQ,SAAsB;wBACxC,GAAG,CAAC,OAAO,CAAC,CAAC,IA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,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAE,CAAC;QAC3D,OAAO,CAAC,UAAG,OAAO,cAAI,MAAM,cAAI,MAAM,CAAE,CAAC,CAAC;IAC9C,CAAC;AAND,CAMC,CAAC;AAEN,IAAM,IAAI,GACN,UAAC,MAAiB;IAClB,OAAA,UAAC,IAAY;QACT,MAAM,EAAE,CAAC;QACT,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;AAJD,CAIC,CAAC;AAEN,SAAS,OAAO,CAAC,OAAe;IAC5B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrB,uBAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC/C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/core",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Super-fast validation decorators of NestJS",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -128,10 +128,13 @@ export namespace CoreSetupWizard {
128
128
  transform: "@nestia/core/lib/transform",
129
129
  } as any);
130
130
  if (typia === undefined)
131
- await fs.promises.writeFile(
132
- "tsconfig.json",
133
- Comment.stringify(config, null, 2),
134
- );
131
+ plugins.push({
132
+ transform: "typia/lib/transform",
133
+ } as any);
134
+ await fs.promises.writeFile(
135
+ "tsconfig.json",
136
+ Comment.stringify(config, null, 2),
137
+ );
135
138
  }
136
139
  if (temporary === true) remove(manager)("comment-json", false);
137
140
  };