very-express 0.0.1

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/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 justin26l
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # VeryExpress
2
+ an generator that generate [Express](https://github.com/expressjs/express) rest-api app based on [jsonSchema](https://github.com/json-schema-org) and [openApi](https://github.com/OAI)
3
+
4
+ ## tech stack
5
+ - TypeScript
6
+ - ExpressJs
7
+ - mongoDb
8
+
9
+ ## TO DO
10
+ - [ ] genarate express server from template
11
+
12
+ - [x] generate openapi
13
+ - [x] path
14
+ - [x] param
15
+ - [x] response
16
+
17
+ - [x] generate mongoose & collection interface
18
+ - [ ] generate sql interface
19
+
20
+ - [ ] genarate controllers from template
21
+ - [ ] based on openapi spec
22
+
23
+ - [ ] genarate routes from template
24
+ - [ ] based on controller
25
+
26
+ ## Dependencies
27
+ - [express](https://github.com/expressjs/express)
28
+ - [json2mongoose](https://github.com/Justin26l/json2mongoose)
29
+ - [js-yaml](https://github.com/nodeca/js-yaml)
@@ -0,0 +1,928 @@
1
+ openapi: 3.0.0
2
+ info:
3
+ title: veryExpress generated api server
4
+ description: OpenApi Spec generated by veryExpress
5
+ version: 1.0.0
6
+ paths:
7
+ /user:
8
+ summary: User
9
+ get:
10
+ summary: User
11
+ operationId: getUser
12
+ tags:
13
+ - user
14
+ parameters:
15
+ - name: name
16
+ in: query
17
+ schema:
18
+ type: string
19
+ maxLength: 64
20
+ - name: userContact
21
+ in: query
22
+ schema:
23
+ type: string
24
+ format: uuid
25
+ - name: married
26
+ in: query
27
+ schema:
28
+ type: string
29
+ enum:
30
+ - single
31
+ - inRelationship
32
+ - married
33
+ - name: isActive
34
+ in: query
35
+ schema:
36
+ type: boolean
37
+ responses:
38
+ '200':
39
+ description: OK
40
+ content:
41
+ application/json:
42
+ schema:
43
+ $ref: '#/components/schemas/getUserResponse'
44
+ '400':
45
+ description: Bad Request
46
+ '401':
47
+ description: Unauthorized
48
+ '403':
49
+ description: Forbidden
50
+ '404':
51
+ description: Not Found
52
+ '405':
53
+ description: Method Not Allowed
54
+ '413':
55
+ description: Payload Too Large
56
+ '429':
57
+ description: Too Many Requests
58
+ '500':
59
+ description: Internal Server Error
60
+ '502':
61
+ description: Bad Gateway
62
+ '503':
63
+ description: Service Unavailable
64
+ post:
65
+ summary: User
66
+ operationId: postUser
67
+ tags:
68
+ - user
69
+ parameters: []
70
+ requestBody:
71
+ description: post user
72
+ required: false
73
+ content:
74
+ application/json:
75
+ schema:
76
+ $ref: '#/components/schemas/postUserBody'
77
+ responses:
78
+ '201':
79
+ description: Crerated
80
+ content:
81
+ application/json:
82
+ schema:
83
+ $ref: '#/components/schemas/postUserResponse'
84
+ '400':
85
+ description: Bad Request
86
+ '401':
87
+ description: Unauthorized
88
+ '403':
89
+ description: Forbidden
90
+ '404':
91
+ description: Not Found
92
+ '405':
93
+ description: Method Not Allowed
94
+ '413':
95
+ description: Payload Too Large
96
+ '429':
97
+ description: Too Many Requests
98
+ '500':
99
+ description: Internal Server Error
100
+ '502':
101
+ description: Bad Gateway
102
+ '503':
103
+ description: Service Unavailable
104
+ /user/{id}:
105
+ summary: User
106
+ get:
107
+ summary: User
108
+ operationId: getUser
109
+ tags:
110
+ - user
111
+ parameters:
112
+ - name: name
113
+ in: query
114
+ schema:
115
+ type: string
116
+ maxLength: 64
117
+ - name: userContact
118
+ in: query
119
+ schema:
120
+ type: string
121
+ format: uuid
122
+ - name: married
123
+ in: query
124
+ schema:
125
+ type: string
126
+ enum:
127
+ - single
128
+ - inRelationship
129
+ - married
130
+ - name: isActive
131
+ in: query
132
+ schema:
133
+ type: boolean
134
+ responses:
135
+ '200':
136
+ description: OK
137
+ content:
138
+ application/json:
139
+ schema:
140
+ $ref: '#/components/schemas/getUserResponse'
141
+ '400':
142
+ description: Bad Request
143
+ '401':
144
+ description: Unauthorized
145
+ '403':
146
+ description: Forbidden
147
+ '404':
148
+ description: Not Found
149
+ '405':
150
+ description: Method Not Allowed
151
+ '413':
152
+ description: Payload Too Large
153
+ '429':
154
+ description: Too Many Requests
155
+ '500':
156
+ description: Internal Server Error
157
+ '502':
158
+ description: Bad Gateway
159
+ '503':
160
+ description: Service Unavailable
161
+ put:
162
+ summary: User
163
+ operationId: putUser
164
+ tags:
165
+ - user
166
+ parameters:
167
+ - name: id
168
+ in: path
169
+ required: true
170
+ schema:
171
+ type: string
172
+ format: uuid
173
+ requestBody:
174
+ description: put user
175
+ required: false
176
+ content:
177
+ application/json:
178
+ schema:
179
+ $ref: '#/components/schemas/putUserBody'
180
+ responses:
181
+ '200':
182
+ description: OK
183
+ content:
184
+ application/json:
185
+ schema:
186
+ $ref: '#/components/schemas/putUserResponse'
187
+ '400':
188
+ description: Bad Request
189
+ '401':
190
+ description: Unauthorized
191
+ '403':
192
+ description: Forbidden
193
+ '404':
194
+ description: Not Found
195
+ '405':
196
+ description: Method Not Allowed
197
+ '413':
198
+ description: Payload Too Large
199
+ '429':
200
+ description: Too Many Requests
201
+ '500':
202
+ description: Internal Server Error
203
+ '502':
204
+ description: Bad Gateway
205
+ '503':
206
+ description: Service Unavailable
207
+ patch:
208
+ summary: User
209
+ operationId: patchUser
210
+ tags:
211
+ - user
212
+ parameters:
213
+ - name: id
214
+ in: path
215
+ required: true
216
+ schema:
217
+ type: string
218
+ format: uuid
219
+ requestBody:
220
+ description: patch user
221
+ required: false
222
+ content:
223
+ application/json:
224
+ schema:
225
+ $ref: '#/components/schemas/patchUserBody'
226
+ responses:
227
+ '200':
228
+ description: OK
229
+ content:
230
+ application/json:
231
+ schema:
232
+ $ref: '#/components/schemas/patchUserResponse'
233
+ '400':
234
+ description: Bad Request
235
+ '401':
236
+ description: Unauthorized
237
+ '403':
238
+ description: Forbidden
239
+ '404':
240
+ description: Not Found
241
+ '405':
242
+ description: Method Not Allowed
243
+ '413':
244
+ description: Payload Too Large
245
+ '429':
246
+ description: Too Many Requests
247
+ '500':
248
+ description: Internal Server Error
249
+ '502':
250
+ description: Bad Gateway
251
+ '503':
252
+ description: Service Unavailable
253
+ delete:
254
+ summary: User
255
+ operationId: deleteUser
256
+ tags:
257
+ - user
258
+ parameters:
259
+ - name: id
260
+ in: path
261
+ required: true
262
+ schema:
263
+ type: string
264
+ format: uuid
265
+ responses:
266
+ '200':
267
+ description: OK
268
+ '400':
269
+ description: Bad Request
270
+ '401':
271
+ description: Unauthorized
272
+ '403':
273
+ description: Forbidden
274
+ '404':
275
+ description: Not Found
276
+ '405':
277
+ description: Method Not Allowed
278
+ '413':
279
+ description: Payload Too Large
280
+ '429':
281
+ description: Too Many Requests
282
+ '500':
283
+ description: Internal Server Error
284
+ '502':
285
+ description: Bad Gateway
286
+ '503':
287
+ description: Service Unavailable
288
+ /usercontact:
289
+ summary: UserContact
290
+ get:
291
+ summary: UserContact
292
+ operationId: getUserContact
293
+ tags:
294
+ - usercontact
295
+ parameters:
296
+ - name: phoneNo
297
+ in: query
298
+ schema:
299
+ type: string
300
+ - name: isActive
301
+ in: query
302
+ schema:
303
+ type: boolean
304
+ responses:
305
+ '200':
306
+ description: OK
307
+ content:
308
+ application/json:
309
+ schema:
310
+ $ref: '#/components/schemas/getUserContactResponse'
311
+ '400':
312
+ description: Bad Request
313
+ '401':
314
+ description: Unauthorized
315
+ '403':
316
+ description: Forbidden
317
+ '404':
318
+ description: Not Found
319
+ '405':
320
+ description: Method Not Allowed
321
+ '413':
322
+ description: Payload Too Large
323
+ '429':
324
+ description: Too Many Requests
325
+ '500':
326
+ description: Internal Server Error
327
+ '502':
328
+ description: Bad Gateway
329
+ '503':
330
+ description: Service Unavailable
331
+ post:
332
+ summary: UserContact
333
+ operationId: postUserContact
334
+ tags:
335
+ - usercontact
336
+ parameters: []
337
+ requestBody:
338
+ description: post usercontact
339
+ required: false
340
+ content:
341
+ application/json:
342
+ schema:
343
+ $ref: '#/components/schemas/postUserContactBody'
344
+ responses:
345
+ '201':
346
+ description: Crerated
347
+ content:
348
+ application/json:
349
+ schema:
350
+ $ref: '#/components/schemas/postUserContactResponse'
351
+ '400':
352
+ description: Bad Request
353
+ '401':
354
+ description: Unauthorized
355
+ '403':
356
+ description: Forbidden
357
+ '404':
358
+ description: Not Found
359
+ '405':
360
+ description: Method Not Allowed
361
+ '413':
362
+ description: Payload Too Large
363
+ '429':
364
+ description: Too Many Requests
365
+ '500':
366
+ description: Internal Server Error
367
+ '502':
368
+ description: Bad Gateway
369
+ '503':
370
+ description: Service Unavailable
371
+ /usercontact/{id}:
372
+ summary: UserContact
373
+ get:
374
+ summary: UserContact
375
+ operationId: getUserContact
376
+ tags:
377
+ - usercontact
378
+ parameters:
379
+ - name: phoneNo
380
+ in: query
381
+ schema:
382
+ type: string
383
+ - name: isActive
384
+ in: query
385
+ schema:
386
+ type: boolean
387
+ responses:
388
+ '200':
389
+ description: OK
390
+ content:
391
+ application/json:
392
+ schema:
393
+ $ref: '#/components/schemas/getUserContactResponse'
394
+ '400':
395
+ description: Bad Request
396
+ '401':
397
+ description: Unauthorized
398
+ '403':
399
+ description: Forbidden
400
+ '404':
401
+ description: Not Found
402
+ '405':
403
+ description: Method Not Allowed
404
+ '413':
405
+ description: Payload Too Large
406
+ '429':
407
+ description: Too Many Requests
408
+ '500':
409
+ description: Internal Server Error
410
+ '502':
411
+ description: Bad Gateway
412
+ '503':
413
+ description: Service Unavailable
414
+ put:
415
+ summary: UserContact
416
+ operationId: putUserContact
417
+ tags:
418
+ - usercontact
419
+ parameters:
420
+ - name: id
421
+ in: path
422
+ required: true
423
+ schema:
424
+ type: string
425
+ format: uuid
426
+ requestBody:
427
+ description: put usercontact
428
+ required: false
429
+ content:
430
+ application/json:
431
+ schema:
432
+ $ref: '#/components/schemas/putUserContactBody'
433
+ responses:
434
+ '200':
435
+ description: OK
436
+ content:
437
+ application/json:
438
+ schema:
439
+ $ref: '#/components/schemas/putUserContactResponse'
440
+ '400':
441
+ description: Bad Request
442
+ '401':
443
+ description: Unauthorized
444
+ '403':
445
+ description: Forbidden
446
+ '404':
447
+ description: Not Found
448
+ '405':
449
+ description: Method Not Allowed
450
+ '413':
451
+ description: Payload Too Large
452
+ '429':
453
+ description: Too Many Requests
454
+ '500':
455
+ description: Internal Server Error
456
+ '502':
457
+ description: Bad Gateway
458
+ '503':
459
+ description: Service Unavailable
460
+ patch:
461
+ summary: UserContact
462
+ operationId: patchUserContact
463
+ tags:
464
+ - usercontact
465
+ parameters:
466
+ - name: id
467
+ in: path
468
+ required: true
469
+ schema:
470
+ type: string
471
+ format: uuid
472
+ requestBody:
473
+ description: patch usercontact
474
+ required: false
475
+ content:
476
+ application/json:
477
+ schema:
478
+ $ref: '#/components/schemas/patchUserContactBody'
479
+ responses:
480
+ '200':
481
+ description: OK
482
+ content:
483
+ application/json:
484
+ schema:
485
+ $ref: '#/components/schemas/patchUserContactResponse'
486
+ '400':
487
+ description: Bad Request
488
+ '401':
489
+ description: Unauthorized
490
+ '403':
491
+ description: Forbidden
492
+ '404':
493
+ description: Not Found
494
+ '405':
495
+ description: Method Not Allowed
496
+ '413':
497
+ description: Payload Too Large
498
+ '429':
499
+ description: Too Many Requests
500
+ '500':
501
+ description: Internal Server Error
502
+ '502':
503
+ description: Bad Gateway
504
+ '503':
505
+ description: Service Unavailable
506
+ delete:
507
+ summary: UserContact
508
+ operationId: deleteUserContact
509
+ tags:
510
+ - usercontact
511
+ parameters:
512
+ - name: id
513
+ in: path
514
+ required: true
515
+ schema:
516
+ type: string
517
+ format: uuid
518
+ responses:
519
+ '200':
520
+ description: OK
521
+ '400':
522
+ description: Bad Request
523
+ '401':
524
+ description: Unauthorized
525
+ '403':
526
+ description: Forbidden
527
+ '404':
528
+ description: Not Found
529
+ '405':
530
+ description: Method Not Allowed
531
+ '413':
532
+ description: Payload Too Large
533
+ '429':
534
+ description: Too Many Requests
535
+ '500':
536
+ description: Internal Server Error
537
+ '502':
538
+ description: Bad Gateway
539
+ '503':
540
+ description: Service Unavailable
541
+ components:
542
+ schemas:
543
+ getUserResponse:
544
+ type: object
545
+ properties:
546
+ _id:
547
+ type: string
548
+ format: uuid
549
+ name:
550
+ type: string
551
+ maxLength: 64
552
+ userContact:
553
+ type: string
554
+ format: uuid
555
+ married:
556
+ type: string
557
+ enum:
558
+ - single
559
+ - inRelationship
560
+ - married
561
+ userAddress:
562
+ type: object
563
+ properties:
564
+ line1:
565
+ type: string
566
+ line2:
567
+ type: string
568
+ city:
569
+ type: string
570
+ state:
571
+ type: string
572
+ country:
573
+ type: string
574
+ enum:
575
+ - Option1
576
+ - Option2
577
+ - Option3
578
+ zip:
579
+ type: string
580
+ isActive:
581
+ type: boolean
582
+ getUserResponseList:
583
+ type: array
584
+ items:
585
+ type: object
586
+ properties:
587
+ _id:
588
+ type: string
589
+ format: uuid
590
+ name:
591
+ type: string
592
+ maxLength: 64
593
+ userContact:
594
+ type: string
595
+ format: uuid
596
+ married:
597
+ type: string
598
+ enum:
599
+ - single
600
+ - inRelationship
601
+ - married
602
+ userAddress:
603
+ type: object
604
+ properties:
605
+ line1:
606
+ type: string
607
+ line2:
608
+ type: string
609
+ city:
610
+ type: string
611
+ state:
612
+ type: string
613
+ country:
614
+ type: string
615
+ enum:
616
+ - Option1
617
+ - Option2
618
+ - Option3
619
+ zip:
620
+ type: string
621
+ isActive:
622
+ type: boolean
623
+ postUserBody:
624
+ type: object
625
+ properties:
626
+ name:
627
+ type: string
628
+ maxLength: 64
629
+ userContact:
630
+ type: string
631
+ format: uuid
632
+ married:
633
+ type: string
634
+ enum:
635
+ - single
636
+ - inRelationship
637
+ - married
638
+ userAddress:
639
+ type: object
640
+ properties:
641
+ line1:
642
+ type: string
643
+ line2:
644
+ type: string
645
+ city:
646
+ type: string
647
+ state:
648
+ type: string
649
+ country:
650
+ type: string
651
+ enum:
652
+ - Option1
653
+ - Option2
654
+ - Option3
655
+ zip:
656
+ type: string
657
+ isActive:
658
+ type: boolean
659
+ postUserResponse:
660
+ type: object
661
+ properties:
662
+ _id:
663
+ type: string
664
+ format: uuid
665
+ name:
666
+ type: string
667
+ maxLength: 64
668
+ userContact:
669
+ type: string
670
+ format: uuid
671
+ married:
672
+ type: string
673
+ enum:
674
+ - single
675
+ - inRelationship
676
+ - married
677
+ userAddress:
678
+ type: object
679
+ properties:
680
+ line1:
681
+ type: string
682
+ line2:
683
+ type: string
684
+ city:
685
+ type: string
686
+ state:
687
+ type: string
688
+ country:
689
+ type: string
690
+ enum:
691
+ - Option1
692
+ - Option2
693
+ - Option3
694
+ zip:
695
+ type: string
696
+ isActive:
697
+ type: boolean
698
+ putUserBody:
699
+ type: object
700
+ properties:
701
+ name:
702
+ type: string
703
+ maxLength: 64
704
+ userContact:
705
+ type: string
706
+ format: uuid
707
+ married:
708
+ type: string
709
+ enum:
710
+ - single
711
+ - inRelationship
712
+ - married
713
+ userAddress:
714
+ type: object
715
+ properties:
716
+ line1:
717
+ type: string
718
+ line2:
719
+ type: string
720
+ city:
721
+ type: string
722
+ state:
723
+ type: string
724
+ country:
725
+ type: string
726
+ enum:
727
+ - Option1
728
+ - Option2
729
+ - Option3
730
+ zip:
731
+ type: string
732
+ isActive:
733
+ type: boolean
734
+ putUserResponse:
735
+ type: object
736
+ properties:
737
+ _id:
738
+ type: string
739
+ format: uuid
740
+ name:
741
+ type: string
742
+ maxLength: 64
743
+ userContact:
744
+ type: string
745
+ format: uuid
746
+ married:
747
+ type: string
748
+ enum:
749
+ - single
750
+ - inRelationship
751
+ - married
752
+ userAddress:
753
+ type: object
754
+ properties:
755
+ line1:
756
+ type: string
757
+ line2:
758
+ type: string
759
+ city:
760
+ type: string
761
+ state:
762
+ type: string
763
+ country:
764
+ type: string
765
+ enum:
766
+ - Option1
767
+ - Option2
768
+ - Option3
769
+ zip:
770
+ type: string
771
+ isActive:
772
+ type: boolean
773
+ patchUserBody:
774
+ type: object
775
+ properties:
776
+ name:
777
+ type: string
778
+ maxLength: 64
779
+ userContact:
780
+ type: string
781
+ format: uuid
782
+ married:
783
+ type: string
784
+ enum:
785
+ - single
786
+ - inRelationship
787
+ - married
788
+ userAddress:
789
+ type: object
790
+ properties:
791
+ line1:
792
+ type: string
793
+ line2:
794
+ type: string
795
+ city:
796
+ type: string
797
+ state:
798
+ type: string
799
+ country:
800
+ type: string
801
+ enum:
802
+ - Option1
803
+ - Option2
804
+ - Option3
805
+ zip:
806
+ type: string
807
+ isActive:
808
+ type: boolean
809
+ patchUserResponse:
810
+ type: object
811
+ properties:
812
+ _id:
813
+ type: string
814
+ format: uuid
815
+ name:
816
+ type: string
817
+ maxLength: 64
818
+ userContact:
819
+ type: string
820
+ format: uuid
821
+ married:
822
+ type: string
823
+ enum:
824
+ - single
825
+ - inRelationship
826
+ - married
827
+ userAddress:
828
+ type: object
829
+ properties:
830
+ line1:
831
+ type: string
832
+ line2:
833
+ type: string
834
+ city:
835
+ type: string
836
+ state:
837
+ type: string
838
+ country:
839
+ type: string
840
+ enum:
841
+ - Option1
842
+ - Option2
843
+ - Option3
844
+ zip:
845
+ type: string
846
+ isActive:
847
+ type: boolean
848
+ getUserContactResponse:
849
+ type: object
850
+ properties:
851
+ _id:
852
+ type: string
853
+ format: uuid
854
+ phoneNo:
855
+ type: string
856
+ isActive:
857
+ type: boolean
858
+ default: true
859
+ getUserContactResponseList:
860
+ type: array
861
+ items:
862
+ type: object
863
+ properties:
864
+ _id:
865
+ type: string
866
+ format: uuid
867
+ phoneNo:
868
+ type: string
869
+ isActive:
870
+ type: boolean
871
+ default: true
872
+ postUserContactBody:
873
+ type: object
874
+ properties:
875
+ phoneNo:
876
+ type: string
877
+ isActive:
878
+ type: boolean
879
+ default: true
880
+ postUserContactResponse:
881
+ type: object
882
+ properties:
883
+ _id:
884
+ type: string
885
+ format: uuid
886
+ phoneNo:
887
+ type: string
888
+ isActive:
889
+ type: boolean
890
+ default: true
891
+ putUserContactBody:
892
+ type: object
893
+ properties:
894
+ phoneNo:
895
+ type: string
896
+ isActive:
897
+ type: boolean
898
+ default: true
899
+ putUserContactResponse:
900
+ type: object
901
+ properties:
902
+ _id:
903
+ type: string
904
+ format: uuid
905
+ phoneNo:
906
+ type: string
907
+ isActive:
908
+ type: boolean
909
+ default: true
910
+ patchUserContactBody:
911
+ type: object
912
+ properties:
913
+ phoneNo:
914
+ type: string
915
+ isActive:
916
+ type: boolean
917
+ default: true
918
+ patchUserContactResponse:
919
+ type: object
920
+ properties:
921
+ _id:
922
+ type: string
923
+ format: uuid
924
+ phoneNo:
925
+ type: string
926
+ isActive:
927
+ type: boolean
928
+ default: true
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "very-express",
3
+ "version": "0.0.1",
4
+ "description": "based on json schema and openapi, generate Express RestApi server with mongoDb ",
5
+ "author": "justin26l",
6
+ "license": "MIT",
7
+ "main": "index.js",
8
+
9
+ "bin": {
10
+ "vex": "./dist/cli.js"
11
+ },
12
+ "scripts": {
13
+ "build": "tsc -p .",
14
+ "dev": "ts-node ./src/cli.ts",
15
+ "prod": "node ./dist/cli.js",
16
+ "test": "echo \"Error: no test specified\" && exit 1"
17
+ },
18
+ "keywords": [
19
+ "jsonSchema",
20
+ "express",
21
+ "RestApi",
22
+ "mongoDb",
23
+ "mongoose",
24
+ "json2mongoose"
25
+ ],
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/Justin26l/json2mongoose.git"
29
+ },
30
+ "dependencies": {
31
+ "@types/express": "^4.17.21",
32
+ "@types/js-yaml": "^4.0.9",
33
+ "@types/swagger-ui-express": "^4.1.6",
34
+ "express": "^4.18.2",
35
+ "express-validator": "^7.0.1",
36
+ "helmet": "^7.1.0",
37
+ "js-yaml": "^4.1.0",
38
+ "swagger-ui-express": "^5.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/express": "^4.17.21",
42
+ "@types/js-yaml": "^4.0.9",
43
+ "@types/swagger-ui-express": "^4.1.6",
44
+ "dotenv": "^16.3.1",
45
+ "express": "^4.18.2",
46
+ "express-validator": "^7.0.1",
47
+ "helmet": "^7.1.0",
48
+ "js-yaml": "^4.1.0",
49
+ "json-schema-to-openapi-schema": "^0.4.0",
50
+ "json2mongoose": "^0.1.5",
51
+ "swagger-ui-express": "^5.0.0",
52
+ "ts-node": "^10.9.1",
53
+ "typescript": "^5.3.2"
54
+ }
55
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,116 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
+
27
+ /* Modules */
28
+ "module": "commonjs", /* Specify what module code is generated. */
29
+ // "rootDir": "./", /* Specify the root folder within your source files. */
30
+ "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
+ "typeRoots": ["./node_modules/@types", "./src/types"], /* Specify multiple folders that act like './node_modules/@types'. */
35
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
39
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
40
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
41
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
42
+ // "resolveJsonModule": true, /* Enable importing .json files. */
43
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
44
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
45
+
46
+ /* JavaScript Support */
47
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
48
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
49
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
50
+
51
+ /* Emit */
52
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
53
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
54
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
55
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
56
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
57
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58
+ "outDir": "./dist", /* Specify an output folder for all emitted files. */
59
+ "removeComments": true, /* Disable emitting comments. */
60
+ // "noEmit": true, /* Disable emitting files from a compilation. */
61
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
64
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
65
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
66
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
67
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
68
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
69
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
70
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
73
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
74
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
75
+
76
+ /* Interop Constraints */
77
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
78
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
79
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
80
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
81
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
82
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
83
+
84
+ /* Type Checking */
85
+ "strict": true, /* Enable all strict type-checking options. */
86
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
87
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
91
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
100
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
101
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
103
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
104
+
105
+ /* Completeness */
106
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
+ },
109
+ "include": [
110
+ "src/**/*.ts"
111
+ , "src/generators/routes.generator.ts" ],
112
+ "exclude": [
113
+ "node_modules",
114
+ "output"
115
+ ]
116
+ }