@koolbase/core 12.35.0 → 12.37.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.
@@ -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/auth.js CHANGED
@@ -392,6 +392,14 @@ class KoolbaseAuth {
392
392
  if (params.nonce && params.nonce.length > 0) {
393
393
  body.nonce = params.nonce;
394
394
  }
395
+ // Exchanged by the server for the token it revokes when the account is
396
+ // deleted, as Apple asks.
397
+ if (params.authorizationCode && params.authorizationCode.length > 0) {
398
+ body.authorization_code = params.authorizationCode;
399
+ }
400
+ if (params.client) {
401
+ body.client = params.client;
402
+ }
395
403
  if (params.fullName) {
396
404
  const nameJson = {};
397
405
  if (params.fullName.givenName)
@@ -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() {
@@ -602,6 +602,11 @@ export interface SignInWithAppleParams {
602
602
  identityToken: string;
603
603
  nonce?: string;
604
604
  fullName?: AppleFullName;
605
+ /** The credential's authorization code: the server exchanges it for the
606
+ * token it revokes when the account is deleted, as Apple asks. */
607
+ authorizationCode?: string;
608
+ /** 'web' when the code came from Apple's web sign-in (the services id). */
609
+ client?: 'web';
605
610
  }
606
611
  /**
607
612
  * Parameters for `KoolbaseAuth.signInWithGoogle`. The SDK is
@@ -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/auth.js CHANGED
@@ -389,6 +389,14 @@ export class KoolbaseAuth {
389
389
  if (params.nonce && params.nonce.length > 0) {
390
390
  body.nonce = params.nonce;
391
391
  }
392
+ // Exchanged by the server for the token it revokes when the account is
393
+ // deleted, as Apple asks.
394
+ if (params.authorizationCode && params.authorizationCode.length > 0) {
395
+ body.authorization_code = params.authorizationCode;
396
+ }
397
+ if (params.client) {
398
+ body.client = params.client;
399
+ }
392
400
  if (params.fullName) {
393
401
  const nameJson = {};
394
402
  if (params.fullName.givenName)
@@ -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() {
@@ -602,6 +602,11 @@ export interface SignInWithAppleParams {
602
602
  identityToken: string;
603
603
  nonce?: string;
604
604
  fullName?: AppleFullName;
605
+ /** The credential's authorization code: the server exchanges it for the
606
+ * token it revokes when the account is deleted, as Apple asks. */
607
+ authorizationCode?: string;
608
+ /** 'web' when the code came from Apple's web sign-in (the services id). */
609
+ client?: 'web';
605
610
  }
606
611
  /**
607
612
  * Parameters for `KoolbaseAuth.signInWithGoogle`. The SDK is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koolbase/core",
3
- "version": "12.35.0",
3
+ "version": "12.37.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",