/** * The wire boundary schemas both codec arms materialize. The host registry * (`src/status-codec.ts`) parses payloads with them through `create()`, and * the browser arm (`src/client/status-codec.ts`) carries the same objects. * Neither half imports the other's module. * * Client-safe: its imports are `zod`, the contract's own types, type-only * domain unions from `types.ts` (erased at build), and the runtime constants * module (values and type-only imports only), all of which * `scripts/client-graph-authority.mjs` allowlists. The sort enum derives from * `src/constants.ts`, the export enums derive from the sibling arrays there, * and the updatable-field set is pinned to it by * `tests/unit/wire-schemas.spec.ts`. The parity specs read both arms and keep * a hand-written refusal table per schema. * @module dsh-zotero/wire-schemas */ import { z } from 'zod'; import type { TypertCodec } from '@deepseek-ai/dsh-typert-protocol'; import type { ZoteroChildRowsView } from './contract.js'; /** * The panel's sort fields, derived from the domain's one array so the two * cannot drift (`tests/unit/wire-schemas.spec.ts` additionally pins the * exact order). */ export declare const zoteroLibrarySortSchema: z.ZodEnum<{ dateModified: "dateModified"; dateAdded: "dateAdded"; date: "date"; title: "title"; creator: "creator"; }>; /** * Wrap a wire schema in the strict codec arm Typert expects. The strict arm is * exactly `{ mode, typeSymbol, create }` (plus optional `encode`/`decode` for * byte-carrying results, which these pure-JSON views do not need), so no live * schema property is carried and `create()` materializes on first use. * @param typeSymbol - the boundary type identity the manifest declares. * @param schema - the shared wire schema both halves validate through. * @returns the strict codec arm. */ export declare function strictCodec(typeSymbol: string, schema: z.ZodType): TypertCodec; /** Wire schema: one status view (strict; absent optional facts stay absent). */ export declare const zoteroStatusSchema: z.ZodReadonly; connected: z.ZodBoolean; apiVersion: z.ZodOptional; serverId: z.ZodOptional; schemaVersion: z.ZodOptional; zoteroVersion: z.ZodOptional; write: z.ZodOptional>; diagnosis: z.ZodOptional; }, z.core.$strict>>; /** Wire schema: resolveAttachment parameter (a non-empty string ref). */ export declare const zoteroRefSchema: z.ZodString; /** Wire schema: resolveAttachment result. */ export declare const zoteroAttachmentLocationSchema: z.ZodReadonly; title: z.ZodString; contentType: z.ZodString; path: z.ZodOptional; url: z.ZodOptional; }, z.core.$strict>>; /** Wire schema: one diagnostics snapshot (strict; the ring pre-strips absent optionals). */ export declare const zoteroDiagnosticsSchema: z.ZodReadonly; event: z.ZodString; message: z.ZodString; count: z.ZodNumber; detail: z.ZodOptional>>; }, z.core.$strict>>>>; total: z.ZodNumber; truncated: z.ZodBoolean; debug: z.ZodBoolean; }, z.core.$strict>>; /** Wire schema: reportClientError parameter (surface + message required, stacks optional). */ export declare const zoteroClientErrorReportSchema: z.ZodReadonly; componentStack: z.ZodOptional; }, z.core.$strict>>; /** Wire schema: reportClientError result (the ring sequence the report was assigned). */ export declare const zoteroReportResultSchema: z.ZodReadonly>; /** Wire schema: the canonical personal library (user/0) on its own. */ export declare const zoteroPersonalLibrarySchema: z.ZodReadonly; id: z.ZodLiteral<0>; }, z.core.$strict>>; /** Wire schema: one supported local library (canonical personal or a group). */ export declare const zoteroLibrarySchema: z.ZodUnion; id: z.ZodLiteral<0>; }, z.core.$strict>>, z.ZodReadonly; id: z.ZodNumber; }, z.core.$strict>>]>; /** Wire schema: the resolved scope a search result echoes back. */ export declare const zoteroResolvedScopeSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly; library: z.ZodUnion; id: z.ZodLiteral<0>; }, z.core.$strict>>, z.ZodReadonly; id: z.ZodNumber; }, z.core.$strict>>]>; }, z.core.$strict>>, z.ZodReadonly; library: z.ZodReadonly; id: z.ZodLiteral<0>; }, z.core.$strict>>; }, z.core.$strict>>, z.ZodReadonly; ref: z.ZodString; name: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; ref: z.ZodString; name: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; library: z.ZodUnion; id: z.ZodLiteral<0>; }, z.core.$strict>>, z.ZodReadonly; id: z.ZodNumber; }, z.core.$strict>>]>; }, z.core.$strict>>], "kind">; /** Wire schema: browse request (one bounded navigation listing). */ export declare const zoteroLibraryBrowseRequestSchema: z.ZodReadonly; library: z.ZodOptional; id: z.ZodLiteral<0>; }, z.core.$strict>>, z.ZodReadonly; id: z.ZodNumber; }, z.core.$strict>>]>>; parentRef: z.ZodOptional; q: z.ZodOptional; match: z.ZodOptional>; offset: z.ZodNumber; limit: z.ZodNumber; }, z.core.$strict>>; /** Wire schema: browse result rows, discriminated by `kind` unlike the domain union. */ export declare const zoteroSavedSearchConditionSchema: z.ZodReadonly>; export declare const zoteroLibraryBrowseItemSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly; tag: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; itemType: z.ZodString; localized: z.ZodOptional; }, z.core.$strict>>, z.ZodReadonly; library: z.ZodUnion; id: z.ZodLiteral<0>; }, z.core.$strict>>, z.ZodReadonly; id: z.ZodNumber; }, z.core.$strict>>]>; name: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; ref: z.ZodString; name: z.ZodString; parentRef: z.ZodOptional; path: z.ZodReadonly>; depth: z.ZodNumber; }, z.core.$strict>>, z.ZodReadonly; ref: z.ZodString; name: z.ZodString; conditions: z.ZodReadonly>>>; }, z.core.$strict>>], "kind">; /** Wire schema: browse result (the requested page of one navigation listing). */ export declare const zoteroLibraryBrowseResultSchema: z.ZodReadonly; items: z.ZodReadonly; tag: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; itemType: z.ZodString; localized: z.ZodOptional; }, z.core.$strict>>, z.ZodReadonly; library: z.ZodUnion; id: z.ZodLiteral<0>; }, z.core.$strict>>, z.ZodReadonly; id: z.ZodNumber; }, z.core.$strict>>]>; name: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; ref: z.ZodString; name: z.ZodString; parentRef: z.ZodOptional; path: z.ZodReadonly>; depth: z.ZodNumber; }, z.core.$strict>>, z.ZodReadonly; ref: z.ZodString; name: z.ZodString; conditions: z.ZodReadonly>>>; }, z.core.$strict>>], "kind">>>; total: z.ZodNumber; offset: z.ZodNumber; returned: z.ZodNumber; limit: z.ZodNumber; nextOffset: z.ZodOptional; }, z.core.$strict>>; /** Wire schema: search request scope (the panel's scope set, including trash). */ export declare const zoteroLibrarySearchScopeSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly; }, z.core.$strict>>, z.ZodReadonly; }, z.core.$strict>>, z.ZodReadonly; refOrName: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; refOrName: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; }, z.core.$strict>>], "kind">; /** * The library panel's item-list filters: one schema for the wire request and * the panel's stored state, so the two cannot drift (a tag spelling the wire * refuses must not survive in localStorage either). */ export declare const zoteroLibraryFiltersSchema: z.ZodObject<{ itemTypes: z.ZodOptional>>; tags: z.ZodOptional>>; tagMatch: z.ZodOptional>; yearFrom: z.ZodOptional; yearTo: z.ZodOptional; hasAttachment: z.ZodOptional; }, z.core.$strict>; /** Wire schema: search request (one item-list page over one scope). */ export declare const zoteroLibrarySearchRequestSchema: z.ZodReadonly; itemTypes: z.ZodOptional>>; tags: z.ZodOptional>>; tagMatch: z.ZodOptional>; yearFrom: z.ZodOptional; yearTo: z.ZodOptional; hasAttachment: z.ZodOptional; scope: z.ZodDiscriminatedUnion<[z.ZodReadonly; }, z.core.$strict>>, z.ZodReadonly; }, z.core.$strict>>, z.ZodReadonly; refOrName: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; refOrName: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; }, z.core.$strict>>], "kind">; library: z.ZodOptional; id: z.ZodLiteral<0>; }, z.core.$strict>>, z.ZodReadonly; id: z.ZodNumber; }, z.core.$strict>>]>>; q: z.ZodOptional; mode: z.ZodOptional>; sort: z.ZodEnum<{ dateModified: "dateModified"; dateAdded: "dateAdded"; date: "date"; title: "title"; creator: "creator"; }>; direction: z.ZodEnum<{ asc: "asc"; desc: "desc"; }>; offset: z.ZodNumber; limit: z.ZodNumber; itemLevel: z.ZodOptional>; }, z.core.$strict>>; /** Wire schema: one item row of a listing (the domain's compact hit, mirrored). */ export declare const zoteroSearchItemSchema: z.ZodReadonly; itemType: z.ZodString; parentRef: z.ZodOptional; bestAttachmentRef: z.ZodOptional; bestAttachmentType: z.ZodOptional; attachmentSize: z.ZodOptional; extra: z.ZodOptional; doi: z.ZodOptional; }, z.core.$strict>>; /** Wire schema: search result (paged primary hits only; no note supplement crosses). */ export declare const zoteroSearchResultSchema: z.ZodReadonly; library: z.ZodUnion; id: z.ZodLiteral<0>; }, z.core.$strict>>, z.ZodReadonly; id: z.ZodNumber; }, z.core.$strict>>]>; }, z.core.$strict>>, z.ZodReadonly; library: z.ZodReadonly; id: z.ZodLiteral<0>; }, z.core.$strict>>; }, z.core.$strict>>, z.ZodReadonly; ref: z.ZodString; name: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; ref: z.ZodString; name: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; library: z.ZodUnion; id: z.ZodLiteral<0>; }, z.core.$strict>>, z.ZodReadonly; id: z.ZodNumber; }, z.core.$strict>>]>; }, z.core.$strict>>], "kind">; items: z.ZodReadonly; itemType: z.ZodString; parentRef: z.ZodOptional; bestAttachmentRef: z.ZodOptional; bestAttachmentType: z.ZodOptional; attachmentSize: z.ZodOptional; extra: z.ZodOptional; doi: z.ZodOptional; }, z.core.$strict>>>>; total: z.ZodNumber; offset: z.ZodNumber; returned: z.ZodNumber; limit: z.ZodNumber; nextOffset: z.ZodOptional; }, z.core.$strict>>; /** Wire schema: item-detail request (one ref plus the child kinds to include). */ export declare const zoteroLibraryItemRequestSchema: z.ZodReadonly>>; childPages: z.ZodOptional>>; attachments: z.ZodOptional>>; annotations: z.ZodOptional>>; }, z.core.$strict>>>; }, z.core.$strict>>; /** Wire schema: one child listing the detail view serves. */ export declare function childRowsSchema(item: z.ZodType): z.ZodType>; export declare const zoteroNoteRowSchema: z.ZodReadonly; }, z.core.$strict>>; export declare const zoteroAnnotationRowSchema: z.ZodReadonly; color: z.ZodOptional; pageLabel: z.ZodOptional; parentRef: z.ZodOptional; }, z.core.$strict>>; export declare const zoteroAttachmentRowSchema: z.ZodReadonly>; /** Wire schema: one paged child-listing request. */ export declare const zoteroLibraryChildPageRequestSchema: z.ZodReadonly; offset: z.ZodNumber; limit: z.ZodNumber; }, z.core.$strict>>; /** Wire schema: one child page, discriminated by the kind it carries. */ export declare const zoteroChildPageSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly; page: z.ZodType>, unknown, z.core.$ZodTypeInternals>, unknown>>; }, z.core.$strict>>, z.ZodReadonly; page: z.ZodType>, unknown, z.core.$ZodTypeInternals>, unknown>>; }, z.core.$strict>>, z.ZodReadonly; page: z.ZodType>, unknown, z.core.$ZodTypeInternals>, unknown>>; }, z.core.$strict>>], "kind">; /** Wire schema: the item detail view (panel include set applied, absent sets stay absent). */ export declare const zoteroItemDetailSchema: z.ZodReadonly; firstName: z.ZodOptional; lastName: z.ZodOptional; }, z.core.$strict>>>>; extra: z.ZodOptional; date: z.ZodOptional; year: z.ZodOptional; venue: z.ZodOptional; doi: z.ZodOptional; url: z.ZodOptional; abstract: z.ZodOptional; abstractTruncated: z.ZodBoolean; noteBody: z.ZodOptional>>; tags: z.ZodReadonly>; collections: z.ZodReadonly; }, z.core.$strict>>>>; children: z.ZodReadonly>; bestAttachment: z.ZodOptional>>; notes: z.ZodOptional>, unknown, z.core.$ZodTypeInternals>, unknown>>>; annotations: z.ZodOptional>, unknown, z.core.$ZodTypeInternals>, unknown>>>; attachments: z.ZodOptional>, unknown, z.core.$ZodTypeInternals>, unknown>>>; }, z.core.$strict>>; /** Wire schema: the export formats, derived from the domain's one ordered array. */ export declare const zoteroLibraryExportFormatSchema: z.ZodEnum<{ citation: "citation"; bibliography: "bibliography"; bibtex: "bibtex"; biblatex: "biblatex"; ris: "ris"; csljson: "csljson"; }>; /** Wire schema: the translator export formats, derived from the sibling array. */ export declare const zoteroLibraryTranslatorExportFormatSchema: z.ZodEnum<{ bibtex: "bibtex"; biblatex: "biblatex"; ris: "ris"; csljson: "csljson"; }>; /** * Wire schema: library export request. The refs bound is Zotero's own * `itemKey` per-request cap — the configured `maxExportRefs` gate runs in the * host service, where the live config is read. */ export declare const zoteroLibraryExportRequestSchema: z.ZodReadonly>; format: z.ZodEnum<{ citation: "citation"; bibliography: "bibliography"; bibtex: "bibtex"; biblatex: "biblatex"; ris: "ris"; csljson: "csljson"; }>; style: z.ZodOptional; locale: z.ZodOptional; }, z.core.$strict>>; /** * Wire schema: library export result, discriminated by the exported format. * The panel endpoint serves rendered text only, so the translator arm carries * no per-document itemization. */ export declare const zoteroLibraryExportResultSchema: z.ZodReadonly; style: z.ZodOptional; locale: z.ZodOptional; citations: z.ZodReadonly>>>; }, z.core.$strict>>, z.ZodReadonly; style: z.ZodOptional; locale: z.ZodOptional; text: z.ZodString; }, z.core.$strict>>, z.ZodReadonly; style: z.ZodOptional; locale: z.ZodOptional; text: z.ZodString; }, z.core.$strict>>], "format">>; /** * Closed panel mutation union. Extra or malformed nested fields are rejected * at the gateway. `satisfies` pins the schema's output to the hand-written * `ZoteroLibraryWriteRequestView`, so drift between the two fails at compile * time. */ export declare const zoteroLibraryWriteRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ operation: z.ZodLiteral<"updateItem">; args: z.ZodObject<{ ref: z.ZodString; set: z.ZodObject<{ title: z.ZodOptional; date: z.ZodOptional; url: z.ZodOptional; doi: z.ZodOptional; abstractNote: z.ZodOptional; publicationTitle: z.ZodOptional; extra: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"updateTags">; args: z.ZodObject<{ ref: z.ZodString; add: z.ZodOptional>; remove: z.ZodOptional>; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"updateMembership">; args: z.ZodObject<{ ref: z.ZodString; add: z.ZodOptional>; remove: z.ZodOptional>; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"createItem">; args: z.ZodObject<{ itemType: z.ZodString; title: z.ZodOptional; url: z.ZodOptional; date: z.ZodOptional; doi: z.ZodOptional; abstractNote: z.ZodOptional; publicationTitle: z.ZodOptional; tags: z.ZodOptional>; collections: z.ZodOptional>; creators: z.ZodOptional; firstName: z.ZodOptional; lastName: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"createNote">; args: z.ZodObject<{ markdown: z.ZodString; parentItem: z.ZodOptional; collections: z.ZodOptional>; tags: z.ZodOptional>; sourceRefs: z.ZodOptional>; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"updateNote">; args: z.ZodObject<{ ref: z.ZodString; markdown: z.ZodString; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"createCollection">; args: z.ZodObject<{ name: z.ZodString; parent: z.ZodOptional; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"updateCollection">; args: z.ZodObject<{ collection: z.ZodString; name: z.ZodOptional; parent: z.ZodOptional; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"deleteCollection">; args: z.ZodObject<{ collection: z.ZodString; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"createSavedSearch">; args: z.ZodObject<{ name: z.ZodString; conditions: z.ZodArray>; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"updateSavedSearch">; args: z.ZodObject<{ search: z.ZodString; name: z.ZodOptional; conditions: z.ZodOptional>>; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"deleteSavedSearch">; args: z.ZodObject<{ search: z.ZodString; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"trash">; args: z.ZodObject<{ refs: z.ZodArray; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"restore">; args: z.ZodObject<{ refs: z.ZodArray; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ operation: z.ZodLiteral<"batch">; args: z.ZodObject<{ create: z.ZodOptional; url: z.ZodOptional; date: z.ZodOptional; doi: z.ZodOptional; abstractNote: z.ZodOptional; publicationTitle: z.ZodOptional; tags: z.ZodOptional>; collections: z.ZodOptional>; creators: z.ZodOptional; firstName: z.ZodOptional; lastName: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strict>>>; update: z.ZodOptional>; removeTags: z.ZodOptional>; addCollections: z.ZodOptional>; removeCollections: z.ZodOptional>; }, z.core.$strict>>>; delete: z.ZodOptional>; }, z.core.$strict>; sessionId: z.ZodString; }, z.core.$strict>], "operation">; export declare const zoteroLibraryWriteResultSchema: z.ZodReadonly; message: z.ZodString; code: z.ZodOptional; }, z.core.$strict>>; //# sourceMappingURL=wire-schemas.d.ts.map