@centrali-io/centrali-sdk 6.0.0 → 6.1.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/index.d.ts +8 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/query-types.ts +8 -2
package/dist/index.d.ts
CHANGED
|
@@ -923,15 +923,23 @@ type SortClause = {
|
|
|
923
923
|
* Two pagination modes. Per contract §6 they are mutually exclusive — `cursor`
|
|
924
924
|
* is forbidden in offset mode and `offset` is forbidden in cursor mode so a
|
|
925
925
|
* caller cannot construct an ambiguous request.
|
|
926
|
+
*
|
|
927
|
+
* `withTotal` is opt-in (default false). When omitted, executors skip the
|
|
928
|
+
* accompanying `count(*)` query and return `meta.total` undefined; `hasMore`
|
|
929
|
+
* is still accurate (executors fetch `limit + 1` rows). Set `withTotal: true`
|
|
930
|
+
* when the caller actually renders a total — e.g. page-1 of a numbered
|
|
931
|
+
* paginator. CEN-1259.
|
|
926
932
|
*/
|
|
927
933
|
type PageClause = {
|
|
928
934
|
limit: number;
|
|
929
935
|
offset?: number;
|
|
930
936
|
cursor?: never;
|
|
937
|
+
withTotal?: boolean;
|
|
931
938
|
} | {
|
|
932
939
|
limit: number;
|
|
933
940
|
cursor?: string;
|
|
934
941
|
offset?: never;
|
|
942
|
+
withTotal?: boolean;
|
|
935
943
|
};
|
|
936
944
|
/**
|
|
937
945
|
* Records Phase 1 page defaults (contract §6).
|
package/dist/index.js
CHANGED
|
@@ -5376,7 +5376,8 @@ var sortClauseSchema = external_exports.object({
|
|
|
5376
5376
|
var pageClauseSchema = external_exports.object({
|
|
5377
5377
|
limit: external_exports.number().int().positive().max(RECORDS_PAGE_MAX_LIMIT2),
|
|
5378
5378
|
offset: external_exports.number().int().nonnegative().optional(),
|
|
5379
|
-
cursor: external_exports.string().optional()
|
|
5379
|
+
cursor: external_exports.string().optional(),
|
|
5380
|
+
withTotal: external_exports.boolean().optional()
|
|
5380
5381
|
}).superRefine((page, ctx) => {
|
|
5381
5382
|
if (page.offset !== void 0 && page.cursor !== void 0) {
|
|
5382
5383
|
ctx.addIssue({
|
package/package.json
CHANGED
package/query-types.ts
CHANGED
|
@@ -300,10 +300,16 @@ export type SortClause = {
|
|
|
300
300
|
* Two pagination modes. Per contract §6 they are mutually exclusive — `cursor`
|
|
301
301
|
* is forbidden in offset mode and `offset` is forbidden in cursor mode so a
|
|
302
302
|
* caller cannot construct an ambiguous request.
|
|
303
|
+
*
|
|
304
|
+
* `withTotal` is opt-in (default false). When omitted, executors skip the
|
|
305
|
+
* accompanying `count(*)` query and return `meta.total` undefined; `hasMore`
|
|
306
|
+
* is still accurate (executors fetch `limit + 1` rows). Set `withTotal: true`
|
|
307
|
+
* when the caller actually renders a total — e.g. page-1 of a numbered
|
|
308
|
+
* paginator. CEN-1259.
|
|
303
309
|
*/
|
|
304
310
|
export type PageClause =
|
|
305
|
-
| { limit: number; offset?: number; cursor?: never }
|
|
306
|
-
| { limit: number; cursor?: string; offset?: never };
|
|
311
|
+
| { limit: number; offset?: number; cursor?: never; withTotal?: boolean }
|
|
312
|
+
| { limit: number; cursor?: string; offset?: never; withTotal?: boolean };
|
|
307
313
|
|
|
308
314
|
/**
|
|
309
315
|
* Records Phase 1 page defaults (contract §6).
|