Gitapp

← Back to module

JSDoc

Types

ReadResult

type
type ReadResult = { kind?: "found"; path?: string; content?: string; versionToken?: string; } | { kind?: "missing"; path?: string; }

DocEntry

type
type DocEntry = { path?: string; type?: "doc" | "dir"; versionToken?: string; }

IfMatch

type
type IfMatch = { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }

JsonPatchOp

type
type JsonPatchOp = { value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; }

FrontmatterBody

type
type FrontmatterBody = { kind?: "preserve"; } | { kind?: "replace"; value?: string; }

IfMissing

type
type IfMissing = "create-empty" | "fail"

Mutation

type
type Mutation = { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; } | { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }

ConflictPolicy

type
type ConflictPolicy = { kind?: "fail"; } | { kind?: "retry-after-pull"; maxAttempts?: number; } | { kind?: "rebase-mutations"; maxAttempts?: number; }

Transaction

type
type Transaction = { message?: string; mutations?: ({ kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; } | { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; })[]; onConflict?: { kind?: "fail"; } | { kind?: "retry-after-pull"; maxAttempts?: number; } | { kind?: "rebase-mutations"; maxAttempts?: number; }; }

TransactionResult

type
type TransactionResult = { kind?: "committed"; commitId?: string; } | { kind?: "conflict"; conflictingPaths?: string[]; } | { kind?: "auth-error"; reason?: string; } | { kind?: "not-found"; reason?: string; } | { kind?: "network-error"; reason?: string; retriable?: boolean; } | { kind?: "validation-error"; errors?: string[]; } | { kind?: "if-match-failed"; path?: string; expected?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }

WatchEvent

type
type WatchEvent = { kind?: "changed"; commitId?: string; paths?: string[]; } | { kind?: "resync"; reason?: string; }

SyncInResult

type
type SyncInResult = { kind?: "up-to-date"; } | { kind?: "applied"; commitId?: string; paths?: string[]; } | { kind?: "diverged"; reason?: string; } | { kind?: "auth-error"; reason?: string; } | { kind?: "not-found"; reason?: string; } | { kind?: "network-error"; reason?: string; retriable?: boolean; }

Interfaces

DocStore

interface
interface DocStore
Members

read

property

Read a single document. Returns missing if absent — never throws.

read: (path: string) => Promise<ReadResult>

list

property

Recursive list of `prefix` (empty string lists root). Returns empty array if prefix doesn't exist — never throws.

list: (prefix: string) => Promise<ReadonlyArray<DocEntry>>

runTransaction

property

Run a transaction. All mutations apply or none do (atomic). Result is a discriminated union; caller branches with ts-pattern.

runTransaction: (tx: Transaction) => Promise<TransactionResult>

watch

property

Subscribe to remote-driven changes under `prefix`. Returns the unsubscribe fn. The callback fires when a sync-in applies commits that touch matching paths. Local writes do NOT echo through watch.

watch: (prefix: string, cb: (event: WatchEvent) => void) => () => void

syncIn

property

Force a pull-then-emit-watches cycle. UI "refresh" affordance.

syncIn: () => Promise<SyncInResult>

drain

property

Wait for any internal queueing to settle. Tests call this after a series of fire-and-forget runTransaction() to await completion.

drain: () => Promise<void>

Constants

ReadResultSchema

const
const ReadResultSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"found">; path: z.ZodString; content: z.ZodString; versionToken: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "found"; path?: string; content?: string; versionToken?: string; }, { kind?: "found"; path?: string; content?: string; versionToken?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"missing">; path: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "missing"; path?: string; }, { kind?: "missing"; path?: string; }>]>

DocEntrySchema

const
const DocEntrySchema: z.ZodObject<{ path: z.ZodString; type: z.ZodEnum<["doc", "dir"]>; versionToken: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; type?: "doc" | "dir"; versionToken?: string; }, { path?: string; type?: "doc" | "dir"; versionToken?: string; }>

IfMatchSchema

const
const IfMatchSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>

JsonPatchOpSchema

const
const JsonPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{ op: z.ZodLiteral<"add">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "add"; }, { value?: JsonValue; path?: string; op?: "add"; }>, z.ZodObject<{ op: z.ZodLiteral<"remove">; path: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; op?: "remove"; }, { path?: string; op?: "remove"; }>, z.ZodObject<{ op: z.ZodLiteral<"replace">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "replace"; }, { value?: JsonValue; path?: string; op?: "replace"; }>, z.ZodObject<{ op: z.ZodLiteral<"test">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "test"; }, { value?: JsonValue; path?: string; op?: "test"; }>]>

