import type { DtoMessage, ImportBase, ImportRef } from './dto.js'; // Named base-schema references for common protocol DTOs. // // These are ImportRef metadata (not re-exports of the actual TypeBox schemas): // the DSL stores { from, name } so the generator can emit the import line and // the identifier — the runtime schema object itself is never loaded by the DSL. // // `import { PageRequest } from '@pylonts/dsl'` therefore gives .include() an // already-resolved reference — no static analysis or name lookup needed. /** Paginated query request base — renders `import { PageRequest } from '@pylonts/core'` + Intersect */ export const PageRequest: ImportBase = { from: '@pylonts/core', name: 'PageRequest' }; /** Paginated list response base — renders `import { PageResult } from '@pylonts/core'` + `PageResult()` */ export const PageResult = (row: DtoMessage): ImportRef => ({ from: '@pylonts/core', name: 'PageResult', args: [row], }); /** Paged rows type base without generic args — renders `import type { PagedRows } from '@pylonts/core'` */ export const PagedRows: ImportBase = { from: '@pylonts/core', name: 'PagedRows', type: true }; /** Paged rows type base — renders `import { PagedRows } from '@pylonts/core'` + `PagedRows()` */ export const PageRows = (row: DtoMessage): ImportRef => ({ from: '@pylonts/core', name: 'PagedRows', args: [row], });