@powerhousedao/reactor-browser 6.2.3-dev.76 → 6.2.3-dev.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{attachment-service-BsOmg2-v.d.ts → attachment-service-C_8_poEv.d.ts} +223 -12
- package/dist/attachment-service-C_8_poEv.d.ts.map +1 -0
- package/dist/{client-BnGewICj.d.ts → client-Cx43uuSO.d.ts} +2 -2
- package/dist/client-Cx43uuSO.d.ts.map +1 -0
- package/dist/{client-CXDpILj6.js → client-D_cBN8L-.js} +91 -3
- package/dist/client-D_cBN8L-.js.map +1 -0
- package/dist/{dispatch-BEI1Ai2b.js → dispatch-DLD1E-9L.js} +80 -8
- package/dist/dispatch-DLD1E-9L.js.map +1 -0
- package/dist/{document-by-id-bHT2FDHM.js → document-by-id-BGTnMWiG.js} +2 -2
- package/dist/{document-by-id-bHT2FDHM.js.map → document-by-id-BGTnMWiG.js.map} +1 -1
- package/dist/{document-model-modules-DAx3VAm3.js → document-model-modules-D_kT09sv.js} +254 -9
- package/dist/document-model-modules-D_kT09sv.js.map +1 -0
- package/dist/{document-operations-zQKFs_xu.js → document-operations-BdCl99y6.js} +777 -52
- package/dist/document-operations-BdCl99y6.js.map +1 -0
- package/dist/{global-DY0jZmcO.d.ts → global-C4kaLEPb.d.ts} +165 -53
- package/dist/global-C4kaLEPb.d.ts.map +1 -0
- package/dist/{index-DlZsXHpT.d.ts → index-CROGY3XV.d.ts} +2 -2
- package/dist/{index-DlZsXHpT.d.ts.map → index-CROGY3XV.d.ts.map} +1 -1
- package/dist/index.d.ts +55 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +215 -53
- package/dist/index.js.map +1 -1
- package/dist/src/ai/index.js +2 -2
- package/dist/src/analytics/index.js +1 -1
- package/dist/src/graphql/client.d.ts +2 -2
- package/dist/src/graphql/client.js +1 -1
- package/dist/src/graphql-client/entry.d.ts +4 -4
- package/dist/src/graphql-client/entry.js +4 -4
- package/dist/src/renown/index.d.ts +1 -1
- package/dist/{switchboard-G3aKXjNx.js → switchboard-CqUq5pIZ.js} +10 -48
- package/dist/switchboard-CqUq5pIZ.js.map +1 -0
- package/dist/{types-0Fh1tNjy.d.ts → types-Vb8q55oM.d.ts} +69 -2
- package/dist/types-Vb8q55oM.d.ts.map +1 -0
- package/package.json +9 -9
- package/dist/attachment-service-BsOmg2-v.d.ts.map +0 -1
- package/dist/client-BnGewICj.d.ts.map +0 -1
- package/dist/client-CXDpILj6.js.map +0 -1
- package/dist/dispatch-BEI1Ai2b.js.map +0 -1
- package/dist/document-model-modules-DAx3VAm3.js.map +0 -1
- package/dist/document-operations-zQKFs_xu.js.map +0 -1
- package/dist/global-DY0jZmcO.d.ts.map +0 -1
- package/dist/switchboard-G3aKXjNx.js.map +0 -1
- package/dist/types-0Fh1tNjy.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-D_cBN8L-.js","names":[],"sources":["../src/graphql/gen/schema.ts","../src/graphql/batch-queries.ts","../src/graphql/client.ts"],"sourcesContent":["import type { GraphQLClient, RequestOptions } from \"graphql-request\";\nimport { gql } from \"graphql-tag\";\nexport type Maybe<T> = T | null | undefined;\nexport type InputMaybe<T> = T | null | undefined;\nexport type Exact<T extends { [key: string]: unknown }> = {\n [K in keyof T]: T[K];\n};\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & {\n [SubKey in K]?: Maybe<T[SubKey]>;\n};\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {\n [SubKey in K]: Maybe<T[SubKey]>;\n};\nexport type MakeEmpty<\n T extends { [key: string]: unknown },\n K extends keyof T,\n> = { [_ in K]?: never };\nexport type Incremental<T> =\n | T\n | {\n [P in keyof T]?: P extends \" $fragmentName\" | \"__typename\" ? T[P] : never;\n };\ntype GraphQLClientRequestHeaders = RequestOptions[\"requestHeaders\"];\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string };\n String: { input: string; output: string };\n Boolean: { input: boolean; output: boolean };\n Int: { input: number; output: number };\n Float: { input: number; output: number };\n DateTime: { input: string | Date; output: string | Date };\n JSONObject: { input: NonNullable<unknown>; output: NonNullable<unknown> };\n};\n\nexport type Action = {\n readonly context?: Maybe<ActionContext>;\n readonly id: Scalars[\"String\"][\"output\"];\n readonly input: Scalars[\"JSONObject\"][\"output\"];\n readonly scope: Scalars[\"String\"][\"output\"];\n readonly timestampUtcMs: Scalars[\"String\"][\"output\"];\n readonly type: Scalars[\"String\"][\"output\"];\n};\n\n/**\n * One operation an authorization preflight predicts a verdict for.\n *\n * `input` is what a conditional grant reads, so a candidate standing for a\n * filled-in form carries that form's input. Omitting it predicts the verdict an\n * empty input earns, not the verdict the filled-in form will get.\n */\nexport type ActionCandidateInput = {\n readonly input?: InputMaybe<Scalars[\"JSONObject\"][\"input\"]>;\n readonly scope: Scalars[\"String\"][\"input\"];\n readonly type: Scalars[\"String\"][\"input\"];\n};\n\nexport type ActionContext = {\n readonly signer?: Maybe<ReactorSigner>;\n};\n\n/**\n * An action's context, as a caller submits it.\n *\n * Declares every field `ActionContext` carries, because an input object rejects a\n * field it does not declare: an action stamped with the head it applies to - which\n * is what a signing client sends - is refused outright if these are missing, and\n * that refusal is a whole-request one, not a per-field one.\n *\n * `prevOpHash` and `prevOpIndex` are the scope head the action was composed\n * against. They are recorded rather than enforced; a signature is verified from\n * the params carried in its own tuple, which do not include them.\n */\nexport type ActionContextInput = {\n /** Covers replay of an operation that would otherwise be a no-op. */\n readonly nonce?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n /** The hash of the state the action applies to. */\n readonly prevOpHash?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n /** The index of the last operation in the scope the action applies to. */\n readonly prevOpIndex?: InputMaybe<Scalars[\"Int\"][\"input\"]>;\n readonly signer?: InputMaybe<ReactorSignerInput>;\n};\n\n/**\n * One candidate's predicted verdict. `reason` carries the refusal a DENY is\n * recorded with, and is null on an ALLOW.\n */\nexport type ActionEvaluation = {\n readonly decision: AuthDecision;\n readonly reason?: Maybe<Scalars[\"String\"][\"output\"]>;\n};\n\n/**\n * The predicted verdicts for a set of candidates, in the order they were given,\n * with the aggregates a caller branches on.\n *\n * The aggregates are redundant -- a verdict is binary -- and all four are returned\n * so a caller reads the one its question is phrased in rather than negating\n * another. Over no candidates every aggregate is false: nothing is allowed and\n * nothing is denied.\n */\nexport type ActionEvaluations = {\n readonly allAllowed: Scalars[\"Boolean\"][\"output\"];\n readonly allDenied: Scalars[\"Boolean\"][\"output\"];\n readonly anyAllowed: Scalars[\"Boolean\"][\"output\"];\n readonly anyDenied: Scalars[\"Boolean\"][\"output\"];\n readonly evaluations: ReadonlyArray<ActionEvaluation>;\n};\n\nexport type ActionInput = {\n readonly context?: InputMaybe<ActionContextInput>;\n readonly id: Scalars[\"String\"][\"input\"];\n readonly input: Scalars[\"JSONObject\"][\"input\"];\n readonly scope: Scalars[\"String\"][\"input\"];\n readonly timestampUtcMs: Scalars[\"String\"][\"input\"];\n readonly type: Scalars[\"String\"][\"input\"];\n};\n\nexport enum AuthDecision {\n Allow = \"ALLOW\",\n Deny = \"DENY\",\n}\n\n/**\n * The outcome of a batch mutation, one entry per job the request named. The wire\n * shape of `BatchExecutionResult` (`{ jobs }`), keyed on each entry by the plan\n * key rather than by position so the client can rebuild the record. The batch is\n * not atomic: each job commits on its own and a failed job releases its\n * dependents, so each entry's status says what happened to that job, and\n * re-submitting re-applies the jobs that succeeded.\n */\nexport type BatchExecutionResult = {\n readonly jobs: ReadonlyArray<BatchJobResult>;\n};\n\n/**\n * One job's outcome within a batch, pairing the plan key the caller gave with the\n * job that applied it. Mirrors one entry of the `Record<string, JobInfo>` that\n * `IReactor.executeBatch` returns (packages/reactor/src/core/types.ts).\n */\nexport type BatchJobResult = {\n readonly job: JobInfo;\n readonly key: Scalars[\"String\"][\"output\"];\n};\n\nexport type ChannelMeta = {\n readonly id: Scalars[\"String\"][\"output\"];\n};\n\nexport type ChannelMetaInput = {\n readonly id: Scalars[\"String\"][\"input\"];\n};\n\nexport type ConsistencyCoordinate = {\n readonly branch: Scalars[\"String\"][\"output\"];\n readonly documentId: Scalars[\"String\"][\"output\"];\n readonly operationIndex: Scalars[\"Int\"][\"output\"];\n readonly scope: Scalars[\"String\"][\"output\"];\n};\n\n/** A consistency token's coordinate, as ConsistencyCoordinate reports it. */\nexport type ConsistencyCoordinateInput = {\n readonly branch: Scalars[\"String\"][\"input\"];\n readonly documentId: Scalars[\"String\"][\"input\"];\n readonly operationIndex: Scalars[\"Int\"][\"input\"];\n readonly scope: Scalars[\"String\"][\"input\"];\n};\n\n/**\n * The write positions a job reached, for read-after-write. Only meaningful once\n * the job has completed.\n */\nexport type ConsistencyToken = {\n readonly coordinates: ReadonlyArray<ConsistencyCoordinate>;\n readonly createdAtUtcIso: Scalars[\"String\"][\"output\"];\n readonly version: Scalars[\"Int\"][\"output\"];\n};\n\n/**\n * A consistency token, as JobInfo.consistencyToken reports it. A read given one\n * waits until the read models it reads from hold every coordinate it names.\n */\nexport type ConsistencyTokenInput = {\n readonly coordinates: ReadonlyArray<ConsistencyCoordinateInput>;\n readonly createdAtUtcIso: Scalars[\"String\"][\"input\"];\n readonly version: Scalars[\"Int\"][\"input\"];\n};\n\nexport type CreateDefaults = {\n readonly protocolVersions: Scalars[\"JSONObject\"][\"output\"];\n readonly signaturePolicy: Scalars[\"String\"][\"output\"];\n};\n\nexport type DeadLetterInfo = {\n readonly branch: Scalars[\"String\"][\"output\"];\n readonly documentId: Scalars[\"String\"][\"output\"];\n readonly error: Scalars[\"String\"][\"output\"];\n /**\n * How the origin classified the failure. A peer needs this to mirror the origin's\n * quarantine decision; without it a held auth operation would freeze the document\n * on the peer side while the origin kept syncing.\n */\n readonly errorType?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly jobId: Scalars[\"String\"][\"output\"];\n readonly operationCount: Scalars[\"Int\"][\"output\"];\n readonly scopes: ReadonlyArray<Scalars[\"String\"][\"output\"]>;\n};\n\nexport type DocumentChangeContext = {\n readonly childId?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly parentId?: Maybe<Scalars[\"String\"][\"output\"]>;\n};\n\nexport type DocumentChangeEvent = {\n readonly context?: Maybe<DocumentChangeContext>;\n readonly documents: ReadonlyArray<PhDocument>;\n readonly type: DocumentChangeType;\n};\n\nexport enum DocumentChangeType {\n ChildAdded = \"CHILD_ADDED\",\n ChildRemoved = \"CHILD_REMOVED\",\n Created = \"CREATED\",\n Deleted = \"DELETED\",\n ParentAdded = \"PARENT_ADDED\",\n ParentRemoved = \"PARENT_REMOVED\",\n Updated = \"UPDATED\",\n}\n\nexport type DocumentModelGlobalState = {\n readonly id: Scalars[\"String\"][\"output\"];\n readonly name: Scalars[\"String\"][\"output\"];\n readonly namespace?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly specification: Scalars[\"JSONObject\"][\"output\"];\n readonly version?: Maybe<Scalars[\"String\"][\"output\"]>;\n};\n\nexport type DocumentModelResultPage = {\n readonly cursor?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly hasNextPage: Scalars[\"Boolean\"][\"output\"];\n readonly hasPreviousPage: Scalars[\"Boolean\"][\"output\"];\n readonly items: ReadonlyArray<DocumentModelGlobalState>;\n};\n\nexport type DocumentOperationsFilterInput = {\n readonly actionTypes?: InputMaybe<ReadonlyArray<Scalars[\"String\"][\"input\"]>>;\n readonly branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly scopes?: InputMaybe<ReadonlyArray<Scalars[\"String\"][\"input\"]>>;\n readonly sinceRevision?: InputMaybe<Scalars[\"Int\"][\"input\"]>;\n readonly timestampFrom?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly timestampTo?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type DocumentRelationship = {\n readonly createdAt: Scalars[\"DateTime\"][\"output\"];\n readonly metadata?: Maybe<Scalars[\"JSONObject\"][\"output\"]>;\n readonly relationshipType: Scalars[\"String\"][\"output\"];\n readonly sourceId: Scalars[\"String\"][\"output\"];\n readonly targetId: Scalars[\"String\"][\"output\"];\n readonly updatedAt: Scalars[\"DateTime\"][\"output\"];\n};\n\nexport type DocumentRelationshipResultPage = {\n readonly cursor?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly hasNextPage: Scalars[\"Boolean\"][\"output\"];\n readonly hasPreviousPage: Scalars[\"Boolean\"][\"output\"];\n readonly items: ReadonlyArray<DocumentRelationship>;\n};\n\nexport type DocumentWithChildren = {\n readonly childIds: ReadonlyArray<Scalars[\"String\"][\"output\"]>;\n readonly document: PhDocument;\n};\n\nexport type DriveFileNode = {\n readonly documentType: Scalars[\"String\"][\"output\"];\n readonly driveId: Scalars[\"ID\"][\"output\"];\n readonly id: Scalars[\"ID\"][\"output\"];\n readonly name: Scalars[\"String\"][\"output\"];\n readonly parentFolder?: Maybe<Scalars[\"ID\"][\"output\"]>;\n};\n\nexport type DriveFolderNode = {\n readonly driveId: Scalars[\"ID\"][\"output\"];\n readonly id: Scalars[\"ID\"][\"output\"];\n readonly name: Scalars[\"String\"][\"output\"];\n readonly parentFolder?: Maybe<Scalars[\"ID\"][\"output\"]>;\n};\n\nexport type DriveNode = DriveFileNode | DriveFolderNode;\n\nexport enum DriveNodeKind {\n File = \"FILE\",\n Folder = \"FOLDER\",\n}\n\nexport type DriveNodePage = {\n readonly hasMore: Scalars[\"Boolean\"][\"output\"];\n readonly nextCursor?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly results: ReadonlyArray<DriveNode>;\n};\n\n/**\n * One mutation job of a batch, mirroring the reactor's `ExecutionJobPlan`\n * (packages/reactor/src/core/types.ts). The batch runs its jobs in dependency\n * order only, not atomically: each job commits on its own with no batch rollback,\n * and a failed job still releases its dependents.\n *\n * `documentIdOrSlug` is the document the job's actions apply to -- an id that does\n * not yet exist when the job's actions create it. `actions` are coerced against\n * `ActionInput` and passed through exactly as `execute` does, so a client-signed\n * action keeps its signature. `scope` is the single scope every action in the job\n * shares, and `dependsOn` names the plan keys this job is ordered after. `branch`\n * defaults to `main`.\n */\nexport type ExecutionJobInput = {\n readonly actions: ReadonlyArray<ActionInput>;\n readonly branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly dependsOn: ReadonlyArray<Scalars[\"String\"][\"input\"]>;\n readonly documentIdOrSlug: Scalars[\"String\"][\"input\"];\n readonly key: Scalars[\"String\"][\"input\"];\n readonly scope: Scalars[\"String\"][\"input\"];\n};\n\n/** The batch a job was submitted in. */\nexport type JobBatchMeta = {\n readonly batchId: Scalars[\"String\"][\"output\"];\n readonly batchJobIds: ReadonlyArray<Scalars[\"String\"][\"output\"]>;\n};\n\nexport type JobChangeEvent = {\n readonly error?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly jobId: Scalars[\"String\"][\"output\"];\n /**\n * What the job produced, once it has produced anything. Nullable for the same\n * reason as `JobInfo.result`: a job that has not written yet has produced\n * nothing, and an empty object would claim otherwise.\n */\n readonly result?: Maybe<Scalars[\"JSONObject\"][\"output\"]>;\n readonly status: Scalars[\"String\"][\"output\"];\n};\n\nexport type JobInfo = {\n readonly completedAt?: Maybe<Scalars[\"DateTime\"][\"output\"]>;\n readonly consistencyToken: ConsistencyToken;\n readonly createdAt: Scalars[\"DateTime\"][\"output\"];\n /**\n * The document the job operates on. Empty for a job this server does not know,\n * which then comes back FAILED with \"Job not found\".\n */\n readonly documentId: Scalars[\"String\"][\"output\"];\n readonly error?: Maybe<Scalars[\"String\"][\"output\"]>;\n /** The error's class name, such as `DocumentAlreadyExistsError`, when it failed. */\n readonly errorName?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly id: Scalars[\"String\"][\"output\"];\n readonly meta: JobBatchMeta;\n /**\n * What the job produced, once it has produced anything. Null until then, which\n * is the state every job is in when it is handed back from a submission.\n */\n readonly result?: Maybe<Scalars[\"JSONObject\"][\"output\"]>;\n readonly status: Scalars[\"String\"][\"output\"];\n};\n\nexport type MoveRelationshipResult = {\n readonly source: PhDocument;\n readonly target: PhDocument;\n};\n\nexport type Mutation = {\n readonly addRelationship: PhDocument;\n readonly createDocument: PhDocument;\n readonly createEmptyDocument: PhDocument;\n readonly deleteDocument: Scalars[\"Boolean\"][\"output\"];\n readonly deleteDocuments: Scalars[\"Boolean\"][\"output\"];\n /**\n * Applies actions to a document and waits for the result.\n *\n * Each action is coerced against `ActionInput`, so one missing a field the wire\n * declares is refused before any work starts. The id in particular: it is hashed\n * into the operation id and replay dedupes by it, so an action without one is\n * stored under an operation id shared by every id-less operation on the same\n * document, scope and branch.\n *\n * Named for `IReactorClient.execute`, which this is the wire form of. `branch`\n * defaults to `main`.\n */\n readonly execute: PhDocument;\n /**\n * Submits actions to a document and returns the job that will apply them.\n *\n * Coerced exactly as `execute` is, so a malformed action is refused here rather\n * than surfacing later as a failed job. Returns the job rather than only its id,\n * so a caller has the status and the creation time it would otherwise have to\n * ask for; `result` is null until the job produces one.\n */\n readonly executeAsync: JobInfo;\n /**\n * Applies multiple mutation jobs in dependency order and waits for all of them,\n * the wire form of `IReactorClient.executeBatch`. Each job's actions are coerced\n * against `ActionInput` exactly as `execute` is, so client-signed actions pass\n * through unchanged, and `dependsOn` orders the jobs. It is synchronous: the jobs\n * are applied and awaited before the result returns, so every returned `JobInfo`\n * is a completed one rather than the pending receipt the in-process reactor hands\n * back. A batch is ordering, not a transaction: each job commits on its own, and\n * a failed job still releases the jobs that depend on it, so any job, before or\n * after a failure, may have committed. A failed job is therefore returned as a\n * FAILED entry with its `error` and `errorName`, beside the final state of every\n * other job, rather than failing the mutation. The mutation itself fails only\n * when no job state can be reported.\n *\n * A job carrying `CREATE_DOCUMENT` must be the batch's only job, with the create\n * as its first action naming the job's document. Its other actions may only be\n * an `UPGRADE_DOCUMENT` of the new document and `ADD_RELATIONSHIP`s targeting\n * it. It is authorized like `createDocument`: write on every source of those\n * relationships, or the right to create when there is none.\n */\n readonly executeBatch: BatchExecutionResult;\n readonly moveRelationship: MoveRelationshipResult;\n /** @deprecated Use execute. Actions here are untyped, so a malformed one is refused by a hand-written check rather than by the schema, and `view.scopes` is accepted but ignored. */\n readonly mutateDocument: PhDocument;\n /** @deprecated Use executeAsync, which is typed and returns the job rather than only its id. */\n readonly mutateDocumentAsync: Scalars[\"String\"][\"output\"];\n readonly pushSyncEnvelopes: Scalars[\"Boolean\"][\"output\"];\n readonly removeRelationship: PhDocument;\n readonly renameDocument: PhDocument;\n readonly setPreferredEditor: PhDocument;\n readonly touchChannel: TouchChannelResult;\n readonly updateRelationship: PhDocument;\n};\n\nexport type MutationAddRelationshipArgs = {\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n metadata?: InputMaybe<Scalars[\"JSONObject\"][\"input\"]>;\n relationshipType: Scalars[\"String\"][\"input\"];\n sourceIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n sourceIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type MutationCreateDocumentArgs = {\n document: Scalars[\"JSONObject\"][\"input\"];\n parentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n parentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type MutationCreateEmptyDocumentArgs = {\n documentType: Scalars[\"String\"][\"input\"];\n parentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n parentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type MutationDeleteDocumentArgs = {\n idOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n identifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n propagate?: InputMaybe<PropagationMode>;\n};\n\nexport type MutationDeleteDocumentsArgs = {\n identifiers?: InputMaybe<ReadonlyArray<Scalars[\"String\"][\"input\"]>>;\n idsOrSlugs?: InputMaybe<ReadonlyArray<Scalars[\"String\"][\"input\"]>>;\n propagate?: InputMaybe<PropagationMode>;\n};\n\nexport type MutationExecuteArgs = {\n actions: ReadonlyArray<ActionInput>;\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n documentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n documentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type MutationExecuteAsyncArgs = {\n actions: ReadonlyArray<ActionInput>;\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n documentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n documentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type MutationExecuteBatchArgs = {\n jobs: ReadonlyArray<ExecutionJobInput>;\n};\n\nexport type MutationMoveRelationshipArgs = {\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n relationshipType: Scalars[\"String\"][\"input\"];\n sourceParentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n sourceParentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetParentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetParentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type MutationMutateDocumentArgs = {\n actions: ReadonlyArray<Scalars[\"JSONObject\"][\"input\"]>;\n documentIdentifier: Scalars[\"String\"][\"input\"];\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type MutationMutateDocumentAsyncArgs = {\n actions: ReadonlyArray<Scalars[\"JSONObject\"][\"input\"]>;\n documentIdentifier: Scalars[\"String\"][\"input\"];\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type MutationPushSyncEnvelopesArgs = {\n envelopes: ReadonlyArray<SyncEnvelopeInput>;\n peerManifestRevision?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type MutationRemoveRelationshipArgs = {\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n relationshipType: Scalars[\"String\"][\"input\"];\n sourceIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n sourceIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type MutationRenameDocumentArgs = {\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n documentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n documentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n name: Scalars[\"String\"][\"input\"];\n};\n\nexport type MutationSetPreferredEditorArgs = {\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n documentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n documentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n preferredEditor?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type MutationTouchChannelArgs = {\n input: TouchChannelInput;\n};\n\nexport type MutationUpdateRelationshipArgs = {\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n metadata?: InputMaybe<Scalars[\"JSONObject\"][\"input\"]>;\n relationshipType: Scalars[\"String\"][\"input\"];\n sourceIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n sourceIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type OperationContext = {\n readonly branch: Scalars[\"String\"][\"output\"];\n readonly documentId: Scalars[\"String\"][\"output\"];\n readonly documentType: Scalars[\"String\"][\"output\"];\n readonly ordinal: Scalars[\"Int\"][\"output\"];\n readonly scope: Scalars[\"String\"][\"output\"];\n};\n\nexport type OperationContextInput = {\n readonly branch: Scalars[\"String\"][\"input\"];\n readonly documentId: Scalars[\"String\"][\"input\"];\n readonly documentType: Scalars[\"String\"][\"input\"];\n readonly ordinal: Scalars[\"Int\"][\"input\"];\n readonly scope: Scalars[\"String\"][\"input\"];\n};\n\nexport type OperationInput = {\n readonly action: ActionInput;\n readonly deniedReason?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly error?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly hash: Scalars[\"String\"][\"input\"];\n readonly id?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly index: Scalars[\"Int\"][\"input\"];\n readonly skip: Scalars[\"Int\"][\"input\"];\n readonly timestampUtcMs: Scalars[\"String\"][\"input\"];\n};\n\nexport type OperationWithContext = {\n readonly context: OperationContext;\n readonly operation: ReactorOperation;\n};\n\nexport type OperationWithContextInput = {\n readonly context: OperationContextInput;\n readonly operation: OperationInput;\n};\n\nexport type OperationsFilterInput = {\n readonly actionTypes?: InputMaybe<ReadonlyArray<Scalars[\"String\"][\"input\"]>>;\n readonly branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n /** @deprecated Use documentIdOrSlug. */\n readonly documentId?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly documentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly scopes?: InputMaybe<ReadonlyArray<Scalars[\"String\"][\"input\"]>>;\n readonly sinceRevision?: InputMaybe<Scalars[\"Int\"][\"input\"]>;\n readonly timestampFrom?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly timestampTo?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type PhDocument = {\n readonly createdAtUtcIso: Scalars[\"DateTime\"][\"output\"];\n readonly documentType: Scalars[\"String\"][\"output\"];\n readonly id: Scalars[\"String\"][\"output\"];\n readonly lastModifiedAtUtcIso: Scalars[\"DateTime\"][\"output\"];\n readonly meta?: Maybe<Scalars[\"JSONObject\"][\"output\"]>;\n readonly name: Scalars[\"String\"][\"output\"];\n readonly operations?: Maybe<ReactorOperationResultPage>;\n readonly preferredEditor?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly protocolVersions?: Maybe<Scalars[\"JSONObject\"][\"output\"]>;\n readonly revisionsList: ReadonlyArray<Revision>;\n readonly slug?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly state: Scalars[\"JSONObject\"][\"output\"];\n};\n\nexport type PhDocumentOperationsArgs = {\n filter?: InputMaybe<DocumentOperationsFilterInput>;\n paging?: InputMaybe<PagingInput>;\n};\n\nexport type PhDocumentResultPage = {\n readonly cursor?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly hasNextPage: Scalars[\"Boolean\"][\"output\"];\n readonly hasPreviousPage: Scalars[\"Boolean\"][\"output\"];\n readonly items: ReadonlyArray<PhDocument>;\n};\n\nexport type PagingInput = {\n readonly cursor?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly limit?: InputMaybe<Scalars[\"Int\"][\"input\"]>;\n readonly offset?: InputMaybe<Scalars[\"Int\"][\"input\"]>;\n};\n\nexport type PeerAgreement = {\n readonly collectionId: Scalars[\"String\"][\"output\"];\n readonly limitedBy: ReadonlyArray<PeerAgreementLimit>;\n readonly local: Scalars[\"JSONObject\"][\"output\"];\n readonly members: ReadonlyArray<PeerAgreementMember>;\n};\n\nexport type PeerAgreementLimit = {\n readonly protocol: Scalars[\"String\"][\"output\"];\n readonly remoteNames: ReadonlyArray<Scalars[\"String\"][\"output\"]>;\n};\n\nexport type PeerAgreementMember = {\n readonly announced: Scalars[\"Boolean\"][\"output\"];\n readonly features: Scalars[\"JSONObject\"][\"output\"];\n readonly protocols: Scalars[\"JSONObject\"][\"output\"];\n readonly remoteName: Scalars[\"String\"][\"output\"];\n};\n\nexport type PollSyncEnvelopesResult = {\n readonly ackOrdinal: Scalars[\"Int\"][\"output\"];\n readonly deadLetters: ReadonlyArray<DeadLetterInfo>;\n readonly envelopes: ReadonlyArray<SyncEnvelope>;\n readonly hasMore: Scalars[\"Boolean\"][\"output\"];\n readonly manifestRevision?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly peerManifestRevision?: Maybe<Scalars[\"String\"][\"output\"]>;\n};\n\nexport enum PropagationMode {\n Cascade = \"CASCADE\",\n Orphan = \"ORPHAN\",\n}\n\nexport type Query = {\n readonly createDefaults: CreateDefaults;\n readonly document?: Maybe<DocumentWithChildren>;\n readonly documentIncomingRelationshipEdges: DocumentRelationshipResultPage;\n readonly documentIncomingRelationships: PhDocumentResultPage;\n readonly documentModels: DocumentModelResultPage;\n readonly documentOperations: ReactorOperationResultPage;\n readonly documentOutgoingRelationshipEdges: DocumentRelationshipResultPage;\n readonly documentOutgoingRelationships: PhDocumentResultPage;\n readonly documentServed: Scalars[\"Boolean\"][\"output\"];\n readonly driveDescendants: ReadonlyArray<DriveNode>;\n readonly driveNode?: Maybe<DriveNode>;\n readonly driveNodes: DriveNodePage;\n /**\n * Predicts whether the calling subject would be admitted to execute each of a\n * set of candidate operations, without submitting any of them. A UI asks this to\n * disable a control rather than offer an action that fails on submit.\n *\n * The answer is a prediction, not a promise:\n *\n * - Real admission compiles an append condition over everything it read and the\n * store enforces it at write time. A preflight reads no future, so a policy\n * change landing between this answer and the submit changes the verdict. The\n * submit path stays the only authority.\n * - The verdict is evaluated at the stream heads, so it is correct for a\n * candidate about to be submitted. A backdated submission is out of contract;\n * the reactor decides that one by position.\n * - A candidate whose verdict depends on its input has to carry that input, since\n * a conditional grant reads it.\n *\n * The subject is the authenticated caller and cannot be named in the request:\n * answering for an arbitrary subject would disclose what a policy grants\n * somebody else. It carries both the caller's address and the did:key of the app\n * instance whose token authenticated the request, so a policy naming either\n * matches the same principal the write path presents.\n *\n * Requires the reactor's authEnforcement feature flag. Without it the reactor\n * holds no decision model, so this fails with extensions.code\n * AUTH_EVALUATION_UNSUPPORTED rather than guessing.\n */\n readonly evaluateActions: ActionEvaluations;\n readonly findDocuments: PhDocumentResultPage;\n readonly jobStatus?: Maybe<JobInfo>;\n readonly peerAgreement: PeerAgreement;\n /**\n * Polls for sync envelopes from a channel.\n *\n * An operation stored before the API required an action id cannot be\n * represented by this schema, and rather than serving a partial response beside\n * a bare non-null violation, this fails with extensions.code\n * MALFORMED_STORED_OPERATION naming the operation. That code means the failure\n * is worth polling through: the document holding the operation needs repairing,\n * but the channel serves every other document, and a peer that stopped polling\n * would stop receiving those too.\n */\n readonly pollSyncEnvelopes: PollSyncEnvelopesResult;\n readonly syncHolds: ReadonlyArray<SyncHold>;\n};\n\nexport type QueryCreateDefaultsArgs = {\n parentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type QueryDocumentArgs = {\n consistency?: InputMaybe<ConsistencyTokenInput>;\n idOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n identifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type QueryDocumentIncomingRelationshipEdgesArgs = {\n consistency?: InputMaybe<ConsistencyTokenInput>;\n paging?: InputMaybe<PagingInput>;\n relationshipType?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type QueryDocumentIncomingRelationshipsArgs = {\n consistency?: InputMaybe<ConsistencyTokenInput>;\n paging?: InputMaybe<PagingInput>;\n relationshipType: Scalars[\"String\"][\"input\"];\n targetIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n targetIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type QueryDocumentModelsArgs = {\n namespace?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n paging?: InputMaybe<PagingInput>;\n};\n\nexport type QueryDocumentOperationsArgs = {\n filter: OperationsFilterInput;\n paging?: InputMaybe<PagingInput>;\n};\n\nexport type QueryDocumentOutgoingRelationshipEdgesArgs = {\n consistency?: InputMaybe<ConsistencyTokenInput>;\n paging?: InputMaybe<PagingInput>;\n relationshipType?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n sourceIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n sourceIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type QueryDocumentOutgoingRelationshipsArgs = {\n consistency?: InputMaybe<ConsistencyTokenInput>;\n paging?: InputMaybe<PagingInput>;\n relationshipType: Scalars[\"String\"][\"input\"];\n sourceIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n sourceIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type QueryDocumentServedArgs = {\n idOrSlug: Scalars[\"String\"][\"input\"];\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type QueryDriveDescendantsArgs = {\n driveId: Scalars[\"ID\"][\"input\"];\n root: Scalars[\"ID\"][\"input\"];\n};\n\nexport type QueryDriveNodeArgs = {\n driveId: Scalars[\"ID\"][\"input\"];\n id: Scalars[\"ID\"][\"input\"];\n};\n\nexport type QueryDriveNodesArgs = {\n driveId: Scalars[\"ID\"][\"input\"];\n kind?: InputMaybe<DriveNodeKind>;\n paging?: InputMaybe<PagingInput>;\n parentFolder?: InputMaybe<Scalars[\"ID\"][\"input\"]>;\n};\n\nexport type QueryEvaluateActionsArgs = {\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n candidates: ReadonlyArray<ActionCandidateInput>;\n documentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n documentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type QueryFindDocumentsArgs = {\n consistency?: InputMaybe<ConsistencyTokenInput>;\n paging?: InputMaybe<PagingInput>;\n search?: InputMaybe<SearchFilterInput>;\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type QueryJobStatusArgs = {\n jobId: Scalars[\"String\"][\"input\"];\n};\n\nexport type QueryPeerAgreementArgs = {\n collectionId: Scalars[\"String\"][\"input\"];\n};\n\nexport type QueryPollSyncEnvelopesArgs = {\n channelId: Scalars[\"String\"][\"input\"];\n manifestRevision?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n outboxAck: Scalars[\"Int\"][\"input\"];\n outboxLatest: Scalars[\"Int\"][\"input\"];\n refusals?: InputMaybe<ReadonlyArray<SyncRefusalInput>>;\n};\n\nexport type QuerySyncHoldsArgs = {\n documentId?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n remoteName?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type ReactorOperation = {\n readonly action: Action;\n readonly deniedReason?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly error?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly hash: Scalars[\"String\"][\"output\"];\n readonly id?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly index: Scalars[\"Int\"][\"output\"];\n readonly skip: Scalars[\"Int\"][\"output\"];\n readonly timestampUtcMs: Scalars[\"String\"][\"output\"];\n};\n\nexport type ReactorOperationResultPage = {\n readonly cursor?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly hasNextPage: Scalars[\"Boolean\"][\"output\"];\n readonly hasPreviousPage: Scalars[\"Boolean\"][\"output\"];\n readonly items: ReadonlyArray<ReactorOperation>;\n};\n\nexport type ReactorSigner = {\n readonly app?: Maybe<ReactorSignerApp>;\n readonly signatures: ReadonlyArray<Scalars[\"String\"][\"output\"]>;\n readonly user?: Maybe<ReactorSignerUser>;\n};\n\nexport type ReactorSignerApp = {\n readonly key: Scalars[\"String\"][\"output\"];\n readonly name: Scalars[\"String\"][\"output\"];\n};\n\nexport type ReactorSignerAppInput = {\n readonly key: Scalars[\"String\"][\"input\"];\n readonly name: Scalars[\"String\"][\"input\"];\n};\n\nexport type ReactorSignerInput = {\n readonly app?: InputMaybe<ReactorSignerAppInput>;\n readonly signatures: ReadonlyArray<Scalars[\"String\"][\"input\"]>;\n readonly user?: InputMaybe<ReactorSignerUserInput>;\n};\n\nexport type ReactorSignerUser = {\n readonly address: Scalars[\"String\"][\"output\"];\n readonly chainId: Scalars[\"Int\"][\"output\"];\n readonly networkId: Scalars[\"String\"][\"output\"];\n};\n\nexport type ReactorSignerUserInput = {\n readonly address: Scalars[\"String\"][\"input\"];\n readonly chainId: Scalars[\"Int\"][\"input\"];\n readonly networkId: Scalars[\"String\"][\"input\"];\n};\n\nexport type RemoteCursor = {\n readonly cursorOrdinal: Scalars[\"Int\"][\"output\"];\n readonly lastSyncedAtUtcMs?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly remoteName: Scalars[\"String\"][\"output\"];\n};\n\nexport type RemoteCursorInput = {\n readonly cursorOrdinal: Scalars[\"Int\"][\"input\"];\n readonly lastSyncedAtUtcMs?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly remoteName: Scalars[\"String\"][\"input\"];\n};\n\nexport type RemoteFilterInput = {\n readonly branch: Scalars[\"String\"][\"input\"];\n readonly documentId: ReadonlyArray<Scalars[\"String\"][\"input\"]>;\n readonly scope: ReadonlyArray<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type Revision = {\n readonly revision: Scalars[\"Int\"][\"output\"];\n readonly scope: Scalars[\"String\"][\"output\"];\n};\n\nexport type SearchFilterInput = {\n /** @deprecated Ignored. Filter by type or parentId. */\n readonly identifiers?: InputMaybe<ReadonlyArray<Scalars[\"String\"][\"input\"]>>;\n readonly parentId?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly type?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type Subscription = {\n readonly documentChanges: DocumentChangeEvent;\n readonly jobChanges: JobChangeEvent;\n};\n\nexport type SubscriptionDocumentChangesArgs = {\n search?: InputMaybe<SearchFilterInput>;\n view?: InputMaybe<ViewFilterInput>;\n};\n\nexport type SubscriptionJobChangesArgs = {\n jobId: Scalars[\"String\"][\"input\"];\n};\n\nexport type SyncEnvelope = {\n readonly channelMeta: ChannelMeta;\n readonly cursor?: Maybe<RemoteCursor>;\n readonly dependsOn?: Maybe<ReadonlyArray<Scalars[\"String\"][\"output\"]>>;\n readonly key?: Maybe<Scalars[\"String\"][\"output\"]>;\n readonly operations?: Maybe<ReadonlyArray<OperationWithContext>>;\n readonly type: SyncEnvelopeType;\n};\n\nexport type SyncEnvelopeInput = {\n readonly channelMeta: ChannelMetaInput;\n readonly cursor?: InputMaybe<RemoteCursorInput>;\n readonly dependsOn?: InputMaybe<ReadonlyArray<Scalars[\"String\"][\"input\"]>>;\n readonly key?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly operations?: InputMaybe<ReadonlyArray<OperationWithContextInput>>;\n readonly type: SyncEnvelopeType;\n};\n\nexport enum SyncEnvelopeType {\n Ack = \"ACK\",\n Operations = \"OPERATIONS\",\n}\n\nexport type SyncHold = {\n readonly branch: Scalars[\"String\"][\"output\"];\n readonly documentId: Scalars[\"String\"][\"output\"];\n readonly heldAtUtcMs: Scalars[\"String\"][\"output\"];\n readonly reason: SyncHoldReason;\n readonly remoteName: Scalars[\"String\"][\"output\"];\n};\n\nexport type SyncHoldReason = {\n readonly peerSupports: ReadonlyArray<Scalars[\"Int\"][\"output\"]>;\n readonly protocol: Scalars[\"String\"][\"output\"];\n readonly version: Scalars[\"Int\"][\"output\"];\n};\n\nexport type SyncRefusalInput = {\n readonly branch: Scalars[\"String\"][\"input\"];\n readonly documentId: Scalars[\"String\"][\"input\"];\n readonly kind?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n};\n\nexport type TouchChannelInput = {\n readonly collectionId: Scalars[\"String\"][\"input\"];\n readonly filter: RemoteFilterInput;\n readonly id: Scalars[\"String\"][\"input\"];\n readonly manifest?: InputMaybe<Scalars[\"JSONObject\"][\"input\"]>;\n readonly name: Scalars[\"String\"][\"input\"];\n readonly sinceTimestampUtcMs: Scalars[\"String\"][\"input\"];\n};\n\nexport type TouchChannelResult = {\n readonly ackOrdinal: Scalars[\"Int\"][\"output\"];\n readonly manifest?: Maybe<Scalars[\"JSONObject\"][\"output\"]>;\n readonly success: Scalars[\"Boolean\"][\"output\"];\n};\n\nexport type ViewFilterInput = {\n readonly branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n readonly scopes?: InputMaybe<ReadonlyArray<Scalars[\"String\"][\"input\"]>>;\n};\n\nexport type PhDocumentFieldsFragment = {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n};\n\nexport type DocumentRelationshipFieldsFragment = {\n readonly sourceId: string;\n readonly targetId: string;\n readonly relationshipType: string;\n readonly metadata?: NonNullable<unknown> | null | undefined;\n readonly createdAt: string | Date;\n readonly updatedAt: string | Date;\n};\n\nexport type GetDocumentModelsQueryVariables = Exact<{\n namespace?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n paging?: InputMaybe<PagingInput>;\n}>;\n\nexport type GetDocumentModelsQuery = {\n readonly documentModels: {\n readonly hasNextPage: boolean;\n readonly hasPreviousPage: boolean;\n readonly cursor?: string | null | undefined;\n readonly items: ReadonlyArray<{\n readonly id: string;\n readonly name: string;\n readonly namespace?: string | null | undefined;\n readonly version?: string | null | undefined;\n readonly specification: NonNullable<unknown>;\n }>;\n };\n};\n\nexport type GetDocumentQueryVariables = Exact<{\n identifier: Scalars[\"String\"][\"input\"];\n view?: InputMaybe<ViewFilterInput>;\n}>;\n\nexport type GetDocumentQuery = {\n readonly document?:\n | {\n readonly childIds: ReadonlyArray<string>;\n readonly document: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n }\n | null\n | undefined;\n};\n\nexport type GetDocumentWithOperationsQueryVariables = Exact<{\n identifier: Scalars[\"String\"][\"input\"];\n view?: InputMaybe<ViewFilterInput>;\n operationsFilter?: InputMaybe<DocumentOperationsFilterInput>;\n operationsPaging?: InputMaybe<PagingInput>;\n}>;\n\nexport type GetDocumentWithOperationsQuery = {\n readonly document?:\n | {\n readonly childIds: ReadonlyArray<string>;\n readonly document: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly operations?:\n | {\n readonly hasNextPage: boolean;\n readonly hasPreviousPage: boolean;\n readonly cursor?: string | null | undefined;\n readonly items: ReadonlyArray<{\n readonly index: number;\n readonly timestampUtcMs: string;\n readonly hash: string;\n readonly skip: number;\n readonly error?: string | null | undefined;\n readonly deniedReason?: string | null | undefined;\n readonly id?: string | null | undefined;\n readonly action: {\n readonly id: string;\n readonly type: string;\n readonly timestampUtcMs: string;\n readonly input: NonNullable<unknown>;\n readonly scope: string;\n readonly context?:\n | {\n readonly signer?:\n | {\n readonly signatures: ReadonlyArray<string>;\n readonly user?:\n | {\n readonly address: string;\n readonly networkId: string;\n readonly chainId: number;\n }\n | null\n | undefined;\n readonly app?:\n | {\n readonly name: string;\n readonly key: string;\n }\n | null\n | undefined;\n }\n | null\n | undefined;\n }\n | null\n | undefined;\n };\n }>;\n }\n | null\n | undefined;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n }\n | null\n | undefined;\n};\n\nexport type GetDocumentOutgoingRelationshipsQueryVariables = Exact<{\n sourceIdentifier: Scalars[\"String\"][\"input\"];\n relationshipType: Scalars[\"String\"][\"input\"];\n view?: InputMaybe<ViewFilterInput>;\n paging?: InputMaybe<PagingInput>;\n}>;\n\nexport type GetDocumentOutgoingRelationshipsQuery = {\n readonly documentOutgoingRelationships: {\n readonly hasNextPage: boolean;\n readonly hasPreviousPage: boolean;\n readonly cursor?: string | null | undefined;\n readonly items: ReadonlyArray<{\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n }>;\n };\n};\n\nexport type GetDocumentIncomingRelationshipsQueryVariables = Exact<{\n targetIdentifier: Scalars[\"String\"][\"input\"];\n relationshipType: Scalars[\"String\"][\"input\"];\n view?: InputMaybe<ViewFilterInput>;\n paging?: InputMaybe<PagingInput>;\n}>;\n\nexport type GetDocumentIncomingRelationshipsQuery = {\n readonly documentIncomingRelationships: {\n readonly hasNextPage: boolean;\n readonly hasPreviousPage: boolean;\n readonly cursor?: string | null | undefined;\n readonly items: ReadonlyArray<{\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n }>;\n };\n};\n\nexport type GetDocumentOutgoingRelationshipEdgesQueryVariables = Exact<{\n sourceIdentifier: Scalars[\"String\"][\"input\"];\n relationshipType?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n view?: InputMaybe<ViewFilterInput>;\n paging?: InputMaybe<PagingInput>;\n}>;\n\nexport type GetDocumentOutgoingRelationshipEdgesQuery = {\n readonly documentOutgoingRelationshipEdges: {\n readonly hasNextPage: boolean;\n readonly hasPreviousPage: boolean;\n readonly cursor?: string | null | undefined;\n readonly items: ReadonlyArray<{\n readonly sourceId: string;\n readonly targetId: string;\n readonly relationshipType: string;\n readonly metadata?: NonNullable<unknown> | null | undefined;\n readonly createdAt: string | Date;\n readonly updatedAt: string | Date;\n }>;\n };\n};\n\nexport type GetDocumentIncomingRelationshipEdgesQueryVariables = Exact<{\n targetIdentifier: Scalars[\"String\"][\"input\"];\n relationshipType?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n view?: InputMaybe<ViewFilterInput>;\n paging?: InputMaybe<PagingInput>;\n}>;\n\nexport type GetDocumentIncomingRelationshipEdgesQuery = {\n readonly documentIncomingRelationshipEdges: {\n readonly hasNextPage: boolean;\n readonly hasPreviousPage: boolean;\n readonly cursor?: string | null | undefined;\n readonly items: ReadonlyArray<{\n readonly sourceId: string;\n readonly targetId: string;\n readonly relationshipType: string;\n readonly metadata?: NonNullable<unknown> | null | undefined;\n readonly createdAt: string | Date;\n readonly updatedAt: string | Date;\n }>;\n };\n};\n\nexport type FindDocumentsQueryVariables = Exact<{\n search?: InputMaybe<SearchFilterInput>;\n view?: InputMaybe<ViewFilterInput>;\n paging?: InputMaybe<PagingInput>;\n}>;\n\nexport type FindDocumentsQuery = {\n readonly findDocuments: {\n readonly hasNextPage: boolean;\n readonly hasPreviousPage: boolean;\n readonly cursor?: string | null | undefined;\n readonly items: ReadonlyArray<{\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n }>;\n };\n};\n\nexport type GetDocumentOperationsQueryVariables = Exact<{\n filter: OperationsFilterInput;\n paging?: InputMaybe<PagingInput>;\n}>;\n\nexport type GetDocumentOperationsQuery = {\n readonly documentOperations: {\n readonly hasNextPage: boolean;\n readonly hasPreviousPage: boolean;\n readonly cursor?: string | null | undefined;\n readonly items: ReadonlyArray<{\n readonly index: number;\n readonly timestampUtcMs: string;\n readonly hash: string;\n readonly skip: number;\n readonly error?: string | null | undefined;\n readonly deniedReason?: string | null | undefined;\n readonly id?: string | null | undefined;\n readonly action: {\n readonly id: string;\n readonly type: string;\n readonly timestampUtcMs: string;\n readonly input: NonNullable<unknown>;\n readonly scope: string;\n readonly context?:\n | {\n readonly signer?:\n | {\n readonly signatures: ReadonlyArray<string>;\n readonly user?:\n | {\n readonly address: string;\n readonly networkId: string;\n readonly chainId: number;\n }\n | null\n | undefined;\n readonly app?:\n | { readonly name: string; readonly key: string }\n | null\n | undefined;\n }\n | null\n | undefined;\n }\n | null\n | undefined;\n };\n }>;\n };\n};\n\nexport type JobInfoFieldsFragment = {\n readonly id: string;\n readonly documentId: string;\n readonly status: string;\n readonly result?: NonNullable<unknown> | null | undefined;\n readonly error?: string | null | undefined;\n readonly errorName?: string | null | undefined;\n readonly createdAt: string | Date;\n readonly completedAt?: string | Date | null | undefined;\n readonly consistencyToken: {\n readonly version: number;\n readonly createdAtUtcIso: string;\n readonly coordinates: ReadonlyArray<{\n readonly documentId: string;\n readonly scope: string;\n readonly branch: string;\n readonly operationIndex: number;\n }>;\n };\n readonly meta: {\n readonly batchId: string;\n readonly batchJobIds: ReadonlyArray<string>;\n };\n};\n\nexport type GetJobStatusQueryVariables = Exact<{\n jobId: Scalars[\"String\"][\"input\"];\n}>;\n\nexport type GetJobStatusQuery = {\n readonly jobStatus?:\n | {\n readonly id: string;\n readonly documentId: string;\n readonly status: string;\n readonly result?: NonNullable<unknown> | null | undefined;\n readonly error?: string | null | undefined;\n readonly errorName?: string | null | undefined;\n readonly createdAt: string | Date;\n readonly completedAt?: string | Date | null | undefined;\n readonly consistencyToken: {\n readonly version: number;\n readonly createdAtUtcIso: string;\n readonly coordinates: ReadonlyArray<{\n readonly documentId: string;\n readonly scope: string;\n readonly branch: string;\n readonly operationIndex: number;\n }>;\n };\n readonly meta: {\n readonly batchId: string;\n readonly batchJobIds: ReadonlyArray<string>;\n };\n }\n | null\n | undefined;\n};\n\nexport type GetDocumentServedQueryVariables = Exact<{\n idOrSlug: Scalars[\"String\"][\"input\"];\n view?: InputMaybe<ViewFilterInput>;\n}>;\n\nexport type GetDocumentServedQuery = { readonly documentServed: boolean };\n\nexport type GetCreateDefaultsQueryVariables = Exact<{\n parentIdOrSlug?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type GetCreateDefaultsQuery = {\n readonly createDefaults: {\n readonly signaturePolicy: string;\n readonly protocolVersions: NonNullable<unknown>;\n };\n};\n\ntype DriveNodeFields_DriveFileNode_Fragment = {\n readonly id: string;\n readonly driveId: string;\n readonly name: string;\n readonly parentFolder?: string | null | undefined;\n readonly documentType: string;\n};\n\ntype DriveNodeFields_DriveFolderNode_Fragment = {\n readonly id: string;\n readonly driveId: string;\n readonly name: string;\n readonly parentFolder?: string | null | undefined;\n};\n\nexport type DriveNodeFieldsFragment =\n | DriveNodeFields_DriveFileNode_Fragment\n | DriveNodeFields_DriveFolderNode_Fragment;\n\nexport type GetDriveNodesQueryVariables = Exact<{\n driveId: Scalars[\"ID\"][\"input\"];\n parentFolder?: InputMaybe<Scalars[\"ID\"][\"input\"]>;\n paging?: InputMaybe<PagingInput>;\n kind?: InputMaybe<DriveNodeKind>;\n}>;\n\nexport type GetDriveNodesQuery = {\n readonly driveNodes: {\n readonly nextCursor?: string | null | undefined;\n readonly hasMore: boolean;\n readonly results: ReadonlyArray<\n | {\n readonly id: string;\n readonly driveId: string;\n readonly name: string;\n readonly parentFolder?: string | null | undefined;\n readonly documentType: string;\n }\n | {\n readonly id: string;\n readonly driveId: string;\n readonly name: string;\n readonly parentFolder?: string | null | undefined;\n }\n >;\n };\n};\n\nexport type GetDriveNodeQueryVariables = Exact<{\n driveId: Scalars[\"ID\"][\"input\"];\n id: Scalars[\"ID\"][\"input\"];\n}>;\n\nexport type GetDriveNodeQuery = {\n readonly driveNode?:\n | {\n readonly id: string;\n readonly driveId: string;\n readonly name: string;\n readonly parentFolder?: string | null | undefined;\n readonly documentType: string;\n }\n | {\n readonly id: string;\n readonly driveId: string;\n readonly name: string;\n readonly parentFolder?: string | null | undefined;\n }\n | null\n | undefined;\n};\n\nexport type GetDriveDescendantsQueryVariables = Exact<{\n driveId: Scalars[\"ID\"][\"input\"];\n root: Scalars[\"ID\"][\"input\"];\n}>;\n\nexport type GetDriveDescendantsQuery = {\n readonly driveDescendants: ReadonlyArray<\n | {\n readonly id: string;\n readonly driveId: string;\n readonly name: string;\n readonly parentFolder?: string | null | undefined;\n readonly documentType: string;\n }\n | {\n readonly id: string;\n readonly driveId: string;\n readonly name: string;\n readonly parentFolder?: string | null | undefined;\n }\n >;\n};\n\nexport type EvaluateActionsQueryVariables = Exact<{\n documentIdentifier: Scalars[\"String\"][\"input\"];\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n candidates: ReadonlyArray<ActionCandidateInput>;\n}>;\n\nexport type EvaluateActionsQuery = {\n readonly evaluateActions: {\n readonly allAllowed: boolean;\n readonly anyAllowed: boolean;\n readonly allDenied: boolean;\n readonly anyDenied: boolean;\n readonly evaluations: ReadonlyArray<{\n readonly decision: AuthDecision;\n readonly reason?: string | null | undefined;\n }>;\n };\n};\n\nexport type CreateDocumentMutationVariables = Exact<{\n document: Scalars[\"JSONObject\"][\"input\"];\n parentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type CreateDocumentMutation = {\n readonly createDocument: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n};\n\nexport type CreateEmptyDocumentMutationVariables = Exact<{\n documentType: Scalars[\"String\"][\"input\"];\n parentIdentifier?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type CreateEmptyDocumentMutation = {\n readonly createEmptyDocument: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n};\n\nexport type MutateDocumentMutationVariables = Exact<{\n documentIdentifier: Scalars[\"String\"][\"input\"];\n actions: ReadonlyArray<ActionInput>;\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type MutateDocumentMutation = {\n readonly mutateDocument: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n};\n\nexport type MutateDocumentAsyncMutationVariables = Exact<{\n documentIdentifier: Scalars[\"String\"][\"input\"];\n actions: ReadonlyArray<ActionInput>;\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type MutateDocumentAsyncMutation = {\n readonly mutateDocumentAsync: {\n readonly id: string;\n readonly documentId: string;\n readonly status: string;\n readonly result?: NonNullable<unknown> | null | undefined;\n readonly error?: string | null | undefined;\n readonly errorName?: string | null | undefined;\n readonly createdAt: string | Date;\n readonly completedAt?: string | Date | null | undefined;\n readonly consistencyToken: {\n readonly version: number;\n readonly createdAtUtcIso: string;\n readonly coordinates: ReadonlyArray<{\n readonly documentId: string;\n readonly scope: string;\n readonly branch: string;\n readonly operationIndex: number;\n }>;\n };\n readonly meta: {\n readonly batchId: string;\n readonly batchJobIds: ReadonlyArray<string>;\n };\n };\n};\n\nexport type ExecuteBatchMutationVariables = Exact<{\n jobs: ReadonlyArray<ExecutionJobInput>;\n}>;\n\nexport type ExecuteBatchMutation = {\n readonly executeBatch: {\n readonly jobs: ReadonlyArray<{\n readonly key: string;\n readonly job: {\n readonly id: string;\n readonly documentId: string;\n readonly status: string;\n readonly result?: NonNullable<unknown> | null | undefined;\n readonly error?: string | null | undefined;\n readonly errorName?: string | null | undefined;\n readonly createdAt: string | Date;\n readonly completedAt?: string | Date | null | undefined;\n readonly consistencyToken: {\n readonly version: number;\n readonly createdAtUtcIso: string;\n readonly coordinates: ReadonlyArray<{\n readonly documentId: string;\n readonly scope: string;\n readonly branch: string;\n readonly operationIndex: number;\n }>;\n };\n readonly meta: {\n readonly batchId: string;\n readonly batchJobIds: ReadonlyArray<string>;\n };\n };\n }>;\n };\n};\n\nexport type RenameDocumentMutationVariables = Exact<{\n documentIdentifier: Scalars[\"String\"][\"input\"];\n name: Scalars[\"String\"][\"input\"];\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type RenameDocumentMutation = {\n readonly renameDocument: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n};\n\nexport type SetPreferredEditorMutationVariables = Exact<{\n documentIdentifier: Scalars[\"String\"][\"input\"];\n preferredEditor?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type SetPreferredEditorMutation = {\n readonly setPreferredEditor: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n};\n\nexport type AddRelationshipMutationVariables = Exact<{\n sourceIdentifier: Scalars[\"String\"][\"input\"];\n targetIdentifier: Scalars[\"String\"][\"input\"];\n relationshipType: Scalars[\"String\"][\"input\"];\n metadata?: InputMaybe<Scalars[\"JSONObject\"][\"input\"]>;\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type AddRelationshipMutation = {\n readonly addRelationship: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n};\n\nexport type UpdateRelationshipMutationVariables = Exact<{\n sourceIdentifier: Scalars[\"String\"][\"input\"];\n targetIdentifier: Scalars[\"String\"][\"input\"];\n relationshipType: Scalars[\"String\"][\"input\"];\n metadata?: InputMaybe<Scalars[\"JSONObject\"][\"input\"]>;\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type UpdateRelationshipMutation = {\n readonly updateRelationship: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n};\n\nexport type RemoveRelationshipMutationVariables = Exact<{\n sourceIdentifier: Scalars[\"String\"][\"input\"];\n targetIdentifier: Scalars[\"String\"][\"input\"];\n relationshipType: Scalars[\"String\"][\"input\"];\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type RemoveRelationshipMutation = {\n readonly removeRelationship: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n};\n\nexport type MoveRelationshipMutationVariables = Exact<{\n sourceParentIdentifier: Scalars[\"String\"][\"input\"];\n targetParentIdentifier: Scalars[\"String\"][\"input\"];\n targetIdentifier: Scalars[\"String\"][\"input\"];\n relationshipType: Scalars[\"String\"][\"input\"];\n branch?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type MoveRelationshipMutation = {\n readonly moveRelationship: {\n readonly source: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n readonly target: {\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n };\n };\n};\n\nexport type DeleteDocumentMutationVariables = Exact<{\n identifier: Scalars[\"String\"][\"input\"];\n propagate?: InputMaybe<PropagationMode>;\n}>;\n\nexport type DeleteDocumentMutation = { readonly deleteDocument: boolean };\n\nexport type DeleteDocumentsMutationVariables = Exact<{\n identifiers: ReadonlyArray<Scalars[\"String\"][\"input\"]>;\n propagate?: InputMaybe<PropagationMode>;\n}>;\n\nexport type DeleteDocumentsMutation = { readonly deleteDocuments: boolean };\n\nexport type DocumentChangesSubscriptionVariables = Exact<{\n search?: InputMaybe<SearchFilterInput>;\n view?: InputMaybe<ViewFilterInput>;\n}>;\n\nexport type DocumentChangesSubscription = {\n readonly documentChanges: {\n readonly type: DocumentChangeType;\n readonly documents: ReadonlyArray<{\n readonly id: string;\n readonly slug?: string | null | undefined;\n readonly name: string;\n readonly documentType: string;\n readonly meta?: NonNullable<unknown> | null | undefined;\n readonly protocolVersions?: NonNullable<unknown> | null | undefined;\n readonly state: NonNullable<unknown>;\n readonly createdAtUtcIso: string | Date;\n readonly lastModifiedAtUtcIso: string | Date;\n readonly revisionsList: ReadonlyArray<{\n readonly scope: string;\n readonly revision: number;\n }>;\n }>;\n readonly context?:\n | {\n readonly parentId?: string | null | undefined;\n readonly childId?: string | null | undefined;\n }\n | null\n | undefined;\n };\n};\n\nexport type JobChangesSubscriptionVariables = Exact<{\n jobId: Scalars[\"String\"][\"input\"];\n}>;\n\nexport type JobChangesSubscription = {\n readonly jobChanges: {\n readonly jobId: string;\n readonly status: string;\n readonly result?: NonNullable<unknown> | null | undefined;\n readonly error?: string | null | undefined;\n };\n};\n\nexport type PollSyncEnvelopesQueryVariables = Exact<{\n channelId: Scalars[\"String\"][\"input\"];\n outboxAck: Scalars[\"Int\"][\"input\"];\n outboxLatest: Scalars[\"Int\"][\"input\"];\n manifestRevision?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n refusals?: InputMaybe<ReadonlyArray<SyncRefusalInput>>;\n}>;\n\nexport type PollSyncEnvelopesQuery = {\n readonly pollSyncEnvelopes: {\n readonly ackOrdinal: number;\n readonly hasMore: boolean;\n readonly manifestRevision?: string | null | undefined;\n readonly peerManifestRevision?: string | null | undefined;\n readonly envelopes: ReadonlyArray<{\n readonly type: SyncEnvelopeType;\n readonly key?: string | null | undefined;\n readonly dependsOn?: ReadonlyArray<string> | null | undefined;\n readonly channelMeta: { readonly id: string };\n readonly operations?:\n | ReadonlyArray<{\n readonly operation: {\n readonly index: number;\n readonly timestampUtcMs: string;\n readonly hash: string;\n readonly skip: number;\n readonly error?: string | null | undefined;\n readonly deniedReason?: string | null | undefined;\n readonly id?: string | null | undefined;\n readonly action: {\n readonly id: string;\n readonly type: string;\n readonly timestampUtcMs: string;\n readonly input: NonNullable<unknown>;\n readonly scope: string;\n readonly context?:\n | {\n readonly signer?:\n | {\n readonly signatures: ReadonlyArray<string>;\n readonly user?:\n | {\n readonly address: string;\n readonly networkId: string;\n readonly chainId: number;\n }\n | null\n | undefined;\n readonly app?:\n | { readonly name: string; readonly key: string }\n | null\n | undefined;\n }\n | null\n | undefined;\n }\n | null\n | undefined;\n };\n };\n readonly context: {\n readonly documentId: string;\n readonly documentType: string;\n readonly scope: string;\n readonly branch: string;\n };\n }>\n | null\n | undefined;\n readonly cursor?:\n | {\n readonly remoteName: string;\n readonly cursorOrdinal: number;\n readonly lastSyncedAtUtcMs?: string | null | undefined;\n }\n | null\n | undefined;\n }>;\n readonly deadLetters: ReadonlyArray<{\n readonly documentId: string;\n readonly error: string;\n readonly errorType?: string | null | undefined;\n }>;\n };\n};\n\nexport type TouchChannelMutationVariables = Exact<{\n input: TouchChannelInput;\n}>;\n\nexport type TouchChannelMutation = {\n readonly touchChannel: {\n readonly success: boolean;\n readonly ackOrdinal: number;\n readonly manifest?: NonNullable<unknown> | null | undefined;\n };\n};\n\nexport type PushSyncEnvelopesMutationVariables = Exact<{\n envelopes: ReadonlyArray<SyncEnvelopeInput>;\n peerManifestRevision?: InputMaybe<Scalars[\"String\"][\"input\"]>;\n}>;\n\nexport type PushSyncEnvelopesMutation = { readonly pushSyncEnvelopes: boolean };\n\nexport const PhDocumentFieldsFragmentDoc = gql`\n fragment PHDocumentFields on PHDocument {\n id\n slug\n name\n documentType\n meta\n protocolVersions\n state\n revisionsList {\n scope\n revision\n }\n createdAtUtcIso\n lastModifiedAtUtcIso\n }\n`;\nexport const DocumentRelationshipFieldsFragmentDoc = gql`\n fragment DocumentRelationshipFields on DocumentRelationship {\n sourceId\n targetId\n relationshipType\n metadata\n createdAt\n updatedAt\n }\n`;\nexport const JobInfoFieldsFragmentDoc = gql`\n fragment JobInfoFields on JobInfo {\n id\n documentId\n status\n result\n error\n errorName\n createdAt\n completedAt\n consistencyToken {\n version\n createdAtUtcIso\n coordinates {\n documentId\n scope\n branch\n operationIndex\n }\n }\n meta {\n batchId\n batchJobIds\n }\n }\n`;\nexport const DriveNodeFieldsFragmentDoc = gql`\n fragment DriveNodeFields on DriveNode {\n ... on DriveFileNode {\n id\n driveId\n name\n parentFolder\n documentType\n }\n ... on DriveFolderNode {\n id\n driveId\n name\n parentFolder\n }\n }\n`;\nexport const GetDocumentModelsDocument = gql`\n query GetDocumentModels($namespace: String, $paging: PagingInput) {\n documentModels(namespace: $namespace, paging: $paging) {\n items {\n id\n name\n namespace\n version\n specification\n }\n hasNextPage\n hasPreviousPage\n cursor\n }\n }\n`;\nexport const GetDocumentDocument = gql`\n query GetDocument($identifier: String!, $view: ViewFilterInput) {\n document(identifier: $identifier, view: $view) {\n document {\n ...PHDocumentFields\n }\n childIds\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const GetDocumentWithOperationsDocument = gql`\n query GetDocumentWithOperations(\n $identifier: String!\n $view: ViewFilterInput\n $operationsFilter: DocumentOperationsFilterInput\n $operationsPaging: PagingInput\n ) {\n document(identifier: $identifier, view: $view) {\n document {\n ...PHDocumentFields\n operations(filter: $operationsFilter, paging: $operationsPaging) {\n items {\n index\n timestampUtcMs\n hash\n skip\n error\n deniedReason\n id\n action {\n id\n type\n timestampUtcMs\n input\n scope\n context {\n signer {\n user {\n address\n networkId\n chainId\n }\n app {\n name\n key\n }\n signatures\n }\n }\n }\n }\n hasNextPage\n hasPreviousPage\n cursor\n }\n }\n childIds\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const GetDocumentOutgoingRelationshipsDocument = gql`\n query GetDocumentOutgoingRelationships(\n $sourceIdentifier: String!\n $relationshipType: String!\n $view: ViewFilterInput\n $paging: PagingInput\n ) {\n documentOutgoingRelationships(\n sourceIdentifier: $sourceIdentifier\n relationshipType: $relationshipType\n view: $view\n paging: $paging\n ) {\n items {\n ...PHDocumentFields\n }\n hasNextPage\n hasPreviousPage\n cursor\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const GetDocumentIncomingRelationshipsDocument = gql`\n query GetDocumentIncomingRelationships(\n $targetIdentifier: String!\n $relationshipType: String!\n $view: ViewFilterInput\n $paging: PagingInput\n ) {\n documentIncomingRelationships(\n targetIdentifier: $targetIdentifier\n relationshipType: $relationshipType\n view: $view\n paging: $paging\n ) {\n items {\n ...PHDocumentFields\n }\n hasNextPage\n hasPreviousPage\n cursor\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const GetDocumentOutgoingRelationshipEdgesDocument = gql`\n query GetDocumentOutgoingRelationshipEdges(\n $sourceIdentifier: String!\n $relationshipType: String\n $view: ViewFilterInput\n $paging: PagingInput\n ) {\n documentOutgoingRelationshipEdges(\n sourceIdentifier: $sourceIdentifier\n relationshipType: $relationshipType\n view: $view\n paging: $paging\n ) {\n items {\n ...DocumentRelationshipFields\n }\n hasNextPage\n hasPreviousPage\n cursor\n }\n }\n ${DocumentRelationshipFieldsFragmentDoc}\n`;\nexport const GetDocumentIncomingRelationshipEdgesDocument = gql`\n query GetDocumentIncomingRelationshipEdges(\n $targetIdentifier: String!\n $relationshipType: String\n $view: ViewFilterInput\n $paging: PagingInput\n ) {\n documentIncomingRelationshipEdges(\n targetIdentifier: $targetIdentifier\n relationshipType: $relationshipType\n view: $view\n paging: $paging\n ) {\n items {\n ...DocumentRelationshipFields\n }\n hasNextPage\n hasPreviousPage\n cursor\n }\n }\n ${DocumentRelationshipFieldsFragmentDoc}\n`;\nexport const FindDocumentsDocument = gql`\n query FindDocuments(\n $search: SearchFilterInput\n $view: ViewFilterInput\n $paging: PagingInput\n ) {\n findDocuments(search: $search, view: $view, paging: $paging) {\n items {\n ...PHDocumentFields\n }\n hasNextPage\n hasPreviousPage\n cursor\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const GetDocumentOperationsDocument = gql`\n query GetDocumentOperations(\n $filter: OperationsFilterInput!\n $paging: PagingInput\n ) {\n documentOperations(filter: $filter, paging: $paging) {\n items {\n index\n timestampUtcMs\n hash\n skip\n error\n deniedReason\n id\n action {\n id\n type\n timestampUtcMs\n input\n scope\n context {\n signer {\n user {\n address\n networkId\n chainId\n }\n app {\n name\n key\n }\n signatures\n }\n }\n }\n }\n hasNextPage\n hasPreviousPage\n cursor\n }\n }\n`;\nexport const GetJobStatusDocument = gql`\n query GetJobStatus($jobId: String!) {\n jobStatus(jobId: $jobId) {\n ...JobInfoFields\n }\n }\n ${JobInfoFieldsFragmentDoc}\n`;\nexport const GetDocumentServedDocument = gql`\n query GetDocumentServed($idOrSlug: String!, $view: ViewFilterInput) {\n documentServed(idOrSlug: $idOrSlug, view: $view)\n }\n`;\nexport const GetCreateDefaultsDocument = gql`\n query GetCreateDefaults($parentIdOrSlug: String) {\n createDefaults(parentIdOrSlug: $parentIdOrSlug) {\n signaturePolicy\n protocolVersions\n }\n }\n`;\nexport const GetDriveNodesDocument = gql`\n query GetDriveNodes(\n $driveId: ID!\n $parentFolder: ID\n $paging: PagingInput\n $kind: DriveNodeKind\n ) {\n driveNodes(\n driveId: $driveId\n parentFolder: $parentFolder\n paging: $paging\n kind: $kind\n ) {\n results {\n ...DriveNodeFields\n }\n nextCursor\n hasMore\n }\n }\n ${DriveNodeFieldsFragmentDoc}\n`;\nexport const GetDriveNodeDocument = gql`\n query GetDriveNode($driveId: ID!, $id: ID!) {\n driveNode(driveId: $driveId, id: $id) {\n ...DriveNodeFields\n }\n }\n ${DriveNodeFieldsFragmentDoc}\n`;\nexport const GetDriveDescendantsDocument = gql`\n query GetDriveDescendants($driveId: ID!, $root: ID!) {\n driveDescendants(driveId: $driveId, root: $root) {\n ...DriveNodeFields\n }\n }\n ${DriveNodeFieldsFragmentDoc}\n`;\nexport const EvaluateActionsDocument = gql`\n query EvaluateActions(\n $documentIdentifier: String!\n $branch: String\n $candidates: [ActionCandidateInput!]!\n ) {\n evaluateActions(\n documentIdentifier: $documentIdentifier\n branch: $branch\n candidates: $candidates\n ) {\n evaluations {\n decision\n reason\n }\n allAllowed\n anyAllowed\n allDenied\n anyDenied\n }\n }\n`;\nexport const CreateDocumentDocument = gql`\n mutation CreateDocument($document: JSONObject!, $parentIdentifier: String) {\n createDocument(document: $document, parentIdentifier: $parentIdentifier) {\n ...PHDocumentFields\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const CreateEmptyDocumentDocument = gql`\n mutation CreateEmptyDocument(\n $documentType: String!\n $parentIdentifier: String\n ) {\n createEmptyDocument(\n documentType: $documentType\n parentIdentifier: $parentIdentifier\n ) {\n ...PHDocumentFields\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const MutateDocumentDocument = gql`\n mutation MutateDocument(\n $documentIdentifier: String!\n $actions: [ActionInput!]!\n $branch: String\n ) {\n mutateDocument: execute(\n documentIdentifier: $documentIdentifier\n actions: $actions\n branch: $branch\n ) {\n ...PHDocumentFields\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const MutateDocumentAsyncDocument = gql`\n mutation MutateDocumentAsync(\n $documentIdentifier: String!\n $actions: [ActionInput!]!\n $branch: String\n ) {\n mutateDocumentAsync: executeAsync(\n documentIdentifier: $documentIdentifier\n actions: $actions\n branch: $branch\n ) {\n ...JobInfoFields\n }\n }\n ${JobInfoFieldsFragmentDoc}\n`;\nexport const ExecuteBatchDocument = gql`\n mutation ExecuteBatch($jobs: [ExecutionJobInput!]!) {\n executeBatch(jobs: $jobs) {\n jobs {\n key\n job {\n ...JobInfoFields\n }\n }\n }\n }\n ${JobInfoFieldsFragmentDoc}\n`;\nexport const RenameDocumentDocument = gql`\n mutation RenameDocument(\n $documentIdentifier: String!\n $name: String!\n $branch: String\n ) {\n renameDocument(\n documentIdentifier: $documentIdentifier\n name: $name\n branch: $branch\n ) {\n ...PHDocumentFields\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const SetPreferredEditorDocument = gql`\n mutation SetPreferredEditor(\n $documentIdentifier: String!\n $preferredEditor: String\n $branch: String\n ) {\n setPreferredEditor(\n documentIdentifier: $documentIdentifier\n preferredEditor: $preferredEditor\n branch: $branch\n ) {\n ...PHDocumentFields\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const AddRelationshipDocument = gql`\n mutation AddRelationship(\n $sourceIdentifier: String!\n $targetIdentifier: String!\n $relationshipType: String!\n $metadata: JSONObject\n $branch: String\n ) {\n addRelationship(\n sourceIdentifier: $sourceIdentifier\n targetIdentifier: $targetIdentifier\n relationshipType: $relationshipType\n metadata: $metadata\n branch: $branch\n ) {\n ...PHDocumentFields\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const UpdateRelationshipDocument = gql`\n mutation UpdateRelationship(\n $sourceIdentifier: String!\n $targetIdentifier: String!\n $relationshipType: String!\n $metadata: JSONObject\n $branch: String\n ) {\n updateRelationship(\n sourceIdentifier: $sourceIdentifier\n targetIdentifier: $targetIdentifier\n relationshipType: $relationshipType\n metadata: $metadata\n branch: $branch\n ) {\n ...PHDocumentFields\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const RemoveRelationshipDocument = gql`\n mutation RemoveRelationship(\n $sourceIdentifier: String!\n $targetIdentifier: String!\n $relationshipType: String!\n $branch: String\n ) {\n removeRelationship(\n sourceIdentifier: $sourceIdentifier\n targetIdentifier: $targetIdentifier\n relationshipType: $relationshipType\n branch: $branch\n ) {\n ...PHDocumentFields\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const MoveRelationshipDocument = gql`\n mutation MoveRelationship(\n $sourceParentIdentifier: String!\n $targetParentIdentifier: String!\n $targetIdentifier: String!\n $relationshipType: String!\n $branch: String\n ) {\n moveRelationship(\n sourceParentIdentifier: $sourceParentIdentifier\n targetParentIdentifier: $targetParentIdentifier\n targetIdentifier: $targetIdentifier\n relationshipType: $relationshipType\n branch: $branch\n ) {\n source {\n ...PHDocumentFields\n }\n target {\n ...PHDocumentFields\n }\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const DeleteDocumentDocument = gql`\n mutation DeleteDocument($identifier: String!, $propagate: PropagationMode) {\n deleteDocument(identifier: $identifier, propagate: $propagate)\n }\n`;\nexport const DeleteDocumentsDocument = gql`\n mutation DeleteDocuments(\n $identifiers: [String!]!\n $propagate: PropagationMode\n ) {\n deleteDocuments(identifiers: $identifiers, propagate: $propagate)\n }\n`;\nexport const DocumentChangesDocument = gql`\n subscription DocumentChanges(\n $search: SearchFilterInput\n $view: ViewFilterInput\n ) {\n documentChanges(search: $search, view: $view) {\n type\n documents {\n ...PHDocumentFields\n }\n context {\n parentId\n childId\n }\n }\n }\n ${PhDocumentFieldsFragmentDoc}\n`;\nexport const JobChangesDocument = gql`\n subscription JobChanges($jobId: String!) {\n jobChanges(jobId: $jobId) {\n jobId\n status\n result\n error\n }\n }\n`;\nexport const PollSyncEnvelopesDocument = gql`\n query PollSyncEnvelopes(\n $channelId: String!\n $outboxAck: Int!\n $outboxLatest: Int!\n $manifestRevision: String\n $refusals: [SyncRefusalInput!]\n ) {\n pollSyncEnvelopes(\n channelId: $channelId\n outboxAck: $outboxAck\n outboxLatest: $outboxLatest\n manifestRevision: $manifestRevision\n refusals: $refusals\n ) {\n envelopes {\n type\n channelMeta {\n id\n }\n operations {\n operation {\n index\n timestampUtcMs\n hash\n skip\n error\n deniedReason\n id\n action {\n id\n type\n timestampUtcMs\n input\n scope\n context {\n signer {\n user {\n address\n networkId\n chainId\n }\n app {\n name\n key\n }\n signatures\n }\n }\n }\n }\n context {\n documentId\n documentType\n scope\n branch\n }\n }\n cursor {\n remoteName\n cursorOrdinal\n lastSyncedAtUtcMs\n }\n key\n dependsOn\n }\n ackOrdinal\n deadLetters {\n documentId\n error\n errorType\n }\n hasMore\n manifestRevision\n peerManifestRevision\n }\n }\n`;\nexport const TouchChannelDocument = gql`\n mutation TouchChannel($input: TouchChannelInput!) {\n touchChannel(input: $input) {\n success\n ackOrdinal\n manifest\n }\n }\n`;\nexport const PushSyncEnvelopesDocument = gql`\n mutation PushSyncEnvelopes(\n $envelopes: [SyncEnvelopeInput!]!\n $peerManifestRevision: String\n ) {\n pushSyncEnvelopes(\n envelopes: $envelopes\n peerManifestRevision: $peerManifestRevision\n )\n }\n`;\n\nexport type SdkFunctionWrapper = <T>(\n action: (requestHeaders?: Record<string, string>) => Promise<T>,\n operationName: string,\n operationType?: string,\n variables?: any,\n) => Promise<T>;\n\nconst defaultWrapper: SdkFunctionWrapper = (\n action,\n _operationName,\n _operationType,\n _variables,\n) => action();\n\nexport function getSdk(\n client: GraphQLClient,\n withWrapper: SdkFunctionWrapper = defaultWrapper,\n) {\n return {\n GetDocumentModels(\n variables?: GetDocumentModelsQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDocumentModelsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDocumentModelsQuery>({\n document: GetDocumentModelsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDocumentModels\",\n \"query\",\n variables,\n );\n },\n GetDocument(\n variables: GetDocumentQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDocumentQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDocumentQuery>({\n document: GetDocumentDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDocument\",\n \"query\",\n variables,\n );\n },\n GetDocumentWithOperations(\n variables: GetDocumentWithOperationsQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDocumentWithOperationsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDocumentWithOperationsQuery>({\n document: GetDocumentWithOperationsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDocumentWithOperations\",\n \"query\",\n variables,\n );\n },\n GetDocumentOutgoingRelationships(\n variables: GetDocumentOutgoingRelationshipsQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDocumentOutgoingRelationshipsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDocumentOutgoingRelationshipsQuery>({\n document: GetDocumentOutgoingRelationshipsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDocumentOutgoingRelationships\",\n \"query\",\n variables,\n );\n },\n GetDocumentIncomingRelationships(\n variables: GetDocumentIncomingRelationshipsQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDocumentIncomingRelationshipsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDocumentIncomingRelationshipsQuery>({\n document: GetDocumentIncomingRelationshipsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDocumentIncomingRelationships\",\n \"query\",\n variables,\n );\n },\n GetDocumentOutgoingRelationshipEdges(\n variables: GetDocumentOutgoingRelationshipEdgesQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDocumentOutgoingRelationshipEdgesQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDocumentOutgoingRelationshipEdgesQuery>({\n document: GetDocumentOutgoingRelationshipEdgesDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDocumentOutgoingRelationshipEdges\",\n \"query\",\n variables,\n );\n },\n GetDocumentIncomingRelationshipEdges(\n variables: GetDocumentIncomingRelationshipEdgesQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDocumentIncomingRelationshipEdgesQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDocumentIncomingRelationshipEdgesQuery>({\n document: GetDocumentIncomingRelationshipEdgesDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDocumentIncomingRelationshipEdges\",\n \"query\",\n variables,\n );\n },\n FindDocuments(\n variables?: FindDocumentsQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<FindDocumentsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<FindDocumentsQuery>({\n document: FindDocumentsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"FindDocuments\",\n \"query\",\n variables,\n );\n },\n GetDocumentOperations(\n variables: GetDocumentOperationsQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDocumentOperationsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDocumentOperationsQuery>({\n document: GetDocumentOperationsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDocumentOperations\",\n \"query\",\n variables,\n );\n },\n GetJobStatus(\n variables: GetJobStatusQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetJobStatusQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetJobStatusQuery>({\n document: GetJobStatusDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetJobStatus\",\n \"query\",\n variables,\n );\n },\n GetDocumentServed(\n variables: GetDocumentServedQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDocumentServedQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDocumentServedQuery>({\n document: GetDocumentServedDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDocumentServed\",\n \"query\",\n variables,\n );\n },\n GetCreateDefaults(\n variables?: GetCreateDefaultsQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetCreateDefaultsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetCreateDefaultsQuery>({\n document: GetCreateDefaultsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetCreateDefaults\",\n \"query\",\n variables,\n );\n },\n GetDriveNodes(\n variables: GetDriveNodesQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDriveNodesQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDriveNodesQuery>({\n document: GetDriveNodesDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDriveNodes\",\n \"query\",\n variables,\n );\n },\n GetDriveNode(\n variables: GetDriveNodeQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDriveNodeQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDriveNodeQuery>({\n document: GetDriveNodeDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDriveNode\",\n \"query\",\n variables,\n );\n },\n GetDriveDescendants(\n variables: GetDriveDescendantsQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<GetDriveDescendantsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<GetDriveDescendantsQuery>({\n document: GetDriveDescendantsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"GetDriveDescendants\",\n \"query\",\n variables,\n );\n },\n EvaluateActions(\n variables: EvaluateActionsQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<EvaluateActionsQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<EvaluateActionsQuery>({\n document: EvaluateActionsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"EvaluateActions\",\n \"query\",\n variables,\n );\n },\n CreateDocument(\n variables: CreateDocumentMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<CreateDocumentMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<CreateDocumentMutation>({\n document: CreateDocumentDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"CreateDocument\",\n \"mutation\",\n variables,\n );\n },\n CreateEmptyDocument(\n variables: CreateEmptyDocumentMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<CreateEmptyDocumentMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<CreateEmptyDocumentMutation>({\n document: CreateEmptyDocumentDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"CreateEmptyDocument\",\n \"mutation\",\n variables,\n );\n },\n MutateDocument(\n variables: MutateDocumentMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<MutateDocumentMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<MutateDocumentMutation>({\n document: MutateDocumentDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"MutateDocument\",\n \"mutation\",\n variables,\n );\n },\n MutateDocumentAsync(\n variables: MutateDocumentAsyncMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<MutateDocumentAsyncMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<MutateDocumentAsyncMutation>({\n document: MutateDocumentAsyncDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"MutateDocumentAsync\",\n \"mutation\",\n variables,\n );\n },\n ExecuteBatch(\n variables: ExecuteBatchMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<ExecuteBatchMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<ExecuteBatchMutation>({\n document: ExecuteBatchDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"ExecuteBatch\",\n \"mutation\",\n variables,\n );\n },\n RenameDocument(\n variables: RenameDocumentMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<RenameDocumentMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<RenameDocumentMutation>({\n document: RenameDocumentDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"RenameDocument\",\n \"mutation\",\n variables,\n );\n },\n SetPreferredEditor(\n variables: SetPreferredEditorMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<SetPreferredEditorMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<SetPreferredEditorMutation>({\n document: SetPreferredEditorDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"SetPreferredEditor\",\n \"mutation\",\n variables,\n );\n },\n AddRelationship(\n variables: AddRelationshipMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<AddRelationshipMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<AddRelationshipMutation>({\n document: AddRelationshipDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"AddRelationship\",\n \"mutation\",\n variables,\n );\n },\n UpdateRelationship(\n variables: UpdateRelationshipMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<UpdateRelationshipMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<UpdateRelationshipMutation>({\n document: UpdateRelationshipDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"UpdateRelationship\",\n \"mutation\",\n variables,\n );\n },\n RemoveRelationship(\n variables: RemoveRelationshipMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<RemoveRelationshipMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<RemoveRelationshipMutation>({\n document: RemoveRelationshipDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"RemoveRelationship\",\n \"mutation\",\n variables,\n );\n },\n MoveRelationship(\n variables: MoveRelationshipMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<MoveRelationshipMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<MoveRelationshipMutation>({\n document: MoveRelationshipDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"MoveRelationship\",\n \"mutation\",\n variables,\n );\n },\n DeleteDocument(\n variables: DeleteDocumentMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<DeleteDocumentMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<DeleteDocumentMutation>({\n document: DeleteDocumentDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"DeleteDocument\",\n \"mutation\",\n variables,\n );\n },\n DeleteDocuments(\n variables: DeleteDocumentsMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<DeleteDocumentsMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<DeleteDocumentsMutation>({\n document: DeleteDocumentsDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"DeleteDocuments\",\n \"mutation\",\n variables,\n );\n },\n DocumentChanges(\n variables?: DocumentChangesSubscriptionVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<DocumentChangesSubscription> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<DocumentChangesSubscription>({\n document: DocumentChangesDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"DocumentChanges\",\n \"subscription\",\n variables,\n );\n },\n JobChanges(\n variables: JobChangesSubscriptionVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<JobChangesSubscription> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<JobChangesSubscription>({\n document: JobChangesDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"JobChanges\",\n \"subscription\",\n variables,\n );\n },\n PollSyncEnvelopes(\n variables: PollSyncEnvelopesQueryVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<PollSyncEnvelopesQuery> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<PollSyncEnvelopesQuery>({\n document: PollSyncEnvelopesDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"PollSyncEnvelopes\",\n \"query\",\n variables,\n );\n },\n TouchChannel(\n variables: TouchChannelMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<TouchChannelMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<TouchChannelMutation>({\n document: TouchChannelDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"TouchChannel\",\n \"mutation\",\n variables,\n );\n },\n PushSyncEnvelopes(\n variables: PushSyncEnvelopesMutationVariables,\n requestHeaders?: GraphQLClientRequestHeaders,\n signal?: RequestInit[\"signal\"],\n ): Promise<PushSyncEnvelopesMutation> {\n return withWrapper(\n (wrappedRequestHeaders) =>\n client.request<PushSyncEnvelopesMutation>({\n document: PushSyncEnvelopesDocument,\n variables,\n requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },\n signal,\n }),\n \"PushSyncEnvelopes\",\n \"mutation\",\n variables,\n );\n },\n };\n}\nexport type Sdk = ReturnType<typeof getSdk>;\n","import {\n GetDocumentDocument,\n GetDocumentOperationsDocument,\n type OperationsFilterInput,\n type PagingInput,\n type ViewFilterInput,\n} from \"./gen/schema.js\";\n\n/** Get the source string from a GraphQL document (string or DocumentNode). */\nfunction getDocumentSource(doc: unknown): string {\n return typeof doc === \"string\"\n ? doc\n : ((doc as { loc?: { source: { body: string } } }).loc?.source.body ?? \"\");\n}\n\n/**\n * Extract the inner selection set of a named field from a GraphQL document source.\n * Returns the `{ ... }` block including braces.\n */\nfunction extractSelectionSet(\n doc: unknown,\n fieldName: string,\n fallback: string,\n): string {\n const source = getDocumentSource(doc);\n\n const regex = new RegExp(\n `${fieldName}\\\\([^)]*\\\\)\\\\s*(\\\\{[\\\\s\\\\S]*\\\\})\\\\s*\\\\}`,\n );\n return regex.exec(source)?.[1] ?? fallback;\n}\n\n/**\n * Extract the query body and any fragment definitions from a GraphQL document.\n * Returns { body, fragments } where body is the content inside the query `{ ... }`\n * and fragments are any trailing fragment definitions.\n */\nfunction extractQueryParts(\n doc: unknown,\n fallbackBody: string,\n): { body: string; fragments: string } {\n const source = getDocumentSource(doc);\n\n // Match the query body: everything between the first `{` and its closing `}`\n // before any fragment definitions\n const queryMatch = /^[^{]*\\{([\\s\\S]*?)\\}\\s*(fragment[\\s\\S]*)?$/.exec(source);\n const body = queryMatch?.[1]?.trim() ?? fallbackBody;\n const fragments = queryMatch?.[2]?.trim() ?? \"\";\n\n return { body, fragments };\n}\n\nconst operationsSelectionSet = extractSelectionSet(\n GetDocumentOperationsDocument,\n \"documentOperations\",\n \"{ items { index } }\",\n);\n\nconst documentParts = extractQueryParts(\n GetDocumentDocument,\n \"document(identifier: $identifier) { document { id name documentType state revisionsList { scope revision } createdAtUtcIso lastModifiedAtUtcIso } childIds }\",\n);\n\n/**\n * Build a single GraphQL query that fetches documentOperations for\n * multiple filters using aliases. Each filter gets its own alias\n * (`scope_0`, `scope_1`, …) so all scopes are fetched in one HTTP request.\n */\nexport function buildBatchOperationsQuery(\n filters: OperationsFilterInput[],\n pagings: (PagingInput | undefined | null)[],\n) {\n const varDefs = filters\n .flatMap((_, i) => [\n `$filter_${i}: OperationsFilterInput!`,\n `$paging_${i}: PagingInput`,\n ])\n .join(\", \");\n\n const fields = filters\n .map(\n (_, i) =>\n `scope_${i}: documentOperations(filter: $filter_${i}, paging: $paging_${i}) ${operationsSelectionSet}`,\n )\n .join(\"\\n \");\n\n const query = `query BatchGetDocumentOperations(${varDefs}) {\n ${fields}\n }`;\n\n const variables: Record<string, unknown> = {};\n for (let i = 0; i < filters.length; i++) {\n variables[`filter_${i}`] = filters[i];\n variables[`paging_${i}`] = pagings[i] ?? null;\n }\n\n return { query, variables };\n}\n\n/**\n * Build a single GraphQL query that fetches a document AND\n * documentOperations for multiple filters, all in one HTTP request.\n */\nexport function buildBatchDocumentWithOperationsQuery(\n identifier: string,\n view: ViewFilterInput | undefined,\n filters: OperationsFilterInput[],\n pagings: (PagingInput | undefined)[],\n) {\n const docVarDefs = \"$identifier: String!, $view: ViewFilterInput\";\n const opsVarDefs = filters\n .flatMap((_, i) => [\n `$filter_${i}: OperationsFilterInput!`,\n `$paging_${i}: PagingInput`,\n ])\n .join(\", \");\n\n const opsFields = filters\n .map(\n (_, i) =>\n `scope_${i}: documentOperations(filter: $filter_${i}, paging: $paging_${i}) ${operationsSelectionSet}`,\n )\n .join(\"\\n \");\n\n const query = `query BatchGetDocumentWithOperations(${docVarDefs}, ${opsVarDefs}) {\n ${documentParts.body}\n ${opsFields}\n }\n ${documentParts.fragments}`;\n\n const variables: Record<string, unknown> = {\n identifier,\n view: view ?? null,\n };\n for (let i = 0; i < filters.length; i++) {\n variables[`filter_${i}`] = filters[i];\n variables[`paging_${i}`] = pagings[i] ?? null;\n }\n\n return { query, variables };\n}\n","import { GraphQLClient, type Variables } from \"graphql-request\";\nimport {\n buildBatchDocumentWithOperationsQuery,\n buildBatchOperationsQuery,\n} from \"./batch-queries.js\";\nimport {\n getSdk,\n type GetDocumentOperationsQuery,\n type GetDocumentQuery,\n type OperationsFilterInput,\n type PagingInput,\n type SdkFunctionWrapper,\n type ViewFilterInput,\n} from \"./gen/schema.js\";\nimport type { ReactorGraphQLClient, RunDocumentOptions } from \"./types.js\";\n\nexport type { ReactorGraphQLClient, RunDocumentOptions } from \"./types.js\";\n\ntype DocumentOperationsPage = GetDocumentOperationsQuery[\"documentOperations\"];\n\ntype DocumentResult = NonNullable<GetDocumentQuery[\"document\"]>;\n\n/**\n * Creates a GraphQL client for the Reactor Subgraph API.\n * @param urlOrGQLClient The URL of the GraphQL API or a GraphQL client instance.\n * @param middleware An optional middleware function to wrap the GraphQL client calls.\n * @returns A GraphQL client for the Reactor Subgraph API.\n */\nexport function createClient(\n urlOrGQLClient: string | GraphQLClient,\n middleware?: SdkFunctionWrapper,\n): ReactorGraphQLClient {\n const client =\n typeof urlOrGQLClient === \"string\"\n ? new GraphQLClient(urlOrGQLClient)\n : urlOrGQLClient;\n\n // The hand-written batch methods below call `client.request` directly,\n // bypassing the middleware that `getSdk` applies. Wrap them in the same\n // shape so auth/logging/tracing middleware runs for batch calls too.\n const runWithMiddleware = async <T>(\n operationName: string,\n run: (requestHeaders?: Record<string, string>) => Promise<T>,\n operationType = \"query\",\n variables?: Variables,\n ): Promise<T> => {\n if (!middleware) return run();\n return middleware(run, operationName, operationType, variables);\n };\n\n return {\n ...getSdk(client, middleware),\n\n /**\n * Run a hand-authored GraphQL document through the same transport and\n * middleware as the generated SDK methods.\n */\n async RunDocument<TData>(options: RunDocumentOptions): Promise<TData> {\n const { document, variables, signal } = options;\n return runWithMiddleware<TData>(\n options.operationName,\n (wrappedRequestHeaders) =>\n client.request<TData>({\n document,\n variables,\n requestHeaders: {\n ...options.requestHeaders,\n ...wrappedRequestHeaders,\n },\n signal,\n }),\n options.operationType,\n variables,\n );\n },\n\n /**\n * Fetch documentOperations for multiple filters in a single HTTP request\n * using GraphQL aliases. Each filter has its own paging parameters.\n * Returns one result page per filter, in order.\n */\n async BatchGetDocumentOperations(\n filters: OperationsFilterInput[],\n pagings: (PagingInput | undefined | null)[],\n ): Promise<DocumentOperationsPage[]> {\n const { query, variables } = buildBatchOperationsQuery(filters, pagings);\n const data = await runWithMiddleware(\n \"BatchGetDocumentOperations\",\n (requestHeaders) =>\n client.request<Record<string, DocumentOperationsPage>>(\n query,\n variables,\n requestHeaders,\n ),\n );\n return filters.map((_, i) => data[`scope_${i}`]);\n },\n\n /**\n * Fetch a document AND documentOperations for multiple filters\n * in a single HTTP request. Combines GetDocument + BatchGetDocumentOperations.\n */\n async BatchGetDocumentWithOperations(\n identifier: string,\n view: ViewFilterInput | undefined,\n filters: OperationsFilterInput[],\n pagings: (PagingInput | undefined)[],\n ): Promise<{\n document: DocumentResult | null;\n operations: DocumentOperationsPage[];\n }> {\n const { query, variables } = buildBatchDocumentWithOperationsQuery(\n identifier,\n view,\n filters,\n pagings,\n );\n const data = await runWithMiddleware(\n \"BatchGetDocumentWithOperations\",\n (requestHeaders) =>\n client.request<\n Record<string, unknown> & { document?: DocumentResult }\n >(query, variables, requestHeaders),\n );\n return {\n document: data.document ?? null,\n operations: filters.map(\n (_, i) => data[`scope_${i}`] as DocumentOperationsPage,\n ),\n };\n },\n };\n}\n"],"mappings":";;;AAipBA,IAAY,kBAAL,yBAAA,iBAAA;CACL,gBAAA,aAAA;CACA,gBAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AA2zCA,MAAa,8BAA8B,GAAG;;;;;;;;;;;;;;;;;AAiB9C,MAAa,wCAAwC,GAAG;;;;;;;;;;AAUxD,MAAa,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;AA0B3C,MAAa,6BAA6B,GAAG;;;;;;;;;;;;;;;;;AAiB7C,MAAa,4BAA4B,GAAG;;;;;;;;;;;;;;;;AAgB5C,MAAa,sBAAsB,GAAG;;;;;;;;;IASlC,4BAA4B;;AAEhC,MAAa,oCAAoC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiDhD,4BAA4B;;AAEhC,MAAa,2CAA2C,GAAG;;;;;;;;;;;;;;;;;;;;;IAqBvD,4BAA4B;;AAEhC,MAAa,2CAA2C,GAAG;;;;;;;;;;;;;;;;;;;;;IAqBvD,4BAA4B;;AAEhC,MAAa,+CAA+C,GAAG;;;;;;;;;;;;;;;;;;;;;IAqB3D,sCAAsC;;AAE1C,MAAa,+CAA+C,GAAG;;;;;;;;;;;;;;;;;;;;;IAqB3D,sCAAsC;;AAE1C,MAAa,wBAAwB,GAAG;;;;;;;;;;;;;;;IAepC,4BAA4B;;AAEhC,MAAa,gCAAgC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0ChD,MAAa,uBAAuB,GAAG;;;;;;IAMnC,yBAAyB;;AAE7B,MAAa,4BAA4B,GAAG;;;;;AAK5C,MAAa,4BAA4B,GAAG;;;;;;;;AAQ5C,MAAa,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;IAoBpC,2BAA2B;;AAE/B,MAAa,uBAAuB,GAAG;;;;;;IAMnC,2BAA2B;;AAE/B,MAAa,8BAA8B,GAAG;;;;;;IAM1C,2BAA2B;;AAE/B,MAAa,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;AAsB1C,MAAa,yBAAyB,GAAG;;;;;;IAMrC,4BAA4B;;AAEhC,MAAa,8BAA8B,GAAG;;;;;;;;;;;;IAY1C,4BAA4B;;AAEhC,MAAa,yBAAyB,GAAG;;;;;;;;;;;;;;IAcrC,4BAA4B;;AAEhC,MAAa,8BAA8B,GAAG;;;;;;;;;;;;;;IAc1C,yBAAyB;;AAE7B,MAAa,uBAAuB,GAAG;;;;;;;;;;;IAWnC,yBAAyB;;AAE7B,MAAa,yBAAyB,GAAG;;;;;;;;;;;;;;IAcrC,4BAA4B;;AAEhC,MAAa,6BAA6B,GAAG;;;;;;;;;;;;;;IAczC,4BAA4B;;AAEhC,MAAa,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;IAkBtC,4BAA4B;;AAEhC,MAAa,6BAA6B,GAAG;;;;;;;;;;;;;;;;;;IAkBzC,4BAA4B;;AAEhC,MAAa,6BAA6B,GAAG;;;;;;;;;;;;;;;;IAgBzC,4BAA4B;;AAEhC,MAAa,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;IAuBvC,4BAA4B;;AAEhC,MAAa,yBAAyB,GAAG;;;;;AAKzC,MAAa,0BAA0B,GAAG;;;;;;;;AAQ1C,MAAa,0BAA0B,GAAG;;;;;;;;;;;;;;;;IAgBtC,4BAA4B;;AAEhC,MAAa,qBAAqB,GAAG;;;;;;;;;;AAUrC,MAAa,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8E5C,MAAa,uBAAuB,GAAG;;;;;;;;;AASvC,MAAa,4BAA4B,GAAG;;;;;;;;;;;AAmB5C,MAAM,kBACJ,QACA,gBACA,gBACA,eACG,OAAO;AAEZ,SAAgB,OACd,QACA,cAAkC,gBAClC;CACA,OAAO;EACL,kBACE,WACA,gBACA,QACiC;GACjC,OAAO,aACJ,0BACC,OAAO,QAAgC;IACrC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,qBACA,SACA,SACF;EACF;EACA,YACE,WACA,gBACA,QAC2B;GAC3B,OAAO,aACJ,0BACC,OAAO,QAA0B;IAC/B,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,eACA,SACA,SACF;EACF;EACA,0BACE,WACA,gBACA,QACyC;GACzC,OAAO,aACJ,0BACC,OAAO,QAAwC;IAC7C,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,6BACA,SACA,SACF;EACF;EACA,iCACE,WACA,gBACA,QACgD;GAChD,OAAO,aACJ,0BACC,OAAO,QAA+C;IACpD,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,oCACA,SACA,SACF;EACF;EACA,iCACE,WACA,gBACA,QACgD;GAChD,OAAO,aACJ,0BACC,OAAO,QAA+C;IACpD,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,oCACA,SACA,SACF;EACF;EACA,qCACE,WACA,gBACA,QACoD;GACpD,OAAO,aACJ,0BACC,OAAO,QAAmD;IACxD,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,wCACA,SACA,SACF;EACF;EACA,qCACE,WACA,gBACA,QACoD;GACpD,OAAO,aACJ,0BACC,OAAO,QAAmD;IACxD,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,wCACA,SACA,SACF;EACF;EACA,cACE,WACA,gBACA,QAC6B;GAC7B,OAAO,aACJ,0BACC,OAAO,QAA4B;IACjC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,iBACA,SACA,SACF;EACF;EACA,sBACE,WACA,gBACA,QACqC;GACrC,OAAO,aACJ,0BACC,OAAO,QAAoC;IACzC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,yBACA,SACA,SACF;EACF;EACA,aACE,WACA,gBACA,QAC4B;GAC5B,OAAO,aACJ,0BACC,OAAO,QAA2B;IAChC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,gBACA,SACA,SACF;EACF;EACA,kBACE,WACA,gBACA,QACiC;GACjC,OAAO,aACJ,0BACC,OAAO,QAAgC;IACrC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,qBACA,SACA,SACF;EACF;EACA,kBACE,WACA,gBACA,QACiC;GACjC,OAAO,aACJ,0BACC,OAAO,QAAgC;IACrC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,qBACA,SACA,SACF;EACF;EACA,cACE,WACA,gBACA,QAC6B;GAC7B,OAAO,aACJ,0BACC,OAAO,QAA4B;IACjC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,iBACA,SACA,SACF;EACF;EACA,aACE,WACA,gBACA,QAC4B;GAC5B,OAAO,aACJ,0BACC,OAAO,QAA2B;IAChC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,gBACA,SACA,SACF;EACF;EACA,oBACE,WACA,gBACA,QACmC;GACnC,OAAO,aACJ,0BACC,OAAO,QAAkC;IACvC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,uBACA,SACA,SACF;EACF;EACA,gBACE,WACA,gBACA,QAC+B;GAC/B,OAAO,aACJ,0BACC,OAAO,QAA8B;IACnC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,mBACA,SACA,SACF;EACF;EACA,eACE,WACA,gBACA,QACiC;GACjC,OAAO,aACJ,0BACC,OAAO,QAAgC;IACrC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,kBACA,YACA,SACF;EACF;EACA,oBACE,WACA,gBACA,QACsC;GACtC,OAAO,aACJ,0BACC,OAAO,QAAqC;IAC1C,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,uBACA,YACA,SACF;EACF;EACA,eACE,WACA,gBACA,QACiC;GACjC,OAAO,aACJ,0BACC,OAAO,QAAgC;IACrC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,kBACA,YACA,SACF;EACF;EACA,oBACE,WACA,gBACA,QACsC;GACtC,OAAO,aACJ,0BACC,OAAO,QAAqC;IAC1C,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,uBACA,YACA,SACF;EACF;EACA,aACE,WACA,gBACA,QAC+B;GAC/B,OAAO,aACJ,0BACC,OAAO,QAA8B;IACnC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,gBACA,YACA,SACF;EACF;EACA,eACE,WACA,gBACA,QACiC;GACjC,OAAO,aACJ,0BACC,OAAO,QAAgC;IACrC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,kBACA,YACA,SACF;EACF;EACA,mBACE,WACA,gBACA,QACqC;GACrC,OAAO,aACJ,0BACC,OAAO,QAAoC;IACzC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,sBACA,YACA,SACF;EACF;EACA,gBACE,WACA,gBACA,QACkC;GAClC,OAAO,aACJ,0BACC,OAAO,QAAiC;IACtC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,mBACA,YACA,SACF;EACF;EACA,mBACE,WACA,gBACA,QACqC;GACrC,OAAO,aACJ,0BACC,OAAO,QAAoC;IACzC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,sBACA,YACA,SACF;EACF;EACA,mBACE,WACA,gBACA,QACqC;GACrC,OAAO,aACJ,0BACC,OAAO,QAAoC;IACzC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,sBACA,YACA,SACF;EACF;EACA,iBACE,WACA,gBACA,QACmC;GACnC,OAAO,aACJ,0BACC,OAAO,QAAkC;IACvC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,oBACA,YACA,SACF;EACF;EACA,eACE,WACA,gBACA,QACiC;GACjC,OAAO,aACJ,0BACC,OAAO,QAAgC;IACrC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,kBACA,YACA,SACF;EACF;EACA,gBACE,WACA,gBACA,QACkC;GAClC,OAAO,aACJ,0BACC,OAAO,QAAiC;IACtC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,mBACA,YACA,SACF;EACF;EACA,gBACE,WACA,gBACA,QACsC;GACtC,OAAO,aACJ,0BACC,OAAO,QAAqC;IAC1C,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,mBACA,gBACA,SACF;EACF;EACA,WACE,WACA,gBACA,QACiC;GACjC,OAAO,aACJ,0BACC,OAAO,QAAgC;IACrC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,cACA,gBACA,SACF;EACF;EACA,kBACE,WACA,gBACA,QACiC;GACjC,OAAO,aACJ,0BACC,OAAO,QAAgC;IACrC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,qBACA,SACA,SACF;EACF;EACA,aACE,WACA,gBACA,QAC+B;GAC/B,OAAO,aACJ,0BACC,OAAO,QAA8B;IACnC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,gBACA,YACA,SACF;EACF;EACA,kBACE,WACA,gBACA,QACoC;GACpC,OAAO,aACJ,0BACC,OAAO,QAAmC;IACxC,UAAU;IACV;IACA,gBAAgB;KAAE,GAAG;KAAgB,GAAG;IAAsB;IAC9D;GACF,CAAC,GACH,qBACA,YACA,SACF;EACF;CACF;AACF;;;;AC5vGA,SAAS,kBAAkB,KAAsB;CAC/C,OAAO,OAAO,QAAQ,WAClB,MACE,IAA+C,KAAK,OAAO,QAAQ;AAC3E;;;;;AAMA,SAAS,oBACP,KACA,WACA,UACQ;CACR,MAAM,SAAS,kBAAkB,GAAG;CAKpC,OAAO,IAHW,OAChB,GAAG,UAAU,wCAEJ,CAAC,CAAC,KAAK,MAAM,CAAC,GAAG,MAAM;AACpC;;;;;;AAOA,SAAS,kBACP,KACA,cACqC;CACrC,MAAM,SAAS,kBAAkB,GAAG;CAIpC,MAAM,aAAa,6CAA6C,KAAK,MAAM;CAI3E,OAAO;EAAE,MAHI,aAAa,EAAE,EAAE,KAAK,KAAK;EAGzB,WAFG,aAAa,EAAE,EAAE,KAAK,KAAK;CAEpB;AAC3B;AAEA,MAAM,yBAAyB,oBAC7B,+BACA,sBACA,qBACF;AAEA,MAAM,gBAAgB,kBACpB,qBACA,8JACF;;;;;;AAOA,SAAgB,0BACd,SACA,SACA;CAeA,MAAM,QAAQ,oCAdE,QACb,SAAS,GAAG,MAAM,CACjB,WAAW,EAAE,2BACb,WAAW,EAAE,cACf,CAAC,CAAC,CACD,KAAK,IASgD,EAAE;MAP3C,QACZ,KACE,GAAG,MACF,SAAS,EAAE,uCAAuC,EAAE,oBAAoB,EAAE,IAAI,wBAClF,CAAC,CACA,KAAK,QAGC,EAAE;;CAGX,MAAM,YAAqC,CAAC;CAC5C,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;EACvC,UAAU,UAAU,OAAO,QAAQ;EACnC,UAAU,UAAU,OAAO,QAAQ,MAAM;CAC3C;CAEA,OAAO;EAAE;EAAO;CAAU;AAC5B;;;;;AAMA,SAAgB,sCACd,YACA,MACA,SACA,SACA;CACA,MAAM,aAAa;CACnB,MAAM,aAAa,QAChB,SAAS,GAAG,MAAM,CACjB,WAAW,EAAE,2BACb,WAAW,EAAE,cACf,CAAC,CAAC,CACD,KAAK,IAAI;CAEZ,MAAM,YAAY,QACf,KACE,GAAG,MACF,SAAS,EAAE,uCAAuC,EAAE,oBAAoB,EAAE,IAAI,wBAClF,CAAC,CACA,KAAK,QAAQ;CAEhB,MAAM,QAAQ,wCAAwC,WAAW,IAAI,WAAW;MAC5E,cAAc,KAAK;MACnB,UAAU;;IAEZ,cAAc;CAEhB,MAAM,YAAqC;EACzC;EACA,MAAM,QAAQ;CAChB;CACA,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;EACvC,UAAU,UAAU,OAAO,QAAQ;EACnC,UAAU,UAAU,OAAO,QAAQ,MAAM;CAC3C;CAEA,OAAO;EAAE;EAAO;CAAU;AAC5B;;;;;;;;;AChHA,SAAgB,aACd,gBACA,YACsB;CACtB,MAAM,SACJ,OAAO,mBAAmB,WACtB,IAAI,cAAc,cAAc,IAChC;CAKN,MAAM,oBAAoB,OACxB,eACA,KACA,gBAAgB,SAChB,cACe;EACf,IAAI,CAAC,YAAY,OAAO,IAAI;EAC5B,OAAO,WAAW,KAAK,eAAe,eAAe,SAAS;CAChE;CAEA,OAAO;EACL,GAAG,OAAO,QAAQ,UAAU;;;;;EAM5B,MAAM,YAAmB,SAA6C;GACpE,MAAM,EAAE,UAAU,WAAW,WAAW;GACxC,OAAO,kBACL,QAAQ,gBACP,0BACC,OAAO,QAAe;IACpB;IACA;IACA,gBAAgB;KACd,GAAG,QAAQ;KACX,GAAG;IACL;IACA;GACF,CAAC,GACH,QAAQ,eACR,SACF;EACF;;;;;;EAOA,MAAM,2BACJ,SACA,SACmC;GACnC,MAAM,EAAE,OAAO,cAAc,0BAA0B,SAAS,OAAO;GACvE,MAAM,OAAO,MAAM,kBACjB,+BACC,mBACC,OAAO,QACL,OACA,WACA,cACF,CACJ;GACA,OAAO,QAAQ,KAAK,GAAG,MAAM,KAAK,SAAS,IAAI;EACjD;;;;;EAMA,MAAM,+BACJ,YACA,MACA,SACA,SAIC;GACD,MAAM,EAAE,OAAO,cAAc,sCAC3B,YACA,MACA,SACA,OACF;GACA,MAAM,OAAO,MAAM,kBACjB,mCACC,mBACC,OAAO,QAEL,OAAO,WAAW,cAAc,CACtC;GACA,OAAO;IACL,UAAU,KAAK,YAAY;IAC3B,YAAY,QAAQ,KACjB,GAAG,MAAM,KAAK,SAAS,IAC1B;GACF;EACF;CACF;AACF"}
|
|
@@ -70,7 +70,7 @@ async function queueActions(document, actionOrActions) {
|
|
|
70
70
|
if (actions.length === 0) throw new Error("No actions provided");
|
|
71
71
|
const reactorClient = getPHStore()?.reactorClient;
|
|
72
72
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
73
|
-
return await reactorClient.execute(document.header.id, "main", actions);
|
|
73
|
+
return await (await reactorClient.write.execute(document.header.id, "main", actions)).document();
|
|
74
74
|
}
|
|
75
75
|
async function queueOperations(documentId, operationOrOperations) {
|
|
76
76
|
if (!documentId) throw new Error("No documentId provided");
|
|
@@ -80,7 +80,7 @@ async function queueOperations(documentId, operationOrOperations) {
|
|
|
80
80
|
const reactorClient = getPHStore()?.reactorClient;
|
|
81
81
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
82
82
|
const actions = operations.map((op) => op.action);
|
|
83
|
-
return await reactorClient.execute(documentId, "main", actions);
|
|
83
|
+
return await (await reactorClient.write.execute(documentId, "main", actions)).document();
|
|
84
84
|
}
|
|
85
85
|
async function uploadOperations(documentId, allOperations, pushOperations, options) {
|
|
86
86
|
const operationsLimit = options?.operationsLimit || 50;
|
|
@@ -370,6 +370,8 @@ function isDuplicateManifestError(error) {
|
|
|
370
370
|
}
|
|
371
371
|
//#endregion
|
|
372
372
|
//#region src/document-cache.ts
|
|
373
|
+
/** The most ids one `getMany` call is asked for. */
|
|
374
|
+
const GET_MANY_CHUNK_SIZE = 100;
|
|
373
375
|
function addPromiseState(promise) {
|
|
374
376
|
if ("status" in promise) return promise;
|
|
375
377
|
const promiseWithState = promise;
|
|
@@ -427,6 +429,18 @@ function isDocumentTypeCache(cache) {
|
|
|
427
429
|
const candidate = cache;
|
|
428
430
|
return typeof candidate.getDocumentsOfTypeState === "function" && typeof candidate.loadDocumentsOfType === "function" && typeof candidate.loadMoreDocumentsOfType === "function" && typeof candidate.subscribeDocumentsOfType === "function";
|
|
429
431
|
}
|
|
432
|
+
function createDeferred() {
|
|
433
|
+
let resolve;
|
|
434
|
+
let reject;
|
|
435
|
+
return {
|
|
436
|
+
promise: new Promise((res, rej) => {
|
|
437
|
+
resolve = res;
|
|
438
|
+
reject = rej;
|
|
439
|
+
}),
|
|
440
|
+
resolve,
|
|
441
|
+
reject
|
|
442
|
+
};
|
|
443
|
+
}
|
|
430
444
|
/** A promise already settled with `value`, readable without awaiting. */
|
|
431
445
|
function fulfilledPromise(value) {
|
|
432
446
|
const promise = Promise.resolve(value);
|
|
@@ -453,13 +467,14 @@ function highestOperationIndex(operations) {
|
|
|
453
467
|
/**
|
|
454
468
|
* Document cache implementation that uses the new ReactorClient API.
|
|
455
469
|
*
|
|
456
|
-
* This cache subscribes to document change events
|
|
470
|
+
* This cache subscribes to document change events through the client's read half
|
|
457
471
|
* and automatically updates the cache when documents are created, updated, or deleted.
|
|
472
|
+
* It is built over a browser client, whose `read` half it uses, or over a read
|
|
473
|
+
* half directly.
|
|
458
474
|
* It also holds paginated operation history per document scope (see `IOperationCache`),
|
|
459
475
|
* which is dropped for a document whenever a change event for it arrives.
|
|
460
476
|
*/
|
|
461
477
|
var DocumentCache = class {
|
|
462
|
-
client;
|
|
463
478
|
documents = /* @__PURE__ */ new Map();
|
|
464
479
|
batchPromises = /* @__PURE__ */ new Map();
|
|
465
480
|
listeners = /* @__PURE__ */ new Map();
|
|
@@ -489,9 +504,10 @@ var DocumentCache = class {
|
|
|
489
504
|
typeRequests = /* @__PURE__ */ new Map();
|
|
490
505
|
typeListeners = /* @__PURE__ */ new Map();
|
|
491
506
|
unsubscribe = null;
|
|
507
|
+
client;
|
|
492
508
|
constructor(client) {
|
|
493
|
-
this.client = client;
|
|
494
|
-
this.unsubscribe = client.subscribe({}, (event) => {
|
|
509
|
+
this.client = readerOf(client);
|
|
510
|
+
this.unsubscribe = this.client.subscribe({}, (event) => {
|
|
495
511
|
this.handleDocumentChange(event);
|
|
496
512
|
});
|
|
497
513
|
}
|
|
@@ -560,6 +576,7 @@ var DocumentCache = class {
|
|
|
560
576
|
const key = ids.join(",");
|
|
561
577
|
const cached = this.batchPromises.get(key);
|
|
562
578
|
const hasDeletedDocuments = ids.some((id) => !this.documents.has(id));
|
|
579
|
+
if (hasDeletedDocuments) this.loadMany(ids);
|
|
563
580
|
const currentPromises = ids.map((id) => this.get(id));
|
|
564
581
|
if (hasDeletedDocuments) {
|
|
565
582
|
const batchPromise = fulfilledOnly(currentPromises);
|
|
@@ -592,6 +609,57 @@ var DocumentCache = class {
|
|
|
592
609
|
});
|
|
593
610
|
return batchPromise;
|
|
594
611
|
}
|
|
612
|
+
/**
|
|
613
|
+
* Reserves an entry for every id not yet cached and fills them from
|
|
614
|
+
* `getMany`, in chunks of {@link GET_MANY_CHUNK_SIZE}. Each id keeps its own
|
|
615
|
+
* entry, settled as `get` would settle it.
|
|
616
|
+
*/
|
|
617
|
+
loadMany(ids) {
|
|
618
|
+
const getMany = this.client.getMany?.bind(this.client);
|
|
619
|
+
const missing = [...new Set(ids)].filter((id) => !this.documents.has(id));
|
|
620
|
+
if (!getMany || missing.length < 2) return;
|
|
621
|
+
const pending = /* @__PURE__ */ new Map();
|
|
622
|
+
for (const id of missing) {
|
|
623
|
+
const deferred = createDeferred();
|
|
624
|
+
pending.set(id, deferred);
|
|
625
|
+
this.refetcher.forget(id);
|
|
626
|
+
this.documents.set(id, addPromiseState(deferred.promise));
|
|
627
|
+
}
|
|
628
|
+
for (let i = 0; i < missing.length; i += 100) this.settleMany(missing.slice(i, i + 100), pending, getMany);
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* `getMany` rejects when any id is unavailable, so a failed chunk is split
|
|
632
|
+
* in half and retried; a single id is read with `get`, so it settles exactly
|
|
633
|
+
* as a single read would.
|
|
634
|
+
*/
|
|
635
|
+
async settleMany(ids, pending, getMany) {
|
|
636
|
+
if (ids.length === 1) {
|
|
637
|
+
const id = ids[0];
|
|
638
|
+
try {
|
|
639
|
+
this.settleFetched(id, await this.client.get(id), pending);
|
|
640
|
+
} catch (error) {
|
|
641
|
+
pending.get(id)?.reject(error);
|
|
642
|
+
}
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
let documents;
|
|
646
|
+
try {
|
|
647
|
+
documents = await getMany(ids);
|
|
648
|
+
} catch {
|
|
649
|
+
const half = Math.ceil(ids.length / 2);
|
|
650
|
+
await Promise.all([this.settleMany(ids.slice(0, half), pending, getMany), this.settleMany(ids.slice(half), pending, getMany)]);
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
if (documents.length !== ids.length) {
|
|
654
|
+
await Promise.all(ids.map((id) => this.settleMany([id], pending, getMany)));
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
ids.forEach((id, i) => this.settleFetched(id, documents[i], pending));
|
|
658
|
+
}
|
|
659
|
+
settleFetched(id, document, pending) {
|
|
660
|
+
if (document.header.id !== id) this.recordAlias(document.header.id, id);
|
|
661
|
+
pending.get(id)?.resolve(document);
|
|
662
|
+
}
|
|
595
663
|
subscribe(id, callback) {
|
|
596
664
|
const ids = Array.isArray(id) ? id : [id];
|
|
597
665
|
for (const docId of ids) {
|
|
@@ -879,6 +947,10 @@ var DocumentCache = class {
|
|
|
879
947
|
this.operationListeners.clear();
|
|
880
948
|
}
|
|
881
949
|
};
|
|
950
|
+
/** The read half of a browser client, or the reader itself. */
|
|
951
|
+
function readerOf(client) {
|
|
952
|
+
return client.read ?? client;
|
|
953
|
+
}
|
|
882
954
|
//#endregion
|
|
883
955
|
//#region src/hooks/document-cache.ts
|
|
884
956
|
const documentEventFunctions = makePHEventFunctions("documentCache");
|
|
@@ -1092,6 +1164,6 @@ function useDispatch(document) {
|
|
|
1092
1164
|
return [document, useMemo(() => createDispatch(() => latest.current), [id])];
|
|
1093
1165
|
}
|
|
1094
1166
|
//#endregion
|
|
1095
|
-
export {
|
|
1167
|
+
export { DocumentTypeMismatchError as A, DocumentRefetcher as C, queueOperations as D, queueActions as E, OperationRejectedError as M, UnsupportedDocumentTypeError as N, uploadOperations as O, isDuplicateModuleError as S, dispatchActions as T, isDocumentTypeCache as _, useDocument as a, DOCUMENT_CHANGE_TYPE as b, useDocuments as c, useGetDocuments as d, DocumentCache as f, addPromiseState as g, IDLE_OPERATIONS_ENTRY as h, setDocumentCache as i, NoSelectedDocumentError as j, DocumentModelNotFoundError as k, useGetDocument as l, IDLE_DOCUMENTS_OF_TYPE_ENTRY as m, useDispatch as n, useDocumentCache as o, GET_MANY_CHUNK_SIZE as p, addDocumentCacheEventHandler as r, useDocumentSafe as s, createDispatch as t, useGetDocumentAsync as u, isOperationCache as v, IDLE_REFETCH_STATE as w, isDuplicateManifestError as x, readPromiseState as y };
|
|
1096
1168
|
|
|
1097
|
-
//# sourceMappingURL=dispatch-
|
|
1169
|
+
//# sourceMappingURL=dispatch-DLD1E-9L.js.map
|