nestia 3.0.8-dev.20220708-3 → 3.0.9
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 +39 -327
- package/lib/IConfiguration.d.ts +2 -1
- package/lib/executable/internal/NestiaCommand.js +30 -9
- package/lib/executable/internal/NestiaCommand.js.map +1 -1
- package/lib/executable/internal/NestiaConfig.js +49 -28
- package/lib/executable/internal/NestiaConfig.js.map +1 -1
- package/lib/executable/nestia.js +0 -0
- package/lib/utils/ImportDictionary.js +2 -2
- package/lib/utils/ImportDictionary.js.map +1 -1
- package/lib/utils/StripEnums.d.ts +3 -0
- package/lib/utils/StripEnums.js +3 -0
- package/lib/utils/StripEnums.js.map +1 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -34,7 +34,6 @@ Ensure type safety | ✅ | ❌ | ❌
|
|
|
34
34
|
import api from "@samchon/shopping-api";
|
|
35
35
|
import { IPage } from "@samchon/shopping-api/lib/structures/IPage";
|
|
36
36
|
import { ISale } from "@samchon/shopping-api/lib/structures/ISale";
|
|
37
|
-
import { ISaleArticleComment } from "@samchon/shopping-api/lib/structures/ISaleArticleComment";
|
|
38
37
|
import { ISaleQuestion } from "@samchon/shopping-api/lib/structures/ISaleQuestion";
|
|
39
38
|
|
|
40
39
|
export async function trace_sale_question_and_comment
|
|
@@ -69,28 +68,17 @@ export async function trace_sale_question_and_comment
|
|
|
69
68
|
}
|
|
70
69
|
);
|
|
71
70
|
console.log("question", question);
|
|
72
|
-
|
|
73
|
-
// WRITE A COMMENT
|
|
74
|
-
const comment: ISaleArticleComment = await api.functional.shoppings.sales.comments.store
|
|
75
|
-
(
|
|
76
|
-
connection,
|
|
77
|
-
"general",
|
|
78
|
-
sale.id,
|
|
79
|
-
question.id,
|
|
80
|
-
{
|
|
81
|
-
body: "p.s) Can you send me a detailed catalogue?",
|
|
82
|
-
anonymous: false
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
console.log("comment", comment);
|
|
86
71
|
}
|
|
87
72
|
```
|
|
88
73
|
|
|
89
74
|
|
|
90
75
|
|
|
76
|
+
|
|
91
77
|
## Setup
|
|
92
78
|
Just like any other package, you've got to install it before you can use it.
|
|
93
79
|
|
|
80
|
+
For reference, `ttypescript` is not mis-writing. Don't forget to install it.
|
|
81
|
+
|
|
94
82
|
```sh
|
|
95
83
|
npm install --save-dev nestia
|
|
96
84
|
|
|
@@ -131,7 +119,7 @@ Unlike `@nestjs/swagger` which requires the DTO class with decorators, `nestia`
|
|
|
131
119
|
|
|
132
120
|
Look at the code below, you may see the difference between `nestia` and `@nestjs/swagger`, and thereby catch the meaning of the pure DTO interface.
|
|
133
121
|
|
|
134
|
-
- Simple [`ISaleArticleComment`](https://github.com/samchon/nestia/tree/master/demo/
|
|
122
|
+
- Simple [`ISaleArticleComment`](https://github.com/samchon/nestia/tree/master/demo/safe/src/api/structures/ISaleArticleComment.ts)
|
|
135
123
|
- Generic interfaces
|
|
136
124
|
- grandparent interface, [`ISaleArticle<Content>`](https://github.com/samchon/nestia/tree/master/demo/generic/src/api/structures/ISaleArticle.ts)
|
|
137
125
|
- parent interface, [`ISaleInquiry<Content>`](https://github.com/samchon/nestia/tree/master/demo/generic/src/api/structures/ISaleInquiry.ts)
|
|
@@ -139,77 +127,6 @@ Look at the code below, you may see the difference between `nestia` and `@nestjs
|
|
|
139
127
|
- 2nd sub-type interface, [`ISaleReview`](https://github.com/samchon/nestia/tree/master/demo/generic/src/api/structures/ISaleReview.ts)
|
|
140
128
|
- Union alias type [`ISaleEntireArticle`](https://github.com/samchon/nestia/tree/master/demo/union/src/api/structures/ISaleEntireArticle.ts)
|
|
141
129
|
|
|
142
|
-
> The below example code would be shown by clicking the arrow button or text.
|
|
143
|
-
|
|
144
|
-
<details>
|
|
145
|
-
<summary>
|
|
146
|
-
Traditional DTO class using <code>@nestjs/swagger</code>
|
|
147
|
-
</summary>
|
|
148
|
-
|
|
149
|
-
```typescript
|
|
150
|
-
export class SaleArticleComment
|
|
151
|
-
{
|
|
152
|
-
@ApiProperty({
|
|
153
|
-
description:
|
|
154
|
-
`Comment wrote on a sale related article.
|
|
155
|
-
|
|
156
|
-
When an article of a sale has been enrolled, all of the participants like consumers and sellers can write a comment on that article. However, when the writer is a consumer, the consumer can hide its name through the annoymous option.
|
|
157
|
-
|
|
158
|
-
Also, writing a reply comment for a specific comment is possible and in that case, the ISaleArticleComment.parent_id property would be activated.`
|
|
159
|
-
})
|
|
160
|
-
id: number;
|
|
161
|
-
|
|
162
|
-
@ApiProperty({
|
|
163
|
-
type: "number",
|
|
164
|
-
nullable: true,
|
|
165
|
-
description:
|
|
166
|
-
`Parent comment ID.
|
|
167
|
-
|
|
168
|
-
Only When this comment has been written as a reply.`
|
|
169
|
-
})
|
|
170
|
-
parent_id: number | null;
|
|
171
|
-
|
|
172
|
-
@ApiProperty({
|
|
173
|
-
type: "string",
|
|
174
|
-
description: "Type of the writer."
|
|
175
|
-
})
|
|
176
|
-
writer_type: "seller" | "consumer";
|
|
177
|
-
|
|
178
|
-
@ApiProperty({
|
|
179
|
-
type: "string",
|
|
180
|
-
nullable: true,
|
|
181
|
-
description:
|
|
182
|
-
`Name of the writer.
|
|
183
|
-
|
|
184
|
-
When this is a type of anonymous comment, writer name would be hidden.`
|
|
185
|
-
})
|
|
186
|
-
writer_name: string | null;
|
|
187
|
-
|
|
188
|
-
@ApiProperty({
|
|
189
|
-
type: "array",
|
|
190
|
-
items: {
|
|
191
|
-
schema: { $ref: getSchemaPath(SaleArticleComment.Content) }
|
|
192
|
-
},
|
|
193
|
-
description:
|
|
194
|
-
`Contents of the comments.
|
|
195
|
-
|
|
196
|
-
When the comment writer tries to modify content, it would not modify the comment content but would be accumulated Therefore, all of the people can read how the content has been changed.`
|
|
197
|
-
})
|
|
198
|
-
contents: SaleArticleComment.Content[];
|
|
199
|
-
|
|
200
|
-
@ApiProperty({
|
|
201
|
-
description: "Creation time."
|
|
202
|
-
})
|
|
203
|
-
created_at: string;
|
|
204
|
-
}
|
|
205
|
-
```
|
|
206
|
-
</details>
|
|
207
|
-
|
|
208
|
-
<details>
|
|
209
|
-
<summary>
|
|
210
|
-
Pure DTO interface using <code>nestia</code>
|
|
211
|
-
</summary>
|
|
212
|
-
|
|
213
130
|
```typescript
|
|
214
131
|
/**
|
|
215
132
|
* Comment wrote on a sale related article.
|
|
@@ -263,148 +180,8 @@ export interface ISaleArticleComment
|
|
|
263
180
|
*/
|
|
264
181
|
created_at: string;
|
|
265
182
|
}
|
|
266
|
-
export namespace ISaleArticleComment
|
|
267
|
-
{
|
|
268
|
-
/**
|
|
269
|
-
* Store info.
|
|
270
|
-
*/
|
|
271
|
-
export interface IStore
|
|
272
|
-
{
|
|
273
|
-
/**
|
|
274
|
-
* Body of the content.
|
|
275
|
-
*/
|
|
276
|
-
body: string;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Whether to hide the writer name or not.
|
|
280
|
-
*/
|
|
281
|
-
annonymous: boolean;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Content info.
|
|
286
|
-
*/
|
|
287
|
-
export interface IContent
|
|
288
|
-
{
|
|
289
|
-
/**
|
|
290
|
-
* Primary Key.
|
|
291
|
-
*/
|
|
292
|
-
id: string;
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Body of the content.
|
|
296
|
-
*/
|
|
297
|
-
body: string;
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Creation time.
|
|
301
|
-
*/
|
|
302
|
-
created_at: string;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
```
|
|
306
|
-
</details>
|
|
307
|
-
|
|
308
|
-
<details>
|
|
309
|
-
<summary>
|
|
310
|
-
Generic typed DTO using <code>nestia</code>
|
|
311
|
-
</summary>
|
|
312
|
-
|
|
313
|
-
```typescript
|
|
314
|
-
/**
|
|
315
|
-
* Inquiry article.
|
|
316
|
-
*
|
|
317
|
-
* Sub-type of article and super-type of question and answer.
|
|
318
|
-
*
|
|
319
|
-
* - List of the sub-types
|
|
320
|
-
* - {@link ISaleQuestion}
|
|
321
|
-
* - {@link ISaleReview}
|
|
322
|
-
*
|
|
323
|
-
* @template Content Content type
|
|
324
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
325
|
-
*/
|
|
326
|
-
export interface ISaleInquiry<Content extends ISaleInquiry.IContent>
|
|
327
|
-
extends ISaleArticle<Content>
|
|
328
|
-
{
|
|
329
|
-
/**
|
|
330
|
-
* Primary Key.
|
|
331
|
-
*/
|
|
332
|
-
id: number;
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Name of the writer.
|
|
336
|
-
*/
|
|
337
|
-
writer: string;
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* List of contents.
|
|
341
|
-
*
|
|
342
|
-
* When the article writer tries to modify content, it would not modify the article
|
|
343
|
-
* content but would be accumulated. Therefore, all the people can read how
|
|
344
|
-
* the content has been changed.
|
|
345
|
-
*/
|
|
346
|
-
contents: Content[];
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Creation time.
|
|
350
|
-
*/
|
|
351
|
-
createdAat: string;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Formal answer from the seller.
|
|
355
|
-
*/
|
|
356
|
-
answer: ISaleInquiryAnswer | null;
|
|
357
|
-
}
|
|
358
|
-
export namespace ISaleInquiry
|
|
359
|
-
{
|
|
360
|
-
/**
|
|
361
|
-
* Content info.
|
|
362
|
-
*/
|
|
363
|
-
export interface IContent
|
|
364
|
-
{
|
|
365
|
-
/**
|
|
366
|
-
* Primary Key
|
|
367
|
-
*/
|
|
368
|
-
id: string;
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Title of the content.
|
|
372
|
-
*/
|
|
373
|
-
title: string;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Body of the content.
|
|
377
|
-
*/
|
|
378
|
-
body: string;
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Attached files.
|
|
382
|
-
*/
|
|
383
|
-
files: IAttachmentFile[];
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Creation time.
|
|
387
|
-
*/
|
|
388
|
-
createdAt: string;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
183
|
```
|
|
392
|
-
</details>
|
|
393
|
-
|
|
394
|
-
<details>
|
|
395
|
-
<summary>
|
|
396
|
-
Union typed DTO using <code>nestia</code>
|
|
397
|
-
</summary>
|
|
398
184
|
|
|
399
|
-
```typescript
|
|
400
|
-
/**
|
|
401
|
-
* Union type of the entire sub-type articles.
|
|
402
|
-
*
|
|
403
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
404
|
-
*/
|
|
405
|
-
export type ISaleEntireArtcle = ISaleQuestion | ISaleReview;
|
|
406
|
-
```
|
|
407
|
-
</details>
|
|
408
185
|
|
|
409
186
|
|
|
410
187
|
|
|
@@ -414,104 +191,57 @@ Controller also can use the generic arguments.
|
|
|
414
191
|
|
|
415
192
|
In the previous [Pure DTO Interface](#pure-dto-interface) corner, we've learned that `nestia` can use the pure interface type as DTO. Also, we've learned that utilizing generic, union/intersection and even conditional typed interfaces are also possible.
|
|
416
193
|
|
|
417
|
-
In the Controller case, it's same with the upper DTO story. With `nestia`, defining a generic typed controller class is also possible, too. By defining a generic typed controller class as a super-type class, you can reduce both duplicated code and description comments.
|
|
194
|
+
In the Controller case, it's same with the upper DTO story. With `nestia`, defining a generic typed controller class is also possible, too. By defining a generic typed controller class as a super-type class, you can reduce both duplicated code and description comments.
|
|
418
195
|
|
|
419
|
-
Look at the below code and feel how powerful `nestia` is.
|
|
196
|
+
Look at the below code and feel how powerful `nestia` is.
|
|
420
197
|
|
|
421
|
-
- Simple [`CustomerSaleArticleCommentsController`](https://github.com/samchon/nestia/blob/master/demo/
|
|
198
|
+
- Simple [`CustomerSaleArticleCommentsController`](https://github.com/samchon/nestia/blob/master/demo/safe/src/controllers/ConsumerSaleArticleCommentsController.ts)
|
|
422
199
|
- Generic controllers
|
|
423
200
|
- abstract controller, [`SaleInquiriesController<Content, Store, Json>`](https://github.com/samchon/nestia/tree/master/demo/generic/src/controllers/SaleInquiriesController.ts)
|
|
424
201
|
- 1st sub-type controller, [`ConsumerSaleQuestionsController`](https://github.com/samchon/nestia/tree/master/demo/generic/src/controllers/ConsumerSaleQuestionsController.ts)
|
|
425
202
|
- 2nd sub-type controller, [`ConsumerSaleQuestionsController`](https://github.com/samchon/nestia/tree/master/demo/generic/src/controllers/ConsumerSaleQuestionsController.ts)
|
|
426
203
|
- Union controller, [`ConsumerSaleEntireArticlesController`](https://github.com/samchon/nestia/tree/master/demo/union/src/controllers/ConsumerSaleEntireArticlesController.ts)
|
|
427
204
|
|
|
428
|
-
|
|
429
|
-
>
|
|
430
|
-
> ```typescript
|
|
431
|
-
> import * as nest from "@nestjs/common";
|
|
432
|
-
> import { assert } from "typescript-json";
|
|
433
|
-
>
|
|
434
|
-
> @nest.Controller("consumers/:section/sales/:saleId/questions")
|
|
435
|
-
> export class SaleQuestionsController
|
|
436
|
-
> extends SaleInquiriesController<
|
|
437
|
-
> ISaleQuestion,
|
|
438
|
-
> ISaleQuestion.IContent,
|
|
439
|
-
> ISaleQuestion.IStore>
|
|
440
|
-
> {
|
|
441
|
-
> public constructor()
|
|
442
|
-
> {
|
|
443
|
-
> super(input => assert(input));
|
|
444
|
-
> }
|
|
445
|
-
> }
|
|
446
|
-
> ```
|
|
205
|
+
Also, you can validate request body data from client automatically, by using [nestia-helper](https://github.com/samchon/nestia-helper) and its `TypedBody()` decorator. Furthermore, `nestia-helper` boosts up JSON string conversion speed about 5x times faster through its `TypedRoute()` component.
|
|
447
206
|
|
|
448
|
-
|
|
449
|
-
import * as express from "express";
|
|
450
|
-
import * as nest from "@nestjs/common";
|
|
451
|
-
import helper from "nestia-helper";
|
|
452
|
-
|
|
453
|
-
import { ISaleInquiry } from "@api/structures/ISaleInquiry";
|
|
207
|
+

|
|
454
208
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
{
|
|
460
|
-
/**
|
|
461
|
-
* Constructor with type assert function.
|
|
462
|
-
*/
|
|
463
|
-
protected constructor(private readonly assert: (input: Store) => void);
|
|
209
|
+
```typescript
|
|
210
|
+
import express from "express";
|
|
211
|
+
import { Controller, Param, Request } from "@nestjs/common";
|
|
212
|
+
import { TypedBody, TypedRoute } from "nestia-helper";
|
|
464
213
|
|
|
465
|
-
|
|
466
|
-
* Store a new inquiry.
|
|
467
|
-
*
|
|
468
|
-
* Write a new article inquirying about a sale.
|
|
469
|
-
*
|
|
470
|
-
* @param request Instance of the Express.Request
|
|
471
|
-
* @param section Code of the target section
|
|
472
|
-
* @param saleId ID of the target sale
|
|
473
|
-
* @param input Content to archive
|
|
474
|
-
* @return Newly archived inquiry
|
|
475
|
-
*
|
|
476
|
-
* @throw 400 bad request error when type of the input data is not valid
|
|
477
|
-
* @throw 401 unauthorized error when you've not logged in yet
|
|
478
|
-
*/
|
|
479
|
-
@nest.Post()
|
|
480
|
-
public store
|
|
481
|
-
(
|
|
482
|
-
@nest.Request() request: express.Request,
|
|
483
|
-
@helper.TypedParam("section", "string") section: string,
|
|
484
|
-
@helper.TypedParam("saleId", "string") saleId: string,
|
|
485
|
-
@nest.Body() input: Store
|
|
486
|
-
): Promise<Json>;
|
|
214
|
+
import { ISaleArticleComment } from "../api/structures/ISaleArticleComment";
|
|
487
215
|
|
|
216
|
+
@Controller("consumers/:section/sales/:saleId/articles/:articleId/comments")
|
|
217
|
+
export class ConsumerSaleArticleCommentsController {
|
|
488
218
|
/**
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
*
|
|
219
|
+
* Store a new comment.
|
|
220
|
+
*
|
|
221
|
+
* Write a comment on a sale article. If you configure the comment to be
|
|
222
|
+
* `anonymous`, only administrator, you and seller of the sale can read
|
|
223
|
+
* the content.
|
|
224
|
+
*
|
|
495
225
|
* @param request Instance of the Express.Request
|
|
496
|
-
* @param
|
|
226
|
+
* @param sectionCode Code of the target section
|
|
497
227
|
* @param saleId ID of the target sale
|
|
498
|
-
* @param
|
|
499
|
-
* @param
|
|
500
|
-
* @return
|
|
501
|
-
*
|
|
228
|
+
* @param articleId ID of the target article
|
|
229
|
+
* @param body Content to write
|
|
230
|
+
* @return Newly archived comment
|
|
231
|
+
*
|
|
502
232
|
* @throw 400 bad request error when type of the input data is not valid
|
|
503
233
|
* @throw 401 unauthorized error when you've not logged in yet
|
|
504
|
-
* @throw 403 forbidden error when the
|
|
234
|
+
* @throw 403 forbidden error when you're a seller and the sale is not yours
|
|
235
|
+
* @throw 404 not found error when unable to find the matched record
|
|
505
236
|
*/
|
|
506
|
-
@
|
|
507
|
-
public
|
|
508
|
-
(
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
): Promise<Json>;
|
|
237
|
+
@TypedRoute.Post() // 5x faster JSON.stringify()
|
|
238
|
+
public async store(
|
|
239
|
+
@Request() request: express.Request,
|
|
240
|
+
@Param("section") sectionCode: string,
|
|
241
|
+
@Param("saleId") saleId: string,
|
|
242
|
+
@Param("articleId") articleId: string,
|
|
243
|
+
@TypedBody() body: ISaleArticleComment.IStore, // auto validation
|
|
244
|
+
): Promise<ISaleArticleComment>;
|
|
515
245
|
}
|
|
516
246
|
```
|
|
517
247
|
|
|
@@ -533,7 +263,7 @@ Route method, path and parameters are well-formed and DTO structures are correct
|
|
|
533
263
|
|
|
534
264
|
Furthermore, there's not any problem even when a generic typed controller class comes. `nestia` will specialize the generic arguments exactly, by analyzing your `NestJS` server code, in the compilation level.
|
|
535
265
|
|
|
536
|
-
- [simple/.../comments/index.ts](https://github.com/samchon/nestia/blob/master/demo/
|
|
266
|
+
- [simple/.../comments/index.ts](https://github.com/samchon/nestia/blob/master/demo/safe/src/api/functional/consumers/sales/articles/comments/index.ts)
|
|
537
267
|
- [generic/.../questions/index.ts](https://github.com/samchon/nestia/tree/master/demo/generic/src/api/functional/consumers/sales/questions/index.ts)
|
|
538
268
|
- [generic/.../reviews/index.ts](https://github.com/samchon/nestia/tree/master/demo/generic/src/api/functional/consumers/sales/reviews/index.ts)
|
|
539
269
|
- [union/.../entire_articles/index.ts](https://github.com/samchon/nestia/tree/master/demo/union/src/api/functional/consumers/sales/entire_articles/index.ts)
|
|
@@ -865,22 +595,4 @@ I support template backend project using this `nestia` library, `samchon/backend
|
|
|
865
595
|
|
|
866
596
|
Reading the README content of the backend template repository, you can find lots of example backend projects who've been generated from the backend. Furthermore, those example projects guide how to generate SDK library from `nestia` and how to distribute the SDK library thorugh the NPM module.
|
|
867
597
|
|
|
868
|
-
Therefore, if you're planning to compose your own backend project using this `nestia`, I recommend you to create the repository and learn from the `samchon/backend` template project.
|
|
869
|
-
|
|
870
|
-
### Archidraw
|
|
871
|
-
https://www.archisketch.com/
|
|
872
|
-
|
|
873
|
-
I have special thanks to the Archidraw, where I'm working for.
|
|
874
|
-
|
|
875
|
-
The Archidraw is a great IT company developing 3D interior editor and lots of solutions based on the 3D assets. Also, the Archidraw is the first company who had adopted this nestia on their commercial backend project, even this nestia was in the alpha level.
|
|
876
|
-
|
|
877
|
-
> 저희 회사 "아키드로우" 에서, 삼촌과 함께 일할 프론트 개발자 분들을, 최고의 대우로 모십니다.
|
|
878
|
-
>
|
|
879
|
-
> "아키드로우" 는 3D (인테리어) 에디터 및 이에 관한 파생 솔루션들을 만드는 회사입니다. 다만 저희 회사의 주력 제품이 3D 에디터라 하여, 반드시 3D 내지 랜더링에 능숙해야 하는 것은 아니니, 일반적인 프론트 개발자 분들도 망설임없이 지원해주십시오.
|
|
880
|
-
>
|
|
881
|
-
> 그리고 저희 회사는 분위기가 다들 친하고 즐겁게 지내는 분위기입니다. 더하여 위 `nestia` 나 [typescript-json](https://github.com/samchon/typescript-json) 및 [payments](https://github.com/archidraw/payments) 등, 제법 합리적(?)이고 재미난 프로젝트들을 다양하게 체험해보실 수 있습니다.
|
|
882
|
-
>
|
|
883
|
-
> - 회사소개서: [archidraw.pdf](https://github.com/archidraw/payments/files/7696710/archidraw.pdf)
|
|
884
|
-
> - 기술 스택: React + TypeScript
|
|
885
|
-
> - 이력서: 자유 양식
|
|
886
|
-
> - 지원처: samchon@archisketch.com
|
|
598
|
+
Therefore, if you're planning to compose your own backend project using this `nestia`, I recommend you to create the repository and learn from the `samchon/backend` template project.
|
package/lib/IConfiguration.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import type { StripEnums } from "./utils/StripEnums";
|
|
2
3
|
/**
|
|
3
4
|
* Definition for the `nestia.config.ts` file.
|
|
4
5
|
*
|
|
@@ -35,7 +36,7 @@ export interface IConfiguration {
|
|
|
35
36
|
* }
|
|
36
37
|
* ```
|
|
37
38
|
*/
|
|
38
|
-
compilerOptions?: ts.CompilerOptions
|
|
39
|
+
compilerOptions?: StripEnums<ts.CompilerOptions>;
|
|
39
40
|
/**
|
|
40
41
|
* Whether to assert parameter types or not.
|
|
41
42
|
*
|
|
@@ -8,14 +8,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
24
|
};
|
|
14
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
26
|
exports.NestiaCommand = void 0;
|
|
16
27
|
const cli_1 = __importDefault(require("cli"));
|
|
17
|
-
const
|
|
18
|
-
const
|
|
28
|
+
const path_1 = __importDefault(require("path"));
|
|
29
|
+
const tsconfck_1 = require("tsconfck");
|
|
30
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
19
31
|
const WorkerConnector_1 = require("tgrid/protocols/workers/WorkerConnector");
|
|
20
32
|
const NestiaApplication_1 = require("../../NestiaApplication");
|
|
21
33
|
var NestiaCommand;
|
|
@@ -66,19 +78,28 @@ var NestiaCommand;
|
|
|
66
78
|
function generate(task, include, command, output) {
|
|
67
79
|
var _a;
|
|
68
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
//
|
|
81
|
+
// CONFIGURATION
|
|
70
82
|
const config = (_a = (yield get_nestia_config(output.validate))) !== null && _a !== void 0 ? _a : parse_cli(include, command, output);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const content = yield fs_1.default.promises.readFile("tsconfig.json", "utf8");
|
|
74
|
-
const options = jsonc_simple_parser_1.default.parse(content).compilerOptions;
|
|
75
|
-
config.compilerOptions = Object.assign(Object.assign({}, options), (config.compilerOptions || {}));
|
|
76
|
-
}
|
|
83
|
+
const options = yield get_typescript_options();
|
|
84
|
+
config.compilerOptions = Object.assign(Object.assign({}, options), (config.compilerOptions || {}));
|
|
77
85
|
// CALL THE APP.GENERATE()
|
|
78
86
|
const app = new NestiaApplication_1.NestiaApplication(config);
|
|
79
87
|
yield task(app);
|
|
80
88
|
});
|
|
81
89
|
}
|
|
90
|
+
function get_typescript_options() {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const configFileName = typescript_1.default.findConfigFile(process.cwd(), typescript_1.default.sys.fileExists, "tsconfig.json");
|
|
93
|
+
if (!configFileName)
|
|
94
|
+
return null;
|
|
95
|
+
const { tsconfig } = yield (0, tsconfck_1.parseNative)(configFileName);
|
|
96
|
+
const configFileText = JSON.stringify(tsconfig);
|
|
97
|
+
const { config } = typescript_1.default.parseConfigFileTextToJson(configFileName, configFileText);
|
|
98
|
+
const configParseResult = typescript_1.default.parseJsonConfigFileContent(config, typescript_1.default.sys, path_1.default.dirname(configFileName));
|
|
99
|
+
const _a = configParseResult.raw.compilerOptions, { moduleResolution } = _a, result = __rest(_a, ["moduleResolution"]);
|
|
100
|
+
return result;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
82
103
|
function get_nestia_config(validate) {
|
|
83
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
105
|
const connector = new WorkerConnector_1.WorkerConnector(null, null, "process");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaCommand.js","sourceRoot":"","sources":["../../../src/executable/internal/NestiaCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NestiaCommand.js","sourceRoot":"","sources":["../../../src/executable/internal/NestiaCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,gDAAwB;AACxB,uCAAuC;AACvC,4DAA4B;AAC5B,6EAA0E;AAG1E,+DAA4D;AAc5D,IAAiB,aAAa,CAwJ7B;AAxJD,WAAiB,aAAa;IAC1B,SAAgB,GAAG,CACf,QAAkB,EAClB,OAAgB,IAAI;QAEpB,OAAO,IAAI,CACP,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,EAClB;YACI,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;YACpD,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM;YACrC,QA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M,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAClB,CAAC;AACL,CAAC,EAxJgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAwJ7B"}
|
|
@@ -54,6 +54,7 @@ var NestiaConfig;
|
|
|
54
54
|
runner.register({
|
|
55
55
|
emit: false,
|
|
56
56
|
compilerOptions: {
|
|
57
|
+
module: "CommonJS",
|
|
57
58
|
noEmit: true,
|
|
58
59
|
},
|
|
59
60
|
});
|
|
@@ -64,13 +65,29 @@ var NestiaConfig;
|
|
|
64
65
|
return (input => { ((input, path = "$input") => {
|
|
65
66
|
const $pred = typescript_json_1.assertType.predicate;
|
|
66
67
|
const $ao = [
|
|
67
|
-
(input, path, exceptionable) => null !== input.input && undefined !== input.input && ("string" === typeof input.input || Array.isArray(input.input) && input.input.every((elem,
|
|
68
|
+
(input, path, exceptionable) => $pred(null !== input.input && undefined !== input.input && $pred("string" === typeof input.input || Array.isArray(input.input) && input.input.every((elem, index8905304311903555) => $pred("string" === typeof elem, exceptionable, () => ({
|
|
69
|
+
path: path + ".input[" + index8905304311903555 + "]",
|
|
70
|
+
expected: "string",
|
|
71
|
+
value: elem
|
|
72
|
+
}))) || "object" === typeof input.input && null !== input.input && $ao[1](input.input, path + ".input", true && exceptionable), exceptionable, () => ({
|
|
73
|
+
path: path + ".input",
|
|
74
|
+
expected: "(Array<string> | Resolve<IConfiguration.IInput> | string)",
|
|
75
|
+
value: input.input
|
|
76
|
+
})), exceptionable, () => ({
|
|
77
|
+
path: path + ".input",
|
|
78
|
+
expected: "(Array<string> | Resolve<IConfiguration.IInput> | string)",
|
|
79
|
+
value: input.input
|
|
80
|
+
})) && $pred(undefined === input.output || "string" === typeof input.output, exceptionable, () => ({
|
|
68
81
|
path: path + ".output",
|
|
69
82
|
expected: "(string | undefined)",
|
|
70
83
|
value: input.output
|
|
71
|
-
})) && $pred(null !== input.compilerOptions && (undefined === input.compilerOptions || "object" === typeof input.compilerOptions && null !== input.compilerOptions &&
|
|
84
|
+
})) && $pred(null !== input.compilerOptions && $pred(undefined === input.compilerOptions || "object" === typeof input.compilerOptions && null !== input.compilerOptions && $ao[2](input.compilerOptions, path + ".compilerOptions", true && exceptionable), exceptionable, () => ({
|
|
72
85
|
path: path + ".compilerOptions",
|
|
73
|
-
expected: "(Resolve<
|
|
86
|
+
expected: "(Resolve<__type.o1> | undefined)",
|
|
87
|
+
value: input.compilerOptions
|
|
88
|
+
})), exceptionable, () => ({
|
|
89
|
+
path: path + ".compilerOptions",
|
|
90
|
+
expected: "(Resolve<__type.o1> | undefined)",
|
|
74
91
|
value: input.compilerOptions
|
|
75
92
|
})) && $pred(undefined === input.assert || "boolean" === typeof input.assert, exceptionable, () => ({
|
|
76
93
|
path: path + ".assert",
|
|
@@ -80,21 +97,25 @@ var NestiaConfig;
|
|
|
80
97
|
path: path + ".json",
|
|
81
98
|
expected: "(boolean | undefined)",
|
|
82
99
|
value: input.json
|
|
83
|
-
})) && $pred(null !== input.swagger && (undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger &&
|
|
100
|
+
})) && $pred(null !== input.swagger && $pred(undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger && $ao[4](input.swagger, path + ".swagger", true && exceptionable), exceptionable, () => ({
|
|
101
|
+
path: path + ".swagger",
|
|
102
|
+
expected: "(Resolve<IConfiguration.ISwagger> | undefined)",
|
|
103
|
+
value: input.swagger
|
|
104
|
+
})), exceptionable, () => ({
|
|
84
105
|
path: path + ".swagger",
|
|
85
106
|
expected: "(Resolve<IConfiguration.ISwagger> | undefined)",
|
|
86
107
|
value: input.swagger
|
|
87
108
|
})),
|
|
88
|
-
(input, path, exceptionable) => $pred(Array.isArray(input.include) && input.include.every((elem,
|
|
89
|
-
path: path + ".include[" +
|
|
109
|
+
(input, path, exceptionable) => $pred(Array.isArray(input.include) && input.include.every((elem, index7384897160724899) => $pred("string" === typeof elem, exceptionable, () => ({
|
|
110
|
+
path: path + ".include[" + index7384897160724899 + "]",
|
|
90
111
|
expected: "string",
|
|
91
112
|
value: elem
|
|
92
113
|
}))), exceptionable, () => ({
|
|
93
114
|
path: path + ".include",
|
|
94
115
|
expected: "Array<string>",
|
|
95
116
|
value: input.include
|
|
96
|
-
})) && $pred(undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every((elem,
|
|
97
|
-
path: path + ".exclude[" +
|
|
117
|
+
})) && $pred(undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every((elem, index4173984770585202) => $pred("string" === typeof elem, exceptionable, () => ({
|
|
118
|
+
path: path + ".exclude[" + index4173984770585202 + "]",
|
|
98
119
|
expected: "string",
|
|
99
120
|
value: elem
|
|
100
121
|
}))), exceptionable, () => ({
|
|
@@ -198,7 +219,7 @@ var NestiaConfig;
|
|
|
198
219
|
path: path + ".importHelpers",
|
|
199
220
|
expected: "(boolean | undefined)",
|
|
200
221
|
value: input.importHelpers
|
|
201
|
-
})) &&
|
|
222
|
+
})) && true && $pred(undefined === input.inlineSourceMap || "boolean" === typeof input.inlineSourceMap, exceptionable, () => ({
|
|
202
223
|
path: path + ".inlineSourceMap",
|
|
203
224
|
expected: "(boolean | undefined)",
|
|
204
225
|
value: input.inlineSourceMap
|
|
@@ -210,12 +231,12 @@ var NestiaConfig;
|
|
|
210
231
|
path: path + ".isolatedModules",
|
|
211
232
|
expected: "(boolean | undefined)",
|
|
212
233
|
value: input.isolatedModules
|
|
213
|
-
})) &&
|
|
234
|
+
})) && true && $pred(undefined === input.keyofStringsOnly || "boolean" === typeof input.keyofStringsOnly, exceptionable, () => ({
|
|
214
235
|
path: path + ".keyofStringsOnly",
|
|
215
236
|
expected: "(boolean | undefined)",
|
|
216
237
|
value: input.keyofStringsOnly
|
|
217
|
-
})) && $pred(undefined === input.lib || Array.isArray(input.lib) && input.lib.every((elem,
|
|
218
|
-
path: path + ".lib[" +
|
|
238
|
+
})) && $pred(undefined === input.lib || Array.isArray(input.lib) && input.lib.every((elem, index5078390044343328) => $pred("string" === typeof elem, exceptionable, () => ({
|
|
239
|
+
path: path + ".lib[" + index5078390044343328 + "]",
|
|
219
240
|
expected: "string",
|
|
220
241
|
value: elem
|
|
221
242
|
}))), exceptionable, () => ({
|
|
@@ -230,19 +251,15 @@ var NestiaConfig;
|
|
|
230
251
|
path: path + ".mapRoot",
|
|
231
252
|
expected: "(string | undefined)",
|
|
232
253
|
value: input.mapRoot
|
|
233
|
-
})) && $pred(undefined === input.
|
|
234
|
-
path: path + ".
|
|
235
|
-
expected: "(number | undefined)",
|
|
236
|
-
value: input.maxNodeModuleJsDepth
|
|
237
|
-
})) && (undefined === input.module || 0 === input.module || 1 === input.module || 2 === input.module || 3 === input.module || 4 === input.module || 5 === input.module || 6 === input.module || 7 === input.module || 99 === input.module || 100 === input.module || 199 === input.module) && (undefined === input.moduleResolution || 1 === input.moduleResolution || 2 === input.moduleResolution || 3 === input.moduleResolution || 99 === input.moduleResolution) && $pred(undefined === input.moduleSuffixes || Array.isArray(input.moduleSuffixes) && input.moduleSuffixes.every((elem, index7661589138254672) => $pred("string" === typeof elem, exceptionable, () => ({
|
|
238
|
-
path: path + ".moduleSuffixes[" + index7661589138254672 + "]",
|
|
254
|
+
})) && true && true && true && $pred(undefined === input.moduleSuffixes || Array.isArray(input.moduleSuffixes) && input.moduleSuffixes.every((elem, index03678189296966594) => $pred("string" === typeof elem, exceptionable, () => ({
|
|
255
|
+
path: path + ".moduleSuffixes[" + index03678189296966594 + "]",
|
|
239
256
|
expected: "string",
|
|
240
257
|
value: elem
|
|
241
258
|
}))), exceptionable, () => ({
|
|
242
259
|
path: path + ".moduleSuffixes",
|
|
243
260
|
expected: "(Array<string> | undefined)",
|
|
244
261
|
value: input.moduleSuffixes
|
|
245
|
-
})) &&
|
|
262
|
+
})) && true && true && $pred(undefined === input.noEmit || "boolean" === typeof input.noEmit, exceptionable, () => ({
|
|
246
263
|
path: path + ".noEmit",
|
|
247
264
|
expected: "(boolean | undefined)",
|
|
248
265
|
value: input.noEmit
|
|
@@ -322,7 +339,11 @@ var NestiaConfig;
|
|
|
322
339
|
path: path + ".outFile",
|
|
323
340
|
expected: "(string | undefined)",
|
|
324
341
|
value: input.outFile
|
|
325
|
-
})) && $pred(null !== input.paths && (undefined === input.paths || "object" === typeof input.paths && null !== input.paths &&
|
|
342
|
+
})) && $pred(null !== input.paths && $pred(undefined === input.paths || "object" === typeof input.paths && null !== input.paths && $ao[3](input.paths, path + ".paths", true && exceptionable), exceptionable, () => ({
|
|
343
|
+
path: path + ".paths",
|
|
344
|
+
expected: "(Resolve<ts.MapLike<Array<string>>> | undefined)",
|
|
345
|
+
value: input.paths
|
|
346
|
+
})), exceptionable, () => ({
|
|
326
347
|
path: path + ".paths",
|
|
327
348
|
expected: "(Resolve<ts.MapLike<Array<string>>> | undefined)",
|
|
328
349
|
value: input.paths
|
|
@@ -382,8 +403,8 @@ var NestiaConfig;
|
|
|
382
403
|
path: path + ".rootDir",
|
|
383
404
|
expected: "(string | undefined)",
|
|
384
405
|
value: input.rootDir
|
|
385
|
-
})) && $pred(undefined === input.rootDirs || Array.isArray(input.rootDirs) && input.rootDirs.every((elem,
|
|
386
|
-
path: path + ".rootDirs[" +
|
|
406
|
+
})) && $pred(undefined === input.rootDirs || Array.isArray(input.rootDirs) && input.rootDirs.every((elem, index12326295156772415) => $pred("string" === typeof elem, exceptionable, () => ({
|
|
407
|
+
path: path + ".rootDirs[" + index12326295156772415 + "]",
|
|
387
408
|
expected: "string",
|
|
388
409
|
value: elem
|
|
389
410
|
}))), exceptionable, () => ({
|
|
@@ -438,7 +459,7 @@ var NestiaConfig;
|
|
|
438
459
|
path: path + ".suppressImplicitAnyIndexErrors",
|
|
439
460
|
expected: "(boolean | undefined)",
|
|
440
461
|
value: input.suppressImplicitAnyIndexErrors
|
|
441
|
-
})) &&
|
|
462
|
+
})) && true && $pred(undefined === input.traceResolution || "boolean" === typeof input.traceResolution, exceptionable, () => ({
|
|
442
463
|
path: path + ".traceResolution",
|
|
443
464
|
expected: "(boolean | undefined)",
|
|
444
465
|
value: input.traceResolution
|
|
@@ -450,16 +471,16 @@ var NestiaConfig;
|
|
|
450
471
|
path: path + ".resolveJsonModule",
|
|
451
472
|
expected: "(boolean | undefined)",
|
|
452
473
|
value: input.resolveJsonModule
|
|
453
|
-
})) && $pred(undefined === input.types || Array.isArray(input.types) && input.types.every((elem,
|
|
454
|
-
path: path + ".types[" +
|
|
474
|
+
})) && $pred(undefined === input.types || Array.isArray(input.types) && input.types.every((elem, index9597464666391768) => $pred("string" === typeof elem, exceptionable, () => ({
|
|
475
|
+
path: path + ".types[" + index9597464666391768 + "]",
|
|
455
476
|
expected: "string",
|
|
456
477
|
value: elem
|
|
457
478
|
}))), exceptionable, () => ({
|
|
458
479
|
path: path + ".types",
|
|
459
480
|
expected: "(Array<string> | undefined)",
|
|
460
481
|
value: input.types
|
|
461
|
-
})) && $pred(undefined === input.typeRoots || Array.isArray(input.typeRoots) && input.typeRoots.every((elem,
|
|
462
|
-
path: path + ".typeRoots[" +
|
|
482
|
+
})) && $pred(undefined === input.typeRoots || Array.isArray(input.typeRoots) && input.typeRoots.every((elem, index4853841767136293) => $pred("string" === typeof elem, exceptionable, () => ({
|
|
483
|
+
path: path + ".typeRoots[" + index4853841767136293 + "]",
|
|
463
484
|
expected: "string",
|
|
464
485
|
value: elem
|
|
465
486
|
}))), exceptionable, () => ({
|
|
@@ -482,7 +503,7 @@ var NestiaConfig;
|
|
|
482
503
|
value: input.output
|
|
483
504
|
}))
|
|
484
505
|
];
|
|
485
|
-
return $pred(null !== input && $pred("object" === typeof input && null !== input &&
|
|
506
|
+
return $pred(null !== input && $pred("object" === typeof input && null !== input && $ao[0](input, path + "", true), true, () => ({
|
|
486
507
|
path: path + "",
|
|
487
508
|
expected: "Resolve<__type>",
|
|
488
509
|
value: input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaConfig.js","sourceRoot":"","sources":["../../../src/executable/internal/NestiaConfig.ts"],"names":[],"mappings":";;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAAC,0BAAS,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;IAC/C,CAAC,CAAA,CAAC,CAAC;AACP,CAAC,EA1BgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA0B5B"}
|
package/lib/executable/nestia.js
CHANGED
|
File without changes
|
|
@@ -35,12 +35,12 @@ class ImportDictionary {
|
|
|
35
35
|
.join("/");
|
|
36
36
|
const index = location.lastIndexOf(NODE_MODULES);
|
|
37
37
|
return index === -1
|
|
38
|
-
? location
|
|
38
|
+
? `./${location}`
|
|
39
39
|
: location.substring(index + NODE_MODULES.length);
|
|
40
40
|
})();
|
|
41
41
|
const realistic = it.second.first;
|
|
42
42
|
const instances = it.second.second.toJSON();
|
|
43
|
-
statements.push(`import ${!realistic ? "type " : ""}{ ${instances.join(", ")} } from "
|
|
43
|
+
statements.push(`import ${!realistic ? "type " : ""}{ ${instances.join(", ")} } from "${file}";`);
|
|
44
44
|
}
|
|
45
45
|
return statements.join("\n");
|
|
46
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportDictionary.js","sourceRoot":"","sources":["../../src/utils/ImportDictionary.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,oDAAiD;AACjD,oDAAiD;AACjD,4CAAyC;AA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AAW,cAAI;qBACxB,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC;qBAC1B,KAAK,CAAC,IAAI,CAAC;qBACX,IAAI,CAAC,GAAG,CAAC,CAAC;gBACf,MAAM,KAAK,GAAW,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;gBACzD,OAAO,KAAK,KAAK,CAAC,CAAC;oBACf,CAAC,CAAC,KAAK,QAAQ,EAAE;oBACjB,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;YAC1D,CAAC,CAAC,EAAE,CAAC;YACL,MAAM,SAAS,GAAY,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;YAC3C,MAAM,SAAS,GAAa,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAEtD,UAAU,CAAC,IAAI,CACX,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,SAAS,CAAC,IAAI,CAClD,IAAI,CACP,YAAY,IAAI,IAAI,CACxB,CAAC;SACL;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACJ;AAhDD,4CAgDC;AAED,MAAM,YAAY,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StripEnums.js","sourceRoot":"","sources":["../../src/utils/StripEnums.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestia",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"description": "Automatic SDK and Document generator for the NestJS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dev": "npm run build -- --watch",
|
|
13
13
|
"eslint": "eslint src",
|
|
14
14
|
"eslint:fix": "eslint src --fix",
|
|
15
|
-
"prettier": "prettier
|
|
15
|
+
"prettier": "prettier --write ./**/*.ts",
|
|
16
16
|
"test": "node lib/test"
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
@@ -37,12 +37,11 @@
|
|
|
37
37
|
"cli": "^1.0.1",
|
|
38
38
|
"del": "^6.0.0",
|
|
39
39
|
"glob": "^7.2.0",
|
|
40
|
-
"jsonc-simple-parser": "^2.2.1",
|
|
41
40
|
"nestia-fetcher": "^2.0.1",
|
|
42
41
|
"tgrid": "^0.8.6",
|
|
43
|
-
"ts-node": "10.8.x",
|
|
44
42
|
"tsconfig-paths": "^4.0.0",
|
|
45
|
-
"
|
|
43
|
+
"tsconfck": "^2.0.1",
|
|
44
|
+
"tstl": "^2.5.7"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
47
|
"@types/cli": "^0.11.19",
|
|
@@ -52,12 +51,13 @@
|
|
|
52
51
|
"@typescript-eslint/eslint-plugin": "^5.26.0",
|
|
53
52
|
"@typescript-eslint/parser": "^5.26.0",
|
|
54
53
|
"eslint": "^8.16.0",
|
|
55
|
-
"nestia-helper": "^3.0.
|
|
54
|
+
"nestia-helper": "^3.0.7",
|
|
56
55
|
"prettier": "^2.6.2",
|
|
57
56
|
"rimraf": "^3.0.2",
|
|
58
|
-
"
|
|
57
|
+
"ts-node": "10.8.x",
|
|
58
|
+
"ttypescript": "^1.5.13",
|
|
59
59
|
"typescript": "^4.7.4",
|
|
60
|
-
"typescript-json": "^3.
|
|
60
|
+
"typescript-json": "^3.1.1",
|
|
61
61
|
"typescript-transform-paths": "^3.3.1"
|
|
62
62
|
}
|
|
63
63
|
}
|