very-express 0.9.0 → 0.10.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/.tmp/als-proof.mjs +15 -0
- package/.tmp/als-proof2.mjs +9 -0
- package/.tmp/gen/out/.env +41 -0
- package/.tmp/gen/out/.vex/meta.json +387 -0
- package/.tmp/gen/out/Dockerfile +20 -0
- package/.tmp/gen/out/README.md +39 -0
- package/.tmp/gen/out/package.json +51 -0
- package/.tmp/gen/out/public/css/style.css +8 -0
- package/.tmp/gen/out/public/js/deleteaccount.js +80 -0
- package/.tmp/gen/out/public/js/login.js +59 -0
- package/.tmp/gen/out/public/js/logincallback.js +19 -0
- package/.tmp/gen/out/public/js/mytokens.js +11 -0
- package/.tmp/gen/out/public/js/refreshtokens.js +23 -0
- package/.tmp/gen/out/scripts/build.js +39 -0
- package/.tmp/gen/out/scripts/oacg-fix.js +83 -0
- package/.tmp/gen/out/tsconfig.json +30 -0
- package/.tmp/gen/out/tsoa.json +32 -0
- package/.tmp/gen/schemas/Project.json +50 -0
- package/.tmp/gen/schemas/Session.json +49 -0
- package/.tmp/gen/schemas/User.json +81 -0
- package/.tmp/gen/schemas/UserAuthProfiles.json +54 -0
- package/.tmp/gen/schemas/UserRole.json +40 -0
- package/.tmp/gen/schemas/UserTenant.json +39 -0
- package/.tmp/gen/vex.config.json +39 -0
- package/.tmp/gen0/out/.env +41 -0
- package/.tmp/gen0/out/.vex/meta.json +323 -0
- package/.tmp/gen0/out/Dockerfile +20 -0
- package/.tmp/gen0/out/README.md +39 -0
- package/.tmp/gen0/out/package.json +51 -0
- package/.tmp/gen0/out/public/css/style.css +8 -0
- package/.tmp/gen0/out/public/js/deleteaccount.js +80 -0
- package/.tmp/gen0/out/public/js/login.js +59 -0
- package/.tmp/gen0/out/public/js/logincallback.js +19 -0
- package/.tmp/gen0/out/public/js/mytokens.js +11 -0
- package/.tmp/gen0/out/public/js/refreshtokens.js +23 -0
- package/.tmp/gen0/out/scripts/build.js +39 -0
- package/.tmp/gen0/out/scripts/oacg-fix.js +83 -0
- package/.tmp/gen0/out/tsconfig.json +30 -0
- package/.tmp/gen0/out/tsoa.json +32 -0
- package/.tmp/gen0/schemas/Session.json +49 -0
- package/.tmp/gen0/schemas/User.json +81 -0
- package/.tmp/gen0/schemas/UserAuthProfiles.json +54 -0
- package/.tmp/gen0/schemas/UserRole.json +38 -0
- package/.tmp/gen0/vex.config.json +32 -0
- package/.tmp/gend/out/.env +41 -0
- package/.tmp/gend/out/.vex/meta.json +317 -0
- package/.tmp/gend/out/Dockerfile +20 -0
- package/.tmp/gend/out/README.md +39 -0
- package/.tmp/gend/out/package.json +51 -0
- package/.tmp/gend/out/public/css/style.css +8 -0
- package/.tmp/gend/out/public/js/deleteaccount.js +80 -0
- package/.tmp/gend/out/public/js/login.js +59 -0
- package/.tmp/gend/out/public/js/logincallback.js +19 -0
- package/.tmp/gend/out/public/js/mytokens.js +11 -0
- package/.tmp/gend/out/public/js/refreshtokens.js +23 -0
- package/.tmp/gend/out/scripts/build.js +39 -0
- package/.tmp/gend/out/scripts/oacg-fix.js +83 -0
- package/.tmp/gend/out/tsconfig.json +30 -0
- package/.tmp/gend/out/tsoa.json +32 -0
- package/.tmp/gend/schemas/Session.json +49 -0
- package/.tmp/gend/schemas/User.json +81 -0
- package/.tmp/gend/schemas/UserAuthProfiles.json +54 -0
- package/.tmp/gend/schemas/UserContact.json +40 -0
- package/.tmp/gend/schemas/UserNote.json +27 -0
- package/.tmp/gend/vex.config.json +33 -0
- package/.tmp/genh/out/.env +41 -0
- package/.tmp/genh/out/.vex/meta.json +323 -0
- package/.tmp/genh/out/Dockerfile +20 -0
- package/.tmp/genh/out/README.md +39 -0
- package/.tmp/genh/out/package.json +51 -0
- package/.tmp/genh/out/public/css/style.css +8 -0
- package/.tmp/genh/out/public/js/deleteaccount.js +80 -0
- package/.tmp/genh/out/public/js/login.js +59 -0
- package/.tmp/genh/out/public/js/logincallback.js +19 -0
- package/.tmp/genh/out/public/js/mytokens.js +11 -0
- package/.tmp/genh/out/public/js/refreshtokens.js +23 -0
- package/.tmp/genh/out/scripts/build.js +39 -0
- package/.tmp/genh/out/scripts/oacg-fix.js +83 -0
- package/.tmp/genh/out/tsconfig.json +30 -0
- package/.tmp/genh/out/tsoa.json +32 -0
- package/.tmp/genh/schemas/Project.json +41 -0
- package/.tmp/genh/schemas/Session.json +49 -0
- package/.tmp/genh/schemas/User.json +81 -0
- package/.tmp/genh/schemas/UserAuthProfiles.json +54 -0
- package/.tmp/genh/schemas/UserTenant.json +39 -0
- package/.tmp/genh/vex.config.json +34 -0
- package/.tmp/gens/out/.env +41 -0
- package/.tmp/gens/out/.vex/meta.json +335 -0
- package/.tmp/gens/out/Dockerfile +20 -0
- package/.tmp/gens/out/README.md +39 -0
- package/.tmp/gens/out/package.json +51 -0
- package/.tmp/gens/out/public/css/style.css +8 -0
- package/.tmp/gens/out/public/js/deleteaccount.js +80 -0
- package/.tmp/gens/out/public/js/login.js +59 -0
- package/.tmp/gens/out/public/js/logincallback.js +19 -0
- package/.tmp/gens/out/public/js/mytokens.js +11 -0
- package/.tmp/gens/out/public/js/refreshtokens.js +23 -0
- package/.tmp/gens/out/scripts/build.js +39 -0
- package/.tmp/gens/out/scripts/oacg-fix.js +83 -0
- package/.tmp/gens/out/tsconfig.json +30 -0
- package/.tmp/gens/out/tsoa.json +32 -0
- package/.tmp/gens/schemas/Session.json +49 -0
- package/.tmp/gens/schemas/User.json +81 -0
- package/.tmp/gens/schemas/UserAuthProfiles.json +54 -0
- package/.tmp/gens/schemas/UserRole.json +38 -0
- package/.tmp/gens/vex.config.json +32 -0
- package/.tmp/npmtest/package.json +1 -0
- package/.tmp/ro-test +0 -0
- package/AGENTS.md +4 -3
- package/README.md +1 -0
- package/dist/index.js +955 -653
- package/dist/templates/_middlewares/Authentication.ts +1 -1
- package/dist/templates/_middlewares/UserContext.ts +30 -4
- package/dist/templates/_services/MongooseRepositoryAdapter.ts +94 -4
- package/dist/templates/_services/TypeOrmRepositoryAdapter.ts +92 -17
- package/dist/templates/_services/VexDbConnector.ts +36 -1
- package/dist/templates/_services/auth/JWTService.ts +13 -2
- package/dist/templates/_tenant/TenantScopeContext.ts +56 -0
- package/dist/templates/_types/auth.ts +7 -1
- package/dist/templates/_types/vex/VexRepository.ts +9 -2
- package/dist/templates/tenantJsonSchema/UserTenant.json +33 -0
- package/docs/architecture/databaseTargets.md +37 -8
- package/docs/architecture/generatorPipeline.md +2 -1
- package/docs/features/accountDeletion.md +61 -9
- package/docs/features/dataIsolation.md +58 -31
- package/docs/features/tenantIsolation.md +147 -0
- package/docs/releaseNote/v0-10-0.md +147 -0
- package/docs/releaseNote/v0-10-1.md +84 -0
- package/docs/vexJsonSchema.md +22 -0
- package/package.json +1 -1
- package/vitest.config.ts +3 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lastGeneratedVersion": "0.9.0",
|
|
3
|
+
"files": {
|
|
4
|
+
"..": {
|
|
5
|
+
"vex.config.json": {
|
|
6
|
+
"lastWriteVersion": "0.9.0",
|
|
7
|
+
"allowOverwrite": true
|
|
8
|
+
},
|
|
9
|
+
"schemas": {
|
|
10
|
+
"Session.json": {
|
|
11
|
+
"lastWriteVersion": "0.9.0",
|
|
12
|
+
"allowOverwrite": true
|
|
13
|
+
},
|
|
14
|
+
"User.json": {
|
|
15
|
+
"lastWriteVersion": "0.9.0",
|
|
16
|
+
"allowOverwrite": true
|
|
17
|
+
},
|
|
18
|
+
"UserAuthProfiles.json": {
|
|
19
|
+
"lastWriteVersion": "0.9.0",
|
|
20
|
+
"allowOverwrite": true
|
|
21
|
+
},
|
|
22
|
+
"UserRole.json": {
|
|
23
|
+
"lastWriteVersion": "0.9.0",
|
|
24
|
+
"allowOverwrite": true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"src": {
|
|
29
|
+
"system": {
|
|
30
|
+
"_controllers": {
|
|
31
|
+
"_ControllerFactory.gen.ts": {
|
|
32
|
+
"lastWriteVersion": "0.9.0",
|
|
33
|
+
"allowOverwrite": true
|
|
34
|
+
},
|
|
35
|
+
"UserController.gen.ts": {
|
|
36
|
+
"lastWriteVersion": "0.9.0",
|
|
37
|
+
"allowOverwrite": true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"_middlewares": {
|
|
41
|
+
"Authentication.gen.ts": {
|
|
42
|
+
"lastWriteVersion": "0.9.0",
|
|
43
|
+
"allowOverwrite": true
|
|
44
|
+
},
|
|
45
|
+
"JoinWhitelistMiddleware.gen.ts": {
|
|
46
|
+
"lastWriteVersion": "0.9.0",
|
|
47
|
+
"allowOverwrite": true
|
|
48
|
+
},
|
|
49
|
+
"UserContext.gen.ts": {
|
|
50
|
+
"lastWriteVersion": "0.9.0",
|
|
51
|
+
"allowOverwrite": true
|
|
52
|
+
},
|
|
53
|
+
"tsoaAuthentication.gen.ts": {
|
|
54
|
+
"lastWriteVersion": "0.9.0",
|
|
55
|
+
"allowOverwrite": true
|
|
56
|
+
},
|
|
57
|
+
"RoleBaseAccessControl.gen.ts": {
|
|
58
|
+
"lastWriteVersion": "0.9.0",
|
|
59
|
+
"allowOverwrite": true
|
|
60
|
+
},
|
|
61
|
+
"JoinWhitelistRegistry.gen.ts": {
|
|
62
|
+
"lastWriteVersion": "0.9.0",
|
|
63
|
+
"allowOverwrite": true
|
|
64
|
+
},
|
|
65
|
+
"DataIsolationRegistry.gen.ts": {
|
|
66
|
+
"lastWriteVersion": "0.9.0",
|
|
67
|
+
"allowOverwrite": true
|
|
68
|
+
},
|
|
69
|
+
"VexFieldRegistry.gen.ts": {
|
|
70
|
+
"lastWriteVersion": "0.9.0",
|
|
71
|
+
"allowOverwrite": true
|
|
72
|
+
},
|
|
73
|
+
"TenantConfig.gen.ts": {
|
|
74
|
+
"lastWriteVersion": "0.9.0",
|
|
75
|
+
"allowOverwrite": true
|
|
76
|
+
},
|
|
77
|
+
"TenantScopeContext.gen.ts": {
|
|
78
|
+
"lastWriteVersion": "0.9.0",
|
|
79
|
+
"allowOverwrite": true
|
|
80
|
+
},
|
|
81
|
+
"TenantScope.gen.ts": {
|
|
82
|
+
"lastWriteVersion": "0.9.0",
|
|
83
|
+
"allowOverwrite": true
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"_routes": {
|
|
87
|
+
"FirebaseAuthUI.gen.ts": {
|
|
88
|
+
"lastWriteVersion": "0.9.0",
|
|
89
|
+
"allowOverwrite": true
|
|
90
|
+
},
|
|
91
|
+
"LoginUI.gen.ts": {
|
|
92
|
+
"lastWriteVersion": "0.9.0",
|
|
93
|
+
"allowOverwrite": true
|
|
94
|
+
},
|
|
95
|
+
"oauth": {
|
|
96
|
+
"OAuthRouteFactory.gen.ts": {
|
|
97
|
+
"lastWriteVersion": "0.9.0",
|
|
98
|
+
"allowOverwrite": true
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"SwaggerRouter.gen.ts": {
|
|
102
|
+
"lastWriteVersion": "0.9.0",
|
|
103
|
+
"allowOverwrite": true
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"_services": {
|
|
107
|
+
"MongooseRepositoryAdapter.gen.ts": {
|
|
108
|
+
"lastWriteVersion": "0.9.0",
|
|
109
|
+
"allowOverwrite": true
|
|
110
|
+
},
|
|
111
|
+
"TypeOrmRepositoryAdapter.gen.ts": {
|
|
112
|
+
"lastWriteVersion": "0.9.0",
|
|
113
|
+
"allowOverwrite": true
|
|
114
|
+
},
|
|
115
|
+
"VexDb.gen.ts": {
|
|
116
|
+
"lastWriteVersion": "0.9.0",
|
|
117
|
+
"allowOverwrite": true
|
|
118
|
+
},
|
|
119
|
+
"VexDbConnector.gen.ts": {
|
|
120
|
+
"lastWriteVersion": "0.9.0",
|
|
121
|
+
"allowOverwrite": true
|
|
122
|
+
},
|
|
123
|
+
"VexSystem.gen.ts": {
|
|
124
|
+
"lastWriteVersion": "0.9.0",
|
|
125
|
+
"allowOverwrite": true
|
|
126
|
+
},
|
|
127
|
+
"auth": {
|
|
128
|
+
"JWTKeyStore.gen.ts": {
|
|
129
|
+
"lastWriteVersion": "0.9.0",
|
|
130
|
+
"allowOverwrite": true
|
|
131
|
+
},
|
|
132
|
+
"JWTService.gen.ts": {
|
|
133
|
+
"lastWriteVersion": "0.9.0",
|
|
134
|
+
"allowOverwrite": true
|
|
135
|
+
},
|
|
136
|
+
"AccountStateGuard.gen.ts": {
|
|
137
|
+
"lastWriteVersion": "0.9.0",
|
|
138
|
+
"allowOverwrite": true
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"oauth": {
|
|
142
|
+
"OAuthProfileMap.gen.ts": {
|
|
143
|
+
"lastWriteVersion": "0.9.0",
|
|
144
|
+
"allowOverwrite": true
|
|
145
|
+
},
|
|
146
|
+
"OAuthStrategyService.gen.ts": {
|
|
147
|
+
"lastWriteVersion": "0.9.0",
|
|
148
|
+
"allowOverwrite": true
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"_types": {
|
|
153
|
+
"auth.gen.ts": {
|
|
154
|
+
"lastWriteVersion": "0.9.0",
|
|
155
|
+
"allowOverwrite": true
|
|
156
|
+
},
|
|
157
|
+
"vex": {
|
|
158
|
+
"VexRepository.gen.ts": {
|
|
159
|
+
"lastWriteVersion": "0.9.0",
|
|
160
|
+
"allowOverwrite": true
|
|
161
|
+
},
|
|
162
|
+
"VexRequest.gen.ts": {
|
|
163
|
+
"lastWriteVersion": "0.9.0",
|
|
164
|
+
"allowOverwrite": true
|
|
165
|
+
},
|
|
166
|
+
"VexResErr.gen.ts": {
|
|
167
|
+
"lastWriteVersion": "0.9.0",
|
|
168
|
+
"allowOverwrite": true
|
|
169
|
+
},
|
|
170
|
+
"VexResOk.gen.ts": {
|
|
171
|
+
"lastWriteVersion": "0.9.0",
|
|
172
|
+
"allowOverwrite": true
|
|
173
|
+
},
|
|
174
|
+
"VexResponse.gen.ts": {
|
|
175
|
+
"lastWriteVersion": "0.9.0",
|
|
176
|
+
"allowOverwrite": true
|
|
177
|
+
},
|
|
178
|
+
"index.ts": {
|
|
179
|
+
"lastWriteVersion": "0.9.0",
|
|
180
|
+
"allowOverwrite": true
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"Session.gen.ts": {
|
|
184
|
+
"lastWriteVersion": "0.9.0",
|
|
185
|
+
"allowOverwrite": true
|
|
186
|
+
},
|
|
187
|
+
"User.gen.ts": {
|
|
188
|
+
"lastWriteVersion": "0.9.0",
|
|
189
|
+
"allowOverwrite": true
|
|
190
|
+
},
|
|
191
|
+
"UserAuthProfiles.gen.ts": {
|
|
192
|
+
"lastWriteVersion": "0.9.0",
|
|
193
|
+
"allowOverwrite": true
|
|
194
|
+
},
|
|
195
|
+
"UserRole.gen.ts": {
|
|
196
|
+
"lastWriteVersion": "0.9.0",
|
|
197
|
+
"allowOverwrite": true
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"_utils": {
|
|
201
|
+
"hash.gen.ts": {
|
|
202
|
+
"lastWriteVersion": "0.9.0",
|
|
203
|
+
"allowOverwrite": true
|
|
204
|
+
},
|
|
205
|
+
"index.ts": {
|
|
206
|
+
"lastWriteVersion": "0.9.0",
|
|
207
|
+
"allowOverwrite": true
|
|
208
|
+
},
|
|
209
|
+
"logger.gen.ts": {
|
|
210
|
+
"lastWriteVersion": "0.9.0",
|
|
211
|
+
"allowOverwrite": true
|
|
212
|
+
},
|
|
213
|
+
"processTimer.gen.ts": {
|
|
214
|
+
"lastWriteVersion": "0.9.0",
|
|
215
|
+
"allowOverwrite": true
|
|
216
|
+
},
|
|
217
|
+
"response.gen.ts": {
|
|
218
|
+
"lastWriteVersion": "0.9.0",
|
|
219
|
+
"allowOverwrite": true
|
|
220
|
+
},
|
|
221
|
+
"validator.gen.ts": {
|
|
222
|
+
"lastWriteVersion": "0.9.0",
|
|
223
|
+
"allowOverwrite": true
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"_roles": {
|
|
227
|
+
"_RoleFactory.gen.ts": {
|
|
228
|
+
"lastWriteVersion": "0.9.0",
|
|
229
|
+
"allowOverwrite": true
|
|
230
|
+
},
|
|
231
|
+
"member.gen.ts": {
|
|
232
|
+
"lastWriteVersion": "0.9.0",
|
|
233
|
+
"allowOverwrite": true
|
|
234
|
+
},
|
|
235
|
+
"index.ts": {
|
|
236
|
+
"lastWriteVersion": "0.9.0",
|
|
237
|
+
"allowOverwrite": true
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"_models": {
|
|
241
|
+
"SessionModel.gen.ts": {
|
|
242
|
+
"lastWriteVersion": "0.9.0",
|
|
243
|
+
"allowOverwrite": true
|
|
244
|
+
},
|
|
245
|
+
"UserModel.gen.ts": {
|
|
246
|
+
"lastWriteVersion": "0.9.0",
|
|
247
|
+
"allowOverwrite": true
|
|
248
|
+
},
|
|
249
|
+
"UserAuthProfilesModel.gen.ts": {
|
|
250
|
+
"lastWriteVersion": "0.9.0",
|
|
251
|
+
"allowOverwrite": true
|
|
252
|
+
},
|
|
253
|
+
"UserRoleModel.gen.ts": {
|
|
254
|
+
"lastWriteVersion": "0.9.0",
|
|
255
|
+
"allowOverwrite": true
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"roles": {
|
|
260
|
+
"member.json": {
|
|
261
|
+
"lastWriteVersion": "0.9.0",
|
|
262
|
+
"allowOverwrite": true
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"server.ts": {
|
|
266
|
+
"lastWriteVersion": "0.9.0",
|
|
267
|
+
"allowOverwrite": true
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"Dockerfile": {
|
|
271
|
+
"lastWriteVersion": "0.9.0",
|
|
272
|
+
"allowOverwrite": true
|
|
273
|
+
},
|
|
274
|
+
"README.md": {
|
|
275
|
+
"lastWriteVersion": "0.9.0",
|
|
276
|
+
"allowOverwrite": true
|
|
277
|
+
},
|
|
278
|
+
"public": {
|
|
279
|
+
"css": {
|
|
280
|
+
"style.css": {
|
|
281
|
+
"lastWriteVersion": "0.9.0",
|
|
282
|
+
"allowOverwrite": true
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"js": {
|
|
286
|
+
"deleteaccount.js": {
|
|
287
|
+
"lastWriteVersion": "0.9.0",
|
|
288
|
+
"allowOverwrite": true
|
|
289
|
+
},
|
|
290
|
+
"login.js": {
|
|
291
|
+
"lastWriteVersion": "0.9.0",
|
|
292
|
+
"allowOverwrite": true
|
|
293
|
+
},
|
|
294
|
+
"logincallback.js": {
|
|
295
|
+
"lastWriteVersion": "0.9.0",
|
|
296
|
+
"allowOverwrite": true
|
|
297
|
+
},
|
|
298
|
+
"mytokens.js": {
|
|
299
|
+
"lastWriteVersion": "0.9.0",
|
|
300
|
+
"allowOverwrite": true
|
|
301
|
+
},
|
|
302
|
+
"refreshtokens.js": {
|
|
303
|
+
"lastWriteVersion": "0.9.0",
|
|
304
|
+
"allowOverwrite": true
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"scripts": {
|
|
309
|
+
"build.js": {
|
|
310
|
+
"lastWriteVersion": "0.9.0",
|
|
311
|
+
"allowOverwrite": true
|
|
312
|
+
},
|
|
313
|
+
"oacg-fix.js": {
|
|
314
|
+
"lastWriteVersion": "0.9.0",
|
|
315
|
+
"allowOverwrite": true
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"tsconfig.json": {
|
|
319
|
+
"lastWriteVersion": "0.9.0",
|
|
320
|
+
"allowOverwrite": true
|
|
321
|
+
},
|
|
322
|
+
"package.json": {
|
|
323
|
+
"lastWriteVersion": "0.9.0",
|
|
324
|
+
"allowOverwrite": true
|
|
325
|
+
},
|
|
326
|
+
".env": {
|
|
327
|
+
"lastWriteVersion": "0.9.0",
|
|
328
|
+
"allowOverwrite": true
|
|
329
|
+
},
|
|
330
|
+
"tsoa.json": {
|
|
331
|
+
"lastWriteVersion": "0.9.0",
|
|
332
|
+
"allowOverwrite": true
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Use the official Node.js image as the base image
|
|
2
|
+
FROM node:14
|
|
3
|
+
|
|
4
|
+
# Set the working directory inside the container
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
|
|
7
|
+
# Copy package.json and package-lock.json to the working directory
|
|
8
|
+
COPY package*.json ./
|
|
9
|
+
|
|
10
|
+
# Install dependencies
|
|
11
|
+
RUN npm install
|
|
12
|
+
|
|
13
|
+
# Copy only the /dist directory to the working directory
|
|
14
|
+
COPY dist ./dist
|
|
15
|
+
|
|
16
|
+
# Expose the port the app runs on
|
|
17
|
+
EXPOSE 3000
|
|
18
|
+
|
|
19
|
+
# Define the command to run the application
|
|
20
|
+
CMD ["npm", "start"]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This app is generated by [VeryExpress](https://github.com/Justin26l/VeryExpress)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# Quick Start
|
|
5
|
+
1. install `very-express` from npm
|
|
6
|
+
`npm install -g very-express` or `npm update -g very-express`
|
|
7
|
+
|
|
8
|
+
2. check configuration file [vex.config.json](./vex.config.json) under project root directory and keep it updated (re-generate the app with very-express).
|
|
9
|
+
`vex`
|
|
10
|
+
|
|
11
|
+
3. we should have a express typescript app.
|
|
12
|
+
```
|
|
13
|
+
├── src/
|
|
14
|
+
│ └── openapi
|
|
15
|
+
│ └── roles (role based access control settings)
|
|
16
|
+
│ └── system (very express generated app)
|
|
17
|
+
├── package.json
|
|
18
|
+
├── tsconfig.json
|
|
19
|
+
├── vex.config.json
|
|
20
|
+
├── .env
|
|
21
|
+
└── ...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
4. start the generated express app.
|
|
25
|
+
```
|
|
26
|
+
npm i
|
|
27
|
+
npm build
|
|
28
|
+
npm run start
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
5. start the app in docker.
|
|
32
|
+
```
|
|
33
|
+
npm run docker-build
|
|
34
|
+
npm run docker-start
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
# Resource
|
|
38
|
+
- [Documents](https://github.com/Justin26l/VeryExpress/blob/main/README.md)
|
|
39
|
+
- [VeryExpress Discord](https://discord.gg/PZGMzDp7)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "index.js",
|
|
3
|
+
"scripts": {
|
|
4
|
+
"build": "npm run openapi && tsc -p . && node scripts/build.js",
|
|
5
|
+
"start": "node dist/server.js",
|
|
6
|
+
"dev": "nodemon --watch src --ext ts --ignore src/system/_routes/tsoa_routes.ts --ignore src/openapi/ --exec \"tsoa spec-and-routes && ts-node src/server.ts\"",
|
|
7
|
+
"openapi": "tsoa spec-and-routes",
|
|
8
|
+
"docker-build": "docker build -t very-express .",
|
|
9
|
+
"docker-start": "docker run -p 3000:3000 very-express"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"cookie": "^0.6.0",
|
|
13
|
+
"cookie-parser": "^1.4.6",
|
|
14
|
+
"dotenv": "^16.4.4",
|
|
15
|
+
"express": "^4.18.2",
|
|
16
|
+
"firebase-admin": "^14.1.0",
|
|
17
|
+
"helmet": "^7.1.0",
|
|
18
|
+
"js-yaml": "^4.1.0",
|
|
19
|
+
"jsonwebtoken": "^9.0.2",
|
|
20
|
+
"passport": "^0.7.0",
|
|
21
|
+
"passport-github": "^1.1.0",
|
|
22
|
+
"passport-google-oauth20": "^2.0.0",
|
|
23
|
+
"passport-jwt": "^4.0.1",
|
|
24
|
+
"pg": "^8.20.0",
|
|
25
|
+
"reflect-metadata": "^0.2.2",
|
|
26
|
+
"swagger-ui-express": "^5.0.0",
|
|
27
|
+
"tsoa": "^7.0.0-alpha.0",
|
|
28
|
+
"typeorm": "^0.3.20"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/cookie-parser": "^1.4.7",
|
|
32
|
+
"@types/crypto-js": "^4.1.2",
|
|
33
|
+
"@types/dotenv": "^8.2.0",
|
|
34
|
+
"@types/express": "^4.17.17",
|
|
35
|
+
"@types/js-yaml": "^4.0.9",
|
|
36
|
+
"@types/jsonwebtoken": "^9.0.7",
|
|
37
|
+
"@types/mongodb": "^4.0.7",
|
|
38
|
+
"@types/ms": "^2.1.0",
|
|
39
|
+
"@types/node": "^20.4.2",
|
|
40
|
+
"@types/passport": "^1.0.16",
|
|
41
|
+
"@types/passport-github": "^1.1.12",
|
|
42
|
+
"@types/passport-google-oauth20": "^2.0.14",
|
|
43
|
+
"@types/pg": "^8.11.0",
|
|
44
|
+
"@types/swagger-ui-express": "^4.1.6",
|
|
45
|
+
"@types/ws": "^8.5.5",
|
|
46
|
+
"nodemon": "^2.0.22",
|
|
47
|
+
"strip-json-comments": "^5.0.1",
|
|
48
|
+
"ts-node": "^10.9.1",
|
|
49
|
+
"typescript": "^5.1.6"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Self-service account deletion page.
|
|
2
|
+
//
|
|
3
|
+
// Sends the access token the same way the rest of the app does — Authorization + X-Auth-Index —
|
|
4
|
+
// and clears the stored tokens on success, because the account is gone the moment the tombstone
|
|
5
|
+
// is written: keeping a token the server will now reject only produces confusing 401s.
|
|
6
|
+
|
|
7
|
+
// The page loads this script from <head>, so it must wait for the DOM: at parse time the
|
|
8
|
+
// button does not exist yet and getElementById would return null.
|
|
9
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
10
|
+
var button = document.getElementById("deleteAccountBtn");
|
|
11
|
+
var input = document.getElementById("confirmInput");
|
|
12
|
+
var result = document.getElementById("deleteResult");
|
|
13
|
+
|
|
14
|
+
if (!button || !input || !result) return;
|
|
15
|
+
|
|
16
|
+
function clearTokens() {
|
|
17
|
+
localStorage.removeItem("accessToken");
|
|
18
|
+
localStorage.removeItem("accessTokenIndex");
|
|
19
|
+
localStorage.removeItem("refreshToken");
|
|
20
|
+
localStorage.removeItem("refreshTokenIndex");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function render(data) {
|
|
24
|
+
result.textContent = JSON.stringify(data, null, 2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
button.addEventListener("click", function () {
|
|
28
|
+
if (input.value !== "DELETE") {
|
|
29
|
+
render({ error: 'Type DELETE in the box to confirm.' });
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
button.disabled = true;
|
|
34
|
+
render({ status: "Deleting…" });
|
|
35
|
+
|
|
36
|
+
fetch("/api/auth/delete-account", {
|
|
37
|
+
method: "POST",
|
|
38
|
+
credentials: "include",
|
|
39
|
+
headers: {
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
"Authorization": "Bearer " + (localStorage.getItem("accessToken") || ""),
|
|
42
|
+
"X-Auth-Index": localStorage.getItem("accessTokenIndex") || "",
|
|
43
|
+
},
|
|
44
|
+
})
|
|
45
|
+
.then(function (response) {
|
|
46
|
+
// read as text first: an error response may not be JSON (a proxy or the
|
|
47
|
+
// express error handler can return HTML), and response.json() would then
|
|
48
|
+
// reject and hide the real status behind a parse error
|
|
49
|
+
return response.text().then(function (text) {
|
|
50
|
+
var body;
|
|
51
|
+
try {
|
|
52
|
+
body = text ? JSON.parse(text) : {};
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
body = { raw: text };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return { ok: response.ok, status: response.status, body: body };
|
|
59
|
+
});
|
|
60
|
+
})
|
|
61
|
+
.then(function (outcome) {
|
|
62
|
+
if (!outcome.ok) {
|
|
63
|
+
render({ status: outcome.status, error: outcome.body });
|
|
64
|
+
button.disabled = false;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
clearTokens();
|
|
69
|
+
render({
|
|
70
|
+
status: "Account deleted. You have been signed out.",
|
|
71
|
+
result: outcome.body,
|
|
72
|
+
});
|
|
73
|
+
input.value = "";
|
|
74
|
+
})
|
|
75
|
+
.catch(function (err) {
|
|
76
|
+
render({ error: String(err) });
|
|
77
|
+
button.disabled = false;
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
3
|
+
// add event listener to login button
|
|
4
|
+
document.querySelector("#localLoginBtn").addEventListener("click", function () {
|
|
5
|
+
// call /api/auth/local
|
|
6
|
+
fetch("/api/auth/local", {
|
|
7
|
+
method: "POST",
|
|
8
|
+
headers: {
|
|
9
|
+
"Content-Type": "application/json"
|
|
10
|
+
},
|
|
11
|
+
body: JSON.stringify({
|
|
12
|
+
email: document.querySelector("#email").value,
|
|
13
|
+
password: document.querySelector("#password").value
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
.then(async (res) => {
|
|
17
|
+
if (res.status === 301 || res.status === 302) {
|
|
18
|
+
const data = await res.json();
|
|
19
|
+
if (data.result?.url) {
|
|
20
|
+
window.location.href = data.result?.url;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
alert("Login successful, but no redirect URL provided.");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const data = await res.json();
|
|
28
|
+
alert("Login Failed: " + data.message);
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
.catch((err) => {
|
|
32
|
+
console.error("Error during login:", err);
|
|
33
|
+
alert("Login Error: " + err.message);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
document.querySelector("#localRegisterBtn").addEventListener("click", function () {
|
|
38
|
+
// call /api/auth/register
|
|
39
|
+
fetch("/api/auth/register", {
|
|
40
|
+
method: "POST",
|
|
41
|
+
headers: {
|
|
42
|
+
"Content-Type": "application/json"
|
|
43
|
+
},
|
|
44
|
+
body: JSON.stringify({
|
|
45
|
+
email: document.querySelector("#email").value,
|
|
46
|
+
password: document.querySelector("#password").value
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
.then(async (res) => {
|
|
50
|
+
if (res.status === 201) {
|
|
51
|
+
alert("Registration successful. You can now log in.");
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
.catch((err) => {
|
|
55
|
+
console.error("Error during registration:", err);
|
|
56
|
+
alert("An error occurred during registration. Please try again later.");
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
document.addEventListener("DOMContentLoaded", function() {
|
|
3
|
+
console.log('Exchange Tokens from /api/auth/token');
|
|
4
|
+
let sessionCode = new URLSearchParams(location.search).get('code');
|
|
5
|
+
fetch(
|
|
6
|
+
'/api/auth/token?code=' + sessionCode, {
|
|
7
|
+
method: 'POST'
|
|
8
|
+
}
|
|
9
|
+
)
|
|
10
|
+
.then((res) => res.text())
|
|
11
|
+
.then((data) => {
|
|
12
|
+
const jsonData = JSON.parse(data);
|
|
13
|
+
document.querySelector("#tokenData").innerHTML = JSON.stringify(jsonData, null, 2);
|
|
14
|
+
localStorage.setItem('accessToken', jsonData.result.accessToken);
|
|
15
|
+
localStorage.setItem('accessTokenIndex', jsonData.result.accessTokenIndex);
|
|
16
|
+
localStorage.setItem('refreshToken', jsonData.result.refreshToken);
|
|
17
|
+
localStorage.setItem('refreshTokenIndex', jsonData.result.refreshTokenIndex);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
let jsonData = {};
|
|
2
|
+
|
|
3
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
4
|
+
jsonData = {
|
|
5
|
+
accessToken: localStorage.getItem("accessToken"),
|
|
6
|
+
accessTokenIndex: localStorage.getItem("accessTokenIndex"),
|
|
7
|
+
refreshToken: localStorage.getItem("refreshToken"),
|
|
8
|
+
refreshTokenIndex: localStorage.getItem("refreshTokenIndex"),
|
|
9
|
+
};
|
|
10
|
+
document.querySelector("#tokenData").innerHTML = JSON.stringify(jsonData, null, 2);
|
|
11
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
2
|
+
jsonPayload = {
|
|
3
|
+
refreshToken: localStorage.getItem("refreshToken"),
|
|
4
|
+
refreshTokenIndex: localStorage.getItem("refreshTokenIndex"),
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
fetch("/api/auth/refresh", {
|
|
8
|
+
method: "POST",
|
|
9
|
+
body: JSON.stringify(jsonPayload),
|
|
10
|
+
headers: {
|
|
11
|
+
"Content-Type": "application/json",
|
|
12
|
+
"Accept": "application/json",
|
|
13
|
+
"Authorization": "Bearer " + localStorage.getItem("accessToken"),
|
|
14
|
+
"X-Auth-Index": localStorage.getItem("accessTokenIndex")
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
.then(res => res.json())
|
|
18
|
+
.then((response) => {
|
|
19
|
+
localStorage.setItem("accessToken", response.accessToken);
|
|
20
|
+
localStorage.setItem("accessTokenIndex", response.accessTokenIndex);
|
|
21
|
+
document.querySelector("#tokenData").innerHTML = JSON.stringify(response, null, 2);
|
|
22
|
+
});
|
|
23
|
+
});
|