| 636 | * `datatype mismatch`. |
| 637 | */ |
| 638 | const normalizeAdminPaging = ( |
| 639 | options: AdminListSubjectsOptions | undefined, |
| 640 | ): { readonly limit: number; readonly offset: number } => { |
| 641 | const requested = options?.limit ?? ADMIN_DEFAULT_PAGE_SIZE; |
| 642 | const limit = Math.min(Math.max(Math.floor(requested), 1), ADMIN_MAX_PAGE_SIZE); |
| 643 | const offset = Math.max(Math.floor(options?.offset ?? 0), 0); |
| 644 | return { limit, offset }; |
| 645 | }; |
| 646 | |
| 647 | export interface ExecutorAdmin { |
| 648 | /** One page of subjects under the tenant, oldest first (stable: ties break on |