FrontmatterBodySchema

const
const FrontmatterBodySchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"preserve">; }, "strip", z.ZodTypeAny, { kind?: "preserve"; }, { kind?: "preserve"; }>, z.ZodObject<{ kind: z.ZodLiteral<"replace">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "replace"; value?: string; }, { kind?: "replace"; value?: string; }>]>

IfMissingSchema

const
const IfMissingSchema: z.ZodEnum<["create-empty", "fail"]>

MutationSchema

const
const MutationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"put">; path: z.ZodString; content: z.ZodString; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>, z.ZodObject<{ kind: z.ZodLiteral<"delete">; path: z.ZodString; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>, z.ZodObject<{ kind: z.ZodLiteral<"json-patch">; path: z.ZodString; ops: z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{ op: z.ZodLiteral<"add">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "add"; }, { value?: JsonValue; path?: string; op?: "add"; }>, z.ZodObject<{ op: z.ZodLiteral<"remove">; path: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; op?: "remove"; }, { path?: string; op?: "remove"; }>, z.ZodObject<{ op: z.ZodLiteral<"replace">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "replace"; }, { value?: JsonValue; path?: string; op?: "replace"; }>, z.ZodObject<{ op: z.ZodLiteral<"test">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "test"; }, { value?: JsonValue; path?: string; op?: "test"; }>]>, "many">; ifMissing: z.ZodEnum<["create-empty", "fail"]>; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; }, { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; }>, z.ZodObject<{ kind: z.ZodLiteral<"upsert-frontmatter">; path: z.ZodString; set: z.ZodRecord<z.ZodString, z.ZodUnknown>; body: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"preserve">; }, "strip", z.ZodTypeAny, { kind?: "preserve"; }, { kind?: "preserve"; }>, z.ZodObject<{ kind: z.ZodLiteral<"replace">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "replace"; value?: string; }, { kind?: "replace"; value?: string; }>]>; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }, { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }>]>

ConflictPolicySchema

const
const ConflictPolicySchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"fail">; }, "strip", z.ZodTypeAny, { kind?: "fail"; }, { kind?: "fail"; }>, z.ZodObject<{ kind: z.ZodLiteral<"retry-after-pull">; maxAttempts: z.ZodNumber; }, "strip", z.ZodTypeAny, { kind?: "retry-after-pull"; maxAttempts?: number; }, { kind?: "retry-after-pull"; maxAttempts?: number; }>, z.ZodObject<{ kind: z.ZodLiteral<"rebase-mutations">; maxAttempts: z.ZodNumber; }, "strip", z.ZodTypeAny, { kind?: "rebase-mutations"; maxAttempts?: number; }, { kind?: "rebase-mutations"; maxAttempts?: number; }>]>

TransactionSchema

const
const TransactionSchema: z.ZodObject<{ mutations: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"put">; path: z.ZodString; content: z.ZodString; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>, z.ZodObject<{ kind: z.ZodLiteral<"delete">; path: z.ZodString; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>, z.ZodObject<{ kind: z.ZodLiteral<"json-patch">; path: z.ZodString; ops: z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{ op: z.ZodLiteral<"add">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "add"; }, { value?: JsonValue; path?: string; op?: "add"; }>, z.ZodObject<{ op: z.ZodLiteral<"remove">; path: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; op?: "remove"; }, { path?: string; op?: "remove"; }>, z.ZodObject<{ op: z.ZodLiteral<"replace">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "replace"; }, { value?: JsonValue; path?: string; op?: "replace"; }>, z.ZodObject<{ op: z.ZodLiteral<"test">; path: z.ZodString; value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>; }, "strip", z.ZodTypeAny, { value?: JsonValue; path?: string; op?: "test"; }, { value?: JsonValue; path?: string; op?: "test"; }>]>, "many">; ifMissing: z.ZodEnum<["create-empty", "fail"]>; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; }, { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; }>, z.ZodObject<{ kind: z.ZodLiteral<"upsert-frontmatter">; path: z.ZodString; set: z.ZodRecord<z.ZodString, z.ZodUnknown>; body: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"preserve">; }, "strip", z.ZodTypeAny, { kind?: "preserve"; }, { kind?: "preserve"; }>, z.ZodObject<{ kind: z.ZodLiteral<"replace">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "replace"; value?: string; }, { kind?: "replace"; value?: string; }>]>; ifMatch: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }, { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; }>]>, "many">; message: z.ZodString; onConflict: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"fail">; }, "strip", z.ZodTypeAny, { kind?: "fail"; }, { kind?: "fail"; }>, z.ZodObject<{ kind: z.ZodLiteral<"retry-after-pull">; maxAttempts: z.ZodNumber; }, "strip", z.ZodTypeAny, { kind?: "retry-after-pull"; maxAttempts?: number; }, { kind?: "retry-after-pull"; maxAttempts?: number; }>, z.ZodObject<{ kind: z.ZodLiteral<"rebase-mutations">; maxAttempts: z.ZodNumber; }, "strip", z.ZodTypeAny, { kind?: "rebase-mutations"; maxAttempts?: number; }, { kind?: "rebase-mutations"; maxAttempts?: number; }>]>; }, "strip", z.ZodTypeAny, { message?: string; mutations?: ({ kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; } | { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; })[]; onConflict?: { kind?: "fail"; } | { kind?: "retry-after-pull"; maxAttempts?: number; } | { kind?: "rebase-mutations"; maxAttempts?: number; }; }, { message?: string; mutations?: ({ kind?: "put"; path?: string; content?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "delete"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; } | { kind?: "json-patch"; path?: string; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; ops?: ({ value?: JsonValue; path?: string; op?: "add"; } | { path?: string; op?: "remove"; } | { value?: JsonValue; path?: string; op?: "replace"; } | { value?: JsonValue; path?: string; op?: "test"; })[]; ifMissing?: "create-empty" | "fail"; } | { kind?: "upsert-frontmatter"; path?: string; set?: Record<string, unknown>; ifMatch?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; body?: { kind?: "preserve"; } | { kind?: "replace"; value?: string; }; })[]; onConflict?: { kind?: "fail"; } | { kind?: "retry-after-pull"; maxAttempts?: number; } | { kind?: "rebase-mutations"; maxAttempts?: number; }; }>

