@rpcbase/db 0.137.0 → 0.138.0
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/dist/ensureMongooseConnection.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +144 -8
- package/dist/index.js.map +1 -1
- package/dist/migrations/20260814090000-baseline-global.d.ts +3 -0
- package/dist/migrations/20260814090000-baseline-global.d.ts.map +1 -0
- package/dist/migrations/20260814090100-baseline-tenant.d.ts +3 -0
- package/dist/migrations/20260814090100-baseline-tenant.d.ts.map +1 -0
- package/dist/migrations/currentResources.d.ts +2 -0
- package/dist/migrations/currentResources.d.ts.map +1 -0
- package/dist/migrations/index.d.ts +5 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +479 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/resources.d.ts +2 -0
- package/dist/migrations/resources.d.ts.map +1 -0
- package/dist/migrations/rtsChanges.d.ts +2 -0
- package/dist/migrations/rtsChanges.d.ts.map +1 -0
- package/dist/models/RBRtsChange.d.ts.map +1 -1
- package/dist/models/RBTenant.d.ts +8 -0
- package/dist/models/RBTenant.d.ts.map +1 -1
- package/dist/models/RBTenantSubscriptionEvent.d.ts +11 -11
- package/dist/models/RBTenantSubscriptionProjection.d.ts +1 -1
- package/dist/modelsApi.d.ts.map +1 -1
- package/dist/mongoResources.d.ts +7 -0
- package/dist/mongoResources.d.ts.map +1 -0
- package/dist/registerModels.d.ts +6 -1
- package/dist/registerModels.d.ts.map +1 -1
- package/dist/rtsChanges-xIGFCLGa.js +7 -0
- package/dist/rtsChanges-xIGFCLGa.js.map +1 -0
- package/dist/tenantProvisioning.d.ts +15 -0
- package/dist/tenantProvisioning.d.ts.map +1 -0
- package/package.json +9 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20260814090000-baseline-global.d.ts","sourceRoot":"","sources":["../../src/migrations/20260814090000-baseline-global.ts"],"names":[],"mappings":";AAKA,wBA+BE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20260814090100-baseline-tenant.d.ts","sourceRoot":"","sources":["../../src/migrations/20260814090100-baseline-tenant.ts"],"names":[],"mappings":";AAKA,wBA+BE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currentResources.d.ts","sourceRoot":"","sources":["../../src/migrations/currentResources.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,+BAA+B,oDAY3C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAGnD,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAEhC,eAAO,MAAM,sBAAsB,+CAQjC,CAAA;AAEF,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { t as rtsChangesTtlSeconds } from "../rtsChanges-xIGFCLGa.js";
|
|
2
|
+
import { defineMigration, defineMigrationSource, defineMongoResources } from "@rpcbase/migrations";
|
|
3
|
+
//#region src/migrations/resources.ts
|
|
4
|
+
var global = "global";
|
|
5
|
+
var tenant = "tenant";
|
|
6
|
+
var owner = "@rpcbase/db";
|
|
7
|
+
var rpcbaseMongoResources = defineMongoResources({
|
|
8
|
+
collections: [
|
|
9
|
+
{
|
|
10
|
+
scope: global,
|
|
11
|
+
name: "rboauthrequests",
|
|
12
|
+
owner
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
scope: global,
|
|
16
|
+
name: "rbtenants",
|
|
17
|
+
owner
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
scope: global,
|
|
21
|
+
name: "rbusers",
|
|
22
|
+
owner
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
scope: tenant,
|
|
26
|
+
name: "rbnotificationdeliveries",
|
|
27
|
+
owner
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
scope: tenant,
|
|
31
|
+
name: "rbnotifications",
|
|
32
|
+
owner
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
scope: tenant,
|
|
36
|
+
name: "rbnotificationsettings",
|
|
37
|
+
owner
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
scope: tenant,
|
|
41
|
+
name: "rbrtschanges",
|
|
42
|
+
owner
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
scope: tenant,
|
|
46
|
+
name: "rbrtscounters",
|
|
47
|
+
owner
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
scope: tenant,
|
|
51
|
+
name: "rbtenantsubscriptionevents",
|
|
52
|
+
owner
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
scope: tenant,
|
|
56
|
+
name: "rbtenantsubscriptionprojections",
|
|
57
|
+
owner
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
scope: tenant,
|
|
61
|
+
name: "rbuploadchunks",
|
|
62
|
+
owner
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
scope: tenant,
|
|
66
|
+
name: "rbuploadsessions",
|
|
67
|
+
owner
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
indexes: [
|
|
71
|
+
{
|
|
72
|
+
scope: global,
|
|
73
|
+
collection: "rboauthrequests",
|
|
74
|
+
name: "expiresAt_1",
|
|
75
|
+
key: { expiresAt: 1 },
|
|
76
|
+
options: { expireAfterSeconds: 0 },
|
|
77
|
+
owner
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
scope: global,
|
|
81
|
+
collection: "rboauthrequests",
|
|
82
|
+
name: "providerId_1",
|
|
83
|
+
key: { providerId: 1 },
|
|
84
|
+
owner
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
scope: global,
|
|
88
|
+
collection: "rbtenants",
|
|
89
|
+
name: "tenantId_1",
|
|
90
|
+
key: { tenantId: 1 },
|
|
91
|
+
options: { unique: true },
|
|
92
|
+
owner
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
scope: global,
|
|
96
|
+
collection: "rbusers",
|
|
97
|
+
name: "email_1",
|
|
98
|
+
key: { email: 1 },
|
|
99
|
+
options: {
|
|
100
|
+
unique: true,
|
|
101
|
+
sparse: true
|
|
102
|
+
},
|
|
103
|
+
owner
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
scope: global,
|
|
107
|
+
collection: "rbusers",
|
|
108
|
+
name: "phone_1",
|
|
109
|
+
key: { phone: 1 },
|
|
110
|
+
options: {
|
|
111
|
+
unique: true,
|
|
112
|
+
sparse: true
|
|
113
|
+
},
|
|
114
|
+
owner
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
scope: global,
|
|
118
|
+
collection: "rbusers",
|
|
119
|
+
name: "tenants_1",
|
|
120
|
+
key: { tenants: 1 },
|
|
121
|
+
owner
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
scope: tenant,
|
|
125
|
+
collection: "rbnotificationdeliveries",
|
|
126
|
+
name: "createdAt_1",
|
|
127
|
+
key: { createdAt: 1 },
|
|
128
|
+
options: { expireAfterSeconds: 7776e3 },
|
|
129
|
+
owner
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
scope: tenant,
|
|
133
|
+
collection: "rbnotificationdeliveries",
|
|
134
|
+
name: "deliveryId_1",
|
|
135
|
+
key: { deliveryId: 1 },
|
|
136
|
+
options: { unique: true },
|
|
137
|
+
owner
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
scope: tenant,
|
|
141
|
+
collection: "rbnotificationdeliveries",
|
|
142
|
+
name: "userId_1",
|
|
143
|
+
key: { userId: 1 },
|
|
144
|
+
owner
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
scope: tenant,
|
|
148
|
+
collection: "rbnotificationdeliveries",
|
|
149
|
+
name: "userId_1_createdAt_-1",
|
|
150
|
+
key: {
|
|
151
|
+
userId: 1,
|
|
152
|
+
createdAt: -1
|
|
153
|
+
},
|
|
154
|
+
owner
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
scope: tenant,
|
|
158
|
+
collection: "rbnotifications",
|
|
159
|
+
name: "archivedAt_1",
|
|
160
|
+
key: { archivedAt: 1 },
|
|
161
|
+
options: { expireAfterSeconds: 7776e3 },
|
|
162
|
+
owner
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
scope: tenant,
|
|
166
|
+
collection: "rbnotifications",
|
|
167
|
+
name: "createdAt_1",
|
|
168
|
+
key: { createdAt: 1 },
|
|
169
|
+
owner
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
scope: tenant,
|
|
173
|
+
collection: "rbnotifications",
|
|
174
|
+
name: "readAt_1",
|
|
175
|
+
key: { readAt: 1 },
|
|
176
|
+
owner
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
scope: tenant,
|
|
180
|
+
collection: "rbnotifications",
|
|
181
|
+
name: "seenAt_1",
|
|
182
|
+
key: { seenAt: 1 },
|
|
183
|
+
owner
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
scope: tenant,
|
|
187
|
+
collection: "rbnotifications",
|
|
188
|
+
name: "topic_1",
|
|
189
|
+
key: { topic: 1 },
|
|
190
|
+
owner
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
scope: tenant,
|
|
194
|
+
collection: "rbnotifications",
|
|
195
|
+
name: "userId_1",
|
|
196
|
+
key: { userId: 1 },
|
|
197
|
+
owner
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
scope: tenant,
|
|
201
|
+
collection: "rbnotifications",
|
|
202
|
+
name: "userId_1_archivedAt_1_createdAt_-1",
|
|
203
|
+
key: {
|
|
204
|
+
userId: 1,
|
|
205
|
+
archivedAt: 1,
|
|
206
|
+
createdAt: -1
|
|
207
|
+
},
|
|
208
|
+
owner
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
scope: tenant,
|
|
212
|
+
collection: "rbnotifications",
|
|
213
|
+
name: "userId_1_readAt_1_archivedAt_1_createdAt_-1",
|
|
214
|
+
key: {
|
|
215
|
+
userId: 1,
|
|
216
|
+
readAt: 1,
|
|
217
|
+
archivedAt: 1,
|
|
218
|
+
createdAt: -1
|
|
219
|
+
},
|
|
220
|
+
owner
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
scope: tenant,
|
|
224
|
+
collection: "rbnotifications",
|
|
225
|
+
name: "userId_1_seenAt_1_archivedAt_1_createdAt_-1",
|
|
226
|
+
key: {
|
|
227
|
+
userId: 1,
|
|
228
|
+
seenAt: 1,
|
|
229
|
+
archivedAt: 1,
|
|
230
|
+
createdAt: -1
|
|
231
|
+
},
|
|
232
|
+
owner
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
scope: tenant,
|
|
236
|
+
collection: "rbnotifications",
|
|
237
|
+
name: "userId_1_tag_1",
|
|
238
|
+
key: {
|
|
239
|
+
userId: 1,
|
|
240
|
+
tag: 1
|
|
241
|
+
},
|
|
242
|
+
options: {
|
|
243
|
+
unique: true,
|
|
244
|
+
partialFilterExpression: {
|
|
245
|
+
tag: { $exists: true },
|
|
246
|
+
drawerActive: true
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
owner
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
scope: tenant,
|
|
253
|
+
collection: "rbnotificationsettings",
|
|
254
|
+
name: "userId_1",
|
|
255
|
+
key: { userId: 1 },
|
|
256
|
+
options: { unique: true },
|
|
257
|
+
owner
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
scope: tenant,
|
|
261
|
+
collection: "rbnotificationsettings",
|
|
262
|
+
name: "userId_1_topicPreferences.topic_1",
|
|
263
|
+
key: {
|
|
264
|
+
userId: 1,
|
|
265
|
+
"topicPreferences.topic": 1
|
|
266
|
+
},
|
|
267
|
+
owner
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
scope: tenant,
|
|
271
|
+
collection: "rbrtschanges",
|
|
272
|
+
name: "modelName_1",
|
|
273
|
+
key: { modelName: 1 },
|
|
274
|
+
owner
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
scope: tenant,
|
|
278
|
+
collection: "rbrtschanges",
|
|
279
|
+
name: "seq_1",
|
|
280
|
+
key: { seq: 1 },
|
|
281
|
+
options: { unique: true },
|
|
282
|
+
owner
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
scope: tenant,
|
|
286
|
+
collection: "rbrtschanges",
|
|
287
|
+
name: "ts_1",
|
|
288
|
+
key: { ts: 1 },
|
|
289
|
+
options: { expireAfterSeconds: rtsChangesTtlSeconds },
|
|
290
|
+
owner
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
scope: tenant,
|
|
294
|
+
collection: "rbtenantsubscriptionevents",
|
|
295
|
+
name: "provider_1_providerEventId_1",
|
|
296
|
+
key: {
|
|
297
|
+
provider: 1,
|
|
298
|
+
providerEventId: 1
|
|
299
|
+
},
|
|
300
|
+
options: {
|
|
301
|
+
unique: true,
|
|
302
|
+
partialFilterExpression: {
|
|
303
|
+
provider: { $type: "string" },
|
|
304
|
+
providerEventId: { $type: "string" }
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
owner
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
scope: tenant,
|
|
311
|
+
collection: "rbtenantsubscriptionevents",
|
|
312
|
+
name: "subscriptionId_1",
|
|
313
|
+
key: { subscriptionId: 1 },
|
|
314
|
+
owner
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
scope: tenant,
|
|
318
|
+
collection: "rbtenantsubscriptionevents",
|
|
319
|
+
name: "tenantId_1",
|
|
320
|
+
key: { tenantId: 1 },
|
|
321
|
+
owner
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
scope: tenant,
|
|
325
|
+
collection: "rbtenantsubscriptionevents",
|
|
326
|
+
name: "tenantId_1_idempotencyKey_1",
|
|
327
|
+
key: {
|
|
328
|
+
tenantId: 1,
|
|
329
|
+
idempotencyKey: 1
|
|
330
|
+
},
|
|
331
|
+
options: { unique: true },
|
|
332
|
+
owner
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
scope: tenant,
|
|
336
|
+
collection: "rbtenantsubscriptionevents",
|
|
337
|
+
name: "tenantId_1_subscriptionId_1_effectiveAt_1_occurredAt_1",
|
|
338
|
+
key: {
|
|
339
|
+
tenantId: 1,
|
|
340
|
+
subscriptionId: 1,
|
|
341
|
+
effectiveAt: 1,
|
|
342
|
+
occurredAt: 1
|
|
343
|
+
},
|
|
344
|
+
owner
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
scope: tenant,
|
|
348
|
+
collection: "rbtenantsubscriptionprojections",
|
|
349
|
+
name: "tenantId_1",
|
|
350
|
+
key: { tenantId: 1 },
|
|
351
|
+
owner
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
scope: tenant,
|
|
355
|
+
collection: "rbtenantsubscriptionprojections",
|
|
356
|
+
name: "tenantId_1_scope_1_scopeId_1",
|
|
357
|
+
key: {
|
|
358
|
+
tenantId: 1,
|
|
359
|
+
scope: 1,
|
|
360
|
+
scopeId: 1
|
|
361
|
+
},
|
|
362
|
+
owner
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
scope: tenant,
|
|
366
|
+
collection: "rbtenantsubscriptionprojections",
|
|
367
|
+
name: "tenantId_1_subscriptionId_1",
|
|
368
|
+
key: {
|
|
369
|
+
tenantId: 1,
|
|
370
|
+
subscriptionId: 1
|
|
371
|
+
},
|
|
372
|
+
options: { unique: true },
|
|
373
|
+
owner
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
scope: tenant,
|
|
377
|
+
collection: "rbuploadchunks",
|
|
378
|
+
name: "expiresAt_1",
|
|
379
|
+
key: { expiresAt: 1 },
|
|
380
|
+
options: { expireAfterSeconds: 0 },
|
|
381
|
+
owner
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
scope: tenant,
|
|
385
|
+
collection: "rbuploadchunks",
|
|
386
|
+
name: "uploadId_1",
|
|
387
|
+
key: { uploadId: 1 },
|
|
388
|
+
owner
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
scope: tenant,
|
|
392
|
+
collection: "rbuploadchunks",
|
|
393
|
+
name: "uploadId_1_index_1",
|
|
394
|
+
key: {
|
|
395
|
+
uploadId: 1,
|
|
396
|
+
index: 1
|
|
397
|
+
},
|
|
398
|
+
options: { unique: true },
|
|
399
|
+
owner
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
scope: tenant,
|
|
403
|
+
collection: "rbuploadsessions",
|
|
404
|
+
name: "expiresAt_1",
|
|
405
|
+
key: { expiresAt: 1 },
|
|
406
|
+
options: { expireAfterSeconds: 0 },
|
|
407
|
+
owner
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
scope: tenant,
|
|
411
|
+
collection: "rbuploadsessions",
|
|
412
|
+
name: "userId_1",
|
|
413
|
+
key: { userId: 1 },
|
|
414
|
+
owner
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
});
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/migrations/index.ts
|
|
420
|
+
var rpcbaseMigrationSource = defineMigrationSource({
|
|
421
|
+
name: "@rpcbase/db",
|
|
422
|
+
migrations: [defineMigration({
|
|
423
|
+
__rpcbaseIntegrity: "467b0d0dc32bcaa0e026996aaa59093f63da44ba375649b015c5204d76c881bb",
|
|
424
|
+
id: "20260814090000-baseline-global",
|
|
425
|
+
scope: "global",
|
|
426
|
+
mode: "online",
|
|
427
|
+
rollback: "compatible",
|
|
428
|
+
resources: {
|
|
429
|
+
before: null,
|
|
430
|
+
after: rpcbaseMongoResources.checksum
|
|
431
|
+
},
|
|
432
|
+
async up({ helpers, resources }) {
|
|
433
|
+
if (!resources) throw new Error("Missing baseline resource snapshot");
|
|
434
|
+
for (const index of resources.after.indexes) {
|
|
435
|
+
if (index.options?.unique !== true) continue;
|
|
436
|
+
const sparseFilter = index.options.sparse === true ? { $or: Object.keys(index.key).map((field) => ({ [field]: { $exists: true } })) } : void 0;
|
|
437
|
+
const partialFilter = index.options.partialFilterExpression;
|
|
438
|
+
const filter = sparseFilter && partialFilter ? { $and: [partialFilter, sparseFilter] } : partialFilter ?? sparseFilter;
|
|
439
|
+
const duplicates = await helpers.findDuplicateKeys(index.collection, index.key, {
|
|
440
|
+
...filter ? { filter } : {},
|
|
441
|
+
...index.options.collation ? { collation: index.options.collation } : {}
|
|
442
|
+
});
|
|
443
|
+
if (duplicates.length > 0) throw new Error(`Cannot create unique index ${index.collection}.${index.name}: ${JSON.stringify(duplicates)}`);
|
|
444
|
+
}
|
|
445
|
+
await helpers.reconcileResources(resources.after);
|
|
446
|
+
}
|
|
447
|
+
}), defineMigration({
|
|
448
|
+
__rpcbaseIntegrity: "a4ef8480c3befadcf18ea83bd77588946ff4ee7b4bb383ab8e59a68b7dee8f85",
|
|
449
|
+
id: "20260814090100-baseline-tenant",
|
|
450
|
+
scope: "tenant",
|
|
451
|
+
mode: "online",
|
|
452
|
+
rollback: "compatible",
|
|
453
|
+
resources: {
|
|
454
|
+
before: null,
|
|
455
|
+
after: rpcbaseMongoResources.checksum
|
|
456
|
+
},
|
|
457
|
+
async up({ helpers, resources }) {
|
|
458
|
+
if (!resources) throw new Error("Missing baseline resource snapshot");
|
|
459
|
+
for (const index of resources.after.indexes) {
|
|
460
|
+
if (index.options?.unique !== true) continue;
|
|
461
|
+
const sparseFilter = index.options.sparse === true ? { $or: Object.keys(index.key).map((field) => ({ [field]: { $exists: true } })) } : void 0;
|
|
462
|
+
const partialFilter = index.options.partialFilterExpression;
|
|
463
|
+
const filter = sparseFilter && partialFilter ? { $and: [partialFilter, sparseFilter] } : partialFilter ?? sparseFilter;
|
|
464
|
+
const duplicates = await helpers.findDuplicateKeys(index.collection, index.key, {
|
|
465
|
+
...filter ? { filter } : {},
|
|
466
|
+
...index.options.collation ? { collation: index.options.collation } : {}
|
|
467
|
+
});
|
|
468
|
+
if (duplicates.length > 0) throw new Error(`Cannot create unique index ${index.collection}.${index.name}: ${JSON.stringify(duplicates)}`);
|
|
469
|
+
}
|
|
470
|
+
await helpers.reconcileResources(resources.after);
|
|
471
|
+
}
|
|
472
|
+
})],
|
|
473
|
+
resources: rpcbaseMongoResources,
|
|
474
|
+
resourceSnapshots: [rpcbaseMongoResources]
|
|
475
|
+
});
|
|
476
|
+
//#endregion
|
|
477
|
+
export { rpcbaseMigrationSource as default, rpcbaseMigrationSource, rpcbaseMongoResources };
|
|
478
|
+
|
|
479
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["defineMongoResources","rtsChangesTtlSeconds","global","const","tenant","owner","rpcbaseMongoResources","collections","scope","name","indexes","collection","key","expiresAt","options","expireAfterSeconds","providerId","tenantId","unique","email","sparse","phone","tenants","createdAt","deliveryId","userId","archivedAt","readAt","seenAt","topic","tag","partialFilterExpression","$exists","drawerActive","modelName","seq","ts","provider","providerEventId","$type","subscriptionId","idempotencyKey","effectiveAt","occurredAt","scopeId","uploadId","index","defineMigration","rpcbaseMongoResources","__rpcbaseIntegrity","id","scope","mode","rollback","resources","before","after","checksum","up","helpers","Error","index","indexes","options","unique","sparseFilter","sparse","$or","Object","keys","key","map","field","$exists","undefined","partialFilter","partialFilterExpression","filter","$and","duplicates","findDuplicateKeys","collection","collation","length","name","JSON","stringify","reconcileResources","defineMigration","rpcbaseMongoResources","__rpcbaseIntegrity","id","scope","mode","rollback","resources","before","after","checksum","up","helpers","Error","index","indexes","options","unique","sparseFilter","sparse","$or","Object","keys","key","map","field","$exists","undefined","partialFilter","partialFilterExpression","filter","$and","duplicates","findDuplicateKeys","collection","collation","length","name","JSON","stringify","reconcileResources","defineMigrationSource","baselineGlobal","baselineTenant","rpcbaseMongoResources","rpcbaseMigrationSource","name","migrations","resources","resourceSnapshots"],"sources":["../../src/migrations/resources.ts","../../src/migrations/20260814090000-baseline-global.ts","../../src/migrations/20260814090100-baseline-tenant.ts","../../src/migrations/index.ts"],"sourcesContent":["import { defineMongoResources } from \"@rpcbase/migrations\"\n\nimport { rtsChangesTtlSeconds } from \"./rtsChanges\"\n\n\nconst global = \"global\" as const\nconst tenant = \"tenant\" as const\nconst owner = \"@rpcbase/db\"\n\nexport const rpcbaseMongoResources = defineMongoResources({\n collections: [\n { scope: global, name: \"rboauthrequests\", owner },\n { scope: global, name: \"rbtenants\", owner },\n { scope: global, name: \"rbusers\", owner },\n { scope: tenant, name: \"rbnotificationdeliveries\", owner },\n { scope: tenant, name: \"rbnotifications\", owner },\n { scope: tenant, name: \"rbnotificationsettings\", owner },\n { scope: tenant, name: \"rbrtschanges\", owner },\n { scope: tenant, name: \"rbrtscounters\", owner },\n { scope: tenant, name: \"rbtenantsubscriptionevents\", owner },\n { scope: tenant, name: \"rbtenantsubscriptionprojections\", owner },\n { scope: tenant, name: \"rbuploadchunks\", owner },\n { scope: tenant, name: \"rbuploadsessions\", owner },\n ],\n indexes: [\n {\n scope: global,\n collection: \"rboauthrequests\",\n name: \"expiresAt_1\",\n key: { expiresAt: 1 },\n options: { expireAfterSeconds: 0 },\n owner,\n },\n {\n scope: global,\n collection: \"rboauthrequests\",\n name: \"providerId_1\",\n key: { providerId: 1 },\n owner,\n },\n {\n scope: global,\n collection: \"rbtenants\",\n name: \"tenantId_1\",\n key: { tenantId: 1 },\n options: { unique: true },\n owner,\n },\n {\n scope: global,\n collection: \"rbusers\",\n name: \"email_1\",\n key: { email: 1 },\n options: { unique: true, sparse: true },\n owner,\n },\n {\n scope: global,\n collection: \"rbusers\",\n name: \"phone_1\",\n key: { phone: 1 },\n options: { unique: true, sparse: true },\n owner,\n },\n {\n scope: global,\n collection: \"rbusers\",\n name: \"tenants_1\",\n key: { tenants: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotificationdeliveries\",\n name: \"createdAt_1\",\n key: { createdAt: 1 },\n options: { expireAfterSeconds: 7_776_000 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotificationdeliveries\",\n name: \"deliveryId_1\",\n key: { deliveryId: 1 },\n options: { unique: true },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotificationdeliveries\",\n name: \"userId_1\",\n key: { userId: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotificationdeliveries\",\n name: \"userId_1_createdAt_-1\",\n key: { userId: 1, createdAt: -1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"archivedAt_1\",\n key: { archivedAt: 1 },\n options: { expireAfterSeconds: 7_776_000 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"createdAt_1\",\n key: { createdAt: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"readAt_1\",\n key: { readAt: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"seenAt_1\",\n key: { seenAt: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"topic_1\",\n key: { topic: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"userId_1\",\n key: { userId: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"userId_1_archivedAt_1_createdAt_-1\",\n key: { userId: 1, archivedAt: 1, createdAt: -1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"userId_1_readAt_1_archivedAt_1_createdAt_-1\",\n key: { userId: 1, readAt: 1, archivedAt: 1, createdAt: -1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"userId_1_seenAt_1_archivedAt_1_createdAt_-1\",\n key: { userId: 1, seenAt: 1, archivedAt: 1, createdAt: -1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotifications\",\n name: \"userId_1_tag_1\",\n key: { userId: 1, tag: 1 },\n options: {\n unique: true,\n partialFilterExpression: { tag: { $exists: true }, drawerActive: true },\n },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotificationsettings\",\n name: \"userId_1\",\n key: { userId: 1 },\n options: { unique: true },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbnotificationsettings\",\n name: \"userId_1_topicPreferences.topic_1\",\n key: { userId: 1, \"topicPreferences.topic\": 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbrtschanges\",\n name: \"modelName_1\",\n key: { modelName: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbrtschanges\",\n name: \"seq_1\",\n key: { seq: 1 },\n options: { unique: true },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbrtschanges\",\n name: \"ts_1\",\n key: { ts: 1 },\n options: { expireAfterSeconds: rtsChangesTtlSeconds },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbtenantsubscriptionevents\",\n name: \"provider_1_providerEventId_1\",\n key: { provider: 1, providerEventId: 1 },\n options: {\n unique: true,\n partialFilterExpression: {\n provider: { $type: \"string\" },\n providerEventId: { $type: \"string\" },\n },\n },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbtenantsubscriptionevents\",\n name: \"subscriptionId_1\",\n key: { subscriptionId: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbtenantsubscriptionevents\",\n name: \"tenantId_1\",\n key: { tenantId: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbtenantsubscriptionevents\",\n name: \"tenantId_1_idempotencyKey_1\",\n key: { tenantId: 1, idempotencyKey: 1 },\n options: { unique: true },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbtenantsubscriptionevents\",\n name: \"tenantId_1_subscriptionId_1_effectiveAt_1_occurredAt_1\",\n key: { tenantId: 1, subscriptionId: 1, effectiveAt: 1, occurredAt: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbtenantsubscriptionprojections\",\n name: \"tenantId_1\",\n key: { tenantId: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbtenantsubscriptionprojections\",\n name: \"tenantId_1_scope_1_scopeId_1\",\n key: { tenantId: 1, scope: 1, scopeId: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbtenantsubscriptionprojections\",\n name: \"tenantId_1_subscriptionId_1\",\n key: { tenantId: 1, subscriptionId: 1 },\n options: { unique: true },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbuploadchunks\",\n name: \"expiresAt_1\",\n key: { expiresAt: 1 },\n options: { expireAfterSeconds: 0 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbuploadchunks\",\n name: \"uploadId_1\",\n key: { uploadId: 1 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbuploadchunks\",\n name: \"uploadId_1_index_1\",\n key: { uploadId: 1, index: 1 },\n options: { unique: true },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbuploadsessions\",\n name: \"expiresAt_1\",\n key: { expiresAt: 1 },\n options: { expireAfterSeconds: 0 },\n owner,\n },\n {\n scope: tenant,\n collection: \"rbuploadsessions\",\n name: \"userId_1\",\n key: { userId: 1 },\n owner,\n },\n ],\n})\n","import { defineMigration } from \"@rpcbase/migrations\"\n\nimport { rpcbaseMongoResources } from \"./resources\"\n\n\nexport default defineMigration({\n __rpcbaseIntegrity: \"467b0d0dc32bcaa0e026996aaa59093f63da44ba375649b015c5204d76c881bb\",\n id: \"20260814090000-baseline-global\",\n scope: \"global\",\n mode: \"online\",\n rollback: \"compatible\",\n resources: {\n before: null,\n after: rpcbaseMongoResources.checksum,\n },\n\n async up({ helpers, resources }) {\n if (!resources) throw new Error(\"Missing baseline resource snapshot\")\n for (const index of resources.after.indexes) {\n if (index.options?.unique !== true) continue\n const sparseFilter = index.options.sparse === true\n ? { $or: Object.keys(index.key).map((field) => ({ [field]: { $exists: true } })) }\n : undefined\n const partialFilter = index.options.partialFilterExpression\n const filter = sparseFilter && partialFilter\n ? { $and: [partialFilter, sparseFilter] }\n : partialFilter ?? sparseFilter\n const duplicates = await helpers.findDuplicateKeys(index.collection, index.key, {\n ...(filter ? { filter } : {}),\n ...(index.options.collation ? { collation: index.options.collation } : {}),\n })\n if (duplicates.length > 0) {\n throw new Error(`Cannot create unique index ${index.collection}.${index.name}: ${JSON.stringify(duplicates)}`)\n }\n }\n await helpers.reconcileResources(resources.after)\n },\n})\n","import { defineMigration } from \"@rpcbase/migrations\"\n\nimport { rpcbaseMongoResources } from \"./resources\"\n\n\nexport default defineMigration({\n __rpcbaseIntegrity: \"a4ef8480c3befadcf18ea83bd77588946ff4ee7b4bb383ab8e59a68b7dee8f85\",\n id: \"20260814090100-baseline-tenant\",\n scope: \"tenant\",\n mode: \"online\",\n rollback: \"compatible\",\n resources: {\n before: null,\n after: rpcbaseMongoResources.checksum,\n },\n\n async up({ helpers, resources }) {\n if (!resources) throw new Error(\"Missing baseline resource snapshot\")\n for (const index of resources.after.indexes) {\n if (index.options?.unique !== true) continue\n const sparseFilter = index.options.sparse === true\n ? { $or: Object.keys(index.key).map((field) => ({ [field]: { $exists: true } })) }\n : undefined\n const partialFilter = index.options.partialFilterExpression\n const filter = sparseFilter && partialFilter\n ? { $and: [partialFilter, sparseFilter] }\n : partialFilter ?? sparseFilter\n const duplicates = await helpers.findDuplicateKeys(index.collection, index.key, {\n ...(filter ? { filter } : {}),\n ...(index.options.collation ? { collation: index.options.collation } : {}),\n })\n if (duplicates.length > 0) {\n throw new Error(`Cannot create unique index ${index.collection}.${index.name}: ${JSON.stringify(duplicates)}`)\n }\n }\n await helpers.reconcileResources(resources.after)\n },\n})\n","import { defineMigrationSource } from \"@rpcbase/migrations\"\n\nimport baselineGlobal from \"./20260814090000-baseline-global\"\nimport baselineTenant from \"./20260814090100-baseline-tenant\"\nimport { rpcbaseMongoResources } from \"./resources\"\n\n\nexport { rpcbaseMongoResources }\n\nexport const rpcbaseMigrationSource = defineMigrationSource({\n name: \"@rpcbase/db\",\n migrations: [\n baselineGlobal,\n baselineTenant,\n ],\n resources: rpcbaseMongoResources,\n resourceSnapshots: [rpcbaseMongoResources],\n})\n\nexport default rpcbaseMigrationSource\n"],"mappings":";;;AAKA,IAAME,SAAS;AACf,IAAME,SAAS;AACf,IAAMC,QAAQ;AAEd,IAAaC,wBAAwBN,qBAAqB;CACxDO,aAAa;EACX;GAAEC,OAAON;GAAQO,MAAM;GAAmBJ;EAAM;EAChD;GAAEG,OAAON;GAAQO,MAAM;GAAaJ;EAAM;EAC1C;GAAEG,OAAON;GAAQO,MAAM;GAAWJ;EAAM;EACxC;GAAEG,OAAOJ;GAAQK,MAAM;GAA4BJ;EAAM;EACzD;GAAEG,OAAOJ;GAAQK,MAAM;GAAmBJ;EAAM;EAChD;GAAEG,OAAOJ;GAAQK,MAAM;GAA0BJ;EAAM;EACvD;GAAEG,OAAOJ;GAAQK,MAAM;GAAgBJ;EAAM;EAC7C;GAAEG,OAAOJ;GAAQK,MAAM;GAAiBJ;EAAM;EAC9C;GAAEG,OAAOJ;GAAQK,MAAM;GAA8BJ;EAAM;EAC3D;GAAEG,OAAOJ;GAAQK,MAAM;GAAmCJ;EAAM;EAChE;GAAEG,OAAOJ;GAAQK,MAAM;GAAkBJ;EAAM;EAC/C;GAAEG,OAAOJ;GAAQK,MAAM;GAAoBJ;EAAM;CAAC;CAEpDK,SAAS;EACP;GACEF,OAAON;GACPS,YAAY;GACZF,MAAM;GACNG,KAAK,EAAEC,WAAW,EAAE;GACpBC,SAAS,EAAEC,oBAAoB,EAAE;GACjCV;EACF;EACA;GACEG,OAAON;GACPS,YAAY;GACZF,MAAM;GACNG,KAAK,EAAEI,YAAY,EAAE;GACrBX;EACF;EACA;GACEG,OAAON;GACPS,YAAY;GACZF,MAAM;GACNG,KAAK,EAAEK,UAAU,EAAE;GACnBH,SAAS,EAAEI,QAAQ,KAAK;GACxBb;EACF;EACA;GACEG,OAAON;GACPS,YAAY;G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pB,QAAQ4B,mBAAmBjC,UAAUE,KAAK;EAClD;CACF,CCxBIkC,CAAc;CAEhBK,WAAWJ;CACXK,mBAAmB,CAACL,qBAAqB;AAC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/migrations/resources.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,qBAAqB,8CAqThC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rtsChanges.d.ts","sourceRoot":"","sources":["../../src/migrations/rtsChanges.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,QAEZ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RBRtsChange.d.ts","sourceRoot":"","sources":["../../src/models/RBRtsChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"RBRtsChange.d.ts","sourceRoot":"","sources":["../../src/models/RBRtsChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,cAAc;;;EAAoC,CAAA;AAE/D,eAAO,MAAM,YAAY;;;;;;;;;iBAMvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEvD,eAAO,MAAM,iBAAiB,EAAE,MAW/B,CAAA"}
|
|
@@ -4,6 +4,14 @@ export declare const ZRBTenant: z.ZodObject<{
|
|
|
4
4
|
tenantId: z.ZodString;
|
|
5
5
|
parentTenantId: z.ZodOptional<z.ZodString>;
|
|
6
6
|
name: z.ZodOptional<z.ZodString>;
|
|
7
|
+
provisioningStatus: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
initializing: "initializing";
|
|
9
|
+
active: "active";
|
|
10
|
+
failed: "failed";
|
|
11
|
+
}>>;
|
|
12
|
+
provisioningError: z.ZodOptional<z.ZodString>;
|
|
13
|
+
provisioningStartedAt: z.ZodOptional<z.ZodDate>;
|
|
14
|
+
provisionedAt: z.ZodOptional<z.ZodDate>;
|
|
7
15
|
}, z.core.$strip>;
|
|
8
16
|
export type IRBTenant = z.infer<typeof ZRBTenant>;
|
|
9
17
|
export declare const RBTenantSchema: Schema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RBTenant.d.ts","sourceRoot":"","sources":["../../src/models/RBTenant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"RBTenant.d.ts","sourceRoot":"","sources":["../../src/models/RBTenant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,SAAS;;;;;;;;;;;;iBAQpB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAQ3B,CAAA"}
|