import * as v from '../../shared/src/valita.ts'; import type { NameMapper } from '../../zero-schema/src/name-mapper.ts'; export declare const CRUD_MUTATION_NAME = "_zero_crud"; /** * Inserts if entity with id does not already exist. */ declare const insertOpSchema: v.ObjectType<{ op: v.Type<"insert">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>; /** * Upsert semantics. Inserts if entity with id does not already exist, * otherwise updates existing entity with id. */ declare const upsertOpSchema: v.ObjectType<{ op: v.Type<"upsert">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>; /** * Updates if entity with id exists, otherwise does nothing. */ declare const updateOpSchema: v.ObjectType<{ op: v.Type<"update">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>; /** * Deletes entity with id if it exists, otherwise does nothing. */ declare const deleteOpSchema: v.ObjectType<{ op: v.Type<"delete">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>; declare const crudOpSchema: v.UnionType<[v.ObjectType<{ op: v.Type<"insert">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"upsert">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"update">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"delete">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>]>; declare const crudArgSchema: v.ObjectType<{ ops: v.ArrayType; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"upsert">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"update">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"delete">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>]>>; }, undefined>; export declare const crudMutationSchema: v.ObjectType<{ type: v.Type<"crud">; id: v.Type; clientID: v.Type; name: v.Type<"_zero_crud">; args: v.TupleType<[v.ObjectType<{ ops: v.ArrayType; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"upsert">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"update">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"delete">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>]>>; }, undefined>]>; timestamp: v.Type; }, undefined>; export declare const customMutationSchema: v.ObjectType<{ type: v.Type<"custom">; id: v.Type; clientID: v.Type; name: v.Type; args: v.ArrayType>; timestamp: v.Type; }, undefined>; export declare const mutationSchema: v.UnionType<[v.ObjectType<{ type: v.Type<"crud">; id: v.Type; clientID: v.Type; name: v.Type<"_zero_crud">; args: v.TupleType<[v.ObjectType<{ ops: v.ArrayType; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"upsert">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"update">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"delete">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>]>>; }, undefined>]>; timestamp: v.Type; }, undefined>, v.ObjectType<{ type: v.Type<"custom">; id: v.Type; clientID: v.Type; name: v.Type; args: v.ArrayType>; timestamp: v.Type; }, undefined>]>; export declare const pushBodySchema: v.ObjectType<{ clientGroupID: v.Type; mutations: v.ArrayType; id: v.Type; clientID: v.Type; name: v.Type<"_zero_crud">; args: v.TupleType<[v.ObjectType<{ ops: v.ArrayType; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"upsert">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"update">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"delete">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>]>>; }, undefined>]>; timestamp: v.Type; }, undefined>, v.ObjectType<{ type: v.Type<"custom">; id: v.Type; clientID: v.Type; name: v.Type; args: v.ArrayType>; timestamp: v.Type; }, undefined>]>>; pushVersion: v.Type; schemaVersion: v.Optional; timestamp: v.Type; requestID: v.Type; }, undefined>; export declare const pushMessageSchema: v.TupleType<[v.Type<"push">, v.ObjectType<{ clientGroupID: v.Type; mutations: v.ArrayType; id: v.Type; clientID: v.Type; name: v.Type<"_zero_crud">; args: v.TupleType<[v.ObjectType<{ ops: v.ArrayType; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"upsert">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"update">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>, v.ObjectType<{ op: v.Type<"delete">; tableName: v.Type; primaryKey: v.Type; value: v.Type>>; }, undefined>]>>; }, undefined>]>; timestamp: v.Type; }, undefined>, v.ObjectType<{ type: v.Type<"custom">; id: v.Type; clientID: v.Type; name: v.Type; args: v.ArrayType>; timestamp: v.Type; }, undefined>]>>; pushVersion: v.Type; schemaVersion: v.Optional; timestamp: v.Type; requestID: v.Type; }, undefined>]>; export declare const mutationIDSchema: v.ObjectType<{ id: v.Type; clientID: v.Type; }, undefined>; declare const mutationOkSchema: v.ObjectType<{ data: v.Optional; }, undefined>; declare const mutationErrorSchema: v.UnionType<[v.ObjectType<{ error: v.Type<"app">; details: v.Optional; }, undefined>, v.ObjectType<{ error: v.Type<"oooMutation" | "alreadyProcessed">; details: v.Optional; }, undefined>]>; export declare const mutationResultSchema: v.UnionType<[v.ObjectType<{ data: v.Optional; }, undefined>, v.UnionType<[v.ObjectType<{ error: v.Type<"app">; details: v.Optional; }, undefined>, v.ObjectType<{ error: v.Type<"oooMutation" | "alreadyProcessed">; details: v.Optional; }, undefined>]>]>; export declare const mutationResponseSchema: v.ObjectType<{ id: v.ObjectType<{ id: v.Type; clientID: v.Type; }, undefined>; result: v.UnionType<[v.ObjectType<{ data: v.Optional; }, undefined>, v.UnionType<[v.ObjectType<{ error: v.Type<"app">; details: v.Optional; }, undefined>, v.ObjectType<{ error: v.Type<"oooMutation" | "alreadyProcessed">; details: v.Optional; }, undefined>]>]>; }, undefined>; declare const pushOkSchema: v.ObjectType<{ mutations: v.ArrayType; clientID: v.Type; }, undefined>; result: v.UnionType<[v.ObjectType<{ data: v.Optional; }, undefined>, v.UnionType<[v.ObjectType<{ error: v.Type<"app">; details: v.Optional; }, undefined>, v.ObjectType<{ error: v.Type<"oooMutation" | "alreadyProcessed">; details: v.Optional; }, undefined>]>]>; }, undefined>>; }, undefined>; declare const pushErrorSchema: v.UnionType<[v.ObjectType<{ error: v.Type<"unsupportedPushVersion">; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>, v.ObjectType<{ error: v.Type<"unsupportedSchemaVersion">; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>, v.ObjectType<{ error: v.Type<"http">; status: v.Type; details: v.Type; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>, v.ObjectType<{ error: v.Type<"zeroPusher">; details: v.Type; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>]>; export declare const pushResponseSchema: v.UnionType<[v.ObjectType<{ mutations: v.ArrayType; clientID: v.Type; }, undefined>; result: v.UnionType<[v.ObjectType<{ data: v.Optional; }, undefined>, v.UnionType<[v.ObjectType<{ error: v.Type<"app">; details: v.Optional; }, undefined>, v.ObjectType<{ error: v.Type<"oooMutation" | "alreadyProcessed">; details: v.Optional; }, undefined>]>]>; }, undefined>>; }, undefined>, v.UnionType<[v.ObjectType<{ error: v.Type<"unsupportedPushVersion">; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>, v.ObjectType<{ error: v.Type<"unsupportedSchemaVersion">; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>, v.ObjectType<{ error: v.Type<"http">; status: v.Type; details: v.Type; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>, v.ObjectType<{ error: v.Type<"zeroPusher">; details: v.Type; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>]>]>; export declare const pushResponseMessageSchema: v.TupleType<[v.Type<"pushResponse">, v.UnionType<[v.ObjectType<{ mutations: v.ArrayType; clientID: v.Type; }, undefined>; result: v.UnionType<[v.ObjectType<{ data: v.Optional; }, undefined>, v.UnionType<[v.ObjectType<{ error: v.Type<"app">; details: v.Optional; }, undefined>, v.ObjectType<{ error: v.Type<"oooMutation" | "alreadyProcessed">; details: v.Optional; }, undefined>]>]>; }, undefined>>; }, undefined>, v.UnionType<[v.ObjectType<{ error: v.Type<"unsupportedPushVersion">; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>, v.ObjectType<{ error: v.Type<"unsupportedSchemaVersion">; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>, v.ObjectType<{ error: v.Type<"http">; status: v.Type; details: v.Type; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>, v.ObjectType<{ error: v.Type<"zeroPusher">; details: v.Type; mutationIDs: v.Optional<{ id: number; clientID: string; }[]>; }, undefined>]>]>]>; export declare const ackMutationResponsesMessageSchema: v.TupleType<[v.Type<"ackMutationResponses">, v.ObjectType<{ id: v.Type; clientID: v.Type; }, undefined>]>; /** * The schema for the querystring parameters of the custom push endpoint. */ export declare const pushParamsSchema: v.ObjectType<{ schema: v.Type; appID: v.Type; }, undefined>; export type InsertOp = v.Infer; export type UpsertOp = v.Infer; export type UpdateOp = v.Infer; export type DeleteOp = v.Infer; export type CRUDOp = v.Infer; export type CRUDOpKind = CRUDOp['op']; export type CRUDMutationArg = v.Infer; export type CRUDMutation = v.Infer; export type CustomMutation = v.Infer; export type Mutation = v.Infer; export type PushBody = v.Infer; export type PushMessage = v.Infer; export type PushResponse = v.Infer; export type PushResponseMessage = v.Infer; export type MutationResponse = v.Infer; export type MutationOk = v.Infer; export type MutationError = v.Infer; export type PushError = v.Infer; export type PushOk = v.Infer; export type MutationID = v.Infer; export type MutationResult = v.Infer; export type AckMutationMessage = v.Infer; export declare function mapCRUD(arg: CRUDMutationArg, map: NameMapper): CRUDMutationArg; export {}; //# sourceMappingURL=push.d.ts.map