TransactionResultSchema

const
const TransactionResultSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"committed">; commitId: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "committed"; commitId?: string; }, { kind?: "committed"; commitId?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"conflict">; conflictingPaths: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { kind?: "conflict"; conflictingPaths?: string[]; }, { kind?: "conflict"; conflictingPaths?: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"auth-error">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "auth-error"; reason?: string; }, { kind?: "auth-error"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"not-found">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "not-found"; reason?: string; }, { kind?: "not-found"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"network-error">; retriable: z.ZodBoolean; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "network-error"; reason?: string; retriable?: boolean; }, { kind?: "network-error"; reason?: string; retriable?: boolean; }>, z.ZodObject<{ kind: z.ZodLiteral<"validation-error">; errors: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { kind?: "validation-error"; errors?: string[]; }, { kind?: "validation-error"; errors?: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"if-match-failed">; path: z.ZodString; expected: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { kind?: "any"; }, { kind?: "any"; }>, z.ZodObject<{ kind: z.ZodLiteral<"absent">; }, "strip", z.ZodTypeAny, { kind?: "absent"; }, { kind?: "absent"; }>, z.ZodObject<{ kind: z.ZodLiteral<"version">; token: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "version"; token?: string; }, { kind?: "version"; token?: string; }>]>; }, "strip", z.ZodTypeAny, { kind?: "if-match-failed"; path?: string; expected?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }, { kind?: "if-match-failed"; path?: string; expected?: { kind?: "any"; } | { kind?: "absent"; } | { kind?: "version"; token?: string; }; }>]>

WatchEventSchema

const
const WatchEventSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"changed">; paths: z.ZodArray<z.ZodString, "many">; commitId: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "changed"; commitId?: string; paths?: string[]; }, { kind?: "changed"; commitId?: string; paths?: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"resync">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "resync"; reason?: string; }, { kind?: "resync"; reason?: string; }>]>

SyncInResultSchema

const
const SyncInResultSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"up-to-date">; }, "strip", z.ZodTypeAny, { kind?: "up-to-date"; }, { kind?: "up-to-date"; }>, z.ZodObject<{ kind: z.ZodLiteral<"applied">; paths: z.ZodArray<z.ZodString, "many">; commitId: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "applied"; commitId?: string; paths?: string[]; }, { kind?: "applied"; commitId?: string; paths?: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"diverged">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "diverged"; reason?: string; }, { kind?: "diverged"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"auth-error">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "auth-error"; reason?: string; }, { kind?: "auth-error"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"not-found">; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "not-found"; reason?: string; }, { kind?: "not-found"; reason?: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"network-error">; retriable: z.ZodBoolean; reason: z.ZodString; }, "strip", z.ZodTypeAny, { kind?: "network-error"; reason?: string; retriable?: boolean; }, { kind?: "network-error"; reason?: string; retriable?: boolean; }>]>