@noy-db/hub 0.2.0-pre.14 → 0.2.0-pre.15
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/aggregate/index.cjs +56 -56
- package/dist/aggregate/index.cjs.map +1 -1
- package/dist/aggregate/index.d.cts +2 -2
- package/dist/aggregate/index.d.ts +2 -2
- package/dist/aggregate/index.js +3 -3
- package/dist/attestation/index.d.cts +5 -5
- package/dist/attestation/index.d.ts +5 -5
- package/dist/blobs/index.d.cts +6 -6
- package/dist/blobs/index.d.ts +6 -6
- package/dist/bundle/index.cjs +426 -68
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +7 -7
- package/dist/bundle/index.d.ts +7 -7
- package/dist/bundle/index.js +1 -1
- package/dist/{chunk-3EWA37FV.js → chunk-3EWXMOK3.js} +7 -266
- package/dist/chunk-3EWXMOK3.js.map +1 -0
- package/dist/{chunk-ACKFRSAH.js → chunk-7EFFHEN5.js} +26 -19
- package/dist/chunk-7EFFHEN5.js.map +1 -0
- package/dist/{chunk-UWNYBOOO.js → chunk-C5T5AFWN.js} +2 -2
- package/dist/chunk-CJORTUJ2.js +524 -0
- package/dist/chunk-CJORTUJ2.js.map +1 -0
- package/dist/{chunk-YNTBADIY.js → chunk-CZI2A4MQ.js} +2 -2
- package/dist/{chunk-KGCORI4L.js → chunk-EYVQHAGH.js} +266 -66
- package/dist/chunk-EYVQHAGH.js.map +1 -0
- package/dist/{chunk-NP6EZT44.js → chunk-IQLVUT37.js} +2 -2
- package/dist/{chunk-4PEFEETV.js → chunk-KIP6JLTF.js} +2 -2
- package/dist/{chunk-ZWTNWAO4.js → chunk-NU6Q3FOR.js} +3 -3
- package/dist/chunk-NU6Q3FOR.js.map +1 -0
- package/dist/{chunk-WIBHRONM.js → chunk-XWH4MXIU.js} +2 -2
- package/dist/consent/index.d.cts +6 -6
- package/dist/consent/index.d.ts +6 -6
- package/dist/derivations/index.d.cts +7 -7
- package/dist/derivations/index.d.ts +7 -7
- package/dist/{dev-unlock-DV7ujTCI.d.ts → dev-unlock-iAS8z9jc.d.ts} +1 -1
- package/dist/{dev-unlock-BF4OSxRv.d.cts → dev-unlock-nVkuRLLe.d.cts} +1 -1
- package/dist/{executor-723ZP6TH.js → executor-HSSRXDOB.js} +4 -4
- package/dist/guards/index.d.cts +7 -7
- package/dist/guards/index.d.ts +7 -7
- package/dist/{hash-BcF5WQXl.d.cts → hash-Cv6byZs7.d.cts} +1 -1
- package/dist/{hash-DswxkLtW.d.ts → hash-DHOnRarj.d.ts} +1 -1
- package/dist/history/index.d.cts +7 -7
- package/dist/history/index.d.ts +7 -7
- package/dist/i18n/index.d.cts +6 -6
- package/dist/i18n/index.d.ts +6 -6
- package/dist/{immutable-guard-C8IYdzfu.d.ts → immutable-guard-BehB1YGB.d.ts} +1 -1
- package/dist/{immutable-guard-7KqslW2K.d.cts → immutable-guard-yBEOYmif.d.cts} +1 -1
- package/dist/{index-CUVOMtgg.d.cts → index-D95VK1Qy.d.cts} +11 -3
- package/dist/{index-Cqzp4tt9.d.ts → index-XNB2r6bX.d.ts} +11 -3
- package/dist/index.cjs +567 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +145 -15
- package/dist/index.d.ts +145 -15
- package/dist/index.js +132 -16
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs +92 -31
- package/dist/indexing/index.cjs.map +1 -1
- package/dist/indexing/index.d.cts +3 -3
- package/dist/indexing/index.d.ts +3 -3
- package/dist/indexing/index.js +3 -3
- package/dist/{lazy-builder-D5GU14TS.d.ts → lazy-builder-ChSqcF5t.d.ts} +1 -1
- package/dist/{lazy-builder-Ci5_YG73.d.cts → lazy-builder-eYZzLEL1.d.cts} +1 -1
- package/dist/materialized-views/index.cjs +2 -2
- package/dist/materialized-views/index.cjs.map +1 -1
- package/dist/materialized-views/index.d.cts +7 -7
- package/dist/materialized-views/index.d.ts +7 -7
- package/dist/materialized-views/index.js +5 -5
- package/dist/{noydb-VZ4JVW55.js → noydb-GZGFBA4E.js} +8 -8
- package/dist/overlay-views/index.d.cts +7 -7
- package/dist/overlay-views/index.d.ts +7 -7
- package/dist/periods/index.d.cts +6 -6
- package/dist/periods/index.d.ts +6 -6
- package/dist/{predicate-Bt5ft-9c.d.cts → predicate-BmhBSPCH.d.cts} +59 -2
- package/dist/{predicate-Bt5ft-9c.d.ts → predicate-BmhBSPCH.d.ts} +59 -2
- package/dist/query/index.cjs +580 -195
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +5 -5
- package/dist/session/index.d.cts +7 -7
- package/dist/session/index.d.ts +7 -7
- package/dist/shadow/index.d.cts +6 -6
- package/dist/shadow/index.d.ts +6 -6
- package/dist/snapshots/index.d.cts +6 -6
- package/dist/snapshots/index.d.ts +6 -6
- package/dist/{stale-7FRJVHN6.js → stale-JH67FU57.js} +2 -2
- package/dist/store/index.d.cts +6 -6
- package/dist/store/index.d.ts +6 -6
- package/dist/{strategy-CrS7PnbE.d.ts → strategy-CbneC7bS.d.cts} +1 -1
- package/dist/{strategy-CrS7PnbE.d.cts → strategy-CbneC7bS.d.ts} +1 -1
- package/dist/sync/index.d.cts +5 -5
- package/dist/sync/index.d.ts +5 -5
- package/dist/team/index.d.cts +6 -6
- package/dist/team/index.d.ts +6 -6
- package/dist/tx/index.d.cts +6 -6
- package/dist/tx/index.d.ts +6 -6
- package/dist/{types-BFHQUjdy.d.ts → types-4t1-tWS4.d.ts} +22 -7
- package/dist/{types-V5R2-pd4.d.cts → types-BpPV5uyy.d.cts} +22 -7
- package/dist/{ulid-CwNf9e6-.d.cts → ulid-CiPrpGqm.d.cts} +1 -1
- package/dist/{ulid-p2nKiiKg.d.ts → ulid-DAfenvFd.d.ts} +1 -1
- package/dist/{vault-group-W7QC4UYW.js → vault-group-KOM7QRJG.js} +3 -3
- package/dist/{with-derivation-C9K43BOB.d.cts → with-derivation-DBqJB3dQ.d.cts} +1 -1
- package/dist/{with-derivation-Ds9yZgCj.d.ts → with-derivation-OK9M2sJE.d.ts} +1 -1
- package/dist/{with-materialized-view-DwR4jkV5.d.ts → with-materialized-view-Dt-ufPWQ.d.ts} +1 -1
- package/dist/{with-materialized-view-DgQcAjYv.d.cts → with-materialized-view-NzuxYPDF.d.cts} +1 -1
- package/dist/{with-overlayed-view-7-rUB3vD.d.cts → with-overlayed-view-CC0_ocy-.d.cts} +1 -1
- package/dist/{with-overlayed-view-ByyhHdVr.d.ts → with-overlayed-view-eDvMs6LO.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-3EWA37FV.js.map +0 -1
- package/dist/chunk-ACKFRSAH.js.map +0 -1
- package/dist/chunk-KGCORI4L.js.map +0 -1
- package/dist/chunk-TV3YZ35S.js +0 -90
- package/dist/chunk-TV3YZ35S.js.map +0 -1
- package/dist/chunk-ZWTNWAO4.js.map +0 -1
- /package/dist/{chunk-UWNYBOOO.js.map → chunk-C5T5AFWN.js.map} +0 -0
- /package/dist/{chunk-YNTBADIY.js.map → chunk-CZI2A4MQ.js.map} +0 -0
- /package/dist/{chunk-NP6EZT44.js.map → chunk-IQLVUT37.js.map} +0 -0
- /package/dist/{chunk-4PEFEETV.js.map → chunk-KIP6JLTF.js.map} +0 -0
- /package/dist/{chunk-WIBHRONM.js.map → chunk-XWH4MXIU.js.map} +0 -0
- /package/dist/{executor-723ZP6TH.js.map → executor-HSSRXDOB.js.map} +0 -0
- /package/dist/{noydb-VZ4JVW55.js.map → noydb-GZGFBA4E.js.map} +0 -0
- /package/dist/{stale-7FRJVHN6.js.map → stale-JH67FU57.js.map} +0 -0
- /package/dist/{vault-group-W7QC4UYW.js.map → vault-group-KOM7QRJG.js.map} +0 -0
package/dist/aggregate/index.cjs
CHANGED
|
@@ -162,62 +162,6 @@ function buildLiveAggregation(recompute, upstreams) {
|
|
|
162
162
|
return new LiveAggregationImpl(recompute, upstreams);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
// src/query/predicate.ts
|
|
166
|
-
function readPath(record, path) {
|
|
167
|
-
if (record === null || record === void 0) return void 0;
|
|
168
|
-
if (!path.includes(".")) {
|
|
169
|
-
return record[path];
|
|
170
|
-
}
|
|
171
|
-
const segments = path.split(".");
|
|
172
|
-
let cursor = record;
|
|
173
|
-
for (const segment of segments) {
|
|
174
|
-
if (cursor === null || cursor === void 0) return void 0;
|
|
175
|
-
cursor = cursor[segment];
|
|
176
|
-
}
|
|
177
|
-
return cursor;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// src/aggregate/canonical-key.ts
|
|
181
|
-
function canonicalGroupKey(fields, row) {
|
|
182
|
-
const sorted = [...fields].sort();
|
|
183
|
-
const parts = [];
|
|
184
|
-
for (const name of sorted) {
|
|
185
|
-
const v = row[name];
|
|
186
|
-
const serialised = v === void 0 ? "undefined" : JSON.stringify(v);
|
|
187
|
-
parts.push(`${name}=${serialised}`);
|
|
188
|
-
}
|
|
189
|
-
return parts.join("|");
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// src/errors.ts
|
|
193
|
-
var NoydbError = class extends Error {
|
|
194
|
-
/** Machine-readable error code. Stable across library versions. */
|
|
195
|
-
code;
|
|
196
|
-
constructor(code, message) {
|
|
197
|
-
super(message);
|
|
198
|
-
this.name = "NoydbError";
|
|
199
|
-
this.code = code;
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
var GroupCardinalityError = class extends NoydbError {
|
|
203
|
-
/** The field being grouped on. */
|
|
204
|
-
field;
|
|
205
|
-
/** Observed number of distinct groups at the moment the cap tripped. */
|
|
206
|
-
cardinality;
|
|
207
|
-
/** The cap that was exceeded. */
|
|
208
|
-
maxGroups;
|
|
209
|
-
constructor(field, cardinality, maxGroups) {
|
|
210
|
-
super(
|
|
211
|
-
"GROUP_CARDINALITY",
|
|
212
|
-
`.groupBy("${field}") produced ${cardinality} distinct groups, exceeding the ${maxGroups}-group ceiling. This is almost always a query mistake \u2014 grouping on a high-uniqueness field like "id" or "createdAt" produces one bucket per record. Narrow the query with .where() before grouping, or group on a lower-cardinality field (status, category, clientId). If you genuinely need high-cardinality grouping, file an issue with your use case.`
|
|
213
|
-
);
|
|
214
|
-
this.name = "GroupCardinalityError";
|
|
215
|
-
this.field = field;
|
|
216
|
-
this.cardinality = cardinality;
|
|
217
|
-
this.maxGroups = maxGroups;
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
|
|
221
165
|
// src/money/fixed-point.ts
|
|
222
166
|
function formatScaledInt(value, scale) {
|
|
223
167
|
const negative = value < 0n;
|
|
@@ -288,6 +232,35 @@ function scaleForCurrency(code) {
|
|
|
288
232
|
return v === void 0 ? null : v;
|
|
289
233
|
}
|
|
290
234
|
|
|
235
|
+
// src/errors.ts
|
|
236
|
+
var NoydbError = class extends Error {
|
|
237
|
+
/** Machine-readable error code. Stable across library versions. */
|
|
238
|
+
code;
|
|
239
|
+
constructor(code, message) {
|
|
240
|
+
super(message);
|
|
241
|
+
this.name = "NoydbError";
|
|
242
|
+
this.code = code;
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
var GroupCardinalityError = class extends NoydbError {
|
|
246
|
+
/** The field being grouped on. */
|
|
247
|
+
field;
|
|
248
|
+
/** Observed number of distinct groups at the moment the cap tripped. */
|
|
249
|
+
cardinality;
|
|
250
|
+
/** The cap that was exceeded. */
|
|
251
|
+
maxGroups;
|
|
252
|
+
constructor(field, cardinality, maxGroups) {
|
|
253
|
+
super(
|
|
254
|
+
"GROUP_CARDINALITY",
|
|
255
|
+
`.groupBy("${field}") produced ${cardinality} distinct groups, exceeding the ${maxGroups}-group ceiling. This is almost always a query mistake \u2014 grouping on a high-uniqueness field like "id" or "createdAt" produces one bucket per record. Narrow the query with .where() before grouping, or group on a lower-cardinality field (status, category, clientId). If you genuinely need high-cardinality grouping, file an issue with your use case.`
|
|
256
|
+
);
|
|
257
|
+
this.name = "GroupCardinalityError";
|
|
258
|
+
this.field = field;
|
|
259
|
+
this.cardinality = cardinality;
|
|
260
|
+
this.maxGroups = maxGroups;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
291
264
|
// src/money/descriptor.ts
|
|
292
265
|
var MoneyUnsupportedError = class extends NoydbError {
|
|
293
266
|
constructor(field, message) {
|
|
@@ -301,6 +274,33 @@ var MoneyUnsupportedError = class extends NoydbError {
|
|
|
301
274
|
field;
|
|
302
275
|
};
|
|
303
276
|
|
|
277
|
+
// src/query/predicate.ts
|
|
278
|
+
function readPath(record, path) {
|
|
279
|
+
if (record === null || record === void 0) return void 0;
|
|
280
|
+
if (!path.includes(".")) {
|
|
281
|
+
return record[path];
|
|
282
|
+
}
|
|
283
|
+
const segments = path.split(".");
|
|
284
|
+
let cursor = record;
|
|
285
|
+
for (const segment of segments) {
|
|
286
|
+
if (cursor === null || cursor === void 0) return void 0;
|
|
287
|
+
cursor = cursor[segment];
|
|
288
|
+
}
|
|
289
|
+
return cursor;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// src/aggregate/canonical-key.ts
|
|
293
|
+
function canonicalGroupKey(fields, row) {
|
|
294
|
+
const sorted = [...fields].sort();
|
|
295
|
+
const parts = [];
|
|
296
|
+
for (const name of sorted) {
|
|
297
|
+
const v = row[name];
|
|
298
|
+
const serialised = v === void 0 ? "undefined" : JSON.stringify(v);
|
|
299
|
+
parts.push(`${name}=${serialised}`);
|
|
300
|
+
}
|
|
301
|
+
return parts.join("|");
|
|
302
|
+
}
|
|
303
|
+
|
|
304
304
|
// src/money/money-reducer.ts
|
|
305
305
|
function toScaledInt(v) {
|
|
306
306
|
if (typeof v === "string" || typeof v === "number" || typeof v === "bigint") {
|