typescript-express-starter 7.0.0 → 8.1.2

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.
Files changed (203) hide show
  1. package/README.kr.md +12 -6
  2. package/README.md +12 -6
  3. package/lib/default/.env.development.local +13 -0
  4. package/lib/default/.env.production.local +13 -0
  5. package/lib/default/.env.test.local +13 -0
  6. package/lib/default/.swcrc +1 -0
  7. package/lib/default/package.json +2 -4
  8. package/lib/default/src/app.ts +6 -7
  9. package/lib/default/src/config/index.ts +5 -0
  10. package/lib/default/src/middlewares/auth.middleware.ts +2 -2
  11. package/lib/default/src/server.ts +0 -2
  12. package/lib/default/src/services/auth.service.ts +2 -2
  13. package/lib/default/src/utils/logger.ts +2 -2
  14. package/lib/default/tsconfig.json +1 -0
  15. package/lib/graphql/.env.development.local +20 -0
  16. package/lib/graphql/.env.production.local +20 -0
  17. package/lib/graphql/.env.test.local +20 -0
  18. package/lib/graphql/.swcrc +1 -0
  19. package/lib/graphql/package.json +2 -4
  20. package/lib/graphql/src/app.ts +7 -8
  21. package/lib/graphql/src/config/index.ts +5 -0
  22. package/lib/graphql/src/databases/index.ts +6 -8
  23. package/lib/graphql/src/middlewares/auth.middleware.ts +2 -2
  24. package/lib/graphql/src/repositories/auth.repository.ts +2 -2
  25. package/lib/graphql/src/server.ts +0 -3
  26. package/lib/graphql/src/utils/logger.ts +2 -2
  27. package/lib/graphql/tsconfig.json +1 -0
  28. package/lib/knex/.env.development.local +20 -0
  29. package/lib/knex/.env.production.local +20 -0
  30. package/lib/knex/.env.test.local +20 -0
  31. package/lib/knex/.swcrc +1 -0
  32. package/lib/knex/knexfile.ts +6 -10
  33. package/lib/knex/package.json +2 -4
  34. package/lib/knex/src/app.ts +6 -7
  35. package/lib/knex/src/config/index.ts +5 -0
  36. package/lib/knex/src/controllers/users.controller.ts +2 -2
  37. package/lib/knex/src/databases/index.ts +6 -8
  38. package/lib/knex/src/middlewares/auth.middleware.ts +2 -2
  39. package/lib/knex/src/server.ts +0 -2
  40. package/lib/knex/src/services/auth.service.ts +2 -2
  41. package/lib/knex/src/utils/logger.ts +2 -2
  42. package/lib/knex/tsconfig.json +1 -0
  43. package/lib/mongoose/.env.development.local +18 -0
  44. package/lib/mongoose/.env.production.local +18 -0
  45. package/lib/mongoose/.env.test.local +18 -0
  46. package/lib/mongoose/.swcrc +1 -0
  47. package/lib/mongoose/package.json +2 -4
  48. package/lib/mongoose/src/app.ts +6 -7
  49. package/lib/mongoose/src/config/index.ts +5 -0
  50. package/lib/mongoose/src/databases/index.ts +2 -5
  51. package/lib/mongoose/src/middlewares/auth.middleware.ts +2 -2
  52. package/lib/mongoose/src/server.ts +0 -2
  53. package/lib/mongoose/src/services/auth.service.ts +2 -2
  54. package/lib/mongoose/src/utils/logger.ts +2 -2
  55. package/lib/mongoose/tsconfig.json +1 -0
  56. package/lib/prisma/.env.development.local +16 -0
  57. package/lib/prisma/.env.production.local +16 -0
  58. package/lib/prisma/.env.test.local +16 -0
  59. package/lib/prisma/.swcrc +1 -0
  60. package/lib/prisma/package.json +2 -4
  61. package/lib/prisma/src/app.ts +6 -7
  62. package/lib/prisma/src/config/index.ts +5 -0
  63. package/lib/prisma/src/middlewares/auth.middleware.ts +2 -2
  64. package/lib/prisma/src/server.ts +0 -2
  65. package/lib/prisma/src/services/auth.service.ts +2 -2
  66. package/lib/prisma/src/utils/logger.ts +2 -2
  67. package/lib/prisma/tsconfig.json +1 -0
  68. package/lib/routing-controllers/.env.development.local +13 -0
  69. package/lib/routing-controllers/.env.production.local +13 -0
  70. package/lib/routing-controllers/.env.test.local +13 -0
  71. package/lib/routing-controllers/.swcrc +1 -0
  72. package/lib/routing-controllers/package.json +2 -4
  73. package/lib/routing-controllers/src/app.ts +7 -8
  74. package/lib/routing-controllers/src/config/index.ts +5 -0
  75. package/lib/routing-controllers/src/middlewares/auth.middleware.ts +2 -2
  76. package/lib/routing-controllers/src/server.ts +0 -2
  77. package/lib/routing-controllers/src/services/auth.service.ts +2 -2
  78. package/lib/routing-controllers/src/utils/logger.ts +2 -2
  79. package/lib/routing-controllers/tsconfig.json +1 -0
  80. package/lib/sequelize/.env.development.local +20 -0
  81. package/lib/sequelize/.env.production.local +20 -0
  82. package/lib/sequelize/.env.test.local +20 -0
  83. package/lib/sequelize/.swcrc +1 -0
  84. package/lib/sequelize/package.json +2 -4
  85. package/lib/sequelize/src/app.ts +6 -7
  86. package/lib/sequelize/src/config/index.ts +5 -0
  87. package/lib/sequelize/src/databases/index.ts +7 -8
  88. package/lib/sequelize/src/middlewares/auth.middleware.ts +2 -2
  89. package/lib/sequelize/src/server.ts +0 -2
  90. package/lib/sequelize/src/services/auth.service.ts +2 -2
  91. package/lib/sequelize/src/utils/logger.ts +2 -2
  92. package/lib/sequelize/tsconfig.json +1 -0
  93. package/lib/typegoose/.dockerignore +18 -0
  94. package/lib/typegoose/.editorconfig +9 -0
  95. package/lib/typegoose/.env.development.local +18 -0
  96. package/lib/typegoose/.env.production.local +18 -0
  97. package/lib/typegoose/.env.test.local +18 -0
  98. package/lib/typegoose/.eslintignore +1 -0
  99. package/lib/typegoose/.eslintrc +18 -0
  100. package/lib/typegoose/.huskyrc +5 -0
  101. package/lib/typegoose/.lintstagedrc.json +5 -0
  102. package/lib/typegoose/.prettierrc +8 -0
  103. package/lib/typegoose/.swcrc +40 -0
  104. package/lib/typegoose/.vscode/launch.json +35 -0
  105. package/lib/typegoose/.vscode/settings.json +6 -0
  106. package/lib/typegoose/Dockerfile +24 -0
  107. package/lib/typegoose/Makefile +6 -0
  108. package/lib/typegoose/docker-compose.yml +46 -0
  109. package/lib/typegoose/ecosystem.config.js +57 -0
  110. package/lib/typegoose/jest.config.js +12 -0
  111. package/lib/typegoose/nginx.conf +40 -0
  112. package/lib/typegoose/nodemon.json +12 -0
  113. package/lib/typegoose/package.json +80 -0
  114. package/lib/typegoose/src/app.ts +93 -0
  115. package/lib/typegoose/src/config/index.ts +5 -0
  116. package/lib/typegoose/src/controllers/auth.controller.ts +46 -0
  117. package/lib/typegoose/src/controllers/index.controller.ts +13 -0
  118. package/lib/typegoose/src/controllers/users.controller.ts +65 -0
  119. package/lib/typegoose/src/databases/index.ts +3 -0
  120. package/lib/typegoose/src/dtos/users.dto.ts +9 -0
  121. package/lib/typegoose/src/exceptions/HttpException.ts +10 -0
  122. package/lib/typegoose/src/http/auth.http +32 -0
  123. package/lib/typegoose/src/http/users.http +34 -0
  124. package/lib/typegoose/src/interfaces/auth.interface.ts +15 -0
  125. package/lib/typegoose/src/interfaces/routes.interface.ts +6 -0
  126. package/lib/typegoose/src/interfaces/users.interface.ts +5 -0
  127. package/lib/typegoose/src/middlewares/auth.middleware.ts +32 -0
  128. package/lib/typegoose/src/middlewares/error.middleware.ts +17 -0
  129. package/lib/typegoose/src/middlewares/validation.middleware.ts +25 -0
  130. package/lib/typegoose/src/models/users.model.ts +18 -0
  131. package/lib/typegoose/src/routes/auth.route.ts +24 -0
  132. package/lib/typegoose/src/routes/index.route.ts +19 -0
  133. package/lib/typegoose/src/routes/users.route.ts +25 -0
  134. package/lib/typegoose/src/server.ts +11 -0
  135. package/lib/typegoose/src/services/auth.service.ts +61 -0
  136. package/lib/typegoose/src/services/users.service.ts +64 -0
  137. package/lib/typegoose/src/tests/auth.test.ts +83 -0
  138. package/lib/typegoose/src/tests/index.test.ts +18 -0
  139. package/lib/typegoose/src/tests/users.test.ts +133 -0
  140. package/lib/typegoose/src/utils/logger.ts +65 -0
  141. package/lib/typegoose/src/utils/util.ts +19 -0
  142. package/lib/typegoose/src/utils/validateEnv.ts +10 -0
  143. package/lib/typegoose/swagger.yaml +122 -0
  144. package/lib/typegoose/tsconfig.json +40 -0
  145. package/lib/typeorm/.env.development.local +20 -0
  146. package/lib/typeorm/.env.production.local +20 -0
  147. package/lib/typeorm/.env.test.local +20 -0
  148. package/lib/typeorm/.swcrc +1 -0
  149. package/lib/typeorm/package.json +2 -4
  150. package/lib/typeorm/src/app.ts +6 -7
  151. package/lib/typeorm/src/config/index.ts +5 -0
  152. package/lib/typeorm/src/databases/index.ts +6 -8
  153. package/lib/typeorm/src/middlewares/auth.middleware.ts +2 -2
  154. package/lib/typeorm/src/server.ts +0 -2
  155. package/lib/typeorm/src/services/auth.service.ts +2 -2
  156. package/lib/typeorm/src/utils/logger.ts +2 -2
  157. package/lib/typeorm/tsconfig.json +1 -0
  158. package/package.json +2 -1
  159. package/lib/default/.env +0 -1
  160. package/lib/default/src/configs/development.json +0 -12
  161. package/lib/default/src/configs/production.json +0 -12
  162. package/lib/default/src/configs/test.json +0 -12
  163. package/lib/default/src/index.ts +0 -1
  164. package/lib/graphql/.env +0 -1
  165. package/lib/graphql/src/configs/development.json +0 -19
  166. package/lib/graphql/src/configs/production.json +0 -19
  167. package/lib/graphql/src/configs/test.json +0 -19
  168. package/lib/graphql/src/index.ts +0 -1
  169. package/lib/graphql/src/interfaces/db.interface.ts +0 -7
  170. package/lib/knex/.env +0 -1
  171. package/lib/knex/src/configs/development.json +0 -19
  172. package/lib/knex/src/configs/production.json +0 -19
  173. package/lib/knex/src/configs/test.json +0 -19
  174. package/lib/knex/src/index.ts +0 -1
  175. package/lib/knex/src/interfaces/db.interface.ts +0 -7
  176. package/lib/mongoose/.env +0 -1
  177. package/lib/mongoose/src/configs/development.json +0 -17
  178. package/lib/mongoose/src/configs/production.json +0 -17
  179. package/lib/mongoose/src/configs/test.json +0 -17
  180. package/lib/mongoose/src/index.ts +0 -1
  181. package/lib/mongoose/src/interfaces/db.interface.ts +0 -5
  182. package/lib/prisma/.env +0 -10
  183. package/lib/prisma/src/configs/development.json +0 -12
  184. package/lib/prisma/src/configs/production.json +0 -12
  185. package/lib/prisma/src/configs/test.json +0 -12
  186. package/lib/prisma/src/index.ts +0 -1
  187. package/lib/routing-controllers/.env +0 -1
  188. package/lib/routing-controllers/src/configs/development.json +0 -12
  189. package/lib/routing-controllers/src/configs/production.json +0 -12
  190. package/lib/routing-controllers/src/configs/test.json +0 -12
  191. package/lib/routing-controllers/src/index.ts +0 -1
  192. package/lib/sequelize/.env +0 -1
  193. package/lib/sequelize/src/configs/development.json +0 -22
  194. package/lib/sequelize/src/configs/production.json +0 -22
  195. package/lib/sequelize/src/configs/test.json +0 -22
  196. package/lib/sequelize/src/index.ts +0 -1
  197. package/lib/sequelize/src/interfaces/db.interface.ts +0 -10
  198. package/lib/typeorm/.env +0 -1
  199. package/lib/typeorm/src/configs/development.json +0 -18
  200. package/lib/typeorm/src/configs/production.json +0 -18
  201. package/lib/typeorm/src/configs/test.json +0 -18
  202. package/lib/typeorm/src/index.ts +0 -1
  203. package/lib/typeorm/src/interfaces/db.interface.ts +0 -6
