@quereus/store 4.5.0 → 4.7.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.
Files changed (107) hide show
  1. package/README.md +34 -6
  2. package/dist/src/common/encoding.d.ts +4 -3
  3. package/dist/src/common/encoding.d.ts.map +1 -1
  4. package/dist/src/common/encoding.js +17 -13
  5. package/dist/src/common/encoding.js.map +1 -1
  6. package/dist/src/common/events.d.ts +31 -25
  7. package/dist/src/common/events.d.ts.map +1 -1
  8. package/dist/src/common/events.js +38 -39
  9. package/dist/src/common/events.js.map +1 -1
  10. package/dist/src/common/implicit-unique-index.d.ts +80 -0
  11. package/dist/src/common/implicit-unique-index.d.ts.map +1 -0
  12. package/dist/src/common/implicit-unique-index.js +148 -0
  13. package/dist/src/common/implicit-unique-index.js.map +1 -0
  14. package/dist/src/common/index.d.ts +7 -3
  15. package/dist/src/common/index.d.ts.map +1 -1
  16. package/dist/src/common/index.js +5 -2
  17. package/dist/src/common/index.js.map +1 -1
  18. package/dist/src/common/json-key.d.ts +30 -2
  19. package/dist/src/common/json-key.d.ts.map +1 -1
  20. package/dist/src/common/json-key.js +49 -2
  21. package/dist/src/common/json-key.js.map +1 -1
  22. package/dist/src/common/key-builder.d.ts +40 -20
  23. package/dist/src/common/key-builder.d.ts.map +1 -1
  24. package/dist/src/common/key-builder.js +31 -23
  25. package/dist/src/common/key-builder.js.map +1 -1
  26. package/dist/src/common/kv-store.d.ts +10 -0
  27. package/dist/src/common/kv-store.d.ts.map +1 -1
  28. package/dist/src/common/pk-key-resolution.d.ts +348 -0
  29. package/dist/src/common/pk-key-resolution.d.ts.map +1 -0
  30. package/dist/src/common/pk-key-resolution.js +481 -0
  31. package/dist/src/common/pk-key-resolution.js.map +1 -0
  32. package/dist/src/common/store-module-access-plan.d.ts +32 -0
  33. package/dist/src/common/store-module-access-plan.d.ts.map +1 -0
  34. package/dist/src/common/store-module-access-plan.js +428 -0
  35. package/dist/src/common/store-module-access-plan.js.map +1 -0
  36. package/dist/src/common/store-module-alter-column.d.ts +23 -0
  37. package/dist/src/common/store-module-alter-column.d.ts.map +1 -0
  38. package/dist/src/common/store-module-alter-column.js +389 -0
  39. package/dist/src/common/store-module-alter-column.js.map +1 -0
  40. package/dist/src/common/store-module-alter.d.ts +55 -0
  41. package/dist/src/common/store-module-alter.d.ts.map +1 -0
  42. package/dist/src/common/store-module-alter.js +504 -0
  43. package/dist/src/common/store-module-alter.js.map +1 -0
  44. package/dist/src/common/store-module-base.d.ts +268 -0
  45. package/dist/src/common/store-module-base.d.ts.map +1 -0
  46. package/dist/src/common/store-module-base.js +362 -0
  47. package/dist/src/common/store-module-base.js.map +1 -0
  48. package/dist/src/common/store-module-catalog.d.ts +269 -0
  49. package/dist/src/common/store-module-catalog.d.ts.map +1 -0
  50. package/dist/src/common/store-module-catalog.js +462 -0
  51. package/dist/src/common/store-module-catalog.js.map +1 -0
  52. package/dist/src/common/store-module-index-build.d.ts +88 -0
  53. package/dist/src/common/store-module-index-build.d.ts.map +1 -0
  54. package/dist/src/common/store-module-index-build.js +280 -0
  55. package/dist/src/common/store-module-index-build.js.map +1 -0
  56. package/dist/src/common/store-module-index.d.ts +116 -0
  57. package/dist/src/common/store-module-index.d.ts.map +1 -0
  58. package/dist/src/common/store-module-index.js +373 -0
  59. package/dist/src/common/store-module-index.js.map +1 -0
  60. package/dist/src/common/store-module-rename.d.ts +49 -0
  61. package/dist/src/common/store-module-rename.d.ts.map +1 -0
  62. package/dist/src/common/store-module-rename.js +268 -0
  63. package/dist/src/common/store-module-rename.js.map +1 -0
  64. package/dist/src/common/store-module-schema-rewrite.d.ts +57 -0
  65. package/dist/src/common/store-module-schema-rewrite.d.ts.map +1 -0
  66. package/dist/src/common/store-module-schema-rewrite.js +140 -0
  67. package/dist/src/common/store-module-schema-rewrite.js.map +1 -0
  68. package/dist/src/common/store-module-schema-sync.d.ts +232 -0
  69. package/dist/src/common/store-module-schema-sync.d.ts.map +1 -0
  70. package/dist/src/common/store-module-schema-sync.js +529 -0
  71. package/dist/src/common/store-module-schema-sync.js.map +1 -0
  72. package/dist/src/common/store-module.d.ts +43 -909
  73. package/dist/src/common/store-module.d.ts.map +1 -1
  74. package/dist/src/common/store-module.js +184 -3276
  75. package/dist/src/common/store-module.js.map +1 -1
  76. package/dist/src/common/store-table-base.d.ts +539 -0
  77. package/dist/src/common/store-table-base.d.ts.map +1 -0
  78. package/dist/src/common/store-table-base.js +900 -0
  79. package/dist/src/common/store-table-base.js.map +1 -0
  80. package/dist/src/common/store-table-constraints.d.ts +237 -0
  81. package/dist/src/common/store-table-constraints.d.ts.map +1 -0
  82. package/dist/src/common/store-table-constraints.js +624 -0
  83. package/dist/src/common/store-table-constraints.js.map +1 -0
  84. package/dist/src/common/store-table-scan.d.ts +452 -0
  85. package/dist/src/common/store-table-scan.d.ts.map +1 -0
  86. package/dist/src/common/store-table-scan.js +901 -0
  87. package/dist/src/common/store-table-scan.js.map +1 -0
  88. package/dist/src/common/store-table.d.ts +71 -1144
  89. package/dist/src/common/store-table.d.ts.map +1 -1
  90. package/dist/src/common/store-table.js +168 -2385
  91. package/dist/src/common/store-table.js.map +1 -1
  92. package/dist/src/testing/index.d.ts +12 -0
  93. package/dist/src/testing/index.d.ts.map +1 -0
  94. package/dist/src/testing/index.js +12 -0
  95. package/dist/src/testing/index.js.map +1 -0
  96. package/dist/src/testing/kv-assert.d.ts +19 -0
  97. package/dist/src/testing/kv-assert.d.ts.map +1 -0
  98. package/dist/src/testing/kv-assert.js +25 -0
  99. package/dist/src/testing/kv-assert.js.map +1 -0
  100. package/dist/src/testing/kv-conformance.d.ts.map +1 -1
  101. package/dist/src/testing/kv-conformance.js +1 -15
  102. package/dist/src/testing/kv-conformance.js.map +1 -1
  103. package/dist/src/testing/kv-provider-conformance.d.ts +54 -0
  104. package/dist/src/testing/kv-provider-conformance.d.ts.map +1 -0
  105. package/dist/src/testing/kv-provider-conformance.js +183 -0
  106. package/dist/src/testing/kv-provider-conformance.js.map +1 -0
  107. package/package.json +8 -8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-table-base.js","sourceRoot":"","sources":["../../../src/common/store-table-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,iBAAiB,GAYjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,cAAc,EACd,cAAc,EACd,gBAAgB,GAEhB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACzK,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,wDAAwD;AACxD,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,2EAA2E;AAC3E,SAAS,eAAe,CAAC,GAAe,EAAE,MAAsB;IAC/D,IAAI,MAAM,CAAC,GAAG,IAAI,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAClE,IAAI,MAAM,CAAC,EAAE,IAAI,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACjE,IAAI,MAAM,CAAC,GAAG,IAAI,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAClE,IAAI,MAAM,CAAC,EAAE,IAAI,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC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C3E,IAAI,CAAC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACxC,IAAI,CAAC,aAAa,EAAE,CAAC;QAErB,sCAAsC;QACtC,IAAI,IAAI,CAAC,aAAa,IAAI,oBAAoB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC3E,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;YAC9B,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;CACD"}
