@koolbase/core 12.35.0 → 12.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/aggregate.d.ts +13 -0
- package/dist/cjs/database.js +5 -0
- package/dist/esm/aggregate.d.ts +13 -0
- package/dist/esm/database.js +5 -0
- package/package.json +1 -1
package/dist/cjs/aggregate.d.ts
CHANGED
|
@@ -87,6 +87,12 @@ export interface KoolbaseAggregateGroup {
|
|
|
87
87
|
category: string;
|
|
88
88
|
/** Keyed by each measure's `as`. Null where a group had nothing to measure. */
|
|
89
89
|
values: Record<string, number | null>;
|
|
90
|
+
/**
|
|
91
|
+
* The collection's count minimum (#299), when this group's count was below
|
|
92
|
+
* it: every value is null, and what to show is "Fewer than N" -- never 0,
|
|
93
|
+
* and never nothing.
|
|
94
|
+
*/
|
|
95
|
+
fewerThan?: number;
|
|
90
96
|
}
|
|
91
97
|
/**
|
|
92
98
|
* How a measure arrived at its number.
|
|
@@ -121,4 +127,11 @@ export interface KoolbaseAggregateResult {
|
|
|
121
127
|
* would be exactly the wrong number this API exists to prevent.
|
|
122
128
|
*/
|
|
123
129
|
tooManyGroups: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* The collection's count minimum (#299), when `matched` was below it: the
|
|
132
|
+
* number is not said. `matched` is then 0 and `accounting` empty, and what
|
|
133
|
+
* to show is "Fewer than N" -- never 0. Only a count that sees beyond what
|
|
134
|
+
* the caller may read, under the collection's Count rule.
|
|
135
|
+
*/
|
|
136
|
+
fewerThan?: number;
|
|
124
137
|
}
|
package/dist/cjs/database.js
CHANGED
|
@@ -637,12 +637,17 @@ class KoolbaseDatabase {
|
|
|
637
637
|
groups: (raw.groups ?? []).map((g) => ({
|
|
638
638
|
category: String(g.category ?? ''),
|
|
639
639
|
values: g.values ?? {},
|
|
640
|
+
// Below the collection's count minimum (#299): "Fewer than N".
|
|
641
|
+
...(typeof g.fewer_than === 'number' ? { fewerThan: g.fewer_than } : {}),
|
|
640
642
|
})),
|
|
641
643
|
matched: Number(raw.matched ?? 0),
|
|
642
644
|
accounting,
|
|
643
645
|
// Explicitly boolean: a missing field must read as false, not
|
|
644
646
|
// undefined, or `if (!r.tooManyGroups)` passes on a refused request.
|
|
645
647
|
tooManyGroups: raw.too_many_groups === true,
|
|
648
|
+
// Below the collection's count minimum (#299): matched is 0 and the
|
|
649
|
+
// number is not said -- show "Fewer than N", never 0.
|
|
650
|
+
...(typeof raw.fewer_than === 'number' ? { fewerThan: raw.fewer_than } : {}),
|
|
646
651
|
};
|
|
647
652
|
}
|
|
648
653
|
async conflicts() {
|
package/dist/esm/aggregate.d.ts
CHANGED
|
@@ -87,6 +87,12 @@ export interface KoolbaseAggregateGroup {
|
|
|
87
87
|
category: string;
|
|
88
88
|
/** Keyed by each measure's `as`. Null where a group had nothing to measure. */
|
|
89
89
|
values: Record<string, number | null>;
|
|
90
|
+
/**
|
|
91
|
+
* The collection's count minimum (#299), when this group's count was below
|
|
92
|
+
* it: every value is null, and what to show is "Fewer than N" -- never 0,
|
|
93
|
+
* and never nothing.
|
|
94
|
+
*/
|
|
95
|
+
fewerThan?: number;
|
|
90
96
|
}
|
|
91
97
|
/**
|
|
92
98
|
* How a measure arrived at its number.
|
|
@@ -121,4 +127,11 @@ export interface KoolbaseAggregateResult {
|
|
|
121
127
|
* would be exactly the wrong number this API exists to prevent.
|
|
122
128
|
*/
|
|
123
129
|
tooManyGroups: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* The collection's count minimum (#299), when `matched` was below it: the
|
|
132
|
+
* number is not said. `matched` is then 0 and `accounting` empty, and what
|
|
133
|
+
* to show is "Fewer than N" -- never 0. Only a count that sees beyond what
|
|
134
|
+
* the caller may read, under the collection's Count rule.
|
|
135
|
+
*/
|
|
136
|
+
fewerThan?: number;
|
|
124
137
|
}
|
package/dist/esm/database.js
CHANGED
|
@@ -634,12 +634,17 @@ export class KoolbaseDatabase {
|
|
|
634
634
|
groups: (raw.groups ?? []).map((g) => ({
|
|
635
635
|
category: String(g.category ?? ''),
|
|
636
636
|
values: g.values ?? {},
|
|
637
|
+
// Below the collection's count minimum (#299): "Fewer than N".
|
|
638
|
+
...(typeof g.fewer_than === 'number' ? { fewerThan: g.fewer_than } : {}),
|
|
637
639
|
})),
|
|
638
640
|
matched: Number(raw.matched ?? 0),
|
|
639
641
|
accounting,
|
|
640
642
|
// Explicitly boolean: a missing field must read as false, not
|
|
641
643
|
// undefined, or `if (!r.tooManyGroups)` passes on a refused request.
|
|
642
644
|
tooManyGroups: raw.too_many_groups === true,
|
|
645
|
+
// Below the collection's count minimum (#299): matched is 0 and the
|
|
646
|
+
// number is not said -- show "Fewer than N", never 0.
|
|
647
|
+
...(typeof raw.fewer_than === 'number' ? { fewerThan: raw.fewer_than } : {}),
|
|
643
648
|
};
|
|
644
649
|
}
|
|
645
650
|
async conflicts() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koolbase/core",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.36.0",
|
|
4
4
|
"description": "Koolbase SDK core \u2014 shared behaviour behind @koolbase/react-native and @koolbase/js. Install one of those, not this.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|