import { i as IPackageManagerOptions, n as IPackageLoaderOptions, r as IPackageManager, s as PackageManagerResult, t as IPackageLoader } from "./types-DnHgkahK.mjs"; import { IAnalyticsStore } from "@powerhousedao/analytics-engine-core"; import { AnalyticsModel } from "@powerhousedao/analytics-engine-graphql"; import * as graphql from "graphql"; import { DocumentNode, GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig, GraphQLSchema } from "graphql"; import { IDocumentModelLoader, IDocumentModelRegistry, IDriveClient, IReactorClient, IRelationalDb, ISyncManager, ParsedDriveUrl, ReactorClientModule, driveIdFromUrl, parseDriveUrl } from "@powerhousedao/reactor"; import { ILogger } from "document-model"; import { DocumentModelGlobalState as DocumentModelGlobalState$1, DocumentModelModule, Operation, PHDocument, PHDocumentHeader } from "@powerhousedao/shared/document-model"; import * as z$1 from "zod"; import { DocumentDriveDocument, DocumentDriveGlobalState } from "@powerhousedao/shared/document-drive"; import { AttachmentBuildResult } from "@powerhousedao/reactor-attachments"; import { IAttachmentClient } from "@powerhousedao/reactor-attachments/client"; import { WebSocketServer } from "ws"; import { IProcessorHostModule, IRelationalDb as IRelationalDb$1, ProcessorApp, ProcessorRecord } from "@powerhousedao/shared/processors"; import { Generated, Kysely } from "kysely"; import { PGlite } from "@electric-sql/pglite"; import { Knex } from "knex"; import http from "node:http"; import { CorsOptions } from "cors"; import { GraphQLResolverMap, GraphQLSchemaModule } from "@apollo/subgraph/dist/schema-helper/resolverMap.js"; import { Context as Context$1, GqlDocument as GqlDocument$1, GqlDriveDocument as GqlDriveDocument$1, GqlOperation as GqlOperation$1, GraphQLManager as GraphQLManager$1, ISubgraph as ISubgraph$1, Processor as Processor$1, SubgraphArgs as SubgraphArgs$1, SubgraphClass as SubgraphClass$1 } from "@powerhousedao/reactor-api"; import { IncomingHttpHeaders } from "http"; import { Pool } from "pg"; //#region src/utils/db.d.ts /** * Permission levels for documents: * - READ: Can fetch and read the document * - WRITE: Can push updates and modify the document * - ADMIN: Can manage document permissions and settings */ type DocumentPermissionLevel = "READ" | "WRITE" | "ADMIN"; /** * Database schema for document permissions */ interface DocumentProtectionTable { documentId: string; protected: boolean; ownerAddress: string | null; createdAt: Date; updatedAt: Date; } interface DocumentPermissionDatabase { DocumentPermission: DocumentPermissionTable; OperationUserPermission: OperationUserPermissionTable; DocumentProtection: DocumentProtectionTable; } interface DocumentPermissionTable { id: Generated; documentId: string; userAddress: string; permission: DocumentPermissionLevel; grantedBy: string; createdAt: Date; updatedAt: Date; } interface OperationUserPermissionTable { id: Generated; documentId: string; operationType: string; userAddress: string; grantedBy: string; createdAt: Date; } type Db = Kysely; /** * Optional factory used by callers (e.g. Switchboard) to inject a * version-specific PGLite instance — e.g. `pglite-legacy-02` when an existing * data dir was created with an older PG major. Wire-compatible with the * current PGLite class for the surface knex-pglite uses. */ type PgliteFactory = (connectionString: string | undefined) => PGlite; interface DbClient { db: Db; knex: Knex; pglite: PGlite | undefined; } declare function getDbClient(connectionString?: string | undefined, pgliteFactory?: PgliteFactory): DbClient; declare const initAnalyticsStoreSql: string[]; //#endregion //#region src/services/document-permission.service.d.ts interface DocumentPermissionEntry { documentId: string; userAddress: string; permission: DocumentPermissionLevel; grantedBy: string; createdAt: Date; updatedAt: Date; } interface OperationUserPermissionEntry { documentId: string; operationType: string; userAddress: string; grantedBy: string; createdAt: Date; } /** * Function type for getting parent document IDs * This is injected to avoid circular dependencies with the reactor client */ type GetParentIdsFn = (documentId: string) => Promise; /** * Configuration for the DocumentPermissionService */ interface DocumentPermissionConfig { defaultProtection: boolean; } /** * Service for managing document-level permissions. * * Permission levels for documents: * - READ: Can fetch and read the document * - WRITE: Can push updates and modify the document * - ADMIN: Can manage document permissions and settings * * Operation permissions: * - Users can be granted permission to execute specific operations */ declare class DocumentPermissionService { private readonly db; readonly config: DocumentPermissionConfig; constructor(db: Kysely, config?: DocumentPermissionConfig); /** * Get the permission level for a user on a specific document. * Returns null if no permission is set. */ getUserPermission(documentId: string, userAddress: string): Promise; /** * Get all permissions for a document */ getDocumentPermissions(documentId: string): Promise; /** * Get all documents a user has explicit access to */ getUserDocuments(userAddress: string): Promise; /** * Grant or update a user's permission on a document. */ grantPermission(documentId: string, userAddress: string, permission: DocumentPermissionLevel, grantedBy: string): Promise; /** * Revoke a user's permission on a document */ revokePermission(documentId: string, userAddress: string): Promise; /** * Delete all permissions for a document (used when deleting a document) */ deleteAllDocumentPermissions(documentId: string): Promise; /** * Grant a user permission to execute an operation on a document */ grantOperationPermission(documentId: string, operationType: string, userAddress: string, grantedBy: string): Promise; /** * Revoke a user's permission to execute an operation */ revokeOperationPermission(documentId: string, operationType: string, userAddress: string): Promise; /** * Get all users with permission to execute an operation */ getOperationUserPermissions(documentId: string, operationType: string): Promise; /** * Whether an operation-permission row exists for the user on this operation. */ hasOperationGrant(documentId: string, operationType: string, userAddress: string): Promise; /** * Check if an operation has any permissions set (is restricted) */ isOperationRestricted(documentId: string, operationType: string): Promise; /** * Check if a specific document has a protection row set to true. * Falls back to `config.defaultProtection` if no row exists. */ isDocumentProtected(documentId: string): Promise; /** * Walk the parent chain: if the document itself or any ancestor is protected, return true. * Collects all ancestor IDs first (with cycle detection), then batch-checks protection. */ isProtectedWithAncestors(documentId: string, getParentIds: GetParentIdsFn): Promise; /** * Collect all ancestor IDs (including the document itself) with cycle detection. */ private collectAncestorIds; /** * Upsert protection status for a document. */ setDocumentProtection(documentId: string, isProtected: boolean): Promise; /** * Get the owner address for a document, or null if not set. */ getDocumentOwner(documentId: string): Promise; /** * Upsert owner address for a document. */ setDocumentOwner(documentId: string, ownerAddress: string): Promise; /** * Initialize protection for a newly created document. * Sets protection status and grants ADMIN to the owner. */ initializeDocumentProtection(documentId: string, ownerAddress: string, defaultProtection?: boolean): Promise; /** * Get the full protection info for a document. */ getDocumentProtection(documentId: string): Promise<{ documentId: string; protected: boolean; ownerAddress: string | null; }>; } //#endregion //#region src/services/authorization.service.d.ts /** * A document id that has been resolved to its canonical form, never a slug. * * Protection and grant rows are written under the canonical id, while the * read/operation data paths accept an id-or-slug identifier. The decision layer * must key on the canonical id, so branding it forces every caller to resolve a * slug to its id before consulting this service, closing the slug-aliasing * bypass (S-C1). The only sanctioned cast from string to CanonicalDocumentId * lives in the BaseSubgraph resolution helpers, immediately after the shared * resolveIdOrSlug lookup returns. */ type CanonicalDocumentId = string & { readonly __canonicalDocumentId: unique symbol; }; /** * Result of a passed per-document authorization check. `fetchIdentifier` is * always safe for the data fetch: the canonical id when resolved, or the raw * identifier when the check was skipped for a policy-wide caller. */ declare class AuthorizedDocumentHandle { readonly fetchIdentifier: string; readonly isResolved: boolean; private constructor(); static resolved(documentId: CanonicalDocumentId): AuthorizedDocumentHandle; static skipped(identifier: string): AuthorizedDocumentHandle; /** The verified canonical id; throws when resolution was skipped. */ canonicalId(): CanonicalDocumentId; } declare const AuthorizationPolicy: { readonly OPEN: "OPEN"; readonly ADMIN_ONLY: "ADMIN_ONLY"; readonly DOCUMENT_PERMISSIONS: "DOCUMENT_PERMISSIONS"; }; type AuthorizationPolicy = (typeof AuthorizationPolicy)[keyof typeof AuthorizationPolicy]; interface AuthorizationConfig { admins: string[]; defaultProtection: boolean; policy: AuthorizationPolicy; } /** * Single source of truth for every permission decision. Always present (never * null) so callers branch on data, not on the existence of a service. * * The policy selects an implementation once at boot: * - OPEN: authentication disabled — everyone (incl. anonymous) is allowed. * - ADMIN_ONLY: authentication on, document permissions off — only ADMINS. * - DOCUMENT_PERMISSIONS: the full per-document protection + grant model. * * Permission inheritance walks the parent-document hierarchy through a * parent resolver injected at construction; callers never supply one. */ interface IAuthorizationService { readonly config: AuthorizationConfig; /** * Whether the user has unrestricted, policy-wide access. Under OPEN this is * true for everyone (including anonymous callers) by design: OPEN means "no * restrictions", and consumers use this check to skip per-document * filtering. It does NOT mean the caller is in the ADMINS list. */ isSupremeAdmin(userAddress?: string): boolean; /** * Whether the user may create new documents under the current policy: * everyone in OPEN, only admins in ADMIN_ONLY, any authenticated user in * DOCUMENT_PERMISSIONS. */ canCreate(userAddress?: string): boolean; canRead(documentId: CanonicalDocumentId, userAddress?: string): Promise; canWrite(documentId: CanonicalDocumentId, userAddress?: string): Promise; /** * Whether the user administers the document: supreme admin, document * owner, or holder of an ADMIN grant. */ canManage(documentId: CanonicalDocumentId, userAddress?: string): Promise; canMutate(documentId: CanonicalDocumentId, operationType: string, userAddress?: string): Promise; } //#endregion //#region src/graphql/types.d.ts type SubgraphClass = typeof BaseSubgraph; type Context = { driveId?: string; document?: PHDocument; headers: IncomingHttpHeaders; db: unknown; user?: { address: string; chainId: number; networkId: string; }; }; type ISubgraph = { name: string; path?: string; resolvers: Record; typeDefs: DocumentNode; reactorClient: IReactorClient; relationalDb: IRelationalDb; hasSubscriptions?: boolean; onSetup?: () => Promise; }; type SubgraphArgs = { reactorClient: IReactorClient; relationalDb: IRelationalDb; analyticsStore: IAnalyticsStore; graphqlManager: GraphQLManager$1; syncManager: ISyncManager; documentPermissionService?: DocumentPermissionService; authorizationService: IAuthorizationService; path?: string; }; type GqlSigner = { user: { address: string; networkId: string; chainId: number; }; app: { name: string; key: string; }; signatures: string[]; }; type GqlOperationContext = { signer: GqlSigner | undefined; }; type GqlSignerUser = { address: string; networkId: string; chainId: number; }; type GqlSignerApp = { name: string; key: string; }; type GqlOperation = { id: string; type: string; index: number; timestampUtcMs: string; hash: string; skip: number; inputText: string; error: string | undefined; context: GqlOperationContext; }; type GqlDocument = { __typename?: string; id: string; name: string; documentType: string; revision: number; createdAtUtcIso: string; lastModifiedAtUtcIso: string; operations: GqlOperation[]; stateJSON: JSON; state: unknown; initialState: unknown; }; type GqlDriveDocument = GqlDocument & { meta: { preferredEditor?: string; }; slug: string; state: DocumentDriveGlobalState; initialState: DocumentDriveGlobalState; }; //#endregion //#region src/graphql/base-subgraph.d.ts declare class BaseSubgraph implements ISubgraph$1 { #private; name: string; path: string; resolvers: Record; typeDefs: DocumentNode; reactorClient: IReactorClient; graphqlManager: GraphQLManager$1; relationalDb: IRelationalDb; syncManager: ISyncManager; documentPermissionService?: DocumentPermissionService; authorizationService: IAuthorizationService; constructor(args: SubgraphArgs$1); onSetup(): Promise; /** * Resolves a caller-supplied identifier (id or slug) to its canonical * document id, memoized per request. Both the decision layer and the data * layer must agree on the subject, so this runs the same resolveIdOrSlug * lookup the data path uses. A resolution failure (not found, ambiguous, or * transient) surfaces as a generic Forbidden, fail-closed, so a bad * identifier cannot be used as a document-existence oracle. */ resolveCanonicalDocumentId(identifier: string, requestKey: object): Promise; /** * Resolves the args' `documentId` to canonical form. Unconditional (unlike the * assertCan* helpers, no admin skip): ACL rows are keyed on the canonical id. */ withCanonicalDocumentId(args: T, requestKey: object): Promise; /** * Read filter for an already-canonical document id (one sourced from the data * layer, such as a fetched document's id). Performs no slug resolution. */ canReadDocument(documentId: CanonicalDocumentId, ctx: Context): Promise; /** * Asserts read access, resolving a slug first. Returns a handle whose * `fetchIdentifier` the caller reuses for the data fetch; a denial throws. */ assertCanRead(identifier: string, ctx: Context): Promise; assertCanWrite(identifier: string, ctx: Context): Promise; assertCanExecuteOperation(identifier: string, operationType: string, ctx: Context): Promise; /** * Read assertion for an already-canonical document id. No slug resolution; * use only with ids sourced from the data layer or already resolved. */ assertCanReadCanonical(documentId: CanonicalDocumentId, ctx: Context): Promise; assertCanWriteCanonical(documentId: CanonicalDocumentId, ctx: Context): Promise; assertCanExecuteOperationCanonical(documentId: CanonicalDocumentId, operationType: string, ctx: Context): Promise; assertCanCreate(ctx: Context): void; } //#endregion //#region src/graphql/analytics-subgraph.d.ts declare class AnalyticsSubgraph extends BaseSubgraph { analyticsStore: IAnalyticsStore; analyticsModel: AnalyticsModel; name: string; typeDefs: graphql.DocumentNode; resolvers: GraphQLResolverMap; constructor(args: SubgraphArgs$1); } //#endregion //#region src/graphql/auth/resolvers.d.ts type DocumentAccessInfo = { documentId: string; permissions: Array<{ documentId: string; userAddress: string; permission: DocumentPermissionLevel; grantedBy: string; createdAt: Date; updatedAt: Date; }>; }; type OperationUserPermission = { documentId: string; operationType: string; userAddress: string; grantedBy: string; createdAt: Date; }; type OperationPermissionsInfo = { documentId: string; operationType: string; userPermissions: OperationUserPermission[]; }; type DocumentProtectionInfo = { documentId: string; protected: boolean; ownerAddress: string | null; }; //#endregion //#region src/graphql/auth/subgraph.d.ts /** * Auth Subgraph - handles all document permission and authorization operations * * This subgraph is conditionally registered based on the DOCUMENT_PERMISSIONS_ENABLED * feature flag. When enabled, it provides GraphQL operations for: * - Document permissions (grant/revoke user access) * - Document protection and ownership * - Operation-level permissions (fine-grained operation control) */ declare class AuthSubgraph extends BaseSubgraph { private logger; constructor(args: SubgraphArgs); name: string; hasSubscriptions: boolean; typeDefs: graphql.DocumentNode; resolvers: { Query: { documentAccess: (_parent: unknown, args: { documentId: string; }, ctx: { user?: { address: string; }; }) => Promise; userDocumentPermissions: (_parent: unknown, _args: unknown, ctx: { user?: { address: string; }; }) => Promise<{ documentId: string; userAddress: string; permission: DocumentPermissionLevel; grantedBy: string; createdAt: Date; updatedAt: Date; }[]>; operationPermissions: (_parent: unknown, args: { documentId: string; operationType: string; }, ctx: { user?: { address: string; }; }) => Promise; canExecuteOperation: (_parent: unknown, args: { documentId: string; operationType: string; }, ctx: { user?: { address: string; }; }) => Promise; documentProtection: (_parent: unknown, args: { documentId: string; }, ctx: { user?: { address: string; }; }) => Promise; }; Mutation: { setDocumentProtection: (_parent: unknown, args: { documentId: string; protected: boolean; }, ctx: { user?: { address: string; }; }) => Promise; transferDocumentOwnership: (_parent: unknown, args: { documentId: string; newOwnerAddress: string; }, ctx: { user?: { address: string; }; }) => Promise; grantDocumentPermission: (_parent: unknown, args: { documentId: string; userAddress: string; permission: string; }, ctx: { user?: { address: string; }; }) => Promise<{ documentId: string; userAddress: string; permission: DocumentPermissionLevel; grantedBy: string; createdAt: Date; updatedAt: Date; }>; revokeDocumentPermission: (_parent: unknown, args: { documentId: string; userAddress: string; }, ctx: { user?: { address: string; }; }) => Promise; grantOperationPermission: (_parent: unknown, args: { documentId: string; operationType: string; userAddress: string; }, ctx: { user?: { address: string; }; }) => Promise; revokeOperationPermission: (_parent: unknown, args: { documentId: string; operationType: string; userAddress: string; }, ctx: { user?: { address: string; }; }) => Promise; }; }; onSetup(): Promise; } //#endregion //#region src/services/auth.service.d.ts interface AuthConfig { enabled: boolean; admins: string[]; skipCredentialVerification?: boolean; credentialVerificationCacheTtlMs?: number; } interface User { address: string; chainId: number; networkId: string; } interface AuthContext { user?: User; admins: string[]; auth_enabled: boolean; } declare class AuthService { private readonly config; private readonly credentialCache; constructor(config: AuthConfig); authenticateRequest(request: globalThis.Request): Promise; /** * Verify a Bearer token regardless of HTTP method. Use this from non-GraphQL * middleware that must enforce authentication on every request. */ verifyBearer(authorization: string | undefined): Promise; authenticateWebSocketConnection(connectionParams: Record): Promise; /** * Verify the auth bearer token */ private verifyToken; /** * Extract user information from verification result */ private extractUserFromVerification; /** * Verify that the credential still exists on the Renown API. * * Results are cached per (address, chainId, issuer) for a short TTL so the * blocking external round-trip is not paid on every request. Concurrent * checks for the same key share a single in-flight request, and entries * that resolve to false are evicted immediately so failed or revoked * credentials are re-checked on the next request. */ private verifyCredentialExists; /** * Enforce the cache size cap before inserting a new entry: drop expired * entries first, then evict oldest-inserted entries (insertion order * matches expiry order since the TTL is constant) until under the cap, so * a flood of distinct keys cannot grow the map without bound. */ private pruneCredentialCache; /** * Fetch the credential from the Renown API and validate it against the * expected address, chainId and issuer. Never throws; returns false on any * network or validation failure. */ private fetchCredentialExists; } //#endregion //#region src/graphql/gateway/types.d.ts type TlsOptions = { keyPath: string; certPath: string; } | { cert: Buffer | string; key: Buffer | string; } | true; type GatewayContextFactory = (request: Request) => Promise; type WsContextFactory = (connectionParams: Record) => Promise; type WsDisposer = { dispose: () => void | Promise; }; type FetchHandler = (request: Request) => Promise; /** * A framework-agnostic description of a federated subgraph service. * Used by IGatewayAdapter.createSupergraphHandler() to compose the supergraph SDL. */ type SubgraphDefinition = { name: string; typeDefs: DocumentNode; url: string; }; interface IGatewayAdapter { /** One-time startup. */ start(httpServer: http.Server): Promise; /** * Returns a Fetch API handler for the given schema. * Caller (IHttpAdapter) is responsible for mounting it at a path. */ createHandler(schema: GraphQLSchema, contextFactory: GatewayContextFactory): Promise; /** * Create a federation gateway handler that composes all subgraphs into a supergraph. * getSubgraphs is called eagerly (during setup) and again on every updateSupergraph() call. */ createSupergraphHandler(getSubgraphs: () => SubgraphDefinition[], httpServer: http.Server, contextFactory: GatewayContextFactory): Promise; /** * Recompose the supergraph SDL from the current subgraph list and push the update * to the running federation gateway. No-op if createSupergraphHandler() has not * been called yet. */ updateSupergraph(): Promise; /** Attach WebSocket subscriptions. Returns a disposer. */ attachWebSocket(wsServer: WebSocketServer, schema: GraphQLSchema, contextFactory: WsContextFactory): WsDisposer; stop(): Promise; } interface IHttpAdapter { /** Set up CORS and body-parser equivalent middleware. */ setupMiddleware(config: { corsOptions?: CorsOptions; bodyLimit?: string; }): void; /** * Mount a Fetch API handler. * - exact = false (default): exact path match via internal dispatch map. * - exact = true: prefix match - handler also receives all sub-paths * (uses framework router.use() semantics). */ mount(path: string, handler: FetchHandler, options?: { exact?: boolean; }): void; /** * Register a GET route that returns a Fetch Response (for health, explorer, etc.). * Registered directly on the underlying framework app, bypassing the sub-router. */ getRoute(path: string, handler: (request: Request) => Response | Promise): void; /** * Start listening on the given port. Returns the underlying http.Server * so callers can attach WebSocket servers. */ listen(port: number, tls?: TlsOptions): Promise; /** * Mount a raw Connect/Express-compatible middleware function (e.g. Vite dev * server middleware). The implementation is adapter-specific; for Express this * is equivalent to `app.use(middleware)`. */ mountRawMiddleware(middleware: unknown): void; /** * Register a method-specific route handler using Node.js core HTTP types. * Use this when a Fetch API FetchHandler is not possible (e.g. streaming * protocols that require direct access to IncomingMessage/ServerResponse). * * The req/res objects are `http.IncomingMessage`/`http.ServerResponse` * (Express Request/Response are compatible subtypes). */ mountNodeRoute(method: "DELETE" | "GET" | "HEAD" | "POST" | "PUT", path: string, handler: (req: http.IncomingMessage, res: http.ServerResponse, body?: unknown) => void | Promise): void; /** * Register framework-specific Sentry error-capturing middleware after all routes * are mounted. Each adapter calls the Sentry setup function appropriate for its * framework (e.g. setupExpressErrorHandler, setupFastifyErrorHandler). * No-op if Sentry is not relevant for the adapter. */ setupSentryErrorHandler(sentry: object): void; /** The raw framework handle (e.g. Express app). Cast as needed at call sites. */ readonly handle: unknown; } //#endregion //#region src/graphql/gateway/auth-middleware.d.ts type AuthFetchMiddleware = (handler: FetchHandler) => FetchHandler; /** Internal — only `graphql-manager.ts` should call this. */ declare function getAuthContext(request: globalThis.Request): AuthContext | undefined; declare function createAuthFetchMiddleware(authService: AuthService): AuthFetchMiddleware; //#endregion //#region src/graphql/gateway/factory.d.ts type GatewayAdapterType = "apollo" | "mercurius"; type HttpAdapterType = "express" | "fastify"; declare function createGatewayAdapter(type: GatewayAdapterType, logger: ILogger): Promise>; type HttpAdapterSetup = { adapter: IHttpAdapter; }; declare function createHttpAdapter(type: HttpAdapterType): Promise; //#endregion //#region src/graphql/gateway/drive-ownership-cache.d.ts /** * In-memory record of which drives this switchboard instance owns. * * Populated at startup by walking the reactor for documents whose type is * listed in `DEFAULT_DRIVE_CONTAINER_TYPES` (both legacy `document-drive` * and `reactor-drive`). Mutated explicitly by resolver hooks after * successful drive create / delete operations. Read by the drive-validation * fetch middleware to short-circuit wrong-shard requests with a structured * 421 response. */ declare class DriveOwnershipCache { private readonly reactorClient; private readonly drives; constructor(reactorClient: IReactorClient); init(): Promise; has(driveId: string): boolean; add(driveId: string): void; remove(driveId: string): void; size(): number; } //#endregion //#region src/graphql/graphql-manager.d.ts type GraphqlManagerFeatureFlags = { enableDocumentModelSubgraphs?: boolean; }; declare class GraphQLManager { #private; private readonly path; private readonly httpServer; private readonly wsServer; private readonly reactorClient; private readonly relationalDb; private readonly analyticsStore; private readonly syncManager; private readonly logger; private readonly httpAdapter; private readonly gatewayAdapter; private readonly authService?; private readonly documentPermissionService?; private readonly featureFlags; private readonly port; private initialized; private coreSubgraphsMap; private contextFields; private readonly subgraphs; private readonly subgraphWsDisposers; readonly driveOwnershipCache: DriveOwnershipCache; /** Cached document models for schema generation - updated on init and regenerate */ private cachedDocumentModels; private readonly subgraphHandlerCache; /** * Optional reactor-drive client. When the switchboard is configured with a * reactor-drive container, this is provided and the resolvers dispatch to * it for reactor-drive parents. */ readonly reactorDriveClient?: IDriveClient; private readonly authorizationService; constructor(path: string, httpServer: http.Server, wsServer: WebSocketServer, reactorClient: IReactorClient, relationalDb: IRelationalDb, analyticsStore: IAnalyticsStore, syncManager: ISyncManager, logger: ILogger, httpAdapter: IHttpAdapter, gatewayAdapter: IGatewayAdapter, authService?: AuthService | undefined, documentPermissionService?: DocumentPermissionService | undefined, featureFlags?: GraphqlManagerFeatureFlags, port?: number, authorizationService?: IAuthorizationService, reactorDriveClient?: IDriveClient); init(coreSubgraphs: SubgraphClass$1[], authMiddleware?: AuthFetchMiddleware): Promise; /** * Regenerate document model subgraphs when models are dynamically loaded. * Fetches current modules from reactor client (source of truth). */ regenerateDocumentModelSubgraphs(): Promise; /** * Register a pre-constructed subgraph instance. * Use this when you need to pass custom dependencies to a subgraph. */ registerSubgraphInstance(subgraphInstance: ISubgraph$1, supergraph?: string, core?: boolean): Promise; /** * Get the base path used for subgraph registration. */ getBasePath(): string; /** * Get the authorization service shared with subgraphs. Use this when * constructing a subgraph instance externally for * {@link registerSubgraphInstance}. */ getAuthorizationService(): IAuthorizationService; registerSubgraph(subgraph: SubgraphClass$1, supergraph?: string, core?: boolean): Promise; updateRouter: (immediate?: boolean) => Promise; private _updateRouter; getAdditionalContextFields: () => Record; setAdditionalContextFields(fields: Record): void; setSupergraph(supergraph: string, subgraphs: ISubgraph$1[]): Promise; shutdown(): Promise; } //#endregion //#region src/services/package-storage.d.ts interface InstalledPackageInfo { name: string; version?: string; registryUrl: string; installedAt: Date; documentTypes: string[]; } interface IPackageStorage { get(name: string): Promise; getAll(): Promise; set(name: string, info: InstalledPackageInfo): Promise; delete(name: string): Promise; has(name: string): Promise; } declare class InMemoryPackageStorage implements IPackageStorage { private packages; get(name: string): Promise; getAll(): Promise; set(name: string, info: InstalledPackageInfo): Promise; delete(name: string): Promise; has(name: string): Promise; } //#endregion //#region src/types.d.ts interface IReactorProcessorHostModule extends IProcessorHostModule { client: IReactorClient; attachments: IAttachmentClient; } type ReadinessGate = { isReady: () => boolean; markReady: () => void; }; type API = { httpAdapter: IHttpAdapter; graphqlManager: GraphQLManager$1; packages: IPackageManager; attachments: AttachmentBuildResult; authService: AuthService | undefined; /** * Releases resources owned by the API: shuts down the GraphQL gateway, * closes WebSocket and HTTP servers, destroys knex pools, and closes any * PGlite instances created via {@link getDbClient}. Safe to call once; * intended to be wired into the reactor's shutdown chain via * `ReactorBuilder.withShutdownHook`. */ dispose: () => Promise; }; type ReactorModule = { analyticsStore: IAnalyticsStore; relationalDb: IRelationalDb$1; }; /** Per-drive factory after the host `module` has been applied once. */ type ProcessorDriveFactory = (driveHeader: PHDocumentHeader) => ProcessorRecord[] | Promise; /** * Builds a per-drive factory from the host module (e.g. vetra `processorFactory`). * Shape: `(module) => (driveHeader) => ...` */ type ProcessorFactoryBuilder = (module: IProcessorHostModule) => ProcessorDriveFactory | Promise; /** Multiple initializers per package name (e.g. Switchboard `processors` option). */ type Processor = ProcessorFactoryBuilder[]; //#endregion //#region src/packages/http-loader.d.ts interface HttpPackageLoaderOptions { registryUrl: string; } interface HttpPackageLoaderLogger { info: (msg: string) => void; error: (msg: string, err: unknown) => void; } type SubgraphsExport = Record; /** * Extract subgraph classes from the imported subgraphs/index.mjs module shape. * * The published bundle uses `export * as Foo from "./file"`, which Node turns * into `{ Foo: , … }`. The inner namespace's keys come from the * source file's named exports — typically `Subgraph` / `default` / the class * name itself — so the shape varies. Flatten one level and keep callables. * * Exported for direct unit testing against synthetic module shapes. */ declare function extractSubgraphsFromModule(module: Record): SubgraphClass$1[]; /** * Loads document models, subgraphs, and processors from an HTTP registry. * Uses Node.js module loader hooks to import directly from HTTP URLs. * * IMPORTANT: Requires https-hooks to be registered before use: * import { register } from "node:module"; * register("@powerhousedao/reactor-api/https-hooks", import.meta.url); */ declare class HttpPackageLoader implements IPackageLoader { private readonly registryUrl; private readonly logger; readonly name = "HttpPackageLoader"; readonly documentModelLoader: HttpDocumentModelLoader; constructor(options: HttpPackageLoaderOptions); /** * Load document models from a package in the HTTP registry. * Imports directly from HTTP URL using Node.js loader hooks. */ /** * Parse a package specifier like "@scope/pkg@tag" into name and optional tag. */ private parsePackageSpec; loadDocumentModels(packageSpec: string): Promise; loadSubgraphs(packageSpec: string): Promise; loadProcessors(packageSpec: string): Promise; /** * Load document models from multiple packages. * Continues loading even if some packages fail. */ loadPackages(packageNames: string[], logger?: HttpPackageLoaderLogger): Promise; private isValidPackageName; } declare class HttpDocumentModelLoader implements IDocumentModelLoader { private readonly loader; private readonly logger; private readonly documentTypeCache; private readonly packageModulesCache; private onModelLoaded?; constructor(loader: HttpPackageLoader); setOnModelLoaded(callback: (model: DocumentModelModule) => void): void; clearCache(): void; load(documentType: string): Promise; private findPackageByDocumentType; getLoadedPackages(): string[]; getPackageModules(packageName: string): DocumentModelModule[] | undefined; removeFromCache(packageName: string): void; } //#endregion //#region src/services/package-management.service.d.ts interface InstallPackageResult { package: InstalledPackageInfo; documentModelsLoaded: number; } interface PackageManagementServiceOptions { storage?: IPackageStorage; defaultRegistryUrl?: string; httpLoader?: HttpPackageLoader; documentModelRegistry?: IDocumentModelRegistry; } declare class PackageManagementService { private readonly storage; private readonly defaultRegistryUrl?; private readonly httpLoader?; private readonly documentModelRegistry?; private readonly logger; private onModelsChanged?; private loadedModulesCache; constructor(options?: PackageManagementServiceOptions); setOnModelsChanged(callback: (models: DocumentModelModule[]) => void): void; installPackage(name: string, registryUrl?: string): Promise; uninstallPackage(name: string): Promise; getInstalledPackages(): Promise; getInstalledPackage(name: string): Promise; getAllLoadedModules(): DocumentModelModule[]; private triggerModelsChanged; } //#endregion //#region src/graphql/packages/subgraph.d.ts interface PackagesSubgraphArgs extends SubgraphArgs { packageManagementService: PackageManagementService; } declare class PackagesSubgraph extends BaseSubgraph { private logger; private packageManagementService; constructor(args: PackagesSubgraphArgs); name: string; hasSubscriptions: boolean; typeDefs: graphql.DocumentNode; resolvers: { Query: { Packages: () => {}; }; PackagesQueries: { installedPackages: () => Promise<{ name: string; version: string | null; registryUrl: string; installedAt: string; documentTypes: string[]; }[]>; installedPackage: (_parent: unknown, args: { name: string; }) => Promise<{ name: string; version: string | null; registryUrl: string; installedAt: string; documentTypes: string[]; } | null>; }; Mutation: { Packages: () => {}; }; PackagesMutations: { installPackage: (_parent: unknown, args: { name: string; registryUrl?: string | null; }, ctx: Context) => Promise<{ package: ReturnType<(info: InstalledPackageInfo) => { name: string; version: string | null; registryUrl: string; installedAt: string; documentTypes: string[]; }>; documentModelsLoaded: number; }>; uninstallPackage: (_parent: unknown, args: { name: string; }, ctx: Context) => Promise; }; }; onSetup(): Promise; } //#endregion //#region src/graphql/playground.d.ts declare function renderGraphqlPlayground(url: string, query?: string, headers?: Record): string; //#endregion //#region src/graphql/reactor/gen/graphql.d.ts type Maybe = T | null | undefined; type InputMaybe = T | null | undefined; type Exact = { [K in keyof T]: T[K] }; type MakeOptional = Omit & { [SubKey in K]?: Maybe }; type MakeMaybe = Omit & { [SubKey in K]: Maybe }; type MakeEmpty = { [_ in K]?: never }; type Incremental = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never }; type RequireFields = Omit & { [P in K]-?: NonNullable }; /** All built-in and custom scalars, mapped to their actual values */ type Scalars = { ID: { input: string; output: string; }; String: { input: string; output: string; }; Boolean: { input: boolean; output: boolean; }; Int: { input: number; output: number; }; Float: { input: number; output: number; }; DateTime: { input: string | Date; output: string | Date; }; JSONObject: { input: NonNullable; output: NonNullable; }; }; type Action = { readonly context?: Maybe; readonly id: Scalars["String"]["output"]; readonly input: Scalars["JSONObject"]["output"]; readonly scope: Scalars["String"]["output"]; readonly timestampUtcMs: Scalars["String"]["output"]; readonly type: Scalars["String"]["output"]; }; type ActionContext = { readonly signer?: Maybe; }; type ActionContextInput = { readonly signer?: InputMaybe; }; type ActionInput = { readonly context?: InputMaybe; readonly id: Scalars["String"]["input"]; readonly input: Scalars["JSONObject"]["input"]; readonly scope: Scalars["String"]["input"]; readonly timestampUtcMs: Scalars["String"]["input"]; readonly type: Scalars["String"]["input"]; }; type ChannelMeta = { readonly id: Scalars["String"]["output"]; }; type ChannelMetaInput = { readonly id: Scalars["String"]["input"]; }; type DeadLetterInfo = { readonly branch: Scalars["String"]["output"]; readonly documentId: Scalars["String"]["output"]; readonly error: Scalars["String"]["output"]; readonly jobId: Scalars["String"]["output"]; readonly operationCount: Scalars["Int"]["output"]; readonly scopes: ReadonlyArray; }; type DocumentChangeContext = { readonly childId?: Maybe; readonly parentId?: Maybe; }; type DocumentChangeEvent = { readonly context?: Maybe; readonly documents: ReadonlyArray; readonly type: DocumentChangeType; }; declare enum DocumentChangeType { ChildAdded = "CHILD_ADDED", ChildRemoved = "CHILD_REMOVED", Created = "CREATED", Deleted = "DELETED", ParentAdded = "PARENT_ADDED", ParentRemoved = "PARENT_REMOVED", Updated = "UPDATED" } type DocumentModelGlobalState = { readonly id: Scalars["String"]["output"]; readonly name: Scalars["String"]["output"]; readonly namespace?: Maybe; readonly specification: Scalars["JSONObject"]["output"]; readonly version?: Maybe; }; type DocumentModelResultPage = { readonly cursor?: Maybe; readonly hasNextPage: Scalars["Boolean"]["output"]; readonly hasPreviousPage: Scalars["Boolean"]["output"]; readonly items: ReadonlyArray; readonly totalCount: Scalars["Int"]["output"]; }; type DocumentOperationsFilterInput = { readonly actionTypes?: InputMaybe>; readonly branch?: InputMaybe; readonly scopes?: InputMaybe>; readonly sinceRevision?: InputMaybe; readonly timestampFrom?: InputMaybe; readonly timestampTo?: InputMaybe; }; type DocumentWithChildren = { readonly childIds: ReadonlyArray; readonly document: PhDocument; }; type JobChangeEvent = { readonly error?: Maybe; readonly jobId: Scalars["String"]["output"]; readonly result: Scalars["JSONObject"]["output"]; readonly status: Scalars["String"]["output"]; }; type JobInfo = { readonly completedAt?: Maybe; readonly createdAt: Scalars["DateTime"]["output"]; readonly error?: Maybe; readonly id: Scalars["String"]["output"]; readonly result: Scalars["JSONObject"]["output"]; readonly status: Scalars["String"]["output"]; }; type MoveRelationshipResult = { readonly source: PhDocument; readonly target: PhDocument; }; type Mutation = { readonly addRelationship: PhDocument; readonly createDocument: PhDocument; readonly createEmptyDocument: PhDocument; readonly deleteDocument: Scalars["Boolean"]["output"]; readonly deleteDocuments: Scalars["Boolean"]["output"]; readonly moveRelationship: MoveRelationshipResult; readonly mutateDocument: PhDocument; readonly mutateDocumentAsync: Scalars["String"]["output"]; readonly pushSyncEnvelopes: Scalars["Boolean"]["output"]; readonly removeRelationship: PhDocument; readonly renameDocument: PhDocument; readonly setPreferredEditor: PhDocument; readonly touchChannel: TouchChannelResult; }; type MutationAddRelationshipArgs = { branch?: InputMaybe; relationshipType: Scalars["String"]["input"]; sourceIdentifier: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; }; type MutationCreateDocumentArgs = { document: Scalars["JSONObject"]["input"]; parentIdentifier?: InputMaybe; }; type MutationCreateEmptyDocumentArgs = { documentType: Scalars["String"]["input"]; parentIdentifier?: InputMaybe; }; type MutationDeleteDocumentArgs = { identifier: Scalars["String"]["input"]; propagate?: InputMaybe; }; type MutationDeleteDocumentsArgs = { identifiers: ReadonlyArray; propagate?: InputMaybe; }; type MutationMoveRelationshipArgs = { branch?: InputMaybe; relationshipType: Scalars["String"]["input"]; sourceParentIdentifier: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; targetParentIdentifier: Scalars["String"]["input"]; }; type MutationMutateDocumentArgs = { actions: ReadonlyArray; documentIdentifier: Scalars["String"]["input"]; view?: InputMaybe; }; type MutationMutateDocumentAsyncArgs = { actions: ReadonlyArray; documentIdentifier: Scalars["String"]["input"]; view?: InputMaybe; }; type MutationPushSyncEnvelopesArgs = { envelopes: ReadonlyArray; }; type MutationRemoveRelationshipArgs = { branch?: InputMaybe; relationshipType: Scalars["String"]["input"]; sourceIdentifier: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; }; type MutationRenameDocumentArgs = { branch?: InputMaybe; documentIdentifier: Scalars["String"]["input"]; name: Scalars["String"]["input"]; }; type MutationSetPreferredEditorArgs = { branch?: InputMaybe; documentIdentifier: Scalars["String"]["input"]; preferredEditor?: InputMaybe; }; type MutationTouchChannelArgs = { input: TouchChannelInput; }; type OperationContext = { readonly branch: Scalars["String"]["output"]; readonly documentId: Scalars["String"]["output"]; readonly documentType: Scalars["String"]["output"]; readonly ordinal: Scalars["Int"]["output"]; readonly scope: Scalars["String"]["output"]; }; type OperationContextInput = { readonly branch: Scalars["String"]["input"]; readonly documentId: Scalars["String"]["input"]; readonly documentType: Scalars["String"]["input"]; readonly ordinal: Scalars["Int"]["input"]; readonly scope: Scalars["String"]["input"]; }; type OperationInput = { readonly action: ActionInput; readonly error?: InputMaybe; readonly hash: Scalars["String"]["input"]; readonly id?: InputMaybe; readonly index: Scalars["Int"]["input"]; readonly skip: Scalars["Int"]["input"]; readonly timestampUtcMs: Scalars["String"]["input"]; }; type OperationWithContext = { readonly context: OperationContext; readonly operation: ReactorOperation; }; type OperationWithContextInput = { readonly context: OperationContextInput; readonly operation: OperationInput; }; type OperationsFilterInput = { readonly actionTypes?: InputMaybe>; readonly branch?: InputMaybe; readonly documentId: Scalars["String"]["input"]; readonly scopes?: InputMaybe>; readonly sinceRevision?: InputMaybe; readonly timestampFrom?: InputMaybe; readonly timestampTo?: InputMaybe; }; type PhDocument = { readonly createdAtUtcIso: Scalars["DateTime"]["output"]; readonly documentType: Scalars["String"]["output"]; readonly id: Scalars["String"]["output"]; readonly lastModifiedAtUtcIso: Scalars["DateTime"]["output"]; readonly name: Scalars["String"]["output"]; readonly operations?: Maybe; readonly preferredEditor?: Maybe; readonly revisionsList: ReadonlyArray; readonly slug?: Maybe; readonly state: Scalars["JSONObject"]["output"]; }; type PhDocumentOperationsArgs = { filter?: InputMaybe; paging?: InputMaybe; }; type PhDocumentResultPage = { readonly cursor?: Maybe; readonly hasNextPage: Scalars["Boolean"]["output"]; readonly hasPreviousPage: Scalars["Boolean"]["output"]; readonly items: ReadonlyArray; readonly totalCount: Scalars["Int"]["output"]; }; type PagingInput = { readonly cursor?: InputMaybe; readonly limit?: InputMaybe; readonly offset?: InputMaybe; }; type PollSyncEnvelopesResult = { readonly ackOrdinal: Scalars["Int"]["output"]; readonly deadLetters: ReadonlyArray; readonly envelopes: ReadonlyArray; readonly hasMore: Scalars["Boolean"]["output"]; }; declare enum PropagationMode { Cascade = "CASCADE", Orphan = "ORPHAN" } type Query = { readonly document?: Maybe; readonly documentIncomingRelationships: PhDocumentResultPage; readonly documentModels: DocumentModelResultPage; readonly documentOperations: ReactorOperationResultPage; readonly documentOutgoingRelationships: PhDocumentResultPage; readonly findDocuments: PhDocumentResultPage; readonly jobStatus?: Maybe; readonly pollSyncEnvelopes: PollSyncEnvelopesResult; }; type QueryDocumentArgs = { identifier: Scalars["String"]["input"]; view?: InputMaybe; }; type QueryDocumentIncomingRelationshipsArgs = { paging?: InputMaybe; relationshipType: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; view?: InputMaybe; }; type QueryDocumentModelsArgs = { namespace?: InputMaybe; paging?: InputMaybe; }; type QueryDocumentOperationsArgs = { filter: OperationsFilterInput; paging?: InputMaybe; }; type QueryDocumentOutgoingRelationshipsArgs = { paging?: InputMaybe; relationshipType: Scalars["String"]["input"]; sourceIdentifier: Scalars["String"]["input"]; view?: InputMaybe; }; type QueryFindDocumentsArgs = { paging?: InputMaybe; search?: InputMaybe; view?: InputMaybe; }; type QueryJobStatusArgs = { jobId: Scalars["String"]["input"]; }; type QueryPollSyncEnvelopesArgs = { channelId: Scalars["String"]["input"]; outboxAck: Scalars["Int"]["input"]; outboxLatest: Scalars["Int"]["input"]; }; type ReactorOperation = { readonly action: Action; readonly error?: Maybe; readonly hash: Scalars["String"]["output"]; readonly id?: Maybe; readonly index: Scalars["Int"]["output"]; readonly skip: Scalars["Int"]["output"]; readonly timestampUtcMs: Scalars["String"]["output"]; }; type ReactorOperationResultPage = { readonly cursor?: Maybe; readonly hasNextPage: Scalars["Boolean"]["output"]; readonly hasPreviousPage: Scalars["Boolean"]["output"]; readonly items: ReadonlyArray; readonly totalCount: Scalars["Int"]["output"]; }; type ReactorSigner = { readonly app?: Maybe; readonly signatures: ReadonlyArray; readonly user?: Maybe; }; type ReactorSignerApp = { readonly key: Scalars["String"]["output"]; readonly name: Scalars["String"]["output"]; }; type ReactorSignerAppInput = { readonly key: Scalars["String"]["input"]; readonly name: Scalars["String"]["input"]; }; type ReactorSignerInput = { readonly app?: InputMaybe; readonly signatures: ReadonlyArray; readonly user?: InputMaybe; }; type ReactorSignerUser = { readonly address: Scalars["String"]["output"]; readonly chainId: Scalars["Int"]["output"]; readonly networkId: Scalars["String"]["output"]; }; type ReactorSignerUserInput = { readonly address: Scalars["String"]["input"]; readonly chainId: Scalars["Int"]["input"]; readonly networkId: Scalars["String"]["input"]; }; type RemoteCursor = { readonly cursorOrdinal: Scalars["Int"]["output"]; readonly lastSyncedAtUtcMs?: Maybe; readonly remoteName: Scalars["String"]["output"]; }; type RemoteCursorInput = { readonly cursorOrdinal: Scalars["Int"]["input"]; readonly lastSyncedAtUtcMs?: InputMaybe; readonly remoteName: Scalars["String"]["input"]; }; type RemoteFilterInput = { readonly branch: Scalars["String"]["input"]; readonly documentId: ReadonlyArray; readonly scope: ReadonlyArray; }; type Revision = { readonly revision: Scalars["Int"]["output"]; readonly scope: Scalars["String"]["output"]; }; type SearchFilterInput = { readonly identifiers?: InputMaybe>; readonly parentId?: InputMaybe; readonly type?: InputMaybe; }; type Subscription = { readonly documentChanges: DocumentChangeEvent; readonly jobChanges: JobChangeEvent; }; type SubscriptionDocumentChangesArgs = { search?: InputMaybe; view?: InputMaybe; }; type SubscriptionJobChangesArgs = { jobId: Scalars["String"]["input"]; }; type SyncEnvelope = { readonly channelMeta: ChannelMeta; readonly cursor?: Maybe; readonly dependsOn?: Maybe>; readonly key?: Maybe; readonly operations?: Maybe>; readonly type: SyncEnvelopeType; }; type SyncEnvelopeInput = { readonly channelMeta: ChannelMetaInput; readonly cursor?: InputMaybe; readonly dependsOn?: InputMaybe>; readonly key?: InputMaybe; readonly operations?: InputMaybe>; readonly type: SyncEnvelopeType; }; declare enum SyncEnvelopeType { Ack = "ACK", Operations = "OPERATIONS" } type TouchChannelInput = { readonly collectionId: Scalars["String"]["input"]; readonly filter: RemoteFilterInput; readonly id: Scalars["String"]["input"]; readonly name: Scalars["String"]["input"]; readonly sinceTimestampUtcMs: Scalars["String"]["input"]; }; type TouchChannelResult = { readonly ackOrdinal: Scalars["Int"]["output"]; readonly success: Scalars["Boolean"]["output"]; }; type ViewFilterInput = { readonly branch?: InputMaybe; readonly scopes?: InputMaybe>; }; type PhDocumentFieldsFragment = { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; type GetDocumentModelsQueryVariables = Exact<{ namespace?: InputMaybe; paging?: InputMaybe; }>; type GetDocumentModelsQuery = { readonly documentModels: { readonly totalCount: number; readonly hasNextPage: boolean; readonly hasPreviousPage: boolean; readonly cursor?: string | null | undefined; readonly items: ReadonlyArray<{ readonly id: string; readonly name: string; readonly namespace?: string | null | undefined; readonly version?: string | null | undefined; readonly specification: NonNullable; }>; }; }; type GetDocumentQueryVariables = Exact<{ identifier: Scalars["String"]["input"]; view?: InputMaybe; }>; type GetDocumentQuery = { readonly document?: { readonly childIds: ReadonlyArray; readonly document: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; } | null | undefined; }; type GetDocumentWithOperationsQueryVariables = Exact<{ identifier: Scalars["String"]["input"]; view?: InputMaybe; operationsFilter?: InputMaybe; operationsPaging?: InputMaybe; }>; type GetDocumentWithOperationsQuery = { readonly document?: { readonly childIds: ReadonlyArray; readonly document: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly operations?: { readonly totalCount: number; readonly hasNextPage: boolean; readonly hasPreviousPage: boolean; readonly cursor?: string | null | undefined; readonly items: ReadonlyArray<{ readonly index: number; readonly timestampUtcMs: string; readonly hash: string; readonly skip: number; readonly error?: string | null | undefined; readonly id?: string | null | undefined; readonly action: { readonly id: string; readonly type: string; readonly timestampUtcMs: string; readonly input: NonNullable; readonly scope: string; readonly context?: { readonly signer?: { readonly signatures: ReadonlyArray; readonly user?: { readonly address: string; readonly networkId: string; readonly chainId: number; } | null | undefined; readonly app?: { readonly name: string; readonly key: string; } | null | undefined; } | null | undefined; } | null | undefined; }; }>; } | null | undefined; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; } | null | undefined; }; type GetDocumentOutgoingRelationshipsQueryVariables = Exact<{ sourceIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; view?: InputMaybe; paging?: InputMaybe; }>; type GetDocumentOutgoingRelationshipsQuery = { readonly documentOutgoingRelationships: { readonly totalCount: number; readonly hasNextPage: boolean; readonly hasPreviousPage: boolean; readonly cursor?: string | null | undefined; readonly items: ReadonlyArray<{ readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }>; }; }; type GetDocumentIncomingRelationshipsQueryVariables = Exact<{ targetIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; view?: InputMaybe; paging?: InputMaybe; }>; type GetDocumentIncomingRelationshipsQuery = { readonly documentIncomingRelationships: { readonly totalCount: number; readonly hasNextPage: boolean; readonly hasPreviousPage: boolean; readonly cursor?: string | null | undefined; readonly items: ReadonlyArray<{ readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }>; }; }; type FindDocumentsQueryVariables = Exact<{ search?: InputMaybe; view?: InputMaybe; paging?: InputMaybe; }>; type FindDocumentsQuery = { readonly findDocuments: { readonly totalCount: number; readonly hasNextPage: boolean; readonly hasPreviousPage: boolean; readonly cursor?: string | null | undefined; readonly items: ReadonlyArray<{ readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }>; }; }; type GetDocumentOperationsQueryVariables = Exact<{ filter: OperationsFilterInput; paging?: InputMaybe; }>; type GetDocumentOperationsQuery = { readonly documentOperations: { readonly totalCount: number; readonly hasNextPage: boolean; readonly hasPreviousPage: boolean; readonly cursor?: string | null | undefined; readonly items: ReadonlyArray<{ readonly index: number; readonly timestampUtcMs: string; readonly hash: string; readonly skip: number; readonly error?: string | null | undefined; readonly id?: string | null | undefined; readonly action: { readonly id: string; readonly type: string; readonly timestampUtcMs: string; readonly input: NonNullable; readonly scope: string; readonly context?: { readonly signer?: { readonly signatures: ReadonlyArray; readonly user?: { readonly address: string; readonly networkId: string; readonly chainId: number; } | null | undefined; readonly app?: { readonly name: string; readonly key: string; } | null | undefined; } | null | undefined; } | null | undefined; }; }>; }; }; type GetJobStatusQueryVariables = Exact<{ jobId: Scalars["String"]["input"]; }>; type GetJobStatusQuery = { readonly jobStatus?: { readonly id: string; readonly status: string; readonly result: NonNullable; readonly error?: string | null | undefined; readonly createdAt: string | Date; readonly completedAt?: string | Date | null | undefined; } | null | undefined; }; type CreateDocumentMutationVariables = Exact<{ document: Scalars["JSONObject"]["input"]; parentIdentifier?: InputMaybe; }>; type CreateDocumentMutation = { readonly createDocument: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; }; type CreateEmptyDocumentMutationVariables = Exact<{ documentType: Scalars["String"]["input"]; parentIdentifier?: InputMaybe; }>; type CreateEmptyDocumentMutation = { readonly createEmptyDocument: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; }; type MutateDocumentMutationVariables = Exact<{ documentIdentifier: Scalars["String"]["input"]; actions: ReadonlyArray; view?: InputMaybe; }>; type MutateDocumentMutation = { readonly mutateDocument: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; }; type MutateDocumentAsyncMutationVariables = Exact<{ documentIdentifier: Scalars["String"]["input"]; actions: ReadonlyArray; view?: InputMaybe; }>; type MutateDocumentAsyncMutation = { readonly mutateDocumentAsync: string; }; type RenameDocumentMutationVariables = Exact<{ documentIdentifier: Scalars["String"]["input"]; name: Scalars["String"]["input"]; branch?: InputMaybe; }>; type RenameDocumentMutation = { readonly renameDocument: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; }; type SetPreferredEditorMutationVariables = Exact<{ documentIdentifier: Scalars["String"]["input"]; preferredEditor?: InputMaybe; branch?: InputMaybe; }>; type SetPreferredEditorMutation = { readonly setPreferredEditor: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; }; type AddRelationshipMutationVariables = Exact<{ sourceIdentifier: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; branch?: InputMaybe; }>; type AddRelationshipMutation = { readonly addRelationship: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; }; type RemoveRelationshipMutationVariables = Exact<{ sourceIdentifier: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; branch?: InputMaybe; }>; type RemoveRelationshipMutation = { readonly removeRelationship: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; }; type MoveRelationshipMutationVariables = Exact<{ sourceParentIdentifier: Scalars["String"]["input"]; targetParentIdentifier: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; branch?: InputMaybe; }>; type MoveRelationshipMutation = { readonly moveRelationship: { readonly source: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; readonly target: { readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }; }; }; type DeleteDocumentMutationVariables = Exact<{ identifier: Scalars["String"]["input"]; propagate?: InputMaybe; }>; type DeleteDocumentMutation = { readonly deleteDocument: boolean; }; type DeleteDocumentsMutationVariables = Exact<{ identifiers: ReadonlyArray; propagate?: InputMaybe; }>; type DeleteDocumentsMutation = { readonly deleteDocuments: boolean; }; type DocumentChangesSubscriptionVariables = Exact<{ search?: InputMaybe; view?: InputMaybe; }>; type DocumentChangesSubscription = { readonly documentChanges: { readonly type: DocumentChangeType; readonly documents: ReadonlyArray<{ readonly id: string; readonly slug?: string | null | undefined; readonly name: string; readonly documentType: string; readonly state: NonNullable; readonly createdAtUtcIso: string | Date; readonly lastModifiedAtUtcIso: string | Date; readonly revisionsList: ReadonlyArray<{ readonly scope: string; readonly revision: number; }>; }>; readonly context?: { readonly parentId?: string | null | undefined; readonly childId?: string | null | undefined; } | null | undefined; }; }; type JobChangesSubscriptionVariables = Exact<{ jobId: Scalars["String"]["input"]; }>; type JobChangesSubscription = { readonly jobChanges: { readonly jobId: string; readonly status: string; readonly result: NonNullable; readonly error?: string | null | undefined; }; }; type PollSyncEnvelopesQueryVariables = Exact<{ channelId: Scalars["String"]["input"]; outboxAck: Scalars["Int"]["input"]; outboxLatest: Scalars["Int"]["input"]; }>; type PollSyncEnvelopesQuery = { readonly pollSyncEnvelopes: { readonly ackOrdinal: number; readonly hasMore: boolean; readonly envelopes: ReadonlyArray<{ readonly type: SyncEnvelopeType; readonly key?: string | null | undefined; readonly dependsOn?: ReadonlyArray | null | undefined; readonly channelMeta: { readonly id: string; }; readonly operations?: ReadonlyArray<{ readonly operation: { readonly index: number; readonly timestampUtcMs: string; readonly hash: string; readonly skip: number; readonly error?: string | null | undefined; readonly id?: string | null | undefined; readonly action: { readonly id: string; readonly type: string; readonly timestampUtcMs: string; readonly input: NonNullable; readonly scope: string; readonly context?: { readonly signer?: { readonly signatures: ReadonlyArray; readonly user?: { readonly address: string; readonly networkId: string; readonly chainId: number; } | null | undefined; readonly app?: { readonly name: string; readonly key: string; } | null | undefined; } | null | undefined; } | null | undefined; }; }; readonly context: { readonly documentId: string; readonly documentType: string; readonly scope: string; readonly branch: string; }; }> | null | undefined; readonly cursor?: { readonly remoteName: string; readonly cursorOrdinal: number; readonly lastSyncedAtUtcMs?: string | null | undefined; } | null | undefined; }>; readonly deadLetters: ReadonlyArray<{ readonly documentId: string; readonly error: string; }>; }; }; type TouchChannelMutationVariables = Exact<{ input: TouchChannelInput; }>; type TouchChannelMutation = { readonly touchChannel: { readonly success: boolean; readonly ackOrdinal: number; }; }; type PushSyncEnvelopesMutationVariables = Exact<{ envelopes: ReadonlyArray; }>; type PushSyncEnvelopesMutation = { readonly pushSyncEnvelopes: boolean; }; type WithIndex = TObject & Record; type ResolversObject = WithIndex; type ResolverTypeWrapper = Promise | T; type ResolverWithResolve = { resolve: ResolverFn; }; type Resolver, TContext = Record, TArgs = Record> = ResolverFn | ResolverWithResolve; type ResolverFn = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => Promise | TResult; type SubscriptionSubscribeFn = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => AsyncIterable | Promise>; type SubscriptionResolveFn = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult | Promise; interface SubscriptionSubscriberObject { subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>; resolve?: SubscriptionResolveFn; } interface SubscriptionResolverObject { subscribe: SubscriptionSubscribeFn; resolve: SubscriptionResolveFn; } type SubscriptionObject = SubscriptionSubscriberObject | SubscriptionResolverObject; type SubscriptionResolver, TContext = Record, TArgs = Record> = ((...args: any[]) => SubscriptionObject) | SubscriptionObject; type TypeResolveFn, TContext = Record> = (parent: TParent, context: TContext, info: GraphQLResolveInfo) => Maybe | Promise>; type IsTypeOfResolverFn, TContext = Record> = (obj: T, context: TContext, info: GraphQLResolveInfo) => boolean | Promise; type NextResolverFn = () => Promise; type DirectiveResolverFn, TParent = Record, TContext = Record, TArgs = Record> = (next: NextResolverFn, parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult | Promise; /** Mapping between all available schema types and the resolvers types */ type ResolversTypes = ResolversObject<{ Action: ResolverTypeWrapper; ActionContext: ResolverTypeWrapper; ActionContextInput: ActionContextInput; ActionInput: ActionInput; Boolean: ResolverTypeWrapper; ChannelMeta: ResolverTypeWrapper; ChannelMetaInput: ChannelMetaInput; DateTime: ResolverTypeWrapper; DeadLetterInfo: ResolverTypeWrapper; DocumentChangeContext: ResolverTypeWrapper; DocumentChangeEvent: ResolverTypeWrapper; DocumentChangeType: DocumentChangeType; DocumentModelGlobalState: ResolverTypeWrapper; DocumentModelResultPage: ResolverTypeWrapper; DocumentOperationsFilterInput: DocumentOperationsFilterInput; DocumentWithChildren: ResolverTypeWrapper; Int: ResolverTypeWrapper; JSONObject: ResolverTypeWrapper; JobChangeEvent: ResolverTypeWrapper; JobInfo: ResolverTypeWrapper; MoveRelationshipResult: ResolverTypeWrapper; Mutation: ResolverTypeWrapper>; OperationContext: ResolverTypeWrapper; OperationContextInput: OperationContextInput; OperationInput: OperationInput; OperationWithContext: ResolverTypeWrapper; OperationWithContextInput: OperationWithContextInput; OperationsFilterInput: OperationsFilterInput; PHDocument: ResolverTypeWrapper; PHDocumentResultPage: ResolverTypeWrapper; PagingInput: PagingInput; PollSyncEnvelopesResult: ResolverTypeWrapper; PropagationMode: PropagationMode; Query: ResolverTypeWrapper>; ReactorOperation: ResolverTypeWrapper; ReactorOperationResultPage: ResolverTypeWrapper; ReactorSigner: ResolverTypeWrapper; ReactorSignerApp: ResolverTypeWrapper; ReactorSignerAppInput: ReactorSignerAppInput; ReactorSignerInput: ReactorSignerInput; ReactorSignerUser: ResolverTypeWrapper; ReactorSignerUserInput: ReactorSignerUserInput; RemoteCursor: ResolverTypeWrapper; RemoteCursorInput: RemoteCursorInput; RemoteFilterInput: RemoteFilterInput; Revision: ResolverTypeWrapper; SearchFilterInput: SearchFilterInput; String: ResolverTypeWrapper; Subscription: ResolverTypeWrapper>; SyncEnvelope: ResolverTypeWrapper; SyncEnvelopeInput: SyncEnvelopeInput; SyncEnvelopeType: SyncEnvelopeType; TouchChannelInput: TouchChannelInput; TouchChannelResult: ResolverTypeWrapper; ViewFilterInput: ViewFilterInput; }>; /** Mapping between all available schema types and the resolvers parents */ type ResolversParentTypes = ResolversObject<{ Action: Action; ActionContext: ActionContext; ActionContextInput: ActionContextInput; ActionInput: ActionInput; Boolean: Scalars["Boolean"]["output"]; ChannelMeta: ChannelMeta; ChannelMetaInput: ChannelMetaInput; DateTime: Scalars["DateTime"]["output"]; DeadLetterInfo: DeadLetterInfo; DocumentChangeContext: DocumentChangeContext; DocumentChangeEvent: DocumentChangeEvent; DocumentModelGlobalState: DocumentModelGlobalState; DocumentModelResultPage: DocumentModelResultPage; DocumentOperationsFilterInput: DocumentOperationsFilterInput; DocumentWithChildren: DocumentWithChildren; Int: Scalars["Int"]["output"]; JSONObject: Scalars["JSONObject"]["output"]; JobChangeEvent: JobChangeEvent; JobInfo: JobInfo; MoveRelationshipResult: MoveRelationshipResult; Mutation: Record; OperationContext: OperationContext; OperationContextInput: OperationContextInput; OperationInput: OperationInput; OperationWithContext: OperationWithContext; OperationWithContextInput: OperationWithContextInput; OperationsFilterInput: OperationsFilterInput; PHDocument: PhDocument; PHDocumentResultPage: PhDocumentResultPage; PagingInput: PagingInput; PollSyncEnvelopesResult: PollSyncEnvelopesResult; Query: Record; ReactorOperation: ReactorOperation; ReactorOperationResultPage: ReactorOperationResultPage; ReactorSigner: ReactorSigner; ReactorSignerApp: ReactorSignerApp; ReactorSignerAppInput: ReactorSignerAppInput; ReactorSignerInput: ReactorSignerInput; ReactorSignerUser: ReactorSignerUser; ReactorSignerUserInput: ReactorSignerUserInput; RemoteCursor: RemoteCursor; RemoteCursorInput: RemoteCursorInput; RemoteFilterInput: RemoteFilterInput; Revision: Revision; SearchFilterInput: SearchFilterInput; String: Scalars["String"]["output"]; Subscription: Record; SyncEnvelope: SyncEnvelope; SyncEnvelopeInput: SyncEnvelopeInput; TouchChannelInput: TouchChannelInput; TouchChannelResult: TouchChannelResult; ViewFilterInput: ViewFilterInput; }>; type ActionResolvers = ResolversObject<{ context?: Resolver, ParentType, ContextType>; id?: Resolver; input?: Resolver; scope?: Resolver; timestampUtcMs?: Resolver; type?: Resolver; }>; type ActionContextResolvers = ResolversObject<{ signer?: Resolver, ParentType, ContextType>; }>; type ChannelMetaResolvers = ResolversObject<{ id?: Resolver; }>; interface DateTimeScalarConfig extends GraphQLScalarTypeConfig { name: "DateTime"; } type DeadLetterInfoResolvers = ResolversObject<{ branch?: Resolver; documentId?: Resolver; error?: Resolver; jobId?: Resolver; operationCount?: Resolver; scopes?: Resolver, ParentType, ContextType>; }>; type DocumentChangeContextResolvers = ResolversObject<{ childId?: Resolver, ParentType, ContextType>; parentId?: Resolver, ParentType, ContextType>; }>; type DocumentChangeEventResolvers = ResolversObject<{ context?: Resolver, ParentType, ContextType>; documents?: Resolver, ParentType, ContextType>; type?: Resolver; }>; type DocumentModelGlobalStateResolvers = ResolversObject<{ id?: Resolver; name?: Resolver; namespace?: Resolver, ParentType, ContextType>; specification?: Resolver; version?: Resolver, ParentType, ContextType>; }>; type DocumentModelResultPageResolvers = ResolversObject<{ cursor?: Resolver, ParentType, ContextType>; hasNextPage?: Resolver; hasPreviousPage?: Resolver; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; }>; type DocumentWithChildrenResolvers = ResolversObject<{ childIds?: Resolver, ParentType, ContextType>; document?: Resolver; }>; interface JsonObjectScalarConfig extends GraphQLScalarTypeConfig { name: "JSONObject"; } type JobChangeEventResolvers = ResolversObject<{ error?: Resolver, ParentType, ContextType>; jobId?: Resolver; result?: Resolver; status?: Resolver; }>; type JobInfoResolvers = ResolversObject<{ completedAt?: Resolver, ParentType, ContextType>; createdAt?: Resolver; error?: Resolver, ParentType, ContextType>; id?: Resolver; result?: Resolver; status?: Resolver; }>; type MoveRelationshipResultResolvers = ResolversObject<{ source?: Resolver; target?: Resolver; }>; type MutationResolvers = ResolversObject<{ addRelationship?: Resolver>; createDocument?: Resolver>; createEmptyDocument?: Resolver>; deleteDocument?: Resolver>; deleteDocuments?: Resolver>; moveRelationship?: Resolver>; mutateDocument?: Resolver>; mutateDocumentAsync?: Resolver>; pushSyncEnvelopes?: Resolver>; removeRelationship?: Resolver>; renameDocument?: Resolver>; setPreferredEditor?: Resolver>; touchChannel?: Resolver>; }>; type OperationContextResolvers = ResolversObject<{ branch?: Resolver; documentId?: Resolver; documentType?: Resolver; ordinal?: Resolver; scope?: Resolver; }>; type OperationWithContextResolvers = ResolversObject<{ context?: Resolver; operation?: Resolver; }>; type PhDocumentResolvers = ResolversObject<{ createdAtUtcIso?: Resolver; documentType?: Resolver; id?: Resolver; lastModifiedAtUtcIso?: Resolver; name?: Resolver; operations?: Resolver, ParentType, ContextType, Partial>; preferredEditor?: Resolver, ParentType, ContextType>; revisionsList?: Resolver, ParentType, ContextType>; slug?: Resolver, ParentType, ContextType>; state?: Resolver; }>; type PhDocumentResultPageResolvers = ResolversObject<{ cursor?: Resolver, ParentType, ContextType>; hasNextPage?: Resolver; hasPreviousPage?: Resolver; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; }>; type PollSyncEnvelopesResultResolvers = ResolversObject<{ ackOrdinal?: Resolver; deadLetters?: Resolver, ParentType, ContextType>; envelopes?: Resolver, ParentType, ContextType>; hasMore?: Resolver; }>; type QueryResolvers = ResolversObject<{ document?: Resolver, ParentType, ContextType, RequireFields>; documentIncomingRelationships?: Resolver>; documentModels?: Resolver>; documentOperations?: Resolver>; documentOutgoingRelationships?: Resolver>; findDocuments?: Resolver>; jobStatus?: Resolver, ParentType, ContextType, RequireFields>; pollSyncEnvelopes?: Resolver>; }>; type ReactorOperationResolvers = ResolversObject<{ action?: Resolver; error?: Resolver, ParentType, ContextType>; hash?: Resolver; id?: Resolver, ParentType, ContextType>; index?: Resolver; skip?: Resolver; timestampUtcMs?: Resolver; }>; type ReactorOperationResultPageResolvers = ResolversObject<{ cursor?: Resolver, ParentType, ContextType>; hasNextPage?: Resolver; hasPreviousPage?: Resolver; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; }>; type ReactorSignerResolvers = ResolversObject<{ app?: Resolver, ParentType, ContextType>; signatures?: Resolver, ParentType, ContextType>; user?: Resolver, ParentType, ContextType>; }>; type ReactorSignerAppResolvers = ResolversObject<{ key?: Resolver; name?: Resolver; }>; type ReactorSignerUserResolvers = ResolversObject<{ address?: Resolver; chainId?: Resolver; networkId?: Resolver; }>; type RemoteCursorResolvers = ResolversObject<{ cursorOrdinal?: Resolver; lastSyncedAtUtcMs?: Resolver, ParentType, ContextType>; remoteName?: Resolver; }>; type RevisionResolvers = ResolversObject<{ revision?: Resolver; scope?: Resolver; }>; type SubscriptionResolvers = ResolversObject<{ documentChanges?: SubscriptionResolver>; jobChanges?: SubscriptionResolver>; }>; type SyncEnvelopeResolvers = ResolversObject<{ channelMeta?: Resolver; cursor?: Resolver, ParentType, ContextType>; dependsOn?: Resolver>, ParentType, ContextType>; key?: Resolver, ParentType, ContextType>; operations?: Resolver>, ParentType, ContextType>; type?: Resolver; }>; type TouchChannelResultResolvers = ResolversObject<{ ackOrdinal?: Resolver; success?: Resolver; }>; type Resolvers = ResolversObject<{ Action?: ActionResolvers; ActionContext?: ActionContextResolvers; ChannelMeta?: ChannelMetaResolvers; DateTime?: GraphQLScalarType; DeadLetterInfo?: DeadLetterInfoResolvers; DocumentChangeContext?: DocumentChangeContextResolvers; DocumentChangeEvent?: DocumentChangeEventResolvers; DocumentModelGlobalState?: DocumentModelGlobalStateResolvers; DocumentModelResultPage?: DocumentModelResultPageResolvers; DocumentWithChildren?: DocumentWithChildrenResolvers; JSONObject?: GraphQLScalarType; JobChangeEvent?: JobChangeEventResolvers; JobInfo?: JobInfoResolvers; MoveRelationshipResult?: MoveRelationshipResultResolvers; Mutation?: MutationResolvers; OperationContext?: OperationContextResolvers; OperationWithContext?: OperationWithContextResolvers; PHDocument?: PhDocumentResolvers; PHDocumentResultPage?: PhDocumentResultPageResolvers; PollSyncEnvelopesResult?: PollSyncEnvelopesResultResolvers; Query?: QueryResolvers; ReactorOperation?: ReactorOperationResolvers; ReactorOperationResultPage?: ReactorOperationResultPageResolvers; ReactorSigner?: ReactorSignerResolvers; ReactorSignerApp?: ReactorSignerAppResolvers; ReactorSignerUser?: ReactorSignerUserResolvers; RemoteCursor?: RemoteCursorResolvers; Revision?: RevisionResolvers; Subscription?: SubscriptionResolvers; SyncEnvelope?: SyncEnvelopeResolvers; TouchChannelResult?: TouchChannelResultResolvers; }>; type Properties = Required<{ [K in keyof T]: z$1.ZodType }>; type definedNonNullAny = {}; declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny; declare const definedNonNullAnySchema: z$1.ZodAny & z$1.ZodType>; declare const DocumentChangeTypeSchema: z$1.ZodEnum; declare const PropagationModeSchema: z$1.ZodEnum; declare const SyncEnvelopeTypeSchema: z$1.ZodEnum; declare function ActionContextInputSchema(): z$1.ZodObject>; declare function ActionInputSchema(): z$1.ZodObject>; declare function ChannelMetaInputSchema(): z$1.ZodObject>; declare function DocumentOperationsFilterInputSchema(): z$1.ZodObject>; declare function OperationContextInputSchema(): z$1.ZodObject>; declare function OperationInputSchema(): z$1.ZodObject>; declare function OperationWithContextInputSchema(): z$1.ZodObject>; declare function OperationsFilterInputSchema(): z$1.ZodObject>; declare function PagingInputSchema(): z$1.ZodObject>; declare function ReactorSignerAppInputSchema(): z$1.ZodObject>; declare function ReactorSignerInputSchema(): z$1.ZodObject>; declare function ReactorSignerUserInputSchema(): z$1.ZodObject>; declare function RemoteCursorInputSchema(): z$1.ZodObject>; declare function RemoteFilterInputSchema(): z$1.ZodObject>; declare function SearchFilterInputSchema(): z$1.ZodObject>; declare function SyncEnvelopeInputSchema(): z$1.ZodObject>; declare function TouchChannelInputSchema(): z$1.ZodObject>; declare function ViewFilterInputSchema(): z$1.ZodObject>; declare const PhDocumentFieldsFragmentDoc: DocumentNode; declare const GetDocumentModelsDocument: DocumentNode; declare const GetDocumentDocument: DocumentNode; declare const GetDocumentWithOperationsDocument: DocumentNode; declare const GetDocumentOutgoingRelationshipsDocument: DocumentNode; declare const GetDocumentIncomingRelationshipsDocument: DocumentNode; declare const FindDocumentsDocument: DocumentNode; declare const GetDocumentOperationsDocument: DocumentNode; declare const GetJobStatusDocument: DocumentNode; declare const CreateDocumentDocument: DocumentNode; declare const CreateEmptyDocumentDocument: DocumentNode; declare const MutateDocumentDocument: DocumentNode; declare const MutateDocumentAsyncDocument: DocumentNode; declare const RenameDocumentDocument: DocumentNode; declare const SetPreferredEditorDocument: DocumentNode; declare const AddRelationshipDocument: DocumentNode; declare const RemoveRelationshipDocument: DocumentNode; declare const MoveRelationshipDocument: DocumentNode; declare const DeleteDocumentDocument: DocumentNode; declare const DeleteDocumentsDocument: DocumentNode; declare const DocumentChangesDocument: DocumentNode; declare const JobChangesDocument: DocumentNode; declare const PollSyncEnvelopesDocument: DocumentNode; declare const TouchChannelDocument: DocumentNode; declare const PushSyncEnvelopesDocument: DocumentNode; type Requester = (doc: DocumentNode, vars?: V, options?: C) => Promise | AsyncIterable; declare function getSdk(requester: Requester): { GetDocumentModels(variables?: GetDocumentModelsQueryVariables, options?: C): Promise; GetDocument(variables: GetDocumentQueryVariables, options?: C): Promise; GetDocumentWithOperations(variables: GetDocumentWithOperationsQueryVariables, options?: C): Promise; GetDocumentOutgoingRelationships(variables: GetDocumentOutgoingRelationshipsQueryVariables, options?: C): Promise; GetDocumentIncomingRelationships(variables: GetDocumentIncomingRelationshipsQueryVariables, options?: C): Promise; FindDocuments(variables?: FindDocumentsQueryVariables, options?: C): Promise; GetDocumentOperations(variables: GetDocumentOperationsQueryVariables, options?: C): Promise; GetJobStatus(variables: GetJobStatusQueryVariables, options?: C): Promise; CreateDocument(variables: CreateDocumentMutationVariables, options?: C): Promise; CreateEmptyDocument(variables: CreateEmptyDocumentMutationVariables, options?: C): Promise; MutateDocument(variables: MutateDocumentMutationVariables, options?: C): Promise; MutateDocumentAsync(variables: MutateDocumentAsyncMutationVariables, options?: C): Promise; RenameDocument(variables: RenameDocumentMutationVariables, options?: C): Promise; SetPreferredEditor(variables: SetPreferredEditorMutationVariables, options?: C): Promise; AddRelationship(variables: AddRelationshipMutationVariables, options?: C): Promise; RemoveRelationship(variables: RemoveRelationshipMutationVariables, options?: C): Promise; MoveRelationship(variables: MoveRelationshipMutationVariables, options?: C): Promise; DeleteDocument(variables: DeleteDocumentMutationVariables, options?: C): Promise; DeleteDocuments(variables: DeleteDocumentsMutationVariables, options?: C): Promise; DocumentChanges(variables?: DocumentChangesSubscriptionVariables, options?: C): AsyncIterable; JobChanges(variables: JobChangesSubscriptionVariables, options?: C): AsyncIterable; PollSyncEnvelopes(variables: PollSyncEnvelopesQueryVariables, options?: C): Promise; TouchChannel(variables: TouchChannelMutationVariables, options?: C): Promise; PushSyncEnvelopes(variables: PushSyncEnvelopesMutationVariables, options?: C): Promise; }; type Sdk = ReturnType; //#endregion //#region src/graphql/reactor/requester.d.ts type FetchLike = (input: URL | string, init: RequestInit) => Promise; //#endregion //#region src/graphql/reactor/factory.d.ts declare function createReactorGraphQLClient(url: string, fetchImpl?: FetchLike, headers?: Record): { GetDocumentModels(variables?: Exact<{ namespace?: InputMaybe; paging?: InputMaybe; }> | undefined, options?: {} | undefined): Promise; GetDocument(variables: Exact<{ identifier: Scalars["String"]["input"]; view?: InputMaybe; }>, options?: {} | undefined): Promise; GetDocumentWithOperations(variables: Exact<{ identifier: Scalars["String"]["input"]; view?: InputMaybe; operationsFilter?: InputMaybe; operationsPaging?: InputMaybe; }>, options?: {} | undefined): Promise; GetDocumentOutgoingRelationships(variables: Exact<{ sourceIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; view?: InputMaybe; paging?: InputMaybe; }>, options?: {} | undefined): Promise; GetDocumentIncomingRelationships(variables: Exact<{ targetIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; view?: InputMaybe; paging?: InputMaybe; }>, options?: {} | undefined): Promise; FindDocuments(variables?: Exact<{ search?: InputMaybe; view?: InputMaybe; paging?: InputMaybe; }> | undefined, options?: {} | undefined): Promise; GetDocumentOperations(variables: Exact<{ filter: OperationsFilterInput; paging?: InputMaybe; }>, options?: {} | undefined): Promise; GetJobStatus(variables: Exact<{ jobId: Scalars["String"]["input"]; }>, options?: {} | undefined): Promise; CreateDocument(variables: Exact<{ document: Scalars["JSONObject"]["input"]; parentIdentifier?: InputMaybe; }>, options?: {} | undefined): Promise; CreateEmptyDocument(variables: Exact<{ documentType: Scalars["String"]["input"]; parentIdentifier?: InputMaybe; }>, options?: {} | undefined): Promise; MutateDocument(variables: Exact<{ documentIdentifier: Scalars["String"]["input"]; actions: ReadonlyArray; view?: InputMaybe; }>, options?: {} | undefined): Promise; MutateDocumentAsync(variables: Exact<{ documentIdentifier: Scalars["String"]["input"]; actions: ReadonlyArray; view?: InputMaybe; }>, options?: {} | undefined): Promise; RenameDocument(variables: Exact<{ documentIdentifier: Scalars["String"]["input"]; name: Scalars["String"]["input"]; branch?: InputMaybe; }>, options?: {} | undefined): Promise; SetPreferredEditor(variables: Exact<{ documentIdentifier: Scalars["String"]["input"]; preferredEditor?: InputMaybe; branch?: InputMaybe; }>, options?: {} | undefined): Promise; AddRelationship(variables: Exact<{ sourceIdentifier: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; branch?: InputMaybe; }>, options?: {} | undefined): Promise; RemoveRelationship(variables: Exact<{ sourceIdentifier: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; branch?: InputMaybe; }>, options?: {} | undefined): Promise; MoveRelationship(variables: Exact<{ sourceParentIdentifier: Scalars["String"]["input"]; targetParentIdentifier: Scalars["String"]["input"]; targetIdentifier: Scalars["String"]["input"]; relationshipType: Scalars["String"]["input"]; branch?: InputMaybe; }>, options?: {} | undefined): Promise; DeleteDocument(variables: Exact<{ identifier: Scalars["String"]["input"]; propagate?: InputMaybe; }>, options?: {} | undefined): Promise; DeleteDocuments(variables: Exact<{ identifiers: ReadonlyArray; propagate?: InputMaybe; }>, options?: {} | undefined): Promise; DocumentChanges(variables?: Exact<{ search?: InputMaybe; view?: InputMaybe; }> | undefined, options?: {} | undefined): AsyncIterable; JobChanges(variables: Exact<{ jobId: Scalars["String"]["input"]; }>, options?: {} | undefined): AsyncIterable; PollSyncEnvelopes(variables: Exact<{ channelId: Scalars["String"]["input"]; outboxAck: Scalars["Int"]["input"]; outboxLatest: Scalars["Int"]["input"]; }>, options?: {} | undefined): Promise; TouchChannel(variables: Exact<{ input: TouchChannelInput; }>, options?: {} | undefined): Promise; PushSyncEnvelopes(variables: Exact<{ envelopes: ReadonlyArray; }>, options?: {} | undefined): Promise; }; //#endregion //#region src/graphql/reactor/subgraph.d.ts declare class ReactorSubgraph extends BaseSubgraph { #private; private logger; constructor(args: SubgraphArgs); name: string; hasSubscriptions: boolean; /** * Check operation-level permissions for an array of actions. * Delegates to base assertCanExecuteOperation for each action. */ private assertCanExecuteOperations; typeDefs: graphql.DocumentNode; resolvers: Resolvers; onSetup(): Promise; } //#endregion //#region src/graphql/system/env/index.d.ts declare const ADMIN_USERS: string[]; //#endregion //#region src/graphql/system/subgraph.d.ts declare class SystemSubgraph extends BaseSubgraph { name: string; hasSubscriptions: boolean; typeDefs: graphql.DocumentNode; resolvers: { Query: { system: () => { version: string; gitHash: string; gitUrl: string | null; }; }; }; } //#endregion //#region src/graphql/system/version.d.ts declare function getVersion(): string; declare function getGitHash(): string; declare function getGitUrl(): string | null; //#endregion //#region src/graphql/utils.d.ts declare function isSubgraphClass(candidate: unknown): candidate is SubgraphClass$1; declare function buildGraphqlOperations(operations: Operation[], skip: number, first: number): GqlOperation$1[]; declare function buildGraphqlOperation(operation: Operation): GqlOperation$1; declare function buildGraphQlDocument(doc: PHDocument): GqlDocument$1; declare function buildGraphQlDriveDocument(doc: DocumentDriveDocument): GqlDriveDocument$1; //#endregion //#region src/packages/import-loader.d.ts /** * This class is used to load packages using the import keyword. */ declare class ImportPackageLoader implements IPackageLoader { private readonly logger; readonly name = "ImportPackageLoader"; loadDocumentModels(identifier: string): Promise; loadSubgraphs(identifier: string): Promise; loadProcessors(identifier: string): Promise; } //#endregion //#region src/packages/package-manager.d.ts /** * A loader throwing "this package isn't mine to load" is normal — loaders are * fallbacks for each other. These shapes mean "not found here", not "broken". * * `ERR_MODULE_NOT_FOUND` is ambiguous: it can mean either (a) the loader's own * entry import for `pkg` failed (expected — the package isn't installed * locally), or (b) the entry loaded successfully but a *transitive* bare * import inside it couldn't resolve (real error — the bundle is broken). We * distinguish by checking whether the error names the package we asked for — * either bare (`'pkg'`) or as a subpath (`'pkg/subgraphs'`), since loaders * import sub-entries like `${pkg}/subgraphs` / `${pkg}/document-models`. */ declare function isExpectedLoaderMiss(error: unknown, pkg: string): boolean; declare function getUniqueDocumentModels(...documentModels: readonly (readonly DocumentModelModule[])[]): DocumentModelModule[]; declare class PackageManager implements IPackageManager { protected options: IPackageManagerOptions; private readonly logger; private loaders; private docModelsMap; private subgraphsMap; private processorMap; private configWatcher; private debouncedUpdateCallbacks; private eventEmitter; constructor(loaders: IPackageLoader[], options: IPackageManagerOptions); init(): Promise; private loadPackages; private loadDocumentModels; private loadSubgraphs; private loadProcessors; private maybeWarnAllLoadersFailed; private updateDocumentModelsForPackage; private subscribePackages; private getAllPackageNames; private getPackageNamesFromConfigFile; private initConfigFileWatcher; private updatePackagesMap; private updateSubgraphsMap; private updateProcessorsMap; onDocumentModelsChange(handler: (documentModels: Record) => void): void; onSubgraphsChange(handler: (subgraphs: Map) => void): void; onProcessorsChange(handler: (processors: Map) => void): void; } //#endregion //#region src/server.d.ts type Options = { port?: number; dbPath: string | undefined; client?: PGlite | typeof Pool | undefined; /** * Factory for the PGLite instance backing the read-model store. When set, * `getDbClient` uses it instead of constructing `new PGlite(dbPath)`. Used * by Switchboard to keep a legacy-version data dir readable while running * the newer Switchboard binary. */ pgliteFactory?: PgliteFactory; configFile?: string; packages?: string[]; auth?: { enabled: boolean; admins: string[]; }; https?: { keyPath: string; certPath: string; } | boolean | undefined; packageLoaders?: IPackageLoader[]; processors?: Record; mcp?: boolean; processorConfig?: Map; /** * Document permission service instance. * When provided, the Auth subgraph is registered and document permission * checks are enforced on document operations. * If not provided, can be auto-created by setting DOCUMENT_PERMISSIONS_ENABLED=true * environment variable. */ documentPermissionService?: DocumentPermissionService; enableDocumentModelSubgraphs?: boolean; logger?: ILogger; /** * Filesystem path for attachment binary storage. * Defaults to a sibling "attachments" directory next to dbPath, * or os.tmpdir() for in-memory DB deployments. */ attachmentStoragePath?: string; }; type ProcessorInitializer = ProcessorFactoryBuilder; /** * Doc-perms require auth: with auth off no `user` is ever resolved, so every * authorization check fails closed. Refuse to boot rather than run broken. */ declare function assertAuthRequiredForDocumentPermissions(authEnabled: boolean, documentPermissionsRequested: boolean): void; /** * Refuses SKIP_CREDENTIAL_VERIFICATION at boot outside tests or an explicit * opt-in: it removes the only binding between a token's claimed address and its * signing key. Fail-closed — unset NODE_ENV counts as production. */ declare function assertSkipCredentialVerificationAllowed(authEnabled: boolean, skipCredentialVerification: boolean, env: NodeJS.ProcessEnv): void; /** * Initializes and starts the API server using an initializer function. * This function first loads packages to get document models, then calls the initializer function * to create the reactor client module with the appropriate dependencies. * * @param clientInitializer - Initializer function that creates the reactor client module with document models. * @param options - Additional options for server configuration. * * @returns The API server components along with the created client instances. */ /** * Result of a client initializer. `reactorDriveClient` is optionally returned * alongside the reactor module so resolvers can dispatch reactor-drive parent * ops to it; legacy switchboards omit it. */ interface ClientInitializerResult { module: ReactorClientModule; reactorDriveClient?: IDriveClient; } declare function initializeAndStartAPI(clientInitializer: (documentModels: DocumentModelModule[]) => Promise, options: Options, processorApp: ProcessorApp): Promise; //#endregion //#region src/utils/create-schema.d.ts declare const buildSubgraphSchemaModule: (documentModels: DocumentModelModule[], resolvers: GraphQLResolverMap, typeDefs: DocumentNode) => GraphQLSchemaModule; declare const createSchema: (documentModels: DocumentModelModule[], resolvers: GraphQLResolverMap, typeDefs: DocumentNode) => graphql.GraphQLSchema; /** * Create a merged GraphQL schema from multiple subgraph modules. * Uses buildSubgraphSchema's array overload to combine type definitions * and resolvers from multiple subgraphs into a single executable schema. */ declare const createMergedSchema: (modules: GraphQLSchemaModule[]) => graphql.GraphQLSchema; declare function getDocumentModelSchemaName(documentModel: DocumentModelGlobalState$1): string; declare const getDocumentModelTypeDefs: (documentModels: DocumentModelModule[], typeDefs: DocumentNode) => DocumentNode; /** * Options for generating document model GraphQL schemas. */ interface DocumentModelSchemaOptions { /** * When true, generates new API patterns: * - Mutations return full document objects (MutationResult type) * - Adds createEmptyDocument mutation * - Makes docId and input parameters required * @default false */ useNewApi?: boolean; } /** * Generate a GraphQL schema for a document model. * * @param documentModel - The document model global state * @param options - Schema generation options * @returns GraphQL DocumentNode */ declare function generateDocumentModelSchema(documentModel: DocumentModelGlobalState$1, options?: DocumentModelSchemaOptions): DocumentNode; //#endregion export { ADMIN_USERS, API, Action, ActionContext, ActionContextInput, ActionContextInputSchema, ActionContextResolvers, ActionInput, ActionInputSchema, ActionResolvers, AddRelationshipDocument, AddRelationshipMutation, AddRelationshipMutationVariables, AnalyticsSubgraph, AuthConfig, AuthContext, AuthFetchMiddleware, AuthService, AuthSubgraph, type AuthorizationConfig, AuthorizationPolicy, AuthorizedDocumentHandle, BaseSubgraph, type CanonicalDocumentId, ChannelMeta, ChannelMetaInput, ChannelMetaInputSchema, ChannelMetaResolvers, ClientInitializerResult, Context, CreateDocumentDocument, CreateDocumentMutation, CreateDocumentMutationVariables, CreateEmptyDocumentDocument, CreateEmptyDocumentMutation, CreateEmptyDocumentMutationVariables, DateTimeScalarConfig, DbClient, DeadLetterInfo, DeadLetterInfoResolvers, DeleteDocumentDocument, DeleteDocumentMutation, DeleteDocumentMutationVariables, DeleteDocumentsDocument, DeleteDocumentsMutation, DeleteDocumentsMutationVariables, DirectiveResolverFn, DocumentChangeContext, DocumentChangeContextResolvers, DocumentChangeEvent, DocumentChangeEventResolvers, DocumentChangeType, DocumentChangeTypeSchema, DocumentChangesDocument, DocumentChangesSubscription, DocumentChangesSubscriptionVariables, DocumentModelGlobalState, DocumentModelGlobalStateResolvers, DocumentModelResultPage, DocumentModelResultPageResolvers, DocumentModelSchemaOptions, DocumentOperationsFilterInput, DocumentOperationsFilterInputSchema, DocumentPermissionConfig, DocumentPermissionDatabase, DocumentPermissionEntry, DocumentPermissionLevel, DocumentPermissionService, DocumentPermissionTable, DocumentProtectionTable, DocumentWithChildren, DocumentWithChildrenResolvers, Exact, FetchHandler, FindDocumentsDocument, FindDocumentsQuery, FindDocumentsQueryVariables, GatewayAdapterType, GatewayContextFactory, GetDocumentDocument, GetDocumentIncomingRelationshipsDocument, GetDocumentIncomingRelationshipsQuery, GetDocumentIncomingRelationshipsQueryVariables, GetDocumentModelsDocument, GetDocumentModelsQuery, GetDocumentModelsQueryVariables, GetDocumentOperationsDocument, GetDocumentOperationsQuery, GetDocumentOperationsQueryVariables, GetDocumentOutgoingRelationshipsDocument, GetDocumentOutgoingRelationshipsQuery, GetDocumentOutgoingRelationshipsQueryVariables, GetDocumentQuery, GetDocumentQueryVariables, GetDocumentWithOperationsDocument, GetDocumentWithOperationsQuery, GetDocumentWithOperationsQueryVariables, GetJobStatusDocument, GetJobStatusQuery, GetJobStatusQueryVariables, GetParentIdsFn, GqlDocument, GqlDriveDocument, GqlOperation, GqlOperationContext, GqlSigner, GqlSignerApp, GqlSignerUser, GraphQLManager, GraphqlManagerFeatureFlags, HttpAdapterSetup, HttpAdapterType, HttpDocumentModelLoader, HttpPackageLoader, HttpPackageLoaderLogger, HttpPackageLoaderOptions, type IAuthorizationService, IGatewayAdapter, IHttpAdapter, type IPackageLoader, type IPackageLoaderOptions, IPackageStorage, IReactorProcessorHostModule, ISubgraph, ImportPackageLoader, InMemoryPackageStorage, Incremental, InputMaybe, InstallPackageResult, InstalledPackageInfo, IsTypeOfResolverFn, JobChangeEvent, JobChangeEventResolvers, JobChangesDocument, JobChangesSubscription, JobChangesSubscriptionVariables, JobInfo, JobInfoResolvers, JsonObjectScalarConfig, MakeEmpty, MakeMaybe, MakeOptional, Maybe, MoveRelationshipDocument, MoveRelationshipMutation, MoveRelationshipMutationVariables, MoveRelationshipResult, MoveRelationshipResultResolvers, MutateDocumentAsyncDocument, MutateDocumentAsyncMutation, MutateDocumentAsyncMutationVariables, MutateDocumentDocument, MutateDocumentMutation, MutateDocumentMutationVariables, Mutation, MutationAddRelationshipArgs, MutationCreateDocumentArgs, MutationCreateEmptyDocumentArgs, MutationDeleteDocumentArgs, MutationDeleteDocumentsArgs, MutationMoveRelationshipArgs, MutationMutateDocumentArgs, MutationMutateDocumentAsyncArgs, MutationPushSyncEnvelopesArgs, MutationRemoveRelationshipArgs, MutationRenameDocumentArgs, MutationResolvers, MutationSetPreferredEditorArgs, MutationTouchChannelArgs, NextResolverFn, OperationContext, OperationContextInput, OperationContextInputSchema, OperationContextResolvers, OperationInput, OperationInputSchema, OperationUserPermissionEntry, OperationUserPermissionTable, OperationWithContext, OperationWithContextInput, OperationWithContextInputSchema, OperationWithContextResolvers, OperationsFilterInput, OperationsFilterInputSchema, PackageManagementService, PackageManagementServiceOptions, PackageManager, PackagesSubgraph, type PackagesSubgraphArgs, PagingInput, PagingInputSchema, type ParsedDriveUrl, PgliteFactory, PhDocument, PhDocumentFieldsFragment, PhDocumentFieldsFragmentDoc, PhDocumentOperationsArgs, PhDocumentResolvers, PhDocumentResultPage, PhDocumentResultPageResolvers, PollSyncEnvelopesDocument, PollSyncEnvelopesQuery, PollSyncEnvelopesQueryVariables, PollSyncEnvelopesResult, PollSyncEnvelopesResultResolvers, Processor, ProcessorDriveFactory, ProcessorFactoryBuilder, PropagationMode, PropagationModeSchema, PushSyncEnvelopesDocument, PushSyncEnvelopesMutation, PushSyncEnvelopesMutationVariables, Query, QueryDocumentArgs, QueryDocumentIncomingRelationshipsArgs, QueryDocumentModelsArgs, QueryDocumentOperationsArgs, QueryDocumentOutgoingRelationshipsArgs, QueryFindDocumentsArgs, QueryJobStatusArgs, QueryPollSyncEnvelopesArgs, QueryResolvers, ReactorModule, ReactorOperation, ReactorOperationResolvers, ReactorOperationResultPage, ReactorOperationResultPageResolvers, ReactorSigner, ReactorSignerApp, ReactorSignerAppInput, ReactorSignerAppInputSchema, ReactorSignerAppResolvers, ReactorSignerInput, ReactorSignerInputSchema, ReactorSignerResolvers, ReactorSignerUser, ReactorSignerUserInput, ReactorSignerUserInputSchema, ReactorSignerUserResolvers, ReactorSubgraph, ReadinessGate, RemoteCursor, RemoteCursorInput, RemoteCursorInputSchema, RemoteCursorResolvers, RemoteFilterInput, RemoteFilterInputSchema, RemoveRelationshipDocument, RemoveRelationshipMutation, RemoveRelationshipMutationVariables, RenameDocumentDocument, RenameDocumentMutation, RenameDocumentMutationVariables, Requester, RequireFields, Resolver, ResolverFn, ResolverTypeWrapper, ResolverWithResolve, Resolvers, ResolversObject, ResolversParentTypes, ResolversTypes, Revision, RevisionResolvers, Scalars, Sdk, SearchFilterInput, SearchFilterInputSchema, SetPreferredEditorDocument, SetPreferredEditorMutation, SetPreferredEditorMutationVariables, SubgraphArgs, SubgraphClass, SubgraphDefinition, Subscription, SubscriptionDocumentChangesArgs, SubscriptionJobChangesArgs, SubscriptionObject, SubscriptionResolveFn, SubscriptionResolver, SubscriptionResolverObject, SubscriptionResolvers, SubscriptionSubscribeFn, SubscriptionSubscriberObject, SyncEnvelope, SyncEnvelopeInput, SyncEnvelopeInputSchema, SyncEnvelopeResolvers, SyncEnvelopeType, SyncEnvelopeTypeSchema, SystemSubgraph, TlsOptions, TouchChannelDocument, TouchChannelInput, TouchChannelInputSchema, TouchChannelMutation, TouchChannelMutationVariables, TouchChannelResult, TouchChannelResultResolvers, TypeResolveFn, User, ViewFilterInput, ViewFilterInputSchema, WithIndex, WsContextFactory, WsDisposer, assertAuthRequiredForDocumentPermissions, assertSkipCredentialVerificationAllowed, buildGraphQlDocument, buildGraphQlDriveDocument, buildGraphqlOperation, buildGraphqlOperations, buildSubgraphSchemaModule, createAuthFetchMiddleware, createGatewayAdapter, createHttpAdapter, createMergedSchema, createReactorGraphQLClient, createSchema, definedNonNullAnySchema, driveIdFromUrl, extractSubgraphsFromModule, generateDocumentModelSchema, getAuthContext, getDbClient, getDocumentModelSchemaName, getDocumentModelTypeDefs, getGitHash, getGitUrl, getSdk, getUniqueDocumentModels, getVersion, initAnalyticsStoreSql, initializeAndStartAPI, isDefinedNonNullAny, isExpectedLoaderMiss, isSubgraphClass, parseDriveUrl, renderGraphqlPlayground }; //# sourceMappingURL=index.d.mts.map