@@ -0,0 +1,237 @@
1
+ /**
2
+ * Secondary-index maintenance and UNIQUE enforcement for the KVStore-backed
3
+ * virtual table — the two halves of keeping a table's indexes and uniqueness
4
+ * invariants true across a write. Index upkeep is how UNIQUE is enforced (a
5
+ * conflict is answered by a seek when an index soundly covers the constraint's
6
+ * enforcement collations, and by a data-store scan otherwise), and a REPLACE
7
+ * eviction needs both.
8
+ *
9
+ * Third layer of the store-table chain:
10
+ * StoreTableBase -> StoreTableScan -> StoreTableConstraints -> StoreTable
11
+ */
12
+ import { ConflictResolution, type Row, type SqlValue, type UpdateResult, type BackingRowChange } from '@quereus/quereus';
13
+ import { StoreTableScan } from './store-table-scan.js';
14
+ /**
15
+ * Index-maintenance and UNIQUE-enforcement layer of the generic KVStore-backed
16
+ * virtual table.
17
+ *
18
+ * Conflict detection compares under the constraint's ENFORCEMENT collations,
19
+ * which need not match the collations the index keys under — every index-seek
20
+ * shortcut here is gated on that agreement and falls back to the data-store scan
21
+ * when it cannot be shown.
22
+ */
23
+ export declare abstract class StoreTableConstraints extends StoreTableScan {
24
+ private readonly predicateCache;
25
+ private readonly indexPredicateCache;
26
+ /**
27
+ * Update secondary indexes after a row change.
28
+ *
29
+ * For PK-change UPDATE, `oldPk` (where the existing entry lives) and `newPk`
30
+ * (where the relocated entry will live) differ; using a single pk for both
31
+ * sides leaks the old entry. Other paths pass the same pk for both.
32
+ */
33
+ protected updateSecondaryIndexes(inTransaction: boolean, oldRow: Row | null, newRow: Row | null, oldPk: SqlValue[], newPk?: SqlValue[]): Promise<void>;
34
+ /**
35
+ * Returns the compiled predicate for a partial-UNIQUE constraint, or undefined
36
+ * when the constraint covers the full table. Compilation is memoized per
37
+ * UniqueConstraintSchema instance so the hot UNIQUE-check path doesn't recompile.
38
+ */
39
+ private compileFor;
40
+ /**
41
+ * Returns the compiled predicate for a partial secondary index, or undefined
42
+ * for a full index. Compilation is memoized per IndexSchema instance so the hot
43
+ * DML index-maintenance path doesn't recompile.
44
+ */
45
+ private compileIndexFor;
46
+ /**
47
+ * Check if two PK arrays name the same row. A semantic-ordering member compares
48
+ * through its type's `compare` (see {@link resolvePkSemanticEquality}) so
49
+ * differently-spelled equal values ('PT1H' / 'PT60M') answer "same row",
50
+ * agreeing with the physical key identity {@link encodeDataKey} produces; every
51
+ * other member keeps the original strict `!==`.
52
+ */
53
+ protected keysEqual(a: SqlValue[], b: SqlValue[]): boolean;
54
+ /**
55
+ * Per-constrained-column comparison functions for one UNIQUE constraint: the
56
+ * type's `compare` for a semantic-ordering column (so 'PT1H' conflicts with
57
+ * 'PT60M', matching the memory backend's typed BTree), else the enforcement
58
+ * collation the caller resolved (`resolveUniqueEnforcementCollations`) through
59
+ * `compareSqlValuesFast` — the exact comparison every finder used before.
60
+ *
61
+ * Thin wrapper over the engine's `uniqueEnforcementComparators`, which memory
62
+ * and the isolation overlay share so the three backends cannot drift.
63
+ */
64
+ private uniqueColumnComparators;
65
+ /**
66
+ * Returns true if any column covered by a UNIQUE constraint differs between
67
+ * oldRow and newRow, or — for partial UNIQUE — any column referenced by the
68
+ * partial predicate differs (which can transition the row across the
69
+ * predicate scope and re-trigger the uniqueness check).
70
+ */
71
+ protected uniqueColumnsChanged(oldRow: Row, newRow: Row): boolean;
72
+ /**
73
+ * Enforce table-level UNIQUE constraints against the prospective newRow.
74
+ * Honors `onConflict`: IGNORE returns an ok-with-undefined-row; REPLACE
75
+ * deletes the conflicting row(s) and continues; otherwise returns a
76
+ * constraint result. Returns null when all constraints pass.
77
+ *
78
+ * Rows whose PK is in `selfPks` are skipped (the row being inserted/updated).
79
+ * NULL in any covered column skips that constraint (multiple NULLs are allowed
80
+ * per SQL standard).
81
+ *
82
+ * Reads through the transaction coordinator's pending writes when active so
83
+ * intra-transaction duplicates are detected.
84
+ *
85
+ * REPLACE evictions (rows at OTHER PKs) are deleted from storage and pushed onto
86
+ * `evicted` so the DML executor runs the full delete pipeline for each
87
+ * (change-tracking, row-time MV maintenance, FK cascade, auto-events).
88
+ */
89
+ protected checkUniqueConstraints(inTransaction: boolean, newRow: Row, selfPks: SqlValue[][], onConflict: ConflictResolution | undefined, evicted: Row[]): Promise<UpdateResult | null>;
90
+ /**
91
+ * Route one UNIQUE constraint's conflict search to the cheapest SOUND finder,
92
+ * in descending preference:
93
+ *
94
+ * 1. A linked row-time covering MV — its backing table (hosted by any
95
+ * backing-host-capable module — memory by default, this store module under
96
+ * `using store` — queried through the db with reads-own-writes) answers the
97
+ * uniqueness question, mirroring the memory enforcement path.
98
+ * 2. A physical secondary index realizing the constraint — one prefix seek
99
+ * instead of a full table scan (see {@link findIndexForUniqueConstraint}).
100
+ * 3. The full data-store scan ({@link findUniqueConflict}) — always correct,
101
+ * O(rows) per checked row.
102
+ *
103
+ * Every finder returns the SAME `{pk, row}` shape, so the caller's conflict
104
+ * action (ABORT / IGNORE / REPLACE eviction) is finder-independent.
105
+ */
106
+ private findUniqueConflictFor;
107
+ /**
108
+ * The `schema.indexes` entry whose physical index store can serve `uc`'s
109
+ * conflict search as a point seek, or undefined when none can.
110
+ *
111
+ * Every non-derived UNIQUE is realized by an index in the materialized schema
112
+ * — a hidden `_uc_*`, or the explicit index it reuses when one covers the same
113
+ * columns (see {@link withImplicitUniqueIndexes} /
114
+ * {@link findReusableIndexForUnique}) — so, like the memory backend, a plain
115
+ * column- or table-level `UNIQUE` is index-servable, not only an explicit
116
+ * `CREATE INDEX`. A UC is index-servable when:
117
+ *
118
+ * - it is index-derived (`derivedFromIndex`, from `CREATE UNIQUE INDEX`) and
119
+ * its named index is still present — the index's partial predicate then
120
+ * equals the constraint's by construction (`appendIndexToTableSchema`); or
121
+ * - some index's columns equal `uc.columns` positionally AND whose predicate
122
+ * is the SAME object as `uc.predicate` (reference identity — the implicit
123
+ * materializer sets it that way). For a FULL UNIQUE that is
124
+ * `undefined === undefined`, which also admits any user full index over the
125
+ * same columns. For a PARTIAL `unique(...) where p` it admits only the
126
+ * co-scoped `_uc_*` (which holds exactly the in-scope rows); an arbitrary
127
+ * user partial index with a DIFFERENT predicate object stays conservative
128
+ * (declined → full scan), because it physically omits rows the constraint
129
+ * still covers. The serving index need not be UNIQUE — a plain index over
130
+ * the constrained columns still holds every in-scope row.
131
+ *
132
+ * Collation guard (see {@link indexSeekHonorsEnforcementCollation}) may still
133
+ * reject the found index, which routes the check back to the full scan.
134
+ */
135
+ private findIndexForUniqueConstraint;
136
+ /**
137
+ * True when a point seek into `index` returns a SUPERSET of `uc`'s true conflict
138
+ * set — the only condition under which the seek may replace the full scan.
139
+ *
140
+ * An index key's leading (index-column) bytes are encoded under the index's own
141
+ * per-column key collations (`resolveIndexKeyCollations`), and the constraint
142
+ * re-validates candidates under its enforcement collations
143
+ * (`uniqueEnforcementCollations` — the index's per-column COLLATE for an
144
+ * index-derived UC, else the declared column collation). For every index a
145
+ * *designed* path can hand this method, the two resolve identically by
146
+ * construction — the seek window is then exactly the C-equal set — so the check
147
+ * is a plain per-column equality of the two resolutions (upper-cased; never-text
148
+ * columns exempt, their bytes being type-native).
149
+ *
150
+ * Kept rather than deleted because one undesigned path can still disagree:
151
+ * `withImplicitUniqueIndexes` skips materializing a `_uc_*` whose NAME is already
152
+ * taken (a user index literally named `_uc_email`, or a named UC colliding with an
153
+ * index name), and the column-set fallback in
154
+ * {@link findIndexForUniqueConstraint} can then hand this a same-columns index
155
+ * whose key collations differ from the enforcement collations. A false `true`
156
+ * there silently accepts a duplicate; a decline only costs the full scan.
157
+ */
158
+ private indexSeekHonorsEnforcementCollation;
159
+ /**
160
+ * The index analogue of {@link findUniqueConflict}: seek the index realizing
161
+ * `uc` at the point formed by `newRow`'s constrained-column values, and
162
+ * re-validate each resolved candidate exactly as the full scan does.
163
+ *
164
+ * The seek encodes ALL of `uc.columns` (positionally aligned with the index's
165
+ * columns, guaranteed by `appendIndexToTableSchema` / the column-set match in
166
+ * {@link findIndexForUniqueConstraint}) as a leading prefix of the index key,
167
+ * under the same key collation and per-column DESC directions
168
+ * {@link updateSecondaryIndexes} used to write it. The remaining suffix is the
169
+ * row's PK, so the window spans every entry sharing those column values.
170
+ * {@link iterateEffective} merges this transaction's pending index puts/deletes
171
+ * over the committed entries, giving read-your-own-writes; each entry resolves
172
+ * to its LIVE row through the data key stored as the entry's value.
173
+ *
174
+ * The seek only narrows the CANDIDATE set to a superset (guaranteed by
175
+ * {@link indexSeekHonorsEnforcementCollation}); the authoritative comparison is
176
+ * the identical self-PK exclusion, per-column enforcement-collation compare,
177
+ * and partial-predicate scope check the full scan performs. A partial index
178
+ * already excludes out-of-scope rows physically — the predicate re-check is
179
+ * kept as defense in depth.
180
+ *
181
+ * Returns {@link INDEX_UNUSABLE} rather than a (possibly wrong) answer when an
182
+ * entry carries a legacy empty value.
183
+ */
184
+ private findUniqueConflictViaIndex;
185
+ /**
186
+ * Scan committed + pending data rows for a row matching `newRow` on
187
+ * `uc.columns` whose PK is not in `selfPks`. For partial UNIQUE, candidates
188
+ * whose row does not satisfy the predicate are skipped. Returns the first
189
+ * match or null.
190
+ */
191
+ private findUniqueConflict;
192
+ /**
193
+ * Find a UNIQUE conflict through a linked row-time covering MV's backing table
194
+ * (the store analogue of the memory `checkUniqueViaMaterializedView`). The
195
+ * backing scan yields candidate conflicting **source** PKs (reads-own-writes via
196
+ * the backing's coordinated connection); each is validated against the *live*
197
+ * store row (committed + this transaction's pending overlay) so a backing entry
198
+ * that lags a row deleted/updated internally this statement is skipped rather
199
+ * than raised as a false conflict. Returns the first real conflict or null.
200
+ */
201
+ private findUniqueConflictViaCoveringMv;
202
+ /**
203
+ * Declared secondary-UNIQUE enforcement for maintenance writes — the store
204
+ * mirror of the memory manager's `enforceSecondaryUniqueOnMaintenance` (see
205
+ * `vtab/backing-host.ts` § Constraint validation for the contract and
206
+ * docs/mv-constraints.md § Derived-row constraint validation for the
207
+ * semantics). Called by `StoreBackingHost.applyMaintenance` AFTER the op
208
+ * batch lands in the coordinator's pending state: post-batch is load-bearing
209
+ * (a `replace-all` diff applies puts before deletes, so a per-op check would
210
+ * false-positive when the derived set moves a unique value between primary
211
+ * keys), and checking only the WRITTEN images is complete (pre-existing
212
+ * contents already satisfied the constraint).
213
+ *
214
+ * Reuses {@link findUniqueConflict} — pending-overlay reads, per-column
215
+ * collations, NULL-pass, partial-predicate scope, self-PK exclusion — with
216
+ * the covering-MV route deliberately bypassed: a covering MV over THIS table
217
+ * is cascade-maintained only after the batch returns, so it lags the batch
218
+ * and would miss a same-batch colliding pair. The conflict action is a hard
219
+ * abort (a derivation write carries no user OR clause, and a declared
220
+ * `on conflict replace`/`ignore` default must not evict or drop derived
221
+ * rows). Per-image cost is one effective full scan: unlike the DML path
222
+ * ({@link findUniqueConflictFor}), this one is NOT routed through
223
+ * {@link findUniqueConflictViaIndex}, because a backing table keeps no
224
+ * secondary indexes by design — there is never an index store to seek.
225
+ *
226
+ * Zero overhead when the table declares no secondary UNIQUE (every MV-sugar
227
+ * backing, and most maintained tables): one empty-array check.
228
+ */
229
+ enforceSecondaryUniqueForMaintenance(changes: readonly BackingRowChange[]): Promise<void>;
230
+ /**
231
+ * Fully delete the row at `pk` (data + secondary indexes + stats + delete event).
232
+ * Used by REPLACE conflict resolution to evict a conflicting unique row before
233
+ * the caller's insert/update proceeds.
234
+ */
235
+ protected deleteRowAt(inTransaction: boolean, pk: SqlValue[], oldRow: Row): Promise<void>;
236
+ }
237
+ //# sourceMappingURL=store-table-constraints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-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