@rpcbase/db 0.139.0 → 0.141.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.
@@ -1 +1 @@
1
- {"version":3,"file":"20260814090000-baseline-global.d.ts","sourceRoot":"","sources":["../../src/migrations/20260814090000-baseline-global.ts"],"names":[],"mappings":";AAGA,wBA+BE"}
1
+ {"version":3,"file":"20260814090000-baseline-global.d.ts","sourceRoot":"","sources":["../../src/migrations/20260814090000-baseline-global.ts"],"names":[],"mappings":";AAKA,wBA+BE"}
@@ -1 +1 @@
1
- {"version":3,"file":"20260814090100-baseline-tenant.d.ts","sourceRoot":"","sources":["../../src/migrations/20260814090100-baseline-tenant.ts"],"names":[],"mappings":";AAGA,wBA+BE"}
1
+ {"version":3,"file":"20260814090100-baseline-tenant.d.ts","sourceRoot":"","sources":["../../src/migrations/20260814090100-baseline-tenant.ts"],"names":[],"mappings":";AAKA,wBA+BE"}
@@ -1 +1 @@
1
- {"version":3,"file":"baselineResources.d.ts","sourceRoot":"","sources":["../../src/migrations/baselineResources.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,6BAA6B,8CAqTxC,CAAA"}
1
+ {"version":3,"file":"baselineResources.d.ts","sourceRoot":"","sources":["../../src/migrations/baselineResources.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,6BAA6B,8CAYxC,CAAA"}
@@ -1,5 +1,5 @@
1
- import { rpcbaseMongoResources } from './resources';
2
- export { rpcbaseMongoResources };
1
+ import { rpcbaseRuntimeRtsRetentionMongoResources } from './runtimeRtsRetentionResources';
2
+ export { rpcbaseRuntimeRtsRetentionMongoResources as rpcbaseMongoResources };
3
3
  export declare const rpcbaseMigrationSource: import('@rpcbase/migrations').MigrationSource;
4
4
  export default rpcbaseMigrationSource;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAInD,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAEhC,eAAO,MAAM,sBAAsB,+CAajC,CAAA;AAEF,eAAe,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,wCAAwC,EAAE,MAAM,gCAAgC,CAAA;AAGzF,OAAO,EAAE,wCAAwC,IAAI,qBAAqB,EAAE,CAAA;AAO5E,eAAO,MAAM,sBAAsB,+CAYjC,CAAA;AAEF,eAAe,sBAAsB,CAAA"}
@@ -1,91 +1,10 @@
1
1
  import { t as rtsChangesTtlSeconds } from "../rtsChanges-xIGFCLGa.js";
2
2
  import { defineMigration, defineMigrationSource, defineMongoResources } from "@rpcbase/migrations";
3
- //#region src/migrations/20260814090000-baseline-global.ts
4
- var _20260814090000_baseline_global_default = defineMigration({
5
- __rpcbaseIntegrity: "1e3bb48e914f377136a22d79a78ba4164eb457be097003a675cfb8864df8baf2",
6
- id: "20260814090000-baseline-global",
7
- scope: "global",
8
- mode: "online",
9
- rollback: "compatible",
10
- resources: {
11
- before: null,
12
- after: "62e2e625d7af99bec6bb635ae75aeb3654db151a2162ec375f039664a9638816"
13
- },
14
- async up({ helpers, resources }) {
15
- if (!resources) throw new Error("Missing baseline resource snapshot");
16
- for (const index of resources.after.indexes) {
17
- if (index.options?.unique !== true) continue;
18
- const sparseFilter = index.options.sparse === true ? { $or: Object.keys(index.key).map((field) => ({ [field]: { $exists: true } })) } : void 0;
19
- const partialFilter = index.options.partialFilterExpression;
20
- const filter = sparseFilter && partialFilter ? { $and: [partialFilter, sparseFilter] } : partialFilter ?? sparseFilter;
21
- const duplicates = await helpers.findDuplicateKeys(index.collection, index.key, {
22
- ...filter ? { filter } : {},
23
- ...index.options.collation ? { collation: index.options.collation } : {}
24
- });
25
- if (duplicates.length > 0) throw new Error(`Cannot create unique index ${index.collection}.${index.name}: ${JSON.stringify(duplicates)}`);
26
- }
27
- await helpers.reconcileResources(resources.after);
28
- }
29
- });
30
- //#endregion
31
- //#region src/migrations/20260814090100-baseline-tenant.ts
32
- var _20260814090100_baseline_tenant_default = defineMigration({
33
- __rpcbaseIntegrity: "0a4fed8912aa300fdd36d7a783e2c00cf5db9a84057d1287340b236edfcd89e4",
34
- id: "20260814090100-baseline-tenant",
35
- scope: "tenant",
36
- mode: "online",
37
- rollback: "compatible",
38
- resources: {
39
- before: null,
40
- after: "62e2e625d7af99bec6bb635ae75aeb3654db151a2162ec375f039664a9638816"
41
- },
42
- async up({ helpers, resources }) {
43
- if (!resources) throw new Error("Missing baseline resource snapshot");
44
- for (const index of resources.after.indexes) {
45
- if (index.options?.unique !== true) continue;
46
- const sparseFilter = index.options.sparse === true ? { $or: Object.keys(index.key).map((field) => ({ [field]: { $exists: true } })) } : void 0;
47
- const partialFilter = index.options.partialFilterExpression;
48
- const filter = sparseFilter && partialFilter ? { $and: [partialFilter, sparseFilter] } : partialFilter ?? sparseFilter;
49
- const duplicates = await helpers.findDuplicateKeys(index.collection, index.key, {
50
- ...filter ? { filter } : {},
51
- ...index.options.collation ? { collation: index.options.collation } : {}
52
- });
53
- if (duplicates.length > 0) throw new Error(`Cannot create unique index ${index.collection}.${index.name}: ${JSON.stringify(duplicates)}`);
54
- }
55
- await helpers.reconcileResources(resources.after);
56
- }
57
- });
58
- //#endregion
59
- //#region src/migrations/20260816090000-runtime-rts-retention.ts
60
- var _20260816090000_runtime_rts_retention_default = defineMigration({
61
- __rpcbaseIntegrity: "b9d2b856d968898563ec9089c6a77c9dab1c5ba02d0f7a0502324937fda9f999",
62
- id: "20260816090000-runtime-rts-retention",
63
- scope: "tenant",
64
- mode: "online",
65
- rollback: "compatible",
66
- resources: {
67
- before: "62e2e625d7af99bec6bb635ae75aeb3654db151a2162ec375f039664a9638816",
68
- after: "d2f715097972b5e8d5c444a84441e80672e2d7e8d052c0f4947b739f995511cf"
69
- },
70
- async up({ db, resources }) {
71
- if (!resources) throw new Error("Missing RTS retention resource snapshot");
72
- const retention = resources.after.indexes.find((index) => index.collection === "rbrtschanges" && index.name === "ts_1")?.runtimeOptions?.expireAfterSeconds;
73
- if (typeof retention !== "number") throw new Error("Missing RTS retention value");
74
- await db.command({
75
- collMod: "rbrtschanges",
76
- index: {
77
- name: "ts_1",
78
- expireAfterSeconds: retention
79
- }
80
- });
81
- }
82
- });
83
- //#endregion
84
- //#region src/migrations/baselineResources.ts
3
+ //#region src/migrations/resources.ts
85
4
  var global = "global";
86
5
  var tenant = "tenant";
87
6
  var owner = "@rpcbase/db";
88
- var rpcbaseBaselineMongoResources = defineMongoResources({
7
+ var rpcbaseMongoResources = defineMongoResources({
89
8
  collections: [
90
9
  {
91
10
  scope: global,
@@ -367,7 +286,7 @@ var rpcbaseBaselineMongoResources = defineMongoResources({
367
286
  collection: "rbrtschanges",
368
287
  name: "ts_1",
369
288
  key: { ts: 1 },
370
- options: { expireAfterSeconds: 60 },
289
+ options: { expireAfterSeconds: rtsChangesTtlSeconds },
371
290
  owner
372
291
  },
373
292
  {
@@ -497,6 +416,101 @@ var rpcbaseBaselineMongoResources = defineMongoResources({
497
416
  ]
498
417
  });
499
418
  //#endregion
419
+ //#region src/migrations/20260814090000-baseline-global.ts
420
+ var _20260814090000_baseline_global_default = defineMigration({
421
+ __rpcbaseIntegrity: "467b0d0dc32bcaa0e026996aaa59093f63da44ba375649b015c5204d76c881bb",
422
+ id: "20260814090000-baseline-global",
423
+ scope: "global",
424
+ mode: "online",
425
+ rollback: "compatible",
426
+ resources: {
427
+ before: null,
428
+ after: rpcbaseMongoResources.checksum
429
+ },
430
+ async up({ helpers, resources }) {
431
+ if (!resources) throw new Error("Missing baseline resource snapshot");
432
+ for (const index of resources.after.indexes) {
433
+ if (index.options?.unique !== true) continue;
434
+ const sparseFilter = index.options.sparse === true ? { $or: Object.keys(index.key).map((field) => ({ [field]: { $exists: true } })) } : void 0;
435
+ const partialFilter = index.options.partialFilterExpression;
436
+ const filter = sparseFilter && partialFilter ? { $and: [partialFilter, sparseFilter] } : partialFilter ?? sparseFilter;
437
+ const duplicates = await helpers.findDuplicateKeys(index.collection, index.key, {
438
+ ...filter ? { filter } : {},
439
+ ...index.options.collation ? { collation: index.options.collation } : {}
440
+ });
441
+ if (duplicates.length > 0) throw new Error(`Cannot create unique index ${index.collection}.${index.name}: ${JSON.stringify(duplicates)}`);
442
+ }
443
+ await helpers.reconcileResources(resources.after);
444
+ }
445
+ });
446
+ //#endregion
447
+ //#region src/migrations/20260814090100-baseline-tenant.ts
448
+ var _20260814090100_baseline_tenant_default = defineMigration({
449
+ __rpcbaseIntegrity: "a4ef8480c3befadcf18ea83bd77588946ff4ee7b4bb383ab8e59a68b7dee8f85",
450
+ id: "20260814090100-baseline-tenant",
451
+ scope: "tenant",
452
+ mode: "online",
453
+ rollback: "compatible",
454
+ resources: {
455
+ before: null,
456
+ after: rpcbaseMongoResources.checksum
457
+ },
458
+ async up({ helpers, resources }) {
459
+ if (!resources) throw new Error("Missing baseline resource snapshot");
460
+ for (const index of resources.after.indexes) {
461
+ if (index.options?.unique !== true) continue;
462
+ const sparseFilter = index.options.sparse === true ? { $or: Object.keys(index.key).map((field) => ({ [field]: { $exists: true } })) } : void 0;
463
+ const partialFilter = index.options.partialFilterExpression;
464
+ const filter = sparseFilter && partialFilter ? { $and: [partialFilter, sparseFilter] } : partialFilter ?? sparseFilter;
465
+ const duplicates = await helpers.findDuplicateKeys(index.collection, index.key, {
466
+ ...filter ? { filter } : {},
467
+ ...index.options.collation ? { collation: index.options.collation } : {}
468
+ });
469
+ if (duplicates.length > 0) throw new Error(`Cannot create unique index ${index.collection}.${index.name}: ${JSON.stringify(duplicates)}`);
470
+ }
471
+ await helpers.reconcileResources(resources.after);
472
+ }
473
+ });
474
+ //#endregion
475
+ //#region src/migrations/20260816090000-runtime-rts-retention.ts
476
+ var _20260816090000_runtime_rts_retention_default = defineMigration({
477
+ __rpcbaseIntegrity: "b9d2b856d968898563ec9089c6a77c9dab1c5ba02d0f7a0502324937fda9f999",
478
+ id: "20260816090000-runtime-rts-retention",
479
+ scope: "tenant",
480
+ mode: "online",
481
+ rollback: "compatible",
482
+ resources: {
483
+ before: "62e2e625d7af99bec6bb635ae75aeb3654db151a2162ec375f039664a9638816",
484
+ after: "d2f715097972b5e8d5c444a84441e80672e2d7e8d052c0f4947b739f995511cf"
485
+ },
486
+ async up({ db, resources }) {
487
+ if (!resources) throw new Error("Missing RTS retention resource snapshot");
488
+ const retention = resources.after.indexes.find((index) => index.collection === "rbrtschanges" && index.name === "ts_1")?.runtimeOptions?.expireAfterSeconds;
489
+ if (typeof retention !== "number") throw new Error("Missing RTS retention value");
490
+ await db.command({
491
+ collMod: "rbrtschanges",
492
+ index: {
493
+ name: "ts_1",
494
+ expireAfterSeconds: retention
495
+ }
496
+ });
497
+ }
498
+ });
499
+ //#endregion
500
+ //#region src/migrations/baselineResources.ts
501
+ var rpcbaseBaselineMongoResources = defineMongoResources({
502
+ collections: [...rpcbaseMongoResources.collections],
503
+ indexes: rpcbaseMongoResources.indexes.map((index) => index.collection === "rbrtschanges" && index.name === "ts_1" ? {
504
+ ...index,
505
+ options: {
506
+ ...index.options,
507
+ expireAfterSeconds: 60
508
+ }
509
+ } : index),
510
+ searchIndexes: [...rpcbaseMongoResources.searchIndexes],
511
+ collectionValidators: [...rpcbaseMongoResources.collectionValidators]
512
+ });
513
+ //#endregion
500
514
  //#region src/migrations/runtimeRtsRetentionResources.ts
501
515
  var rpcbaseRuntimeRtsRetentionMongoResources = defineMongoResources({
502
516
  collections: [...rpcbaseBaselineMongoResources.collections],
@@ -514,30 +528,28 @@ var rpcbaseRuntimeRtsRetentionMongoResources = defineMongoResources({
514
528
  collectionValidators: [...rpcbaseBaselineMongoResources.collectionValidators]
515
529
  });
516
530
  //#endregion
517
- //#region src/migrations/resources.ts
518
- var rpcbaseMongoResources = defineMongoResources({
519
- collections: [...rpcbaseRuntimeRtsRetentionMongoResources.collections],
520
- indexes: [...rpcbaseRuntimeRtsRetentionMongoResources.indexes],
521
- searchIndexes: [...rpcbaseRuntimeRtsRetentionMongoResources.searchIndexes],
522
- collectionValidators: [...rpcbaseRuntimeRtsRetentionMongoResources.collectionValidators]
523
- });
524
- //#endregion
525
531
  //#region src/migrations/index.ts
532
+ var baselineResources = {
533
+ before: null,
534
+ after: rpcbaseBaselineMongoResources.checksum
535
+ };
526
536
  var rpcbaseMigrationSource = defineMigrationSource({
527
537
  name: "@rpcbase/db",
528
538
  migrations: [
529
- _20260814090000_baseline_global_default,
530
- _20260814090100_baseline_tenant_default,
539
+ {
540
+ ..._20260814090000_baseline_global_default,
541
+ resources: baselineResources
542
+ },
543
+ {
544
+ ..._20260814090100_baseline_tenant_default,
545
+ resources: baselineResources
546
+ },
531
547
  _20260816090000_runtime_rts_retention_default
532
548
  ],
533
- resources: rpcbaseMongoResources,
534
- resourceSnapshots: [
535
- rpcbaseBaselineMongoResources,
536
- rpcbaseRuntimeRtsRetentionMongoResources,
537
- rpcbaseMongoResources
538
- ]
549
+ resources: rpcbaseRuntimeRtsRetentionMongoResources,
550
+ resourceSnapshots: [rpcbaseBaselineMongoResources, rpcbaseRuntimeRtsRetentionMongoResources]
539
551
  });
540
552
  //#endregion
541
- export { rpcbaseMigrationSource as default, rpcbaseMigrationSource, rpcbaseMongoResources };
553
+ export { rpcbaseMigrationSource as default, rpcbaseMigrationSource, rpcbaseRuntimeRtsRetentionMongoResources as rpcbaseMongoResources };
542
554
 
543
555
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["defineMigration","__rpcbaseIntegrity","id","scope","mode","rollback","resources","before","after","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","__rpcbaseIntegrity","id","scope","mode","rollback","resources","before","after","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","__rpcbaseIntegrity","id","scope","mode","rollback","resources","before","after","up","db","Error","retention","indexes","find","index","collection","name","runtimeOptions","expireAfterSeconds","command","collMod","defineMongoResources","global","const","tenant","owner","rpcbaseBaselineMongoResources","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","defineMongoResources","rpcbaseBaselineMongoResources","rtsChangesTtlSeconds","rpcbaseRuntimeRtsRetentionMongoResources","collections","indexes","map","index","collection","name","options","indexOptions","resource","expireAfterSeconds","_baselineTtl","Object","keys","length","runtimeOptions","searchIndexes","collectionValidators","defineMongoResources","rpcbaseRuntimeRtsRetentionMongoResources","rpcbaseMongoResources","collections","indexes","searchIndexes","collectionValidators","defineMigrationSource","baselineGlobal","baselineTenant","runtimeRtsRetention","rpcbaseBaselineMongoResources","rpcbaseMongoResources","rpcbaseRuntimeRtsRetentionMongoResources","rpcbaseMigrationSource","name","migrations","resources","resourceSnapshots"],"sources":["../../src/migrations/20260814090000-baseline-global.ts","../../src/migrations/20260814090100-baseline-tenant.ts","../../src/migrations/20260816090000-runtime-rts-retention.ts","../../src/migrations/baselineResources.ts","../../src/migrations/runtimeRtsRetentionResources.ts","../../src/migrations/resources.ts","../../src/migrations/index.ts"],"sourcesContent":["import { defineMigration } from \"@rpcbase/migrations\"\n\n\nexport default defineMigration({\n __rpcbaseIntegrity: \"1e3bb48e914f377136a22d79a78ba4164eb457be097003a675cfb8864df8baf2\",\n id: \"20260814090000-baseline-global\",\n scope: \"global\",\n mode: \"online\",\n rollback: \"compatible\",\n resources: {\n before: null,\n after: \"62e2e625d7af99bec6bb635ae75aeb3654db151a2162ec375f039664a9638816\",\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\n\nexport default defineMigration({\n __rpcbaseIntegrity: \"0a4fed8912aa300fdd36d7a783e2c00cf5db9a84057d1287340b236edfcd89e4\",\n id: \"20260814090100-baseline-tenant\",\n scope: \"tenant\",\n mode: \"online\",\n rollback: \"compatible\",\n resources: {\n before: null,\n after: \"62e2e625d7af99bec6bb635ae75aeb3654db151a2162ec375f039664a9638816\",\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\n\nexport default defineMigration({\n __rpcbaseIntegrity: \"b9d2b856d968898563ec9089c6a77c9dab1c5ba02d0f7a0502324937fda9f999\",\n id: \"20260816090000-runtime-rts-retention\",\n scope: \"tenant\",\n mode: \"online\",\n rollback: \"compatible\",\n resources: {\n before: \"62e2e625d7af99bec6bb635ae75aeb3654db151a2162ec375f039664a9638816\",\n after: \"d2f715097972b5e8d5c444a84441e80672e2d7e8d052c0f4947b739f995511cf\",\n },\n\n async up({ db, resources }) {\n if (!resources) throw new Error(\"Missing RTS retention resource snapshot\")\n const retention = resources.after.indexes\n .find((index) => index.collection === \"rbrtschanges\" && index.name === \"ts_1\")\n ?.runtimeOptions?.expireAfterSeconds\n if (typeof retention !== \"number\") throw new Error(\"Missing RTS retention value\")\n await db.command({\n collMod: \"rbrtschanges\",\n index: { name: \"ts_1\", expireAfterSeconds: retention },\n })\n },\n})\n","import { defineMongoResources } from \"@rpcbase/migrations\"\n\n\nconst global = \"global\" as const\nconst tenant = \"tenant\" as const\nconst owner = \"@rpcbase/db\"\n\nexport const rpcbaseBaselineMongoResources = 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: 60 },\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 { defineMongoResources } from \"@rpcbase/migrations\"\n\nimport { rpcbaseBaselineMongoResources } from \"./baselineResources\"\nimport { rtsChangesTtlSeconds } from \"./rtsChanges\"\n\n\nexport const rpcbaseRuntimeRtsRetentionMongoResources = defineMongoResources({\n collections: [...rpcbaseBaselineMongoResources.collections],\n indexes: rpcbaseBaselineMongoResources.indexes.map((index) => {\n if (index.collection !== \"rbrtschanges\" || index.name !== \"ts_1\") return index\n const { options: indexOptions, ...resource } = index\n const { expireAfterSeconds: _baselineTtl, ...options } = indexOptions ?? {}\n return {\n ...resource,\n ...(Object.keys(options).length > 0 ? { options } : {}),\n runtimeOptions: { expireAfterSeconds: rtsChangesTtlSeconds },\n }\n }),\n searchIndexes: [...rpcbaseBaselineMongoResources.searchIndexes],\n collectionValidators: [...rpcbaseBaselineMongoResources.collectionValidators],\n})\n","import { defineMongoResources } from \"@rpcbase/migrations\"\n\nimport { rpcbaseRuntimeRtsRetentionMongoResources } from \"./runtimeRtsRetentionResources\"\n\n\nexport const rpcbaseMongoResources = defineMongoResources({\n collections: [...rpcbaseRuntimeRtsRetentionMongoResources.collections],\n indexes: [...rpcbaseRuntimeRtsRetentionMongoResources.indexes],\n searchIndexes: [...rpcbaseRuntimeRtsRetentionMongoResources.searchIndexes],\n collectionValidators: [...rpcbaseRuntimeRtsRetentionMongoResources.collectionValidators],\n})\n","import { defineMigrationSource } from \"@rpcbase/migrations\"\n\nimport baselineGlobal from \"./20260814090000-baseline-global\"\nimport baselineTenant from \"./20260814090100-baseline-tenant\"\nimport runtimeRtsRetention from \"./20260816090000-runtime-rts-retention\"\nimport { rpcbaseBaselineMongoResources } from \"./baselineResources\"\nimport { rpcbaseMongoResources } from \"./resources\"\nimport { rpcbaseRuntimeRtsRetentionMongoResources } from \"./runtimeRtsRetentionResources\"\n\n\nexport { rpcbaseMongoResources }\n\nexport const rpcbaseMigrationSource = defineMigrationSource({\n name: \"@rpcbase/db\",\n migrations: [\n baselineGlobal,\n baselineTenant,\n runtimeRtsRetention,\n ],\n resources: rpcbaseMongoResources,\n resourceSnapshots: [\n rpcbaseBaselineMongoResources,\n rpcbaseRuntimeRtsRetentionMongoResources,\n rpcbaseMongoResources,\n ],\n})\n\nexport default rpcbaseMigrationSource\n"],"mappings":";;;AAGA,IAAA,0CAAeA,gBAAgB;CAC7BC,oBAAoB;CACpBC,IAAI;CACJC,OAAO;CACPC,MAAM;CACNC,UAAU;CACVC,WAAW;EACTC,QAAQ;EACRC,OAAO;CACT;CAEA,MAAMC,GAAG,EAAEC,SAASJ,aAAa;EAC/B,IAAI,CAACA,WAAW,MAAM,IAAIK,MAAM,oCAAoC;EACpE,KAAK,MAAMC,SAASN,UAAUE,MAAMK,SAAS;GAC3C,IAAID,MAAME,SAASC,WAAW,MAAM;GACpC,MAAMC,eAAeJ,MAAME,QAAQG,WAAW,OAC1C,EAAEC,KAAKC,OAAOC,KAAKR,MAAMS,GAAG,CAAC,CAACC,KAAKC,WAAW,GAAGA,QAAQ,EAAEC,SAAS,KAAK,EAAE,EAAE,EAAE,IAC/EC,KAAAA;GACJ,MAAMC,gBAAgBd,MAAME,QAAQa;GACpC,MAAMC,SAASZ,gBAAgBU,gBAC3B,EAAEG,MAAM,CAACH,eAAeV,YAAY,EAAE,IACtCU,iBAAiBV;GACrB,MAAMc,aAAa,MAAMpB,QAAQqB,kBAAkBnB,MAAMoB,YAAYpB,MAAMS,KAAK;IAC9E,GAAIO,SAAS,EAAEA,OAAO,IAAI,CAAC;IAC3B,GAAIhB,MAAME,QAAQmB,YAAY,EAAEA,WAAWrB,MAAME,QAAQmB,UAAU,IAAI,CAAC;GAC1E,CAAC;GACD,IAAIH,WAAWI,SAAS,GACtB,MAAM,IAAIvB,MAAM,8BAA8BC,MAAMoB,WAAU,GAAIpB,MAAMuB,KAAI,IAAKC,KAAKC,UAAUP,UAAU,GAAG;EAEjH;EACA,MAAMpB,QAAQ4B,mBAAmBhC,UAAUE,KAAK;CAClD;AACF,CAAC;;;AChCD,IAAA,0CAAe+B,gBAAgB;CAC7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,yCAAyCI,aAAa;CACzEC,sBAAsB,CAAC,GAAGL,yCAAyCK,oBAAoB;AACzF,CAAC;;;ACED,IAAaQ,yBAAyBP,sBAAsB;CAC1DQ,MAAM;CACNC,YAAY;EACVR;EACAC;EACAC;CAAmB;CAErBO,WAAWL;CACXM,mBAAmB;EACjBP;EACAE;EACAD;CAAqB;AAEzB,CAAC"}
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","defineMigration","__rpcbaseIntegrity","id","scope","mode","rollback","resources","before","after","up","db","Error","retention","indexes","find","index","collection","name","runtimeOptions","expireAfterSeconds","command","collMod","defineMongoResources","rpcbaseMongoResources","rpcbaseBaselineMongoResources","collections","indexes","map","index","collection","name","options","expireAfterSeconds","searchIndexes","collectionValidators","defineMongoResources","rpcbaseBaselineMongoResources","rtsChangesTtlSeconds","rpcbaseRuntimeRtsRetentionMongoResources","collections","indexes","map","index","collection","name","options","indexOptions","resource","expireAfterSeconds","_baselineTtl","Object","keys","length","runtimeOptions","searchIndexes","collectionValidators","defineMigrationSource","baselineGlobal","baselineTenant","runtimeRtsRetention","rpcbaseBaselineMongoResources","rpcbaseRuntimeRtsRetentionMongoResources","rpcbaseMongoResources","baselineResources","before","after","checksum","rpcbaseMigrationSource","name","migrations","resources","resourceSnapshots"],"sources":["../../src/migrations/resources.ts","../../src/migrations/20260814090000-baseline-global.ts","../../src/migrations/20260814090100-baseline-tenant.ts","../../src/migrations/20260816090000-runtime-rts-retention.ts","../../src/migrations/baselineResources.ts","../../src/migrations/runtimeRtsRetentionResources.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 { defineMigration } from \"@rpcbase/migrations\"\n\n\nexport default defineMigration({\n __rpcbaseIntegrity: \"b9d2b856d968898563ec9089c6a77c9dab1c5ba02d0f7a0502324937fda9f999\",\n id: \"20260816090000-runtime-rts-retention\",\n scope: \"tenant\",\n mode: \"online\",\n rollback: \"compatible\",\n resources: {\n before: \"62e2e625d7af99bec6bb635ae75aeb3654db151a2162ec375f039664a9638816\",\n after: \"d2f715097972b5e8d5c444a84441e80672e2d7e8d052c0f4947b739f995511cf\",\n },\n\n async up({ db, resources }) {\n if (!resources) throw new Error(\"Missing RTS retention resource snapshot\")\n const retention = resources.after.indexes\n .find((index) => index.collection === \"rbrtschanges\" && index.name === \"ts_1\")\n ?.runtimeOptions?.expireAfterSeconds\n if (typeof retention !== \"number\") throw new Error(\"Missing RTS retention value\")\n await db.command({\n collMod: \"rbrtschanges\",\n index: { name: \"ts_1\", expireAfterSeconds: retention },\n })\n },\n})\n","import { defineMongoResources } from \"@rpcbase/migrations\"\n\nimport { rpcbaseMongoResources } from \"./resources\"\n\n\nexport const rpcbaseBaselineMongoResources = defineMongoResources({\n collections: [...rpcbaseMongoResources.collections],\n indexes: rpcbaseMongoResources.indexes.map((index) => (\n index.collection === \"rbrtschanges\" && index.name === \"ts_1\"\n ? {\n ...index,\n options: { ...index.options, expireAfterSeconds: 60 },\n }\n : index\n )),\n searchIndexes: [...rpcbaseMongoResources.searchIndexes],\n collectionValidators: [...rpcbaseMongoResources.collectionValidators],\n})\n","import { defineMongoResources } from \"@rpcbase/migrations\"\n\nimport { rpcbaseBaselineMongoResources } from \"./baselineResources\"\nimport { rtsChangesTtlSeconds } from \"./rtsChanges\"\n\n\nexport const rpcbaseRuntimeRtsRetentionMongoResources = defineMongoResources({\n collections: [...rpcbaseBaselineMongoResources.collections],\n indexes: rpcbaseBaselineMongoResources.indexes.map((index) => {\n if (index.collection !== \"rbrtschanges\" || index.name !== \"ts_1\") return index\n const { options: indexOptions, ...resource } = index\n const { expireAfterSeconds: _baselineTtl, ...options } = indexOptions ?? {}\n return {\n ...resource,\n ...(Object.keys(options).length > 0 ? { options } : {}),\n runtimeOptions: { expireAfterSeconds: rtsChangesTtlSeconds },\n }\n }),\n searchIndexes: [...rpcbaseBaselineMongoResources.searchIndexes],\n collectionValidators: [...rpcbaseBaselineMongoResources.collectionValidators],\n})\n","import { defineMigrationSource } from \"@rpcbase/migrations\"\n\nimport baselineGlobal from \"./20260814090000-baseline-global\"\nimport baselineTenant from \"./20260814090100-baseline-tenant\"\nimport runtimeRtsRetention from \"./20260816090000-runtime-rts-retention\"\nimport { rpcbaseBaselineMongoResources } from \"./baselineResources\"\nimport { rpcbaseRuntimeRtsRetentionMongoResources } from \"./runtimeRtsRetentionResources\"\n\n\nexport { rpcbaseRuntimeRtsRetentionMongoResources as rpcbaseMongoResources }\n\nconst baselineResources = {\n before: null,\n after: rpcbaseBaselineMongoResources.checksum,\n}\n\nexport const rpcbaseMigrationSource = defineMigrationSource({\n name: \"@rpcbase/db\",\n migrations: [\n { ...baselineGlobal, resources: baselineResources },\n { ...baselineTenant, resources: baselineResources },\n runtimeRtsRetention,\n ],\n resources: rpcbaseRuntimeRtsRetentionMongoResources,\n resourceSnapshots: [\n rpcbaseBaselineMongoResources,\n rpcbaseRuntimeRtsRetentionMongoResources,\n ],\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;GAA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AwC;AAE5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/migrations/resources.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB,8CAKhC,CAAA"}
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/migrations/resources.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,qBAAqB,8CAqThC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/db",
3
- "version": "0.139.0",
3
+ "version": "0.141.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"