@noy-db/hub 0.1.0-pre.8 → 0.2.0-pre.1
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 +91 -36
- 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 +16 -9
- package/dist/aggregate/index.js.map +1 -1
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +6 -6
- package/dist/blobs/index.d.ts +6 -6
- package/dist/blobs/index.js +4 -4
- package/dist/bundle/index.cjs +298 -7
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +6 -6
- package/dist/bundle/index.d.ts +6 -6
- package/dist/bundle/index.js +15 -4
- package/dist/{chunk-GOUT6DND.js → chunk-23TTQXVO.js} +173 -91
- package/dist/chunk-23TTQXVO.js.map +1 -0
- package/dist/{chunk-CIMZBAZB.js → chunk-2AXFIYHT.js} +1 -1
- package/dist/chunk-2AXFIYHT.js.map +1 -0
- package/dist/chunk-34YSDCDP.js +73 -0
- package/dist/chunk-34YSDCDP.js.map +1 -0
- package/dist/{chunk-HC7Z5EQZ.js → chunk-4TFSM22V.js} +4 -4
- package/dist/{chunk-7XBQS42M.js → chunk-537VFZTR.js} +4 -4
- package/dist/{chunk-M62XNWRA.js → chunk-5DWL3JBF.js} +2 -2
- package/dist/{chunk-RSPLI376.js → chunk-5SCJ5UEF.js} +3 -3
- package/dist/chunk-5ZGZ6HIZ.js +100 -0
- package/dist/chunk-5ZGZ6HIZ.js.map +1 -0
- package/dist/chunk-6HPZY4ON.js +291 -0
- package/dist/chunk-6HPZY4ON.js.map +1 -0
- package/dist/{chunk-WN6UK7PM.js → chunk-7H6DOO3E.js} +239 -11
- package/dist/chunk-7H6DOO3E.js.map +1 -0
- package/dist/{chunk-ACLDOTNQ.js → chunk-ADQ5MQ54.js} +275 -3
- package/dist/chunk-ADQ5MQ54.js.map +1 -0
- package/dist/chunk-CBAHB2BF.js +893 -0
- package/dist/chunk-CBAHB2BF.js.map +1 -0
- package/dist/chunk-DPMFBCV6.js +296 -0
- package/dist/chunk-DPMFBCV6.js.map +1 -0
- package/dist/chunk-DYBQG5PQ.js +34 -0
- package/dist/chunk-DYBQG5PQ.js.map +1 -0
- package/dist/{chunk-ZFKD4QMV.js → chunk-DYECX3IX.js} +3 -3
- package/dist/chunk-EGQYGYIU.js +51 -0
- package/dist/chunk-EGQYGYIU.js.map +1 -0
- package/dist/chunk-FCXOFQAJ.js +79 -0
- package/dist/chunk-FCXOFQAJ.js.map +1 -0
- package/dist/chunk-HB3Z2GCR.js +124 -0
- package/dist/chunk-HB3Z2GCR.js.map +1 -0
- package/dist/{chunk-SCZXXXU4.js → chunk-I6MX32UC.js} +7 -32
- package/dist/chunk-I6MX32UC.js.map +1 -0
- package/dist/{chunk-VQBTTTUN.js → chunk-KESP7GOK.js} +4 -4
- package/dist/{chunk-VQBTTTUN.js.map → chunk-KESP7GOK.js.map} +1 -1
- package/dist/{chunk-NXFEYLVG.js → chunk-MIQHZESA.js} +4 -3
- package/dist/{chunk-NXFEYLVG.js.map → chunk-MIQHZESA.js.map} +1 -1
- package/dist/chunk-MKSA2V7A.js +19 -0
- package/dist/chunk-MKSA2V7A.js.map +1 -0
- package/dist/{chunk-M5INGEFC.js → chunk-MRIBLZL3.js} +3 -1
- package/dist/chunk-MRIBLZL3.js.map +1 -0
- package/dist/{chunk-2WGMYBYS.js → chunk-NIOHFJPJ.js} +6 -6
- package/dist/chunk-OMLIZL2P.js +61 -0
- package/dist/chunk-OMLIZL2P.js.map +1 -0
- package/dist/{chunk-USKYUS74.js → chunk-P7EQ2S5O.js} +2 -2
- package/dist/{chunk-YVFTBQHL.js → chunk-PA6R5ZCI.js} +217 -10
- package/dist/chunk-PA6R5ZCI.js.map +1 -0
- package/dist/chunk-PEULZC6M.js +118 -0
- package/dist/chunk-PEULZC6M.js.map +1 -0
- package/dist/chunk-RD5LYKD6.js +82 -0
- package/dist/chunk-RD5LYKD6.js.map +1 -0
- package/dist/chunk-SIZWEV2Y.js +145 -0
- package/dist/chunk-SIZWEV2Y.js.map +1 -0
- package/dist/{chunk-Y4CMTMUW.js → chunk-UA4RI7OT.js} +12 -6
- package/dist/chunk-UA4RI7OT.js.map +1 -0
- package/dist/chunk-UMLVJTYV.js +20 -0
- package/dist/chunk-UMLVJTYV.js.map +1 -0
- package/dist/chunk-UZXLQCHP.js +53 -0
- package/dist/chunk-UZXLQCHP.js.map +1 -0
- package/dist/{chunk-R2ZTGEVP.js → chunk-VMIO4IXG.js} +5 -5
- package/dist/{chunk-MR4424N3.js → chunk-WCA2NROQ.js} +2 -2
- package/dist/{chunk-TDR6T5CJ.js → chunk-XGSOTWYX.js} +91 -132
- package/dist/chunk-XGSOTWYX.js.map +1 -0
- package/dist/{chunk-NPC4LFV5.js → chunk-YMYK7US4.js} +2 -2
- package/dist/{chunk-PJK6IOBC.js → chunk-YS3POABP.js} +1 -1
- package/dist/chunk-YS3POABP.js.map +1 -0
- package/dist/chunk-Z72JH4KG.js +209 -0
- package/dist/chunk-Z72JH4KG.js.map +1 -0
- package/dist/{chunk-R36SIKES.js → chunk-ZNOEIM6Y.js} +2 -2
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +6 -6
- package/dist/consent/index.d.ts +6 -6
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-IVKU7YTT.js → crypto-A7FRXYHC.js} +3 -3
- package/dist/{delegation-2DBS2EOH.js → delegation-YBA4X4JN.js} +5 -4
- package/dist/derivations/index.cjs +351 -0
- package/dist/derivations/index.cjs.map +1 -0
- package/dist/derivations/index.d.cts +71 -0
- package/dist/derivations/index.d.ts +71 -0
- package/dist/derivations/index.js +27 -0
- package/dist/{dev-unlock-BygpnIWe.d.ts → dev-unlock-D9s-loPr.d.ts} +1 -1
- package/dist/{dev-unlock-BZKx666y.d.cts → dev-unlock-DRwVSy2S.d.cts} +1 -1
- package/dist/executor-7E3VFGW7.js +11 -0
- package/dist/executor-CEWX2FQI.js +8 -0
- package/dist/executor-CEWX2FQI.js.map +1 -0
- package/dist/executor-X4SQ3ZLC.js +8 -0
- package/dist/executor-X4SQ3ZLC.js.map +1 -0
- package/dist/fanout-sidecar-VJ52RIEY.js +51 -0
- package/dist/fanout-sidecar-VJ52RIEY.js.map +1 -0
- package/dist/guards/index.cjs +315 -0
- package/dist/guards/index.cjs.map +1 -0
- package/dist/guards/index.d.cts +30 -0
- package/dist/guards/index.d.ts +30 -0
- package/dist/guards/index.js +29 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/{hash-B0eU2Qv9.d.ts → hash-DXXXusyk.d.ts} +1 -1
- package/dist/{hash-CIyfmKsg.d.cts → hash-DtRih9MQ.d.cts} +1 -1
- package/dist/history/index.cjs +8 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +7 -7
- package/dist/history/index.d.ts +7 -7
- package/dist/history/index.js +6 -6
- package/dist/i18n/index.cjs +81 -0
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +6 -6
- package/dist/i18n/index.d.ts +6 -6
- package/dist/i18n/index.js +19 -6
- package/dist/i18n/index.js.map +1 -1
- package/dist/{index-Dp4tKCjX.d.ts → index-4agOpzqd.d.ts} +174 -3
- package/dist/{index-6xNpPsxR.d.cts → index-CNwA-B6-.d.ts} +303 -5
- package/dist/{index-DJTf9yxn.d.ts → index-CmVgTkqk.d.cts} +303 -5
- package/dist/{index-DsVbTDZI.d.cts → index-hdFvZkBP.d.cts} +174 -3
- package/dist/index.cjs +5929 -1089
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +207 -16
- package/dist/index.d.ts +207 -16
- package/dist/index.js +2402 -672
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs +2 -0
- 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 +4 -4
- package/dist/{lazy-builder-CZVLKh0Z.d.cts → lazy-builder-C-rPfWG0.d.cts} +1 -1
- package/dist/{lazy-builder-BwEoBQZ9.d.ts → lazy-builder-Rpd-V3jP.d.ts} +1 -1
- package/dist/{ledger-UQIMMKO5.js → ledger-3TXNP47J.js} +6 -6
- package/dist/ledger-3TXNP47J.js.map +1 -0
- package/dist/materialized-views/index.cjs +837 -0
- package/dist/materialized-views/index.cjs.map +1 -0
- package/dist/materialized-views/index.d.cts +183 -0
- package/dist/materialized-views/index.d.ts +183 -0
- package/dist/materialized-views/index.js +45 -0
- package/dist/materialized-views/index.js.map +1 -0
- package/dist/overlay-views/index.cjs +359 -0
- package/dist/overlay-views/index.cjs.map +1 -0
- package/dist/overlay-views/index.d.cts +81 -0
- package/dist/overlay-views/index.d.ts +81 -0
- package/dist/overlay-views/index.js +23 -0
- package/dist/overlay-views/index.js.map +1 -0
- package/dist/periods/index.cjs +7 -1
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +6 -6
- package/dist/periods/index.d.ts +6 -6
- package/dist/periods/index.js +6 -6
- package/dist/{predicate-SBHmi6D0.d.cts → predicate-Dnu81tsS.d.cts} +25 -1
- package/dist/{predicate-SBHmi6D0.d.ts → predicate-Dnu81tsS.d.ts} +25 -1
- package/dist/{public-envelope-3QTQADDW.js → public-envelope-PY6NKFLI.js} +4 -4
- package/dist/public-envelope-PY6NKFLI.js.map +1 -0
- package/dist/query/index.cjs +302 -124
- 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 +26 -11
- package/dist/read-only-facade-ITU6L7BL.js +7 -0
- package/dist/read-only-facade-ITU6L7BL.js.map +1 -0
- package/dist/registry-3L3N3PTG.js +10 -0
- package/dist/registry-3L3N3PTG.js.map +1 -0
- package/dist/registry-O47PUPSY.js +8 -0
- package/dist/registry-O47PUPSY.js.map +1 -0
- package/dist/registry-RFGGMVNJ.js +7 -0
- package/dist/registry-RFGGMVNJ.js.map +1 -0
- package/dist/registry-WLLMODKN.js +8 -0
- package/dist/registry-WLLMODKN.js.map +1 -0
- package/dist/session/index.cjs +7 -1
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +7 -7
- package/dist/session/index.d.ts +7 -7
- package/dist/session/index.js +10 -3
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +6 -6
- package/dist/shadow/index.d.ts +6 -6
- package/dist/shadow/index.js +2 -2
- package/dist/stale-HSC5YO2O.js +13 -0
- package/dist/stale-HSC5YO2O.js.map +1 -0
- package/dist/store/index.cjs +14 -0
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +6 -6
- package/dist/store/index.d.ts +6 -6
- package/dist/store/index.js +5 -2
- package/dist/{strategy-D-SrOLCl.d.cts → strategy-DSTrsZ8t.d.cts} +72 -19
- package/dist/{strategy-D-SrOLCl.d.ts → strategy-DSTrsZ8t.d.ts} +72 -19
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +5 -5
- package/dist/sync/index.d.ts +5 -5
- package/dist/sync/index.js +4 -4
- package/dist/team/index.cjs +1554 -2
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +6 -6
- package/dist/team/index.d.ts +6 -6
- package/dist/team/index.js +76 -9
- package/dist/tx/index.cjs +296 -44
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +6 -6
- package/dist/tx/index.d.ts +6 -6
- package/dist/tx/index.js +2 -2
- package/dist/{types-DD9eKKNc.d.ts → types-C4lwMKKF.d.cts} +2771 -322
- package/dist/{types-arFMsCtn.d.cts → types-DW9RGSSs.d.ts} +2771 -322
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.js +1 -1
- package/dist/with-derivation-C8LDlV7t.d.cts +13 -0
- package/dist/with-derivation-g-pGoMzL.d.ts +13 -0
- package/dist/with-guard-DWOCK4Ca.d.ts +18 -0
- package/dist/with-guard-jI1x9Z3k.d.cts +18 -0
- package/dist/with-materialized-view-DaKR-N6J.d.ts +27 -0
- package/dist/with-materialized-view-DcTx4H3j.d.cts +27 -0
- package/dist/with-overlayed-view-D-6oWAgM.d.cts +13 -0
- package/dist/with-overlayed-view-N7jYuNOS.d.ts +13 -0
- package/package.json +53 -2
- package/dist/chunk-ACLDOTNQ.js.map +0 -1
- package/dist/chunk-BTDCBVJW.js +0 -160
- package/dist/chunk-BTDCBVJW.js.map +0 -1
- package/dist/chunk-CIMZBAZB.js.map +0 -1
- package/dist/chunk-GOUT6DND.js.map +0 -1
- package/dist/chunk-M5INGEFC.js.map +0 -1
- package/dist/chunk-PJK6IOBC.js.map +0 -1
- package/dist/chunk-SCZXXXU4.js.map +0 -1
- package/dist/chunk-TDR6T5CJ.js.map +0 -1
- package/dist/chunk-TOQK4KAN.js +0 -79
- package/dist/chunk-TOQK4KAN.js.map +0 -1
- package/dist/chunk-WN6UK7PM.js.map +0 -1
- package/dist/chunk-Y4CMTMUW.js.map +0 -1
- package/dist/chunk-YVFTBQHL.js.map +0 -1
- /package/dist/{chunk-HC7Z5EQZ.js.map → chunk-4TFSM22V.js.map} +0 -0
- /package/dist/{chunk-7XBQS42M.js.map → chunk-537VFZTR.js.map} +0 -0
- /package/dist/{chunk-M62XNWRA.js.map → chunk-5DWL3JBF.js.map} +0 -0
- /package/dist/{chunk-RSPLI376.js.map → chunk-5SCJ5UEF.js.map} +0 -0
- /package/dist/{chunk-ZFKD4QMV.js.map → chunk-DYECX3IX.js.map} +0 -0
- /package/dist/{chunk-2WGMYBYS.js.map → chunk-NIOHFJPJ.js.map} +0 -0
- /package/dist/{chunk-USKYUS74.js.map → chunk-P7EQ2S5O.js.map} +0 -0
- /package/dist/{chunk-R2ZTGEVP.js.map → chunk-VMIO4IXG.js.map} +0 -0
- /package/dist/{chunk-MR4424N3.js.map → chunk-WCA2NROQ.js.map} +0 -0
- /package/dist/{chunk-NPC4LFV5.js.map → chunk-YMYK7US4.js.map} +0 -0
- /package/dist/{chunk-R36SIKES.js.map → chunk-ZNOEIM6Y.js.map} +0 -0
- /package/dist/{crypto-IVKU7YTT.js.map → crypto-A7FRXYHC.js.map} +0 -0
- /package/dist/{delegation-2DBS2EOH.js.map → delegation-YBA4X4JN.js.map} +0 -0
- /package/dist/{ledger-UQIMMKO5.js.map → derivations/index.js.map} +0 -0
- /package/dist/{public-envelope-3QTQADDW.js.map → executor-7E3VFGW7.js.map} +0 -0
package/dist/store/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
import '../
|
|
5
|
-
import '../
|
|
1
|
+
import { aO as NoydbStore, cA as NoydbBundleStore } from '../types-C4lwMKKF.cjs';
|
|
2
|
+
export { bs as BUNDLE_STORE_POLICY, c6 as INDEXED_STORE_POLICY, cT as PullMode, cV as PullPolicy, cX as PushMode, cZ as PushPolicy, dA as SyncPolicy, dB as SyncScheduler, dC as SyncSchedulerStatus } from '../types-C4lwMKKF.cjs';
|
|
3
|
+
export { aq as StoreCapabilityError } from '../index-CmVgTkqk.cjs';
|
|
4
|
+
import '../lazy-builder-C-rPfWG0.cjs';
|
|
5
|
+
import '../predicate-Dnu81tsS.cjs';
|
|
6
|
+
import '../strategy-DSTrsZ8t.cjs';
|
|
6
7
|
import '../strategy-BSxFXGzb.cjs';
|
|
7
|
-
import '../index-6xNpPsxR.cjs';
|
|
8
8
|
|
|
9
9
|
interface WrapBundleStoreOptions {
|
|
10
10
|
/**
|
package/dist/store/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
import '../
|
|
5
|
-
import '../
|
|
1
|
+
import { aO as NoydbStore, cA as NoydbBundleStore } from '../types-DW9RGSSs.js';
|
|
2
|
+
export { bs as BUNDLE_STORE_POLICY, c6 as INDEXED_STORE_POLICY, cT as PullMode, cV as PullPolicy, cX as PushMode, cZ as PushPolicy, dA as SyncPolicy, dB as SyncScheduler, dC as SyncSchedulerStatus } from '../types-DW9RGSSs.js';
|
|
3
|
+
export { aq as StoreCapabilityError } from '../index-CNwA-B6-.js';
|
|
4
|
+
import '../lazy-builder-Rpd-V3jP.js';
|
|
5
|
+
import '../predicate-Dnu81tsS.js';
|
|
6
|
+
import '../strategy-DSTrsZ8t.js';
|
|
6
7
|
import '../strategy-BSxFXGzb.js';
|
|
7
|
-
import '../index-DJTf9yxn.js';
|
|
8
8
|
|
|
9
9
|
interface WrapBundleStoreOptions {
|
|
10
10
|
/**
|
package/dist/store/index.js
CHANGED
|
@@ -9,16 +9,19 @@ import {
|
|
|
9
9
|
withRetry,
|
|
10
10
|
wrapBundleStore,
|
|
11
11
|
wrapStore
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-P7EQ2S5O.js";
|
|
13
13
|
import {
|
|
14
14
|
BUNDLE_STORE_POLICY,
|
|
15
15
|
INDEXED_STORE_POLICY,
|
|
16
16
|
SyncScheduler
|
|
17
17
|
} from "../chunk-2QR2PQTT.js";
|
|
18
|
-
import
|
|
18
|
+
import {
|
|
19
|
+
StoreCapabilityError
|
|
20
|
+
} from "../chunk-ADQ5MQ54.js";
|
|
19
21
|
export {
|
|
20
22
|
BUNDLE_STORE_POLICY,
|
|
21
23
|
INDEXED_STORE_POLICY,
|
|
24
|
+
StoreCapabilityError,
|
|
22
25
|
SyncScheduler,
|
|
23
26
|
createBundleStore,
|
|
24
27
|
routeStore,
|
|
@@ -399,30 +399,64 @@ type GroupedRow<F extends string, R> = {
|
|
|
399
399
|
[K in F]: unknown;
|
|
400
400
|
} & R;
|
|
401
401
|
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
402
|
+
* Multi-key variant — result-row shape for variadic
|
|
403
|
+
* `.groupBy(...fields)`. Every grouped field name appears on the row
|
|
404
|
+
* (typed as `unknown` for the same reason as `GroupedRow`), plus the
|
|
405
|
+
* reducer outputs from the spec.
|
|
406
|
+
*/
|
|
407
|
+
type GroupedRowN<F extends readonly string[], R> = {
|
|
408
|
+
[K in F[number]]: unknown;
|
|
409
|
+
} & R;
|
|
410
|
+
/**
|
|
411
|
+
* Shared base class for the chainable grouped-query wrappers. Holds
|
|
412
|
+
* the constructor + protected fields that both single-key
|
|
413
|
+
* `GroupedQuery<T, F>` and variadic `GroupedQueryN<T, F>` need; each
|
|
414
|
+
* subclass only overrides `aggregate()` with its own result-row
|
|
415
|
+
* generic.
|
|
404
416
|
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
417
|
+
* Not exported — implementation detail. Adding `.having()` /
|
|
418
|
+
* `.live()` / `.orderByGroup()` etc. in the future lands here once
|
|
419
|
+
* and both subclasses pick it up automatically.
|
|
420
|
+
*
|
|
421
|
+
* @internal
|
|
410
422
|
*/
|
|
411
|
-
declare class
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
private readonly upstreams;
|
|
423
|
+
declare abstract class GroupedQueryBase {
|
|
424
|
+
protected readonly executeRecords: () => readonly unknown[];
|
|
425
|
+
protected readonly upstreams: readonly AggregationUpstream[];
|
|
415
426
|
/**
|
|
416
427
|
* Optional dict label resolver attached by the query builder when
|
|
417
|
-
* the grouping field is a dictKey.
|
|
428
|
+
* the grouping field is a dictKey. Variadic groupings always pass
|
|
429
|
+
* `undefined` — `<field>Label` projection has no meaningful shape
|
|
430
|
+
* for composite keys.
|
|
418
431
|
*/
|
|
419
|
-
|
|
420
|
-
|
|
432
|
+
protected readonly dictLabelResolver?: ((key: string, locale: string, fallback?: string | readonly string[]) => Promise<string | undefined>) | undefined;
|
|
433
|
+
/**
|
|
434
|
+
* Field set this grouped query buckets on. Stored in declaration
|
|
435
|
+
* order — the same order is preserved on every result row by
|
|
436
|
+
* `groupAndReduce`. For the single-field constructor, this is
|
|
437
|
+
* `[field]`.
|
|
438
|
+
*/
|
|
439
|
+
protected readonly fields: readonly string[];
|
|
440
|
+
constructor(executeRecords: () => readonly unknown[], fieldOrFields: string | readonly string[], upstreams: readonly AggregationUpstream[],
|
|
421
441
|
/**
|
|
422
442
|
* Optional dict label resolver attached by the query builder when
|
|
423
|
-
* the grouping field is a dictKey.
|
|
443
|
+
* the grouping field is a dictKey. Variadic groupings always pass
|
|
444
|
+
* `undefined` — `<field>Label` projection has no meaningful shape
|
|
445
|
+
* for composite keys.
|
|
424
446
|
*/
|
|
425
447
|
dictLabelResolver?: ((key: string, locale: string, fallback?: string | readonly string[]) => Promise<string | undefined>) | undefined);
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Chainable wrapper returned by `Query.groupBy(field)`. Terminates
|
|
451
|
+
* with `.aggregate(spec)` which returns a `GroupedAggregation`.
|
|
452
|
+
*
|
|
453
|
+
* Kept minimal — the only operation on a grouped query is
|
|
454
|
+
* aggregation. Ordering, limiting, and further filtering belong on
|
|
455
|
+
* the underlying `Query` before `.groupBy()` is called; applying
|
|
456
|
+
* them post-group would be a different operation (`having` /
|
|
457
|
+
* `groupOrderBy`), out of scope for.
|
|
458
|
+
*/
|
|
459
|
+
declare class GroupedQuery<T, F extends string> extends GroupedQueryBase {
|
|
426
460
|
/**
|
|
427
461
|
* Build a grouped aggregation. Returns a `GroupedAggregation`
|
|
428
462
|
* with `.run()`, `.runAsync()`, and `.live()` terminals — same shape
|
|
@@ -431,6 +465,14 @@ declare class GroupedQuery<T, F extends string> {
|
|
|
431
465
|
*/
|
|
432
466
|
aggregate<Spec extends AggregateSpec>(spec: Spec): GroupedAggregation<GroupedRow<F, AggregateResult<Spec>>>;
|
|
433
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Variadic-keyed sibling of `GroupedQuery<T, F>`. Constructed by the
|
|
470
|
+
* multi-arg `Query.groupBy(...fields)` overload. The runtime shape is
|
|
471
|
+
* identical — only the type-level result-row narrowing differs.
|
|
472
|
+
*/
|
|
473
|
+
declare class GroupedQueryN<T, F extends readonly string[]> extends GroupedQueryBase {
|
|
474
|
+
aggregate<Spec extends AggregateSpec>(spec: Spec): GroupedAggregation<GroupedRowN<F, AggregateResult<Spec>>>;
|
|
475
|
+
}
|
|
434
476
|
/**
|
|
435
477
|
* Execute the group-and-reduce pipeline. Pure function over a
|
|
436
478
|
* record array and a spec — shared by `GroupedAggregation.run()`
|
|
@@ -442,7 +484,7 @@ declare class GroupedQuery<T, F extends string> {
|
|
|
442
484
|
* bucket would be created — the consumer doesn't have to wait for
|
|
443
485
|
* the full partition to materialize before the error fires.
|
|
444
486
|
*/
|
|
445
|
-
declare function groupAndReduce<R>(records: readonly unknown[],
|
|
487
|
+
declare function groupAndReduce<R>(records: readonly unknown[], fieldOrFields: string | readonly string[], spec: AggregateSpec): R[];
|
|
446
488
|
/**
|
|
447
489
|
* Grouped aggregation wrapper — the `.groupBy(field).aggregate(spec)`
|
|
448
490
|
* terminal. Shape mirrors `Aggregation<R>` from aggregate.ts: two
|
|
@@ -455,7 +497,6 @@ declare function groupAndReduce<R>(records: readonly unknown[], field: string, s
|
|
|
455
497
|
*/
|
|
456
498
|
declare class GroupedAggregation<R> {
|
|
457
499
|
private readonly executeRecords;
|
|
458
|
-
private readonly field;
|
|
459
500
|
private readonly spec;
|
|
460
501
|
private readonly upstreams;
|
|
461
502
|
/**
|
|
@@ -463,7 +504,8 @@ declare class GroupedAggregation<R> {
|
|
|
463
504
|
*. Present when the grouping field is a dictKey.
|
|
464
505
|
*/
|
|
465
506
|
private readonly dictLabelResolver?;
|
|
466
|
-
|
|
507
|
+
private readonly fields;
|
|
508
|
+
constructor(executeRecords: () => readonly unknown[], fields: string | readonly string[], spec: AggregateSpec, upstreams: readonly AggregationUpstream[],
|
|
467
509
|
/**
|
|
468
510
|
* Optional dict label resolver for `<field>Label` projection
|
|
469
511
|
*. Present when the grouping field is a dictKey.
|
|
@@ -479,6 +521,10 @@ declare class GroupedAggregation<R> {
|
|
|
479
521
|
*
|
|
480
522
|
* The `<field>Label` field is appended to each row. Rows whose group
|
|
481
523
|
* key has no dictionary entry get `<field>Label: undefined`.
|
|
524
|
+
*
|
|
525
|
+
* Dict-label resolution is single-field only — multi-key groupings
|
|
526
|
+
* do not produce a `<field>Label`. The resolver is only attached
|
|
527
|
+
* by the builder when `fields.length === 1`.
|
|
482
528
|
*/
|
|
483
529
|
runAsync(opts?: {
|
|
484
530
|
locale?: string;
|
|
@@ -537,6 +583,13 @@ interface AggregateStrategy {
|
|
|
537
583
|
* closure / upstream inputs as `aggregate` plus the group key field.
|
|
538
584
|
*/
|
|
539
585
|
groupBy<T, F extends string>(executeRecords: () => readonly unknown[], field: F, upstreams: readonly AggregationUpstream[], dictLabelResolver?: (key: string, locale: string, fallback?: string | readonly string[]) => Promise<string | undefined>): GroupedQuery<T, F>;
|
|
586
|
+
/**
|
|
587
|
+
* Variadic-keyed sibling — builds a `GroupedQueryN<T, F>` for
|
|
588
|
+
* `Query.groupBy(...fields)`. No dictLabelResolver — `<field>Label`
|
|
589
|
+
* projection only applies to single-field groupings, which dispatch
|
|
590
|
+
* through `groupBy` above.
|
|
591
|
+
*/
|
|
592
|
+
groupByN<T, F extends readonly string[]>(executeRecords: () => readonly unknown[], fields: F, upstreams: readonly AggregationUpstream[]): GroupedQueryN<T, F>;
|
|
540
593
|
/**
|
|
541
594
|
* Terminal streaming aggregator for `ScanBuilder.aggregate(spec)`.
|
|
542
595
|
* Takes an async iterable of decrypted records + the spec and
|
|
@@ -545,4 +598,4 @@ interface AggregateStrategy {
|
|
|
545
598
|
scanAggregate<Spec extends AggregateSpec>(iter: AsyncIterable<unknown>, spec: Spec): Promise<AggregateResult<Spec>>;
|
|
546
599
|
}
|
|
547
600
|
|
|
548
|
-
export { type AggregateStrategy as A, GROUPBY_MAX_CARDINALITY as G, type LiveAggregation as L, type Reducer as R, type AggregateResult as a, type AggregateSpec as b, Aggregation as c, type AggregationUpstream as d, GROUPBY_WARN_CARDINALITY as e, GroupedAggregation as f, GroupedQuery as g,
|
|
601
|
+
export { type AggregateStrategy as A, GROUPBY_MAX_CARDINALITY as G, type LiveAggregation as L, type Reducer as R, type AggregateResult as a, type AggregateSpec as b, Aggregation as c, type AggregationUpstream as d, GROUPBY_WARN_CARDINALITY as e, GroupedAggregation as f, GroupedQuery as g, GroupedQueryN as h, type GroupedRow as i, type GroupedRowN as j, type ReducerOptions as k, avg as l, buildLiveAggregation as m, count as n, groupAndReduce as o, max as p, min as q, reduceRecords as r, resetGroupByWarnings as s, sum as t };
|
|
@@ -399,30 +399,64 @@ type GroupedRow<F extends string, R> = {
|
|
|
399
399
|
[K in F]: unknown;
|
|
400
400
|
} & R;
|
|
401
401
|
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
402
|
+
* Multi-key variant — result-row shape for variadic
|
|
403
|
+
* `.groupBy(...fields)`. Every grouped field name appears on the row
|
|
404
|
+
* (typed as `unknown` for the same reason as `GroupedRow`), plus the
|
|
405
|
+
* reducer outputs from the spec.
|
|
406
|
+
*/
|
|
407
|
+
type GroupedRowN<F extends readonly string[], R> = {
|
|
408
|
+
[K in F[number]]: unknown;
|
|
409
|
+
} & R;
|
|
410
|
+
/**
|
|
411
|
+
* Shared base class for the chainable grouped-query wrappers. Holds
|
|
412
|
+
* the constructor + protected fields that both single-key
|
|
413
|
+
* `GroupedQuery<T, F>` and variadic `GroupedQueryN<T, F>` need; each
|
|
414
|
+
* subclass only overrides `aggregate()` with its own result-row
|
|
415
|
+
* generic.
|
|
404
416
|
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
417
|
+
* Not exported — implementation detail. Adding `.having()` /
|
|
418
|
+
* `.live()` / `.orderByGroup()` etc. in the future lands here once
|
|
419
|
+
* and both subclasses pick it up automatically.
|
|
420
|
+
*
|
|
421
|
+
* @internal
|
|
410
422
|
*/
|
|
411
|
-
declare class
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
private readonly upstreams;
|
|
423
|
+
declare abstract class GroupedQueryBase {
|
|
424
|
+
protected readonly executeRecords: () => readonly unknown[];
|
|
425
|
+
protected readonly upstreams: readonly AggregationUpstream[];
|
|
415
426
|
/**
|
|
416
427
|
* Optional dict label resolver attached by the query builder when
|
|
417
|
-
* the grouping field is a dictKey.
|
|
428
|
+
* the grouping field is a dictKey. Variadic groupings always pass
|
|
429
|
+
* `undefined` — `<field>Label` projection has no meaningful shape
|
|
430
|
+
* for composite keys.
|
|
418
431
|
*/
|
|
419
|
-
|
|
420
|
-
|
|
432
|
+
protected readonly dictLabelResolver?: ((key: string, locale: string, fallback?: string | readonly string[]) => Promise<string | undefined>) | undefined;
|
|
433
|
+
/**
|
|
434
|
+
* Field set this grouped query buckets on. Stored in declaration
|
|
435
|
+
* order — the same order is preserved on every result row by
|
|
436
|
+
* `groupAndReduce`. For the single-field constructor, this is
|
|
437
|
+
* `[field]`.
|
|
438
|
+
*/
|
|
439
|
+
protected readonly fields: readonly string[];
|
|
440
|
+
constructor(executeRecords: () => readonly unknown[], fieldOrFields: string | readonly string[], upstreams: readonly AggregationUpstream[],
|
|
421
441
|
/**
|
|
422
442
|
* Optional dict label resolver attached by the query builder when
|
|
423
|
-
* the grouping field is a dictKey.
|
|
443
|
+
* the grouping field is a dictKey. Variadic groupings always pass
|
|
444
|
+
* `undefined` — `<field>Label` projection has no meaningful shape
|
|
445
|
+
* for composite keys.
|
|
424
446
|
*/
|
|
425
447
|
dictLabelResolver?: ((key: string, locale: string, fallback?: string | readonly string[]) => Promise<string | undefined>) | undefined);
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Chainable wrapper returned by `Query.groupBy(field)`. Terminates
|
|
451
|
+
* with `.aggregate(spec)` which returns a `GroupedAggregation`.
|
|
452
|
+
*
|
|
453
|
+
* Kept minimal — the only operation on a grouped query is
|
|
454
|
+
* aggregation. Ordering, limiting, and further filtering belong on
|
|
455
|
+
* the underlying `Query` before `.groupBy()` is called; applying
|
|
456
|
+
* them post-group would be a different operation (`having` /
|
|
457
|
+
* `groupOrderBy`), out of scope for.
|
|
458
|
+
*/
|
|
459
|
+
declare class GroupedQuery<T, F extends string> extends GroupedQueryBase {
|
|
426
460
|
/**
|
|
427
461
|
* Build a grouped aggregation. Returns a `GroupedAggregation`
|
|
428
462
|
* with `.run()`, `.runAsync()`, and `.live()` terminals — same shape
|
|
@@ -431,6 +465,14 @@ declare class GroupedQuery<T, F extends string> {
|
|
|
431
465
|
*/
|
|
432
466
|
aggregate<Spec extends AggregateSpec>(spec: Spec): GroupedAggregation<GroupedRow<F, AggregateResult<Spec>>>;
|
|
433
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Variadic-keyed sibling of `GroupedQuery<T, F>`. Constructed by the
|
|
470
|
+
* multi-arg `Query.groupBy(...fields)` overload. The runtime shape is
|
|
471
|
+
* identical — only the type-level result-row narrowing differs.
|
|
472
|
+
*/
|
|
473
|
+
declare class GroupedQueryN<T, F extends readonly string[]> extends GroupedQueryBase {
|
|
474
|
+
aggregate<Spec extends AggregateSpec>(spec: Spec): GroupedAggregation<GroupedRowN<F, AggregateResult<Spec>>>;
|
|
475
|
+
}
|
|
434
476
|
/**
|
|
435
477
|
* Execute the group-and-reduce pipeline. Pure function over a
|
|
436
478
|
* record array and a spec — shared by `GroupedAggregation.run()`
|
|
@@ -442,7 +484,7 @@ declare class GroupedQuery<T, F extends string> {
|
|
|
442
484
|
* bucket would be created — the consumer doesn't have to wait for
|
|
443
485
|
* the full partition to materialize before the error fires.
|
|
444
486
|
*/
|
|
445
|
-
declare function groupAndReduce<R>(records: readonly unknown[],
|
|
487
|
+
declare function groupAndReduce<R>(records: readonly unknown[], fieldOrFields: string | readonly string[], spec: AggregateSpec): R[];
|
|
446
488
|
/**
|
|
447
489
|
* Grouped aggregation wrapper — the `.groupBy(field).aggregate(spec)`
|
|
448
490
|
* terminal. Shape mirrors `Aggregation<R>` from aggregate.ts: two
|
|
@@ -455,7 +497,6 @@ declare function groupAndReduce<R>(records: readonly unknown[], field: string, s
|
|
|
455
497
|
*/
|
|
456
498
|
declare class GroupedAggregation<R> {
|
|
457
499
|
private readonly executeRecords;
|
|
458
|
-
private readonly field;
|
|
459
500
|
private readonly spec;
|
|
460
501
|
private readonly upstreams;
|
|
461
502
|
/**
|
|
@@ -463,7 +504,8 @@ declare class GroupedAggregation<R> {
|
|
|
463
504
|
*. Present when the grouping field is a dictKey.
|
|
464
505
|
*/
|
|
465
506
|
private readonly dictLabelResolver?;
|
|
466
|
-
|
|
507
|
+
private readonly fields;
|
|
508
|
+
constructor(executeRecords: () => readonly unknown[], fields: string | readonly string[], spec: AggregateSpec, upstreams: readonly AggregationUpstream[],
|
|
467
509
|
/**
|
|
468
510
|
* Optional dict label resolver for `<field>Label` projection
|
|
469
511
|
*. Present when the grouping field is a dictKey.
|
|
@@ -479,6 +521,10 @@ declare class GroupedAggregation<R> {
|
|
|
479
521
|
*
|
|
480
522
|
* The `<field>Label` field is appended to each row. Rows whose group
|
|
481
523
|
* key has no dictionary entry get `<field>Label: undefined`.
|
|
524
|
+
*
|
|
525
|
+
* Dict-label resolution is single-field only — multi-key groupings
|
|
526
|
+
* do not produce a `<field>Label`. The resolver is only attached
|
|
527
|
+
* by the builder when `fields.length === 1`.
|
|
482
528
|
*/
|
|
483
529
|
runAsync(opts?: {
|
|
484
530
|
locale?: string;
|
|
@@ -537,6 +583,13 @@ interface AggregateStrategy {
|
|
|
537
583
|
* closure / upstream inputs as `aggregate` plus the group key field.
|
|
538
584
|
*/
|
|
539
585
|
groupBy<T, F extends string>(executeRecords: () => readonly unknown[], field: F, upstreams: readonly AggregationUpstream[], dictLabelResolver?: (key: string, locale: string, fallback?: string | readonly string[]) => Promise<string | undefined>): GroupedQuery<T, F>;
|
|
586
|
+
/**
|
|
587
|
+
* Variadic-keyed sibling — builds a `GroupedQueryN<T, F>` for
|
|
588
|
+
* `Query.groupBy(...fields)`. No dictLabelResolver — `<field>Label`
|
|
589
|
+
* projection only applies to single-field groupings, which dispatch
|
|
590
|
+
* through `groupBy` above.
|
|
591
|
+
*/
|
|
592
|
+
groupByN<T, F extends readonly string[]>(executeRecords: () => readonly unknown[], fields: F, upstreams: readonly AggregationUpstream[]): GroupedQueryN<T, F>;
|
|
540
593
|
/**
|
|
541
594
|
* Terminal streaming aggregator for `ScanBuilder.aggregate(spec)`.
|
|
542
595
|
* Takes an async iterable of decrypted records + the spec and
|
|
@@ -545,4 +598,4 @@ interface AggregateStrategy {
|
|
|
545
598
|
scanAggregate<Spec extends AggregateSpec>(iter: AsyncIterable<unknown>, spec: Spec): Promise<AggregateResult<Spec>>;
|
|
546
599
|
}
|
|
547
600
|
|
|
548
|
-
export { type AggregateStrategy as A, GROUPBY_MAX_CARDINALITY as G, type LiveAggregation as L, type Reducer as R, type AggregateResult as a, type AggregateSpec as b, Aggregation as c, type AggregationUpstream as d, GROUPBY_WARN_CARDINALITY as e, GroupedAggregation as f, GroupedQuery as g,
|
|
601
|
+
export { type AggregateStrategy as A, GROUPBY_MAX_CARDINALITY as G, type LiveAggregation as L, type Reducer as R, type AggregateResult as a, type AggregateSpec as b, Aggregation as c, type AggregationUpstream as d, GROUPBY_WARN_CARDINALITY as e, GroupedAggregation as f, GroupedQuery as g, GroupedQueryN as h, type GroupedRow as i, type GroupedRowN as j, type ReducerOptions as k, avg as l, buildLiveAggregation as m, count as n, groupAndReduce as o, max as p, min as q, reduceRecords as r, resetGroupByWarnings as s, sum as t };
|