UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1,020 lines (1,004 loc) 194 kB
import { ComparisonOperatorExpression, Kysely, ColumnType, Generated, Dialect, KyselyPlugin } from 'kysely'; import { jsonArrayFrom } from 'kysely/helpers/sqlite'; import * as zod from 'zod'; import zod__default, { ZodType } from 'zod'; import * as fastify from 'fastify'; import { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify'; import * as http from 'http'; import { Readable } from 'node:stream'; import * as fs from 'fs'; import * as stream from 'stream'; import { InlineConfig } from 'vite'; type FilterValue = string | Array<string> | number | Array<number>; type FilterOperator = ComparisonOperatorExpression | "%"; type FilterObject = { value: FilterValue; operator?: FilterOperator; }; type QueryParamFilters = Record<string, FilterObject>; declare class CollectionBuilder extends FieldBuilder { #private; key: string; config: CollectionConfigSchemaType; includeFieldKeys: string[]; filterableFieldKeys: FieldFilters; constructor(key: string, config: CollectionConfigSchemaType); addText(key: string, props?: CFProps<"text"> & { collection?: FieldCollectionConfig; }): this; addNumber(key: string, props?: CFProps<"number"> & { collection?: FieldCollectionConfig; }): this; addCheckbox(key: string, props?: CFProps<"checkbox"> & { collection?: FieldCollectionConfig; }): this; addSelect(key: string, props?: CFProps<"select"> & { collection?: FieldCollectionConfig; }): this; addTextarea(key: string, props?: CFProps<"textarea"> & { collection?: FieldCollectionConfig; }): this; addDateTime(key: string, props?: CFProps<"datetime"> & { collection?: FieldCollectionConfig; }): this; addUser(key: string, props?: CFProps<"user"> & { collection?: FieldCollectionConfig; }): this; addMedia(key: string, props?: CFProps<"media"> & { collection?: FieldCollectionConfig; }): this; documentFieldFilters(filters?: QueryParamFilters, allowAll?: boolean): DocumentFieldFilters[]; queryIncludeFields(all?: boolean): string[]; get getData(): CollectionData; get fixedBricks(): CollectionBrickConfig[]; get builderBricks(): CollectionBrickConfig[]; get brickInstances(): Array<BrickBuilder>; } declare const ConfigSchema: zod__default.ZodObject<{ db: zod__default.ZodUnknown; host: zod__default.ZodString; keys: zod__default.ZodObject<{ encryptionKey: zod__default.ZodString; cookieSecret: zod__default.ZodString; accessTokenSecret: zod__default.ZodString; refreshTokenSecret: zod__default.ZodString; }, "strip", zod__default.ZodTypeAny, { encryptionKey: string; cookieSecret: string; accessTokenSecret: string; refreshTokenSecret: string; }, { encryptionKey: string; cookieSecret: string; accessTokenSecret: string; refreshTokenSecret: string; }>; paths: zod__default.ZodOptional<zod__default.ZodObject<{ emailTemplates: zod__default.ZodOptional<zod__default.ZodString>; }, "strip", zod__default.ZodTypeAny, { emailTemplates?: string | undefined; }, { emailTemplates?: string | undefined; }>>; disableSwagger: zod__default.ZodBoolean; localisation: zod__default.ZodOptional<zod__default.ZodObject<{ locales: zod__default.ZodArray<zod__default.ZodObject<{ label: zod__default.ZodString; code: zod__default.ZodString; }, "strip", zod__default.ZodTypeAny, { code: string; label: string; }, { code: string; label: string; }>, "many">; defaultLocale: zod__default.ZodString; }, "strip", zod__default.ZodTypeAny, { locales: { code: string; label: string; }[]; defaultLocale: string; }, { locales: { code: string; label: string; }[]; defaultLocale: string; }>>; email: zod__default.ZodOptional<zod__default.ZodObject<{ from: zod__default.ZodObject<{ email: zod__default.ZodString; name: zod__default.ZodString; }, "strip", zod__default.ZodTypeAny, { email: string; name: string; }, { email: string; name: string; }>; strategy: zod__default.ZodUnknown; }, "strip", zod__default.ZodTypeAny, { from: { email: string; name: string; }; strategy?: unknown; }, { from: { email: string; name: string; }; strategy?: unknown; }>>; media: zod__default.ZodObject<{ storage: zod__default.ZodNumber; maxSize: zod__default.ZodNumber; processed: zod__default.ZodObject<{ limit: zod__default.ZodNumber; store: zod__default.ZodBoolean; }, "strip", zod__default.ZodTypeAny, { limit: number; store: boolean; }, { limit: number; store: boolean; }>; fallbackImage: zod__default.ZodOptional<zod__default.ZodUnion<[zod__default.ZodString, zod__default.ZodBoolean]>>; strategy: zod__default.ZodOptional<zod__default.ZodUnknown>; }, "strip", zod__default.ZodTypeAny, { storage: number; maxSize: number; processed: { limit: number; store: boolean; }; strategy?: unknown; fallbackImage?: string | boolean | undefined; }, { storage: number; maxSize: number; processed: { limit: number; store: boolean; }; strategy?: unknown; fallbackImage?: string | boolean | undefined; }>; hooks: zod__default.ZodArray<zod__default.ZodObject<{ service: zod__default.ZodString; event: zod__default.ZodString; handler: zod__default.ZodUnknown; }, "strip", zod__default.ZodTypeAny, { event: string; service: string; handler?: unknown; }, { event: string; service: string; handler?: unknown; }>, "many">; fastifyExtensions: zod__default.ZodOptional<zod__default.ZodArray<zod__default.ZodFunction<zod__default.ZodTuple<[zod__default.ZodType<FastifyInstance<fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>, zod__default.ZodTypeDef, FastifyInstance<fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>>], zod__default.ZodUnknown>, zod__default.ZodPromise<zod__default.ZodVoid>>, "many">>; collections: zod__default.ZodArray<zod__default.ZodUnknown, "many">; plugins: zod__default.ZodArray<zod__default.ZodUnknown, "many">; vite: zod__default.ZodOptional<zod__default.ZodUnknown>; }, "strip", zod__default.ZodTypeAny, { media: { storage: number; maxSize: number; processed: { limit: number; store: boolean; }; strategy?: unknown; fallbackImage?: string | boolean | undefined; }; keys: { encryptionKey: string; cookieSecret: string; accessTokenSecret: string; refreshTokenSecret: string; }; hooks: { event: string; service: string; handler?: unknown; }[]; host: string; disableSwagger: boolean; collections: unknown[]; plugins: unknown[]; email?: { from: { email: string; name: string; }; strategy?: unknown; } | undefined; db?: unknown; paths?: { emailTemplates?: string | undefined; } | undefined; localisation?: { locales: { code: string; label: string; }[]; defaultLocale: string; } | undefined; fastifyExtensions?: ((args_0: FastifyInstance<fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>, ...args: unknown[]) => Promise<void>)[] | undefined; vite?: unknown; }, { media: { storage: number; maxSize: number; processed: { limit: number; store: boolean; }; strategy?: unknown; fallbackImage?: string | boolean | undefined; }; keys: { encryptionKey: string; cookieSecret: string; accessTokenSecret: string; refreshTokenSecret: string; }; hooks: { event: string; service: string; handler?: unknown; }[]; host: string; disableSwagger: boolean; collections: unknown[]; plugins: unknown[]; email?: { from: { email: string; name: string; }; strategy?: unknown; } | undefined; db?: unknown; paths?: { emailTemplates?: string | undefined; } | undefined; localisation?: { locales: { code: string; label: string; }[]; defaultLocale: string; } | undefined; fastifyExtensions?: ((args_0: FastifyInstance<fastify.RawServerDefault, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>, ...args: unknown[]) => Promise<void>)[] | undefined; vite?: unknown; }>; interface LucidErrorData { type?: "validation" | "basic" | "forbidden" | "authorisation" | "cron" | "toolkit"; name?: string; message?: string; status?: number; code?: "csrf" | "login" | "authorisation" | "rate_limit" | "not_found"; zod?: zod__default.ZodError; errorResponse?: ErrorResult; } type ErrorResultValue = ErrorResultObj | ErrorResultObj[] | FieldErrors[] | string | undefined; interface ErrorResultObj { code?: string; message?: string; children?: ErrorResultObj[]; [key: string]: ErrorResultValue; } type ErrorResult = Record<string, ErrorResultValue>; interface FieldErrors { brickId: string | number | undefined; groupId: string | number | undefined; key: string; localeCode?: string; message: string; } declare const _default: { locales: readonly ["en"]; tempDir: string; swaggerRoutePrefix: string; headers: { accessToken: string; csrf: string; refreshToken: string; clientIntegrationKey: string; contentLocale: string; }; seedDefaults: { user: { firstName: string; lastName: string; email: string; username: string; password: string; superAdmin: number; }; roles: { name: string; description: string; permissions: Permission[]; }[]; }; fieldBuiler: { maxRepeaterDepth: number; }; collectionBuilder: { isLocked: boolean; useDrafts: boolean; useRevisions: boolean; useTranslations: boolean; }; customFields: { link: { targets: string[]; }; }; query: { page: number; perPage: number; }; locations: { resetPassword: string; }; errors: { name: string; message: string; status: number; code: undefined; errorResponse: undefined; }; emailTemplates: { resetPassword: string; userInvite: string; passwordResetSuccess: string; emailChanged: string; }; rateLimit: { max: number; timeWindow: string; }; runtimeStore: { dist: string; }; vite: { outputDir: string; dist: string; mount: string; html: string; rootSelector: string; buildMetadata: string; port: number; }; arguments: { noCache: string; }; brickTypes: { readonly builder: "builder"; readonly fixed: "fixed"; readonly collectionFields: "collection-fields"; }; cronSchedule: string; csrfExpiration: number; refreshTokenExpiration: number; accessTokenExpiration: number; passwordResetTokenExpirationMinutes: number; userInviteTokenExpirationMinutes: number; documentation: string; lucidUi: string; mediaAwaitingSyncInterval: number; fastify: { version: string; }; }; type SupportedLocales = (typeof _default.locales)[number]; type LocaleValue = Partial<Record<SupportedLocales, string>> | string; interface TranslationsObj { localeCode: string; value: string | null; } interface ServiceData$1<K extends string> { keys: Record<K, number | null>; items: Array<{ translations: TranslationsObj[]; key: K; }>; } interface ServiceData<K extends string> { keys: K[]; translations: Array<{ value: string | null; localeCode: string; key: K; }>; } declare const FieldValueSchema: zod__default.ZodOptional<zod__default.ZodUnion<[zod__default.ZodString, zod__default.ZodNumber, zod__default.ZodObject<{ url: zod__default.ZodNullable<zod__default.ZodString>; target: zod__default.ZodOptional<zod__default.ZodNullable<zod__default.ZodString>>; label: zod__default.ZodOptional<zod__default.ZodNullable<zod__default.ZodString>>; }, "strip", zod__default.ZodTypeAny, { url: string | null; label?: string | null | undefined; target?: string | null | undefined; }, { url: string | null; label?: string | null | undefined; target?: string | null | undefined; }>, zod__default.ZodNull, zod__default.ZodAny]>>; type FieldValueSchemaType = zod__default.infer<typeof FieldValueSchema>; declare const FieldBaseSchema: zod__default.ZodObject<{ key: zod__default.ZodString; type: zod__default.ZodUnion<[zod__default.ZodLiteral<"text">, zod__default.ZodLiteral<"wysiwyg">, zod__default.ZodLiteral<"media">, zod__default.ZodLiteral<"number">, zod__default.ZodLiteral<"checkbox">, zod__default.ZodLiteral<"select">, zod__default.ZodLiteral<"textarea">, zod__default.ZodLiteral<"json">, zod__default.ZodLiteral<"colour">, zod__default.ZodLiteral<"datetime">, zod__default.ZodLiteral<"link">, zod__default.ZodLiteral<"repeater">, zod__default.ZodLiteral<"user">, zod__default.ZodLiteral<"document">]>; translations: zod__default.ZodOptional<zod__default.ZodRecord<zod__default.ZodString, zod__default.ZodOptional<zod__default.ZodUnion<[zod__default.ZodString, zod__default.ZodNumber, zod__default.ZodObject<{ url: zod__default.ZodNullable<zod__default.ZodString>; target: zod__default.ZodOptional<zod__default.ZodNullable<zod__default.ZodString>>; label: zod__default.ZodOptional<zod__default.ZodNullable<zod__default.ZodString>>; }, "strip", zod__default.ZodTypeAny, { url: string | null; label?: string | null | undefined; target?: string | null | undefined; }, { url: string | null; label?: string | null | undefined; target?: string | null | undefined; }>, zod__default.ZodNull, zod__default.ZodAny]>>>>; value: zod__default.ZodOptional<zod__default.ZodOptional<zod__default.ZodUnion<[zod__default.ZodString, zod__default.ZodNumber, zod__default.ZodObject<{ url: zod__default.ZodNullable<zod__default.ZodString>; target: zod__default.ZodOptional<zod__default.ZodNullable<zod__default.ZodString>>; label: zod__default.ZodOptional<zod__default.ZodNullable<zod__default.ZodString>>; }, "strip", zod__default.ZodTypeAny, { url: string | null; label?: string | null | undefined; target?: string | null | undefined; }, { url: string | null; label?: string | null | undefined; target?: string | null | undefined; }>, zod__default.ZodNull, zod__default.ZodAny]>>>; }, "strip", zod__default.ZodTypeAny, { type: "number" | "json" | "media" | "text" | "wysiwyg" | "document" | "repeater" | "checkbox" | "select" | "textarea" | "colour" | "datetime" | "link" | "user"; key: string; value?: any; translations?: Record<string, any> | undefined; }, { type: "number" | "json" | "media" | "text" | "wysiwyg" | "document" | "repeater" | "checkbox" | "select" | "textarea" | "colour" | "datetime" | "link" | "user"; key: string; value?: any; translations?: Record<string, any> | undefined; }>; declare const FieldSchema: zod__default.ZodType<FieldSchemaType>; type FieldSchemaType = zod__default.infer<typeof FieldBaseSchema> & { groups?: { id: string | number; order?: number; open?: BooleanInt; fields: FieldSchemaType[]; }[]; }; interface FieldInsertItem { key: FieldSchemaType["key"]; type: FieldSchemaType["type"]; value: FieldValueSchemaType; localeCode: string; groupRef?: string; groupId?: number | string; } interface GroupInsertItem { ref: string; order: number; repeater: string; open: BooleanInt; parentGroupRef?: string; } interface GroupSimpleResponse { group_id: number; ref: string | null; } interface BrickConfigProps { details?: { name?: LocaleValue; summary?: LocaleValue; }; preview?: { image?: string; }; } interface BrickConfig { details: { name: LocaleValue; summary?: LocaleValue; }; preview?: { image?: string; }; } type BrickTypes = (typeof _default.brickTypes)[keyof typeof _default.brickTypes]; declare const BrickSchema: zod__default.ZodObject<{ id: zod__default.ZodUnion<[zod__default.ZodString, zod__default.ZodNumber]>; key: zod__default.ZodString; order: zod__default.ZodNumber; type: zod__default.ZodUnion<[zod__default.ZodLiteral<"builder">, zod__default.ZodLiteral<"fixed">]>; open: zod__default.ZodOptional<zod__default.ZodUnion<[zod__default.ZodLiteral<1>, zod__default.ZodLiteral<0>]>>; fields: zod__default.ZodOptional<zod__default.ZodArray<zod__default.ZodType<FieldSchemaType, zod__default.ZodTypeDef, FieldSchemaType>, "many">>; }, "strip", zod__default.ZodTypeAny, { type: "builder" | "fixed"; key: string; id: string | number; order: number; fields?: FieldSchemaType[] | undefined; open?: 0 | 1 | undefined; }, { type: "builder" | "fixed"; key: string; id: string | number; order: number; fields?: FieldSchemaType[] | undefined; open?: 0 | 1 | undefined; }>; interface BrickSchema { id: number | string; key?: string; order?: number; type: BrickTypes; open?: BooleanInt; fields?: zod__default.infer<typeof FieldSchema>[]; } interface BrickInsertItem extends BrickSchema { id: number | string; fields: Array<FieldInsertItem>; groups: Array<GroupInsertItem>; } declare const lucidServices: { auth: { accessToken: { generateToken: (reply: fastify.FastifyReply, request: fastify.FastifyRequest, userId: number) => ServiceResponse<undefined>; verifyToken: (request: fastify.FastifyRequest) => Awaited<ServiceResponse<fastify.FastifyRequest["auth"]>>; clearToken: (reply: fastify.FastifyReply) => Awaited<ServiceResponse<undefined>>; }; refreshToken: { generateToken: (reply: fastify.FastifyReply, request: fastify.FastifyRequest, userId: number) => ServiceResponse<undefined>; verifyToken: (request: fastify.FastifyRequest, reply: fastify.FastifyReply) => ServiceResponse<{ user_id: number; }>; clearToken: (request: fastify.FastifyRequest, reply: fastify.FastifyReply) => ServiceResponse<undefined>; }; csrf: { generateToken: (request: fastify.FastifyRequest, reply: fastify.FastifyReply) => ServiceResponse<string>; verifyToken: (request: fastify.FastifyRequest) => Awaited<ServiceResponse<undefined>>; clearToken: (reply: fastify.FastifyReply) => Awaited<ServiceResponse<undefined>>; }; login: ServiceFn<[{ usernameOrEmail: string; password: string; }], { id: number; }>; }; collection: { document: { versions: { createSingle: ServiceFn<[{ documentId: number; collection: CollectionBuilder; userId: number; publish: BooleanInt; bricks?: Array<BrickSchema>; fields?: Array<FieldSchemaType>; }], number>; promoteVersion: ServiceFn<[{ fromVersionId: number; toVersionType: "draft" | "published"; collectionKey: string; documentId: number; userId: number; skipRevisionCheck?: boolean; }], undefined>; restoreRevision: ServiceFn<[{ documentId: number; versionId: number; userId: number; collectionKey: string; }], undefined>; }; brick: { checks: { checkValidateBricksFields: ServiceFn<[{ bricks: Array<BrickInsertItem>; collection: CollectionBuilder; }], undefined>; checkDuplicateOrder: (bricks: Array<BrickInsertItem>) => Awaited<ServiceResponse<undefined>>; }; deleteMultipleBricks: ServiceFn<[{ versionId: number; apply: { bricks: boolean; collectionFields: boolean; }; }], undefined>; getMultiple: ServiceFn<[{ versionId: number; collectionKey: string; documentFieldsRelationStatus?: Exclude<DocumentVersionType, "revision">; }], { bricks: Array<BrickResponse>; fields: Array<FieldResponse>; }>; createMultiple: ServiceFn<[{ versionId: number; documentId: number; bricks?: Array<BrickSchema>; fields?: Array<FieldSchemaType>; collection: CollectionBuilder; skipValidation?: boolean; }], undefined>; createMultipleFields: ServiceFn<[{ documentId: number; versionId: number; fields: CFInsertItem<FieldTypes>[]; }], undefined>; createMultipleGroups: ServiceFn<[{ versionId: number; documentId: number; brickGroups: Array<{ brickId: number; groups: GroupInsertItem[]; }>; }], GroupSimpleResponse[]>; }; checks: { checkCollection: ServiceFn<[{ key: string; }], CollectionBuilder>; checkSingleCollectionDocumentCount: ServiceFn<[{ collectionKey: string; collectionMode: "single" | "multiple"; documentId?: number; }], undefined>; }; client: { getSingle: ServiceFn<[{ collectionKey: string; status: Exclude<DocumentVersionType, "revision">; query: zod.TypeOf<zod.ZodObject<{ filter: zod.ZodOptional<zod.ZodUnion<[zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>, zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodString, "many">, zod.ZodNumber, zod.ZodArray<zod.ZodNumber, "many">]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>]>>, zod.ZodObject<{ documentId: zod.ZodOptional<zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>>; documentCreatedBy: zod.ZodOptional<zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>>; documentUpdatedBy: zod.ZodOptional<zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>>; documentCreatedAt: zod.ZodOptional<zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>>; documentUpdatedAt: zod.ZodOptional<zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>>; }, "strip", zod.ZodTypeAny, { documentId?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; }, { documentId?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; }>]>>; include: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<["bricks"]>, "many">>; }, "strip", zod.ZodTypeAny, { filter?: Record<string, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }> | { documentId?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; } | undefined; include?: "bricks"[] | undefined; }, { filter?: Record<string, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }> | { documentId?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; } | undefined; include?: "bricks"[] | undefined; }>>; }], ClientDocumentResponse>; getMultiple: ServiceFn<[{ collectionKey: string; status: Exclude<DocumentVersionType, "revision">; query: zod.TypeOf<zod.ZodObject<{ filter: zod.ZodOptional<zod.ZodUnion<[zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>, zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodString, "many">, zod.ZodNumber, zod.ZodArray<zod.ZodNumber, "many">]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>]>>, zod.ZodObject<{ documentId: zod.ZodOptional<zod.ZodUnion<[zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>, zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodString, "many">, zod.ZodNumber, zod.ZodArray<zod.ZodNumber, "many">]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>]>>; documentCreatedBy: zod.ZodOptional<zod.ZodUnion<[zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>, zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodString, "many">, zod.ZodNumber, zod.ZodArray<zod.ZodNumber, "many">]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>]>>; documentUpdatedBy: zod.ZodOptional<zod.ZodUnion<[zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>, zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodString, "many">, zod.ZodNumber, zod.ZodArray<zod.ZodNumber, "many">]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>]>>; documentCreatedAt: zod.ZodOptional<zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>>; documentUpdatedAt: zod.ZodOptional<zod.ZodObject<{ value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>; operator: zod.ZodOptional<zod.ZodEnum<["=", "%", "like", "ilike", "in", "not in", "<>", "is not", "is", "!="]>>; }, "strip", zod.ZodTypeAny, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }, { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; }>>; }, "strip", zod.ZodTypeAny, { documentId?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; }, { documentId?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedBy?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | { value: string | number | string[] | number[]; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentCreatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; documentUpdatedAt?: { value: string | number; operator?: "=" | "!=" | "<>" | "in" | "not in" | "is" | "is not" | "like" | "ilike" | "%" | undefined; } | undefined; }>]>>; sort: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{