UNPKG

@taqueria/protocol

Version:

A TypeScript package which contains types that are to be shared between @taqueria/node-sdk and @taqueria/taqueria.

304 lines • 9.59 kB
import * as Timestamp from '@taqueria/protocol/Timestamp'; import * as Verb from '@taqueria/protocol/Verb'; import { z } from 'zod'; declare const internalOpSchema: z.ZodObject<{ hash: z.ZodEffects<z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, string & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }, any>, string & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }, any>; time: z.ZodEffects<z.ZodNumber, Timestamp.Timestamp, number>; output: z.ZodUnknown; }, "strip", z.ZodTypeAny, { hash: string & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }; time: { __type: Timestamp.Timestamp; } & number; output?: unknown; }, { time: number; hash?: any; output?: unknown; }>; declare const internalTaskSchema: z.ZodObject<{ task: z.ZodEffects<z.ZodString, Verb.Verb, string>; plugin: z.ZodString; time: z.ZodEffects<z.ZodNumber, Timestamp.Timestamp, number>; output: z.ZodUnknown; }, "strip", z.ZodTypeAny, { plugin: string; task: { __type: Verb.Verb; } & { __type: import("./NonEmptyString").NonEmptyString; } & string; time: { __type: Timestamp.Timestamp; } & number; output?: unknown; }, { plugin: string; task: string; time: number; output?: unknown; }>; export type PersistedTask = z.infer<typeof internalTaskSchema>; export type PersistedOperation = z.infer<typeof internalOpSchema>; export declare const rawSchema: z.ZodObject<{ operations: z.ZodRecord<z.ZodString, z.ZodObject<{ hash: z.ZodString; time: z.ZodNumber; output: z.ZodUnknown; }, "strip", z.ZodTypeAny, { hash: string; time: number; output?: unknown; }, { hash: string; time: number; output?: unknown; }>>; tasks: z.ZodRecord<z.ZodString, z.ZodObject<{ task: z.ZodString; plugin: z.ZodString; time: z.ZodNumber; output: z.ZodUnknown; }, "strip", z.ZodTypeAny, { plugin: string; task: string; time: number; output?: unknown; }, { plugin: string; task: string; time: number; output?: unknown; }>>; }, "strip", z.ZodTypeAny, { tasks: Record<string, { plugin: string; task: string; time: number; output?: unknown; }>; operations: Record<string, { hash: string; time: number; output?: unknown; }>; }, { tasks: Record<string, { plugin: string; task: string; time: number; output?: unknown; }>; operations: Record<string, { hash: string; time: number; output?: unknown; }>; }>; export declare const internalSchema: z.ZodEffects<z.ZodObject<{ operations: z.ZodRecord<z.ZodString, z.ZodObject<{ hash: z.ZodEffects<z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, string & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }, any>, string & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }, any>; time: z.ZodEffects<z.ZodNumber, Timestamp.Timestamp, number>; output: z.ZodUnknown; }, "strip", z.ZodTypeAny, { hash: string & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }; time: { __type: Timestamp.Timestamp; } & number; output?: unknown; }, { time: number; hash?: any; output?: unknown; }>>; tasks: z.ZodRecord<z.ZodString, z.ZodObject<{ task: z.ZodEffects<z.ZodString, Verb.Verb, string>; plugin: z.ZodString; time: z.ZodEffects<z.ZodNumber, Timestamp.Timestamp, number>; output: z.ZodUnknown; }, "strip", z.ZodTypeAny, { plugin: string; task: { __type: Verb.Verb; } & { __type: import("./NonEmptyString").NonEmptyString; } & string; time: { __type: Timestamp.Timestamp; } & number; output?: unknown; }, { plugin: string; task: string; time: number; output?: unknown; }>>; }, "strip", z.ZodTypeAny, { tasks: Record<string, { plugin: string; task: { __type: Verb.Verb; } & { __type: import("./NonEmptyString").NonEmptyString; } & string; time: { __type: Timestamp.Timestamp; } & number; output?: unknown; }>; operations: Record<string, { hash: string & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }; time: { __type: Timestamp.Timestamp; } & number; output?: unknown; }>; }, { tasks: Record<string, { plugin: string; task: string; time: number; output?: unknown; }>; operations: Record<string, { time: number; hash?: any; output?: unknown; }>; }>, { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; }, { tasks: Record<string, { plugin: string; task: string; time: number; output?: unknown; }>; operations: Record<string, { time: number; hash?: any; output?: unknown; }>; }>; export declare const generatedSchemas: { rawSchema: z.ZodType<any, z.ZodTypeDef, any>; internalSchema: z.ZodType<any, z.ZodTypeDef, any>; schema: z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }, any>; }, factory: { make: (input: { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; }) => import("fluture").FutureInstance<import("./TaqError").TaqError, { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }>; of: (input: unknown) => import("fluture").FutureInstance<import("./TaqError").TaqError, { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }>; create: (input: { tasks: Record<string, { plugin: string; task: string; time: number; output?: unknown; }>; operations: Record<string, { hash: string; time: number; output?: unknown; }>; } | { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; }) => { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }; from: (input: unknown) => { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }; }; export type PersistentState = z.infer<typeof generatedSchemas.schema>; export type t = PersistentState; export type State = PersistentState; export declare const create: (input: { tasks: Record<string, { plugin: string; task: string; time: number; output?: unknown; }>; operations: Record<string, { hash: string; time: number; output?: unknown; }>; } | { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; }) => { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }, of: (input: unknown) => import("fluture").FutureInstance<import("./TaqError").TaqError, { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }>, make: (input: { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; }) => import("fluture").FutureInstance<import("./TaqError").TaqError, { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }>; export declare const schemas: { schema: z.ZodEffects<z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }, any>, { operations: Record<string, PersistedOperation>; tasks: Record<string, PersistedTask>; } & { readonly __type: "generated" & z.infer<z.ZodType<any, z.ZodTypeDef, any>>; }, any>; rawSchema: z.ZodType<any, z.ZodTypeDef, any>; internalSchema: z.ZodType<any, z.ZodTypeDef, any>; }; export {}; //# sourceMappingURL=PersistentState.d.ts.map