@@ -1,17 +0,0 @@
1
- {
2
- "env": "test",
3
- "dbConfig": {
4
- "host": "localhost",
5
- "database": "test",
6
- "port": 27017
7
- },
8
- "secretKey": "secretKey",
9
- "log": {
10
- "format": "dev",
11
- "dir": "../logs"
12
- },
13
- "cors": {
14
- "origin": true,
15
- "credentials": true
16
- }
17
- }
@@ -1 +0,0 @@
1
- process.env['NODE_CONFIG_DIR'] = __dirname + '/configs';
@@ -1,5 +0,0 @@
1
- export interface dbConfig {
2
- host: string;
3
- port: number;
4
- database: string;
5
- }
package/lib/prisma/.env DELETED
@@ -1,10 +0,0 @@
1
- PORT=3000
2
-
3
- # This text is inserted by `prisma init`:
4
- # Environment variables declared in this file are automatically made available to Prisma.
5
- # See the documentation for more detail: https://pris.ly/d/prisma-schema#using-environment-variables
6
-
7
- # Prisma supports the native connection string format for PostgreSQL, MySQL and SQLite.
8
- # See the documentation for all the connection string options: https://pris.ly/d/connection-strings
9
-
10
- DATABASE_URL="mysql://root:password@localhost:3306/test"
@@ -1,12 +0,0 @@
1
- {
2
- "env": "development",
3
- "secretKey": "secretKey",
4
- "log": {
5
- "format": "dev",
6
- "dir": "../logs"
7
- },
8
- "cors": {
9
- "origin": true,
10
- "credentials": true
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- {
2
- "env": "production",
3
- "secretKey": "secretKey",
4
- "log": {
5
- "format": "combined",
6
- "dir": "../logs"
7
- },
8
- "cors": {
9
- "origin": "your.domain.com",
10
- "credentials": true
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- {
2
- "env": "test",
3
- "secretKey": "secretKey",
4
- "log": {
5
- "format": "dev",
6
- "dir": "../logs"
7
- },
8
- "cors": {
9
- "origin": true,
10
- "credentials": true
11
- }
12
- }
@@ -1 +0,0 @@
1
- process.env['NODE_CONFIG_DIR'] = __dirname + '/configs';
@@ -1 +0,0 @@
1
- PORT=3000
@@ -1,12 +0,0 @@
1
- {
2
- "env": "development",
3
- "secretKey": "secretKey",
4
- "log": {
5
- "format": "dev",
6
- "dir": "../logs"
7
- },
8
- "cors": {
9
- "origin": true,
10
- "credentials": true
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- {
2
- "env": "production",
3
- "secretKey": "secretKey",
4
- "log": {
5
- "format": "combined",
6
- "dir": "../logs"
7
- },
8
- "cors": {
9
- "origin": "your.domain.com",
10
- "credentials": true
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- {
2
- "env": "test",
3
- "secretKey": "secretKey",
4
- "log": {
5
- "format": "dev",
6
- "dir": "../logs"
7
- },
8
- "cors": {
9
- "origin": true,
10
- "credentials": true
11
- }
12
- }
@@ -1 +0,0 @@
1
- process.env['NODE_CONFIG_DIR'] = __dirname + '/configs';
@@ -1 +0,0 @@
1
- PORT=3000
@@ -1,22 +0,0 @@
1
- {
2
- "env": "development",
3
- "dbConfig": {
4
- "host": "localhost",
5
- "user": "root",
6
- "password": "password",
7
- "database": "test",
8
- "pool": {
9
- "min": 0,
10
- "max": 5
11
- }
12
- },
13
- "secretKey": "secretKey",
14
- "log": {
15
- "format": "dev",
16
- "dir": "../logs"
17
- },
18
- "cors": {
19
- "origin": true,
20
- "credentials": true
21
- }
22
- }
@@ -1,22 +0,0 @@
1
- {
2
- "env": "production",
3
- "dbConfig": {
4
- "host": "localhost",
5
- "user": "root",
6
- "password": "password",
7
- "database": "test",
8
- "pool": {
9
- "min": 0,
10
- "max": 5
11
- }
12
- },
13
- "secretKey": "secretKey",
14
- "log": {
15
- "format": "combined",
16
- "dir": "../logs"
17
- },
18
- "cors": {
19
- "origin": "your.domain.com",
20
- "credentials": true
21
- }
22
- }
@@ -1,22 +0,0 @@
1
- {
2
- "env": "test",
3
- "dbConfig": {
4
- "host": "localhost",
5
- "user": "root",
6
- "password": "password",
7
- "database": "test",
8
- "pool": {
9
- "min": 0,
10
- "max": 5
11
- }
12
- },
13
- "secretKey": "secretKey",
14
- "log": {
15
- "format": "dev",
16
- "dir": "../logs"
17
- },
18
- "cors": {
19
- "origin": true,
20
- "credentials": true
21
- }
22
- }
@@ -1 +0,0 @@
1
- process.env['NODE_CONFIG_DIR'] = __dirname + '/configs';
@@ -1,10 +0,0 @@
1
- export interface dbConfig {
2
- host: string;
3
- user: string;
4
- password: string;
5
- database: string;
6
- pool: {
7
- min: number;
8
- max: number;
9
- };
10
- }
package/lib/typeorm/.env DELETED
@@ -1 +0,0 @@
1
- PORT=3000
@@ -1,18 +0,0 @@
1
- {
2
- "env": "development",
3
- "dbConfig": {
4
- "host": "localhost",
5
- "user": "root",
6
- "password": "password",
7
- "database": "test"
8
- },
9
- "secretKey": "secretKey",
10
- "log": {
11
- "format": "dev",
12
- "dir": "../logs"
13
- },
14
- "cors": {
15
- "origin": true,
16
- "credentials": true
17
- }
18
- }
@@ -1,18 +0,0 @@
1
- {
2
- "env": "production",
3
- "dbConfig": {
4
- "host": "localhost",
5
- "user": "root",
6
- "password": "password",
7
- "database": "test"
8
- },
9
- "secretKey": "secretKey",
10
- "log": {
11
- "format": "combined",
12
- "dir": "../logs"
13
- },
14
- "cors": {
15
- "origin": "your.domain.com",
16
- "credentials": true
17
- }
18
- }
@@ -1,18 +0,0 @@
1
- {
2
- "env": "test",
3
- "dbConfig": {
4
- "host": "localhost",
5
- "user": "root",
6
- "password": "password",
7
- "database": "test"
8
- },
9
- "secretKey": "secretKey",
10
- "log": {
11
- "format": "dev",
12
- "dir": "../logs"
13
- },
14
- "cors": {
15
- "origin": true,
16
- "credentials": true
17
- }
18
- }
@@ -1 +0,0 @@
1
- process.env['NODE_CONFIG_DIR'] = __dirname + '/configs';
@@ -1,6 +0,0 @@
1
- export interface dbConfig {
2
- host: string;
3
- user: string;
4
- password: string;
5
- database: string;
6
- }