very-express 0.10.0 → 0.10.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.
- package/.tmp/gen/out/.vex/meta.json +108 -102
- package/.tmp/gen/vex.config.json +1 -1
- package/.tmp/genh/out/.vex/meta.json +71 -71
- package/.tmp/genh/vex.config.json +4 -1
- package/AGENTS.md +1 -0
- package/dist/index.js +138 -129
- package/dist/templates/_services/MongooseRepositoryAdapter.ts +26 -0
- package/dist/templates/_services/TypeOrmRepositoryAdapter.ts +131 -4
- package/dist/templates/_services/VexDbConnector.ts +36 -1
- package/dist/templates/_types/vex/VexRepository.ts +7 -0
- package/docs/architecture/databaseTargets.md +25 -1
- package/docs/features/dataIsolation.md +2 -0
- package/docs/features/tenantIsolation.md +23 -1
- package/docs/releaseNote/v0-10-1.md +84 -0
- package/docs/releaseNote/v0-10-2.md +54 -0
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"lastGeneratedVersion": "0.
|
|
2
|
+
"lastGeneratedVersion": "0.10.0",
|
|
3
3
|
"files": {
|
|
4
4
|
"..": {
|
|
5
5
|
"vex.config.json": {
|
|
6
|
-
"lastWriteVersion": "0.
|
|
6
|
+
"lastWriteVersion": "0.10.0",
|
|
7
7
|
"allowOverwrite": true
|
|
8
8
|
},
|
|
9
9
|
"schemas": {
|
|
10
10
|
"Session.json": {
|
|
11
|
-
"lastWriteVersion": "0.
|
|
11
|
+
"lastWriteVersion": "0.10.0",
|
|
12
12
|
"allowOverwrite": true
|
|
13
13
|
},
|
|
14
14
|
"User.json": {
|
|
15
|
-
"lastWriteVersion": "0.
|
|
15
|
+
"lastWriteVersion": "0.10.0",
|
|
16
16
|
"allowOverwrite": true
|
|
17
17
|
},
|
|
18
18
|
"UserAuthProfiles.json": {
|
|
19
|
-
"lastWriteVersion": "0.
|
|
19
|
+
"lastWriteVersion": "0.10.0",
|
|
20
20
|
"allowOverwrite": true
|
|
21
21
|
},
|
|
22
22
|
"UserTenant.json": {
|
|
23
|
-
"lastWriteVersion": "0.
|
|
23
|
+
"lastWriteVersion": "0.10.0",
|
|
24
24
|
"allowOverwrite": true
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -29,294 +29,294 @@
|
|
|
29
29
|
"system": {
|
|
30
30
|
"_controllers": {
|
|
31
31
|
"_ControllerFactory.gen.ts": {
|
|
32
|
-
"lastWriteVersion": "0.
|
|
32
|
+
"lastWriteVersion": "0.10.0",
|
|
33
33
|
"allowOverwrite": true
|
|
34
34
|
},
|
|
35
35
|
"ProjectController.gen.ts": {
|
|
36
|
-
"lastWriteVersion": "0.
|
|
36
|
+
"lastWriteVersion": "0.10.0",
|
|
37
37
|
"allowOverwrite": true
|
|
38
38
|
},
|
|
39
39
|
"UserController.gen.ts": {
|
|
40
|
-
"lastWriteVersion": "0.
|
|
40
|
+
"lastWriteVersion": "0.10.0",
|
|
41
41
|
"allowOverwrite": true
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"_middlewares": {
|
|
45
45
|
"Authentication.gen.ts": {
|
|
46
|
-
"lastWriteVersion": "0.
|
|
46
|
+
"lastWriteVersion": "0.10.0",
|
|
47
47
|
"allowOverwrite": true
|
|
48
48
|
},
|
|
49
49
|
"JoinWhitelistMiddleware.gen.ts": {
|
|
50
|
-
"lastWriteVersion": "0.
|
|
50
|
+
"lastWriteVersion": "0.10.0",
|
|
51
51
|
"allowOverwrite": true
|
|
52
52
|
},
|
|
53
53
|
"UserContext.gen.ts": {
|
|
54
|
-
"lastWriteVersion": "0.
|
|
54
|
+
"lastWriteVersion": "0.10.0",
|
|
55
55
|
"allowOverwrite": true
|
|
56
56
|
},
|
|
57
57
|
"tsoaAuthentication.gen.ts": {
|
|
58
|
-
"lastWriteVersion": "0.
|
|
58
|
+
"lastWriteVersion": "0.10.0",
|
|
59
59
|
"allowOverwrite": true
|
|
60
60
|
},
|
|
61
61
|
"JoinWhitelistRegistry.gen.ts": {
|
|
62
|
-
"lastWriteVersion": "0.
|
|
62
|
+
"lastWriteVersion": "0.10.0",
|
|
63
63
|
"allowOverwrite": true
|
|
64
64
|
},
|
|
65
65
|
"DataIsolationRegistry.gen.ts": {
|
|
66
|
-
"lastWriteVersion": "0.
|
|
66
|
+
"lastWriteVersion": "0.10.0",
|
|
67
67
|
"allowOverwrite": true
|
|
68
68
|
},
|
|
69
69
|
"VexFieldRegistry.gen.ts": {
|
|
70
|
-
"lastWriteVersion": "0.
|
|
70
|
+
"lastWriteVersion": "0.10.0",
|
|
71
71
|
"allowOverwrite": true
|
|
72
72
|
},
|
|
73
73
|
"TenantScopeContext.gen.ts": {
|
|
74
|
-
"lastWriteVersion": "0.
|
|
74
|
+
"lastWriteVersion": "0.10.0",
|
|
75
75
|
"allowOverwrite": true
|
|
76
76
|
},
|
|
77
77
|
"TenantScope.gen.ts": {
|
|
78
|
-
"lastWriteVersion": "0.
|
|
78
|
+
"lastWriteVersion": "0.10.0",
|
|
79
79
|
"allowOverwrite": true
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"_routes": {
|
|
83
83
|
"FirebaseAuthUI.gen.ts": {
|
|
84
|
-
"lastWriteVersion": "0.
|
|
84
|
+
"lastWriteVersion": "0.10.0",
|
|
85
85
|
"allowOverwrite": true
|
|
86
86
|
},
|
|
87
87
|
"LoginUI.gen.ts": {
|
|
88
|
-
"lastWriteVersion": "0.
|
|
88
|
+
"lastWriteVersion": "0.10.0",
|
|
89
89
|
"allowOverwrite": true
|
|
90
90
|
},
|
|
91
91
|
"oauth": {
|
|
92
92
|
"OAuthRouteFactory.gen.ts": {
|
|
93
|
-
"lastWriteVersion": "0.
|
|
93
|
+
"lastWriteVersion": "0.10.0",
|
|
94
94
|
"allowOverwrite": true
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
"SwaggerRouter.gen.ts": {
|
|
98
|
-
"lastWriteVersion": "0.
|
|
98
|
+
"lastWriteVersion": "0.10.0",
|
|
99
99
|
"allowOverwrite": true
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
"_services": {
|
|
103
103
|
"MongooseRepositoryAdapter.gen.ts": {
|
|
104
|
-
"lastWriteVersion": "0.
|
|
104
|
+
"lastWriteVersion": "0.10.0",
|
|
105
105
|
"allowOverwrite": true
|
|
106
106
|
},
|
|
107
107
|
"TypeOrmRepositoryAdapter.gen.ts": {
|
|
108
|
-
"lastWriteVersion": "0.
|
|
108
|
+
"lastWriteVersion": "0.10.0",
|
|
109
109
|
"allowOverwrite": true
|
|
110
110
|
},
|
|
111
111
|
"VexDb.gen.ts": {
|
|
112
|
-
"lastWriteVersion": "0.
|
|
112
|
+
"lastWriteVersion": "0.10.0",
|
|
113
113
|
"allowOverwrite": true
|
|
114
114
|
},
|
|
115
115
|
"VexDbConnector.gen.ts": {
|
|
116
|
-
"lastWriteVersion": "0.
|
|
116
|
+
"lastWriteVersion": "0.10.0",
|
|
117
117
|
"allowOverwrite": true
|
|
118
118
|
},
|
|
119
119
|
"VexSystem.gen.ts": {
|
|
120
|
-
"lastWriteVersion": "0.
|
|
120
|
+
"lastWriteVersion": "0.10.0",
|
|
121
121
|
"allowOverwrite": true
|
|
122
122
|
},
|
|
123
123
|
"auth": {
|
|
124
124
|
"JWTKeyStore.gen.ts": {
|
|
125
|
-
"lastWriteVersion": "0.
|
|
125
|
+
"lastWriteVersion": "0.10.0",
|
|
126
126
|
"allowOverwrite": true
|
|
127
127
|
},
|
|
128
128
|
"JWTService.gen.ts": {
|
|
129
|
-
"lastWriteVersion": "0.
|
|
129
|
+
"lastWriteVersion": "0.10.0",
|
|
130
130
|
"allowOverwrite": true
|
|
131
131
|
},
|
|
132
132
|
"AccountStateGuard.gen.ts": {
|
|
133
|
-
"lastWriteVersion": "0.
|
|
133
|
+
"lastWriteVersion": "0.10.0",
|
|
134
134
|
"allowOverwrite": true
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
137
|
"oauth": {
|
|
138
138
|
"OAuthProfileMap.gen.ts": {
|
|
139
|
-
"lastWriteVersion": "0.
|
|
139
|
+
"lastWriteVersion": "0.10.0",
|
|
140
140
|
"allowOverwrite": true
|
|
141
141
|
},
|
|
142
142
|
"OAuthStrategyService.gen.ts": {
|
|
143
|
-
"lastWriteVersion": "0.
|
|
143
|
+
"lastWriteVersion": "0.10.0",
|
|
144
144
|
"allowOverwrite": true
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
"TenantService.gen.ts": {
|
|
148
|
-
"lastWriteVersion": "0.
|
|
148
|
+
"lastWriteVersion": "0.10.0",
|
|
149
149
|
"allowOverwrite": true
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
"_types": {
|
|
153
153
|
"auth.gen.ts": {
|
|
154
|
-
"lastWriteVersion": "0.
|
|
154
|
+
"lastWriteVersion": "0.10.0",
|
|
155
155
|
"allowOverwrite": true
|
|
156
156
|
},
|
|
157
157
|
"vex": {
|
|
158
158
|
"VexRepository.gen.ts": {
|
|
159
|
-
"lastWriteVersion": "0.
|
|
159
|
+
"lastWriteVersion": "0.10.0",
|
|
160
160
|
"allowOverwrite": true
|
|
161
161
|
},
|
|
162
162
|
"VexRequest.gen.ts": {
|
|
163
|
-
"lastWriteVersion": "0.
|
|
163
|
+
"lastWriteVersion": "0.10.0",
|
|
164
164
|
"allowOverwrite": true
|
|
165
165
|
},
|
|
166
166
|
"VexResErr.gen.ts": {
|
|
167
|
-
"lastWriteVersion": "0.
|
|
167
|
+
"lastWriteVersion": "0.10.0",
|
|
168
168
|
"allowOverwrite": true
|
|
169
169
|
},
|
|
170
170
|
"VexResOk.gen.ts": {
|
|
171
|
-
"lastWriteVersion": "0.
|
|
171
|
+
"lastWriteVersion": "0.10.0",
|
|
172
172
|
"allowOverwrite": true
|
|
173
173
|
},
|
|
174
174
|
"VexResponse.gen.ts": {
|
|
175
|
-
"lastWriteVersion": "0.
|
|
175
|
+
"lastWriteVersion": "0.10.0",
|
|
176
176
|
"allowOverwrite": true
|
|
177
177
|
},
|
|
178
178
|
"index.ts": {
|
|
179
|
-
"lastWriteVersion": "0.
|
|
179
|
+
"lastWriteVersion": "0.10.0",
|
|
180
180
|
"allowOverwrite": true
|
|
181
181
|
}
|
|
182
182
|
},
|
|
183
183
|
"Project.gen.ts": {
|
|
184
|
-
"lastWriteVersion": "0.
|
|
184
|
+
"lastWriteVersion": "0.10.0",
|
|
185
185
|
"allowOverwrite": true
|
|
186
186
|
},
|
|
187
187
|
"Session.gen.ts": {
|
|
188
|
-
"lastWriteVersion": "0.
|
|
188
|
+
"lastWriteVersion": "0.10.0",
|
|
189
189
|
"allowOverwrite": true
|
|
190
190
|
},
|
|
191
191
|
"User.gen.ts": {
|
|
192
|
-
"lastWriteVersion": "0.
|
|
192
|
+
"lastWriteVersion": "0.10.0",
|
|
193
193
|
"allowOverwrite": true
|
|
194
194
|
},
|
|
195
195
|
"UserAuthProfiles.gen.ts": {
|
|
196
|
-
"lastWriteVersion": "0.
|
|
196
|
+
"lastWriteVersion": "0.10.0",
|
|
197
197
|
"allowOverwrite": true
|
|
198
198
|
},
|
|
199
199
|
"UserTenant.gen.ts": {
|
|
200
|
-
"lastWriteVersion": "0.
|
|
200
|
+
"lastWriteVersion": "0.10.0",
|
|
201
201
|
"allowOverwrite": true
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
204
|
"_utils": {
|
|
205
205
|
"hash.gen.ts": {
|
|
206
|
-
"lastWriteVersion": "0.
|
|
206
|
+
"lastWriteVersion": "0.10.0",
|
|
207
207
|
"allowOverwrite": true
|
|
208
208
|
},
|
|
209
209
|
"index.ts": {
|
|
210
|
-
"lastWriteVersion": "0.
|
|
210
|
+
"lastWriteVersion": "0.10.0",
|
|
211
211
|
"allowOverwrite": true
|
|
212
212
|
},
|
|
213
213
|
"logger.gen.ts": {
|
|
214
|
-
"lastWriteVersion": "0.
|
|
214
|
+
"lastWriteVersion": "0.10.0",
|
|
215
215
|
"allowOverwrite": true
|
|
216
216
|
},
|
|
217
217
|
"processTimer.gen.ts": {
|
|
218
|
-
"lastWriteVersion": "0.
|
|
218
|
+
"lastWriteVersion": "0.10.0",
|
|
219
219
|
"allowOverwrite": true
|
|
220
220
|
},
|
|
221
221
|
"response.gen.ts": {
|
|
222
|
-
"lastWriteVersion": "0.
|
|
222
|
+
"lastWriteVersion": "0.10.0",
|
|
223
223
|
"allowOverwrite": true
|
|
224
224
|
},
|
|
225
225
|
"validator.gen.ts": {
|
|
226
|
-
"lastWriteVersion": "0.
|
|
226
|
+
"lastWriteVersion": "0.10.0",
|
|
227
227
|
"allowOverwrite": true
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
230
|
"_models": {
|
|
231
231
|
"ProjectModel.gen.ts": {
|
|
232
|
-
"lastWriteVersion": "0.
|
|
232
|
+
"lastWriteVersion": "0.10.0",
|
|
233
233
|
"allowOverwrite": true
|
|
234
234
|
},
|
|
235
235
|
"SessionModel.gen.ts": {
|
|
236
|
-
"lastWriteVersion": "0.
|
|
236
|
+
"lastWriteVersion": "0.10.0",
|
|
237
237
|
"allowOverwrite": true
|
|
238
238
|
},
|
|
239
239
|
"UserModel.gen.ts": {
|
|
240
|
-
"lastWriteVersion": "0.
|
|
240
|
+
"lastWriteVersion": "0.10.0",
|
|
241
241
|
"allowOverwrite": true
|
|
242
242
|
},
|
|
243
243
|
"UserAuthProfilesModel.gen.ts": {
|
|
244
|
-
"lastWriteVersion": "0.
|
|
244
|
+
"lastWriteVersion": "0.10.0",
|
|
245
245
|
"allowOverwrite": true
|
|
246
246
|
},
|
|
247
247
|
"UserTenantModel.gen.ts": {
|
|
248
|
-
"lastWriteVersion": "0.
|
|
248
|
+
"lastWriteVersion": "0.10.0",
|
|
249
249
|
"allowOverwrite": true
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
},
|
|
253
253
|
"server.ts": {
|
|
254
|
-
"lastWriteVersion": "0.
|
|
254
|
+
"lastWriteVersion": "0.10.0",
|
|
255
255
|
"allowOverwrite": true
|
|
256
256
|
}
|
|
257
257
|
},
|
|
258
258
|
"Dockerfile": {
|
|
259
|
-
"lastWriteVersion": "0.
|
|
259
|
+
"lastWriteVersion": "0.10.0",
|
|
260
260
|
"allowOverwrite": true
|
|
261
261
|
},
|
|
262
262
|
"README.md": {
|
|
263
|
-
"lastWriteVersion": "0.
|
|
263
|
+
"lastWriteVersion": "0.10.0",
|
|
264
264
|
"allowOverwrite": true
|
|
265
265
|
},
|
|
266
266
|
"public": {
|
|
267
267
|
"css": {
|
|
268
268
|
"style.css": {
|
|
269
|
-
"lastWriteVersion": "0.
|
|
269
|
+
"lastWriteVersion": "0.10.0",
|
|
270
270
|
"allowOverwrite": true
|
|
271
271
|
}
|
|
272
272
|
},
|
|
273
273
|
"js": {
|
|
274
274
|
"deleteaccount.js": {
|
|
275
|
-
"lastWriteVersion": "0.
|
|
275
|
+
"lastWriteVersion": "0.10.0",
|
|
276
276
|
"allowOverwrite": true
|
|
277
277
|
},
|
|
278
278
|
"login.js": {
|
|
279
|
-
"lastWriteVersion": "0.
|
|
279
|
+
"lastWriteVersion": "0.10.0",
|
|
280
280
|
"allowOverwrite": true
|
|
281
281
|
},
|
|
282
282
|
"logincallback.js": {
|
|
283
|
-
"lastWriteVersion": "0.
|
|
283
|
+
"lastWriteVersion": "0.10.0",
|
|
284
284
|
"allowOverwrite": true
|
|
285
285
|
},
|
|
286
286
|
"mytokens.js": {
|
|
287
|
-
"lastWriteVersion": "0.
|
|
287
|
+
"lastWriteVersion": "0.10.0",
|
|
288
288
|
"allowOverwrite": true
|
|
289
289
|
},
|
|
290
290
|
"refreshtokens.js": {
|
|
291
|
-
"lastWriteVersion": "0.
|
|
291
|
+
"lastWriteVersion": "0.10.0",
|
|
292
292
|
"allowOverwrite": true
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
},
|
|
296
296
|
"scripts": {
|
|
297
297
|
"build.js": {
|
|
298
|
-
"lastWriteVersion": "0.
|
|
298
|
+
"lastWriteVersion": "0.10.0",
|
|
299
299
|
"allowOverwrite": true
|
|
300
300
|
},
|
|
301
301
|
"oacg-fix.js": {
|
|
302
|
-
"lastWriteVersion": "0.
|
|
302
|
+
"lastWriteVersion": "0.10.0",
|
|
303
303
|
"allowOverwrite": true
|
|
304
304
|
}
|
|
305
305
|
},
|
|
306
306
|
"tsconfig.json": {
|
|
307
|
-
"lastWriteVersion": "0.
|
|
307
|
+
"lastWriteVersion": "0.10.0",
|
|
308
308
|
"allowOverwrite": true
|
|
309
309
|
},
|
|
310
310
|
"package.json": {
|
|
311
|
-
"lastWriteVersion": "0.
|
|
311
|
+
"lastWriteVersion": "0.10.0",
|
|
312
312
|
"allowOverwrite": true
|
|
313
313
|
},
|
|
314
314
|
".env": {
|
|
315
|
-
"lastWriteVersion": "0.
|
|
315
|
+
"lastWriteVersion": "0.10.0",
|
|
316
316
|
"allowOverwrite": true
|
|
317
317
|
},
|
|
318
318
|
"tsoa.json": {
|
|
319
|
-
"lastWriteVersion": "0.
|
|
319
|
+
"lastWriteVersion": "0.10.0",
|
|
320
320
|
"allowOverwrite": true
|
|
321
321
|
}
|
|
322
322
|
}
|
package/AGENTS.md
CHANGED
|
@@ -65,6 +65,7 @@ Read from `vex.config.json → jsonSchemaDir` (this repo: `./output/jsonSchema`)
|
|
|
65
65
|
- **Only `one-to-one` and `many-to-one` are declared in `x-foreignKey`.** `one-to-many` is derived from the other side and must not be hand-written.
|
|
66
66
|
- **RBAC is opt-in.** `utils.generator.isRbacEnabled()` is the single gate for every RBAC code path. Absent `useRBAC`, or `roles: []`, means RBAC off — never "RBAC with zero roles". Never branch on `compilerOptions.useRBAC` directly.
|
|
67
67
|
- **The request scope is layered, not owned by one module.** `TenantScope.middleware` (L0 in `server.ts`) opens `UserContext`; `Authentication.middleware` (L1) adds the verified token; in tenant `option` mode `TenantScope` runs again after authentication (attached by the generated controllers) to read the claim. `UserContext.run` merges, so no layer erases another. Tenant files are emitted only when `vex.config.tenant.enable` is true; `preSelect` works with no auth module. Isolation (`isolation` rules) is independent of audit fields; use `utils.generator.isAuthEnabled()` when a code path depends on auth being on.
|
|
68
|
+
- **Business code never touches the raw DB connection.** Multi-write flows go through `vexDb.transaction(async (tx) => tx.getRepository(...))`; `dataSource` is private and the transaction handle exposes no manager. `save` inserts without `_id` and performs a scoped update with one.
|
|
68
69
|
- **A create that declares `onCreateUserId` with no identity in `UserContext` throws.** Both repository adapters enforce it; `onUpdateUserId` is deliberately not enforced. `isolation` has nothing to do with whether the context exists.
|
|
69
70
|
- **Boolean config defaults use `??`, not `||`.** `x || true` swallows an explicit `false`.
|
|
70
71
|
- **Never write to git.** No `git add`, `commit`, `push`, `reset`, `checkout`, `stash`, `rm`, `mv`. The
|