@powerhousedao/reactor-api 6.2.3-dev.34 → 6.2.3-dev.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,14 +1,14 @@
1
- import { a as IPackagePieceSource, c as PackageManagerResult, i as IPackageManagerOptions, l as PackagePiece, n as IPackageLoaderOptions, r as IPackageManager, t as IPackageLoader, u as PackagePieceEntry } from "./types-CuSz_zv6.mjs";
1
+ import { a as IPackagePieceSource, c as PackageManagerResult, i as IPackageManagerOptions, l as PackagePiece, n as IPackageLoaderOptions, r as IPackageManager, t as IPackageLoader, u as PackagePieceEntry } from "./types-DlTiz6AA.mjs";
2
2
  import { IAnalyticsStore } from "@powerhousedao/analytics-engine-core";
3
3
  import { AnalyticsModel } from "@powerhousedao/analytics-engine-graphql";
4
4
  import { DocumentNode, GraphQLError, GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig, GraphQLSchema } from "graphql";
5
5
  import { AttachmentRef, IDocumentModelLoader, IDocumentModelRegistry, IDriveClient, IReactorClient, IReactorProcessorHostModuleBase, IRelationalDb, ISyncManager, InProcessReactorClientModule, ParsedDriveUrl, ProcessorFactoryBuilder as ProcessorFactoryBuilder$1, SyncScopeGate, driveIdFromUrl, parseDriveUrl } from "@powerhousedao/reactor";
6
+ import { AuthSubject, DocumentModelGlobalState as DocumentModelGlobalState$1, DocumentModelModule, Operation, PHDocument, UpgradeManifest } from "@powerhousedao/shared/document-model";
6
7
  import { ILogger } from "document-model";
7
8
  import { GraphQLResolverMap, GraphQLSchemaModule } from "@apollo/subgraph";
8
- import { AuthSubject, DocumentModelGlobalState as DocumentModelGlobalState$1, DocumentModelModule, Operation, PHDocument, UpgradeManifest } from "@powerhousedao/shared/document-model";
9
9
  import * as z$1 from "zod";
10
10
  import { DocumentDriveDocument, DocumentDriveGlobalState } from "@powerhousedao/shared/document-drive";
11
- import { AttachmentBuildResult, AttachmentReferenceIndexBuildResult, IAttachmentReferenceReader, IAttachmentReferenceWriter } from "@powerhousedao/reactor-attachments";
11
+ import { AttachmentBuildResult, AttachmentDownloadOptions, AttachmentDownloadTarget, AttachmentDownloadTargetOptions, AttachmentHeader, AttachmentReferenceIndexBuildResult, AttachmentResponse, AttachmentStatOptions, IAttachmentReferenceReader, IAttachmentReferenceWriter, IAttachmentService, IAttachmentUpload, ReserveAttachmentOptions } from "@powerhousedao/reactor-attachments";
12
12
  import { IAttachmentClient } from "@powerhousedao/reactor-attachments/client";
13
13
  import { WebSocketServer } from "ws";
14
14
  import { AuthorizerResult, IHttpScope, IRelationalDb as IRelationalDb$1, IWebhookEndpoints, IWebhookScope, NodeRouteSpec, ProcessorApp, ProcessorFactory, RouteActor, RouteAuth, RouteAuthorizer, RouteBody, RouteContext, RouteHandler, RouteMethod, RouteOptions, RouteSpec, RouteTransport, RouteUser, RouteUser as RouteUser$1, ScopedRouteHandle, WebhookEndpointInfo, WebhookField, WebhookHashAlgorithm, WebhookPolicy, WebhookReply, WebhookRequest, WebhookScheme, WebhookSignatureEncoding, WebhookSpec, WebhookVerification } from "@powerhousedao/shared/processors";
@@ -146,7 +146,18 @@ export declare class DocumentPermissionService {
146
146
  /**
147
147
  * Delete all permissions for a document (used when deleting a document)
148
148
  */
149
- deleteAllDocumentPermissions(documentId: string): Promise<void>;
149
+ deleteAllDocumentPermissions(documentId: string): Promise<{
150
+ DocumentPermission: number;
151
+ OperationUserPermission: number;
152
+ }>;
153
+ /** Delete a document's protection row, which names its owner. */
154
+ deleteDocumentProtection(documentId: string): Promise<number>;
155
+ /** Every row that names the address, for a subject access request. */
156
+ rowsForAddress(address: string): Promise<{
157
+ permissions: DocumentPermissionEntry[];
158
+ operationPermissions: OperationUserPermissionEntry[];
159
+ ownedDocumentIds: string[];
160
+ }>;
150
161
  /**
151
162
  * Grant a user permission to execute an operation on a document
152
163
  */
@@ -733,6 +744,192 @@ export declare function redactHeaders(headers: Record<string, string>, extra?: s
733
744
  * XML or CSV payload is still reachable downstream. */
734
745
  export declare function parseWebhookBody(raw: Buffer, contentType?: string): unknown;
735
746
  //#endregion
747
+ //#region src/services/canonical-document-id.d.ts
748
+ /**
749
+ * Raised when a caller-supplied identifier cannot be resolved to a canonical
750
+ * document id. Carries no detail on purpose: resolution failures must not act
751
+ * as a document-existence oracle, so consumers map this to their generic
752
+ * fail-closed response.
753
+ */
754
+ export declare class CanonicalDocumentIdResolutionError extends Error {
755
+ constructor();
756
+ }
757
+ export type CanonicalDocumentIdResolver = (identifier: string) => Promise<CanonicalDocumentId>;
758
+ /**
759
+ * The sanctioned string-to-CanonicalDocumentId cast: both the GraphQL layer
760
+ * and server routes must resolve caller identifiers through this helper so
761
+ * decision and data layers always agree on the subject document.
762
+ */
763
+ export declare function createCanonicalDocumentIdResolver(client: Pick<IReactorClient, "resolveIdOrSlug">): CanonicalDocumentIdResolver;
764
+ //#endregion
765
+ //#region src/services/attachment-access.service.d.ts
766
+ /**
767
+ * Whether the active Reactor composition hosts the attachment-reference
768
+ * projection. Reported by the client initializer: the built-in stack always
769
+ * registers it, while a caller-provided Reactor may lack the live
770
+ * registration capability. Consumers of reference evidence must fail closed
771
+ * when it is unavailable.
772
+ */
773
+ export type AttachmentReferenceProjectionCapability = {
774
+ status: "available";
775
+ } | {
776
+ status: "unavailable";
777
+ reason: "live-read-model-registration-unsupported" | "in-process-reactor-module-unavailable" | "initializer-did-not-report";
778
+ };
779
+ /**
780
+ * Outcome of an attachment read authorization. `denied` intentionally covers
781
+ * both an unreadable document and an absent document/ref relationship so the
782
+ * route layer cannot leak which check failed. `projection-unavailable` means
783
+ * the reference index is not being maintained in this composition; it is
784
+ * returned before any document-authorization or reference lookup runs.
785
+ */
786
+ export type AttachmentAccessResult = {
787
+ kind: "allowed";
788
+ documentId: CanonicalDocumentId;
789
+ ref: AttachmentRef;
790
+ } | {
791
+ kind: "denied";
792
+ } | {
793
+ kind: "projection-unavailable";
794
+ };
795
+ export interface AttachmentAccessRequest {
796
+ documentId: string;
797
+ attachmentRef: string;
798
+ userAddress?: string;
799
+ /**
800
+ * The `did:key` of the app instance whose token authenticated the caller.
801
+ * A policy subject is an address AND a key — a grant can name either, and a
802
+ * document's creator is recorded by key — so a decision made from the address
803
+ * alone answers a narrower question than the one being asked.
804
+ */
805
+ appKey?: string;
806
+ }
807
+ /** The reactor's read gate, as the attachment facade consults it. */
808
+ export type AttachmentReadGate = Pick<IReactorClient, "isServed" | "get">;
809
+ /**
810
+ * Which scopes of a document a subject may read, asked by document id.
811
+ *
812
+ * Structural on purpose: the composition that has a policy model to enforce
813
+ * supplies `SyncScopeGate`, and one that does not supplies nothing at all.
814
+ */
815
+ export interface IDocumentScopeGate {
816
+ scopePredicateById(documentId: string, subject: {
817
+ address?: string;
818
+ key?: string;
819
+ }, branch: string, signal?: AbortSignal): Promise<(scope: string) => boolean>;
820
+ }
821
+ export type AttachmentCallerResult = {
822
+ kind: "admitted";
823
+ } | {
824
+ kind: "unauthenticated";
825
+ };
826
+ export interface AttachmentCallerRequest {
827
+ intent: "read" | "write";
828
+ userAddress?: string;
829
+ appKey?: string;
830
+ }
831
+ export interface IAttachmentAccessService {
832
+ canReadAttachment(request: AttachmentAccessRequest): Promise<AttachmentAccessResult>;
833
+ /** Whether this caller may use attachments at all, before any document decides. */
834
+ admitCaller(request: AttachmentCallerRequest): Promise<AttachmentCallerResult>;
835
+ }
836
+ export interface AttachmentAccessServiceOptions {
837
+ /** Refuse writes from a caller with no address. Default `true`. */
838
+ refuseAnonymousWrites?: boolean;
839
+ /** Refuse reads from a caller with no address. Default `false`. */
840
+ refuseAnonymousReads?: boolean;
841
+ }
842
+ /**
843
+ * Composes document authorization with the projected document/ref
844
+ * relationship. Order is fixed: validate ref, resolve the canonical document
845
+ * id, decide the read, check the reactor's read gate serves the document, then
846
+ * check the reference index and that the subject may read a scope whose
847
+ * operations reference the attachment. A denied document never reaches the
848
+ * reference reader, and the facade never touches attachment metadata, storage
849
+ * backends, or presigners.
850
+ *
851
+ * The named document decides alone: an attachment several documents reference
852
+ * is readable through each of them on that document's own terms.
853
+ *
854
+ * The read is decided by the document's own policy when this composition has a
855
+ * model to enforce it with, and by the host's permission tables when it does
856
+ * not. That is not a preference between two equivalent answers: a host running
857
+ * document policies keeps no rows in the permission tables, so asking them
858
+ * about such a document returns whatever the host-wide policy says — under
859
+ * `OPEN`, `true`, for everyone. Serving bytes on that answer hands the file to
860
+ * anyone who learns its hash, which the document's own state may well have told
861
+ * them. Both are kept because they are the two halves of one rule: an
862
+ * attachment is readable by whoever may read the document that references it,
863
+ * and each composition can only express that in its own terms. The caller
864
+ * decision mirrors the routes' `requireAuth`.
865
+ */
866
+ export declare class AttachmentAccessService implements IAttachmentAccessService {
867
+ private readonly resolveCanonicalId;
868
+ private readonly authorization;
869
+ private readonly references;
870
+ private readonly projection;
871
+ private readonly readGate;
872
+ /**
873
+ * Absent below auth enforcement, where there is no policy model to
874
+ * evaluate; the host's permission tables decide alone, exactly as before.
875
+ */
876
+ private readonly scopeGate?;
877
+ private readonly options;
878
+ constructor(resolveCanonicalId: CanonicalDocumentIdResolver, authorization: IAuthorizationService, references: IAttachmentReferenceReader, projection: AttachmentReferenceProjectionCapability, readGate: AttachmentReadGate,
879
+ /**
880
+ * Absent below auth enforcement, where there is no policy model to
881
+ * evaluate; the host's permission tables decide alone, exactly as before.
882
+ */
883
+ scopeGate?: IDocumentScopeGate | undefined, options?: AttachmentAccessServiceOptions);
884
+ admitCaller(request: AttachmentCallerRequest): Promise<AttachmentCallerResult>;
885
+ canReadAttachment(request: AttachmentAccessRequest): Promise<AttachmentAccessResult>;
886
+ /**
887
+ * Whether the caller may read the state the reference lives in.
888
+ *
889
+ * A failure here is rethrown rather than turned into a denial. A read side
890
+ * that is down must not read as a policy: a denial nobody can distinguish
891
+ * from a refusal is one nobody investigates, and the route answers 500 for a
892
+ * reason.
893
+ */
894
+ private canReadDocument;
895
+ }
896
+ //#endregion
897
+ //#region src/services/authorized-attachment.service.d.ts
898
+ /** The reference index is not maintained in this composition. */
899
+ export declare class AttachmentAccessUnavailable extends Error {
900
+ constructor();
901
+ }
902
+ /** The access decision itself failed; the cause is logged, not surfaced. */
903
+ export declare class AttachmentAccessFailed extends Error {
904
+ constructor(cause: unknown);
905
+ }
906
+ /** An `IAttachmentService` whose reads and writes are decided for one subject. */
907
+ export declare class AuthorizedAttachmentService implements IAttachmentService {
908
+ private readonly inner;
909
+ private readonly access;
910
+ private readonly subject;
911
+ private readonly logger;
912
+ constructor(inner: IAttachmentService, access: IAttachmentAccessService, subject: AuthSubject, logger: ILogger);
913
+ /** Hash-first only: an upload-first handle can send after it expires. */
914
+ reserve(options: ReserveAttachmentOptions): Promise<IAttachmentUpload>;
915
+ stat(ref: AttachmentRef, options?: AttachmentStatOptions): Promise<AttachmentHeader>;
916
+ get(ref: AttachmentRef, options?: AbortSignal | AttachmentDownloadOptions): Promise<AttachmentResponse>;
917
+ getDownloadTarget(ref: AttachmentRef, options: AttachmentDownloadTargetOptions): Promise<AttachmentDownloadTarget>;
918
+ private decideRead;
919
+ private admit;
920
+ private accessFailed;
921
+ }
922
+ export interface IAttachmentClientProvider {
923
+ forSubject(subject: AuthSubject): IAttachmentClient;
924
+ }
925
+ export declare class AttachmentClientProvider implements IAttachmentClientProvider {
926
+ private readonly service;
927
+ private readonly access;
928
+ private readonly logger;
929
+ constructor(service: IAttachmentService, access: IAttachmentAccessService, logger: ILogger);
930
+ forSubject(subject: AuthSubject): IAttachmentClient;
931
+ }
932
+ //#endregion
736
933
  //#region src/graphql/types.d.ts
737
934
  export type SubgraphClass = typeof BaseSubgraph;
738
935
  export type Context = {
@@ -786,6 +983,11 @@ export type SubgraphArgs = {
786
983
  * to the host's permission tables alone.
787
984
  */
788
985
  syncServingGate?: SyncScopeGate;
986
+ /**
987
+ * Attachments as the request's caller may use them. Bind per request with
988
+ * `BaseSubgraph.attachmentsFor(ctx)`.
989
+ */
990
+ attachments?: IAttachmentClientProvider;
789
991
  /**
790
992
  * The host's base path, injected by the GraphQL manager when it constructs
791
993
  * a subgraph. Subgraph code may read it, but routing ignores it: every
@@ -872,6 +1074,12 @@ export declare class BaseSubgraph implements ISubgraph$1 {
872
1074
  authorizationService: IAuthorizationService;
873
1075
  syncServingGate?: SyncScopeGate;
874
1076
  constructor(args: SubgraphArgs$1);
1077
+ /**
1078
+ * An attachment client bound to this request's caller, memoized per request.
1079
+ *
1080
+ * @throws Error when the host provides no attachment client to subgraphs.
1081
+ */
1082
+ attachmentsFor(ctx: Context): IAttachmentClient;
875
1083
  onSetup(): Promise<void>;
876
1084
  onDisconnect(): Promise<void>;
877
1085
  /**
@@ -1032,6 +1240,10 @@ declare function transferDocumentOwnership(service: DocumentPermissionService, a
1032
1240
  }, userAddress: string | undefined): Promise<DocumentProtectionInfo>;
1033
1241
  //#endregion
1034
1242
  //#region src/graphql/auth/subgraph.d.ts
1243
+ type DocumentArgs = {
1244
+ documentIdOrSlug?: string | null;
1245
+ documentId?: string | null;
1246
+ };
1035
1247
  /**
1036
1248
  * Auth Subgraph - handles all document permission and authorization operations
1037
1249
  *
@@ -1042,6 +1254,7 @@ declare function transferDocumentOwnership(service: DocumentPermissionService, a
1042
1254
  * - Operation-level permissions (fine-grained operation control)
1043
1255
  */
1044
1256
  export declare class AuthSubgraph extends BaseSubgraph {
1257
+ #private;
1045
1258
  private logger;
1046
1259
  constructor(args: SubgraphArgs);
1047
1260
  name: string;
@@ -1049,9 +1262,7 @@ export declare class AuthSubgraph extends BaseSubgraph {
1049
1262
  typeDefs: import("graphql").DocumentNode;
1050
1263
  resolvers: {
1051
1264
  Query: {
1052
- documentAccess: (_parent: unknown, args: {
1053
- documentId: string;
1054
- }, ctx: {
1265
+ documentAccess: (_parent: unknown, args: DocumentArgs, ctx: {
1055
1266
  user?: {
1056
1267
  address: string;
1057
1268
  };
@@ -1068,49 +1279,42 @@ export declare class AuthSubgraph extends BaseSubgraph {
1068
1279
  createdAt: Date;
1069
1280
  updatedAt: Date;
1070
1281
  }[]>;
1071
- operationPermissions: (_parent: unknown, args: {
1072
- documentId: string;
1282
+ operationPermissions: (_parent: unknown, args: DocumentArgs & {
1073
1283
  operationType: string;
1074
1284
  }, ctx: {
1075
1285
  user?: {
1076
1286
  address: string;
1077
1287
  };
1078
1288
  }) => Promise<OperationPermissionsInfo>;
1079
- canExecuteOperation: (_parent: unknown, args: {
1080
- documentId: string;
1289
+ canExecuteOperation: (_parent: unknown, args: DocumentArgs & {
1081
1290
  operationType: string;
1082
1291
  }, ctx: {
1083
1292
  user?: {
1084
1293
  address: string;
1085
1294
  };
1086
1295
  }) => Promise<boolean>;
1087
- documentProtection: (_parent: unknown, args: {
1088
- documentId: string;
1089
- }, ctx: {
1296
+ documentProtection: (_parent: unknown, args: DocumentArgs, ctx: {
1090
1297
  user?: {
1091
1298
  address: string;
1092
1299
  };
1093
1300
  }) => Promise<DocumentProtectionInfo>;
1094
1301
  };
1095
1302
  Mutation: {
1096
- setDocumentProtection: (_parent: unknown, args: {
1097
- documentId: string;
1303
+ setDocumentProtection: (_parent: unknown, args: DocumentArgs & {
1098
1304
  protected: boolean;
1099
1305
  }, ctx: {
1100
1306
  user?: {
1101
1307
  address: string;
1102
1308
  };
1103
1309
  }) => Promise<DocumentProtectionInfo>;
1104
- transferDocumentOwnership: (_parent: unknown, args: {
1105
- documentId: string;
1310
+ transferDocumentOwnership: (_parent: unknown, args: DocumentArgs & {
1106
1311
  newOwnerAddress: string;
1107
1312
  }, ctx: {
1108
1313
  user?: {
1109
1314
  address: string;
1110
1315
  };
1111
1316
  }) => Promise<DocumentProtectionInfo>;
1112
- grantDocumentPermission: (_parent: unknown, args: {
1113
- documentId: string;
1317
+ grantDocumentPermission: (_parent: unknown, args: DocumentArgs & {
1114
1318
  userAddress: string;
1115
1319
  permission: string;
1116
1320
  }, ctx: {
@@ -1125,16 +1329,14 @@ export declare class AuthSubgraph extends BaseSubgraph {
1125
1329
  createdAt: Date;
1126
1330
  updatedAt: Date;
1127
1331
  }>;
1128
- revokeDocumentPermission: (_parent: unknown, args: {
1129
- documentId: string;
1332
+ revokeDocumentPermission: (_parent: unknown, args: DocumentArgs & {
1130
1333
  userAddress: string;
1131
1334
  }, ctx: {
1132
1335
  user?: {
1133
1336
  address: string;
1134
1337
  };
1135
1338
  }) => Promise<boolean>;
1136
- grantOperationPermission: (_parent: unknown, args: {
1137
- documentId: string;
1339
+ grantOperationPermission: (_parent: unknown, args: DocumentArgs & {
1138
1340
  operationType: string;
1139
1341
  userAddress: string;
1140
1342
  }, ctx: {
@@ -1142,8 +1344,7 @@ export declare class AuthSubgraph extends BaseSubgraph {
1142
1344
  address: string;
1143
1345
  };
1144
1346
  }) => Promise<OperationUserPermission>;
1145
- revokeOperationPermission: (_parent: unknown, args: {
1146
- documentId: string;
1347
+ revokeOperationPermission: (_parent: unknown, args: DocumentArgs & {
1147
1348
  operationType: string;
1148
1349
  userAddress: string;
1149
1350
  }, ctx: {
@@ -1200,6 +1401,31 @@ type RequireAuthFetchMiddleware = (handler: FetchHandler) => FetchHandler;
1200
1401
  export type GraphqlManagerFeatureFlags = {
1201
1402
  enableDocumentModelSubgraphs?: boolean;
1202
1403
  };
1404
+ /** Dependencies and settings for a {@link GraphQLManager}. */
1405
+ export type GraphQLManagerOptions = {
1406
+ path: string;
1407
+ httpServer: http.Server;
1408
+ wsServer: WebSocketServer;
1409
+ reactorClient: IReactorClient;
1410
+ relationalDb: IRelationalDb;
1411
+ analyticsStore: IAnalyticsStore;
1412
+ syncManager: ISyncManager;
1413
+ logger: ILogger;
1414
+ httpAdapter: IHttpAdapter;
1415
+ gatewayAdapter: IGatewayAdapter<Context$1>;
1416
+ authService?: AuthService;
1417
+ documentPermissionService?: DocumentPermissionService;
1418
+ /** Defaults to every flag on. */
1419
+ featureFlags?: GraphqlManagerFeatureFlags;
1420
+ /** Defaults to 4001. */
1421
+ port?: number;
1422
+ authorizationService: IAuthorizationService;
1423
+ /** Resolvers dispatch to it for reactor-drive parents. */
1424
+ reactorDriveClient?: IDriveClient;
1425
+ syncServingGate?: SyncScopeGate;
1426
+ httpRoutes?: HttpRouteService;
1427
+ attachments?: IAttachmentClientProvider;
1428
+ };
1203
1429
  export declare function createWsAuthHandlers(opts: {
1204
1430
  authService?: AuthService;
1205
1431
  /** Whether anonymous callers are refused; read at call time, not at build time. */
@@ -1209,22 +1435,6 @@ export declare function createWsAuthHandlers(opts: {
1209
1435
  }): WsHandlers<Context$1>;
1210
1436
  export declare class GraphQLManager {
1211
1437
  #private;
1212
- private readonly path;
1213
- private readonly httpServer;
1214
- private readonly wsServer;
1215
- private readonly reactorClient;
1216
- private readonly relationalDb;
1217
- private readonly analyticsStore;
1218
- private readonly syncManager;
1219
- private readonly logger;
1220
- private readonly httpAdapter;
1221
- private readonly gatewayAdapter;
1222
- private readonly authService?;
1223
- private readonly documentPermissionService?;
1224
- private readonly featureFlags;
1225
- private readonly port;
1226
- private readonly syncServingGate?;
1227
- private readonly httpRoutes?;
1228
1438
  private initialized;
1229
1439
  private coreSubgraphsMap;
1230
1440
  private contextFields;
@@ -1251,7 +1461,24 @@ export declare class GraphQLManager {
1251
1461
  */
1252
1462
  readonly reactorDriveClient?: IDriveClient;
1253
1463
  private readonly authorizationService;
1254
- constructor(path: string, httpServer: http.Server, wsServer: WebSocketServer, reactorClient: IReactorClient, relationalDb: IRelationalDb, analyticsStore: IAnalyticsStore, syncManager: ISyncManager, logger: ILogger, httpAdapter: IHttpAdapter, gatewayAdapter: IGatewayAdapter<Context$1>, authService?: AuthService | undefined, documentPermissionService?: DocumentPermissionService | undefined, featureFlags?: GraphqlManagerFeatureFlags, port?: number, authorizationService?: IAuthorizationService, reactorDriveClient?: IDriveClient, syncServingGate?: SyncScopeGate | undefined, httpRoutes?: HttpRouteService | undefined);
1464
+ private readonly path;
1465
+ private readonly httpServer;
1466
+ private readonly wsServer;
1467
+ private readonly reactorClient;
1468
+ private readonly relationalDb;
1469
+ private readonly analyticsStore;
1470
+ private readonly syncManager;
1471
+ private readonly logger;
1472
+ private readonly httpAdapter;
1473
+ private readonly gatewayAdapter;
1474
+ private readonly authService?;
1475
+ private readonly documentPermissionService?;
1476
+ private readonly featureFlags;
1477
+ private readonly port;
1478
+ private readonly syncServingGate?;
1479
+ private readonly httpRoutes?;
1480
+ private readonly attachments?;
1481
+ constructor(options: GraphQLManagerOptions);
1255
1482
  init(coreSubgraphs: SubgraphClass$1[], authMiddleware?: AuthFetchMiddleware, requireAuthMiddleware?: RequireAuthFetchMiddleware): Promise<void>;
1256
1483
  /**
1257
1484
  * Regenerate document model subgraphs when models are dynamically loaded.
@@ -1341,135 +1568,6 @@ export declare class InMemoryPackageStorage implements IPackageStorage {
1341
1568
  has(name: string): Promise<boolean>;
1342
1569
  }
1343
1570
  //#endregion
1344
- //#region src/services/canonical-document-id.d.ts
1345
- /**
1346
- * Raised when a caller-supplied identifier cannot be resolved to a canonical
1347
- * document id. Carries no detail on purpose: resolution failures must not act
1348
- * as a document-existence oracle, so consumers map this to their generic
1349
- * fail-closed response.
1350
- */
1351
- export declare class CanonicalDocumentIdResolutionError extends Error {
1352
- constructor();
1353
- }
1354
- export type CanonicalDocumentIdResolver = (identifier: string) => Promise<CanonicalDocumentId>;
1355
- /**
1356
- * The sanctioned string-to-CanonicalDocumentId cast: both the GraphQL layer
1357
- * and server routes must resolve caller identifiers through this helper so
1358
- * decision and data layers always agree on the subject document.
1359
- */
1360
- export declare function createCanonicalDocumentIdResolver(client: Pick<IReactorClient, "resolveIdOrSlug">): CanonicalDocumentIdResolver;
1361
- //#endregion
1362
- //#region src/services/attachment-access.service.d.ts
1363
- /**
1364
- * Whether the active Reactor composition hosts the attachment-reference
1365
- * projection. Reported by the client initializer: the built-in stack always
1366
- * registers it, while a caller-provided Reactor may lack the live
1367
- * registration capability. Consumers of reference evidence must fail closed
1368
- * when it is unavailable.
1369
- */
1370
- export type AttachmentReferenceProjectionCapability = {
1371
- status: "available";
1372
- } | {
1373
- status: "unavailable";
1374
- reason: "live-read-model-registration-unsupported" | "in-process-reactor-module-unavailable" | "initializer-did-not-report";
1375
- };
1376
- /**
1377
- * Outcome of an attachment read authorization. `denied` intentionally covers
1378
- * both an unreadable document and an absent document/ref relationship so the
1379
- * route layer cannot leak which check failed. `projection-unavailable` means
1380
- * the reference index is not being maintained in this composition; it is
1381
- * returned before any document-authorization or reference lookup runs.
1382
- */
1383
- export type AttachmentAccessResult = {
1384
- kind: "allowed";
1385
- documentId: CanonicalDocumentId;
1386
- ref: AttachmentRef;
1387
- } | {
1388
- kind: "denied";
1389
- } | {
1390
- kind: "projection-unavailable";
1391
- };
1392
- export interface AttachmentAccessRequest {
1393
- documentId: string;
1394
- attachmentRef: string;
1395
- userAddress?: string;
1396
- /**
1397
- * The `did:key` of the app instance whose token authenticated the caller.
1398
- * A policy subject is an address AND a key — a grant can name either, and a
1399
- * document's creator is recorded by key — so a decision made from the address
1400
- * alone answers a narrower question than the one being asked.
1401
- */
1402
- appKey?: string;
1403
- }
1404
- /** The reactor's read gate, as the attachment facade consults it. */
1405
- export type AttachmentReadGate = Pick<IReactorClient, "isServed" | "get">;
1406
- /**
1407
- * Which scopes of a document a subject may read, asked by document id.
1408
- *
1409
- * Structural on purpose: the composition that has a policy model to enforce
1410
- * supplies `SyncScopeGate`, and one that does not supplies nothing at all.
1411
- */
1412
- export interface IDocumentScopeGate {
1413
- scopePredicateById(documentId: string, subject: {
1414
- address?: string;
1415
- key?: string;
1416
- }, branch: string, signal?: AbortSignal): Promise<(scope: string) => boolean>;
1417
- }
1418
- export interface IAttachmentAccessService {
1419
- canReadAttachment(request: AttachmentAccessRequest): Promise<AttachmentAccessResult>;
1420
- }
1421
- /**
1422
- * Composes document authorization with the projected document/ref
1423
- * relationship. Order is fixed: validate ref, resolve the canonical document
1424
- * id, decide the read, check the reactor's read gate serves the document, then
1425
- * check the reference index and that the subject may read a scope whose
1426
- * operations reference the attachment. A denied document never reaches the
1427
- * reference reader, and the facade never touches attachment metadata, storage
1428
- * backends, or presigners.
1429
- *
1430
- * The named document decides alone: an attachment several documents reference
1431
- * is readable through each of them on that document's own terms.
1432
- *
1433
- * The read is decided by the document's own policy when this composition has a
1434
- * model to enforce it with, and by the host's permission tables when it does
1435
- * not. That is not a preference between two equivalent answers: a host running
1436
- * document policies keeps no rows in the permission tables, so asking them
1437
- * about such a document returns whatever the host-wide policy says — under
1438
- * `OPEN`, `true`, for everyone. Serving bytes on that answer hands the file to
1439
- * anyone who learns its hash, which the document's own state may well have told
1440
- * them. Both are kept because they are the two halves of one rule: an
1441
- * attachment is readable by whoever may read the document that references it,
1442
- * and each composition can only express that in its own terms.
1443
- */
1444
- export declare class AttachmentAccessService implements IAttachmentAccessService {
1445
- private readonly resolveCanonicalId;
1446
- private readonly authorization;
1447
- private readonly references;
1448
- private readonly projection;
1449
- private readonly readGate;
1450
- /**
1451
- * Absent below auth enforcement, where there is no policy model to
1452
- * evaluate; the host's permission tables decide alone, exactly as before.
1453
- */
1454
- private readonly scopeGate?;
1455
- constructor(resolveCanonicalId: CanonicalDocumentIdResolver, authorization: IAuthorizationService, references: IAttachmentReferenceReader, projection: AttachmentReferenceProjectionCapability, readGate: AttachmentReadGate,
1456
- /**
1457
- * Absent below auth enforcement, where there is no policy model to
1458
- * evaluate; the host's permission tables decide alone, exactly as before.
1459
- */
1460
- scopeGate?: IDocumentScopeGate | undefined);
1461
- canReadAttachment(request: AttachmentAccessRequest): Promise<AttachmentAccessResult>;
1462
- /**
1463
- * Whether the caller may read the state the reference lives in.
1464
- *
1465
- * A failure here is rethrown rather than turned into a denial. A read side
1466
- * that is down must not read as a policy: a denial nobody can distinguish
1467
- * from a refusal is one nobody investigates, and the route answers 500 for a
1468
- * reason.
1469
- */
1470
- private canReadDocument;
1471
- }
1472
- //#endregion
1473
1571
  //#region src/types.d.ts
1474
1572
  /**
1475
1573
  * Module hosts pass to processor factories: the reactor-level module plus the
@@ -1494,6 +1592,8 @@ export type API = {
1494
1592
  attachmentReferenceIndex: AttachmentReferenceIndexBuildResult;
1495
1593
  /** Document-authorized attachment read decisions; see AttachmentAccessService. */
1496
1594
  attachmentAccess: IAttachmentAccessService;
1595
+ /** Caller-bound attachment clients for subgraphs the host constructs itself. */
1596
+ attachmentClientProvider: IAttachmentClientProvider;
1497
1597
  authService: AuthService | undefined;
1498
1598
  /**
1499
1599
  * Whether this deployment refuses anonymous callers
@@ -1992,41 +2092,52 @@ export type MutationAddRelationshipArgs = {
1992
2092
  branch?: InputMaybe<Scalars["String"]["input"]>;
1993
2093
  metadata?: InputMaybe<Scalars["JSONObject"]["input"]>;
1994
2094
  relationshipType: Scalars["String"]["input"];
1995
- sourceIdentifier: Scalars["String"]["input"];
1996
- targetIdentifier: Scalars["String"]["input"];
2095
+ sourceIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2096
+ sourceIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2097
+ targetIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2098
+ targetIdentifier?: InputMaybe<Scalars["String"]["input"]>;
1997
2099
  };
1998
2100
  export type MutationCreateDocumentArgs = {
1999
2101
  document: Scalars["JSONObject"]["input"];
2102
+ parentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2000
2103
  parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2001
2104
  };
2002
2105
  export type MutationCreateEmptyDocumentArgs = {
2003
2106
  documentType: Scalars["String"]["input"];
2107
+ parentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2004
2108
  parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2005
2109
  };
2006
2110
  export type MutationDeleteDocumentArgs = {
2007
- identifier: Scalars["String"]["input"];
2111
+ idOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2112
+ identifier?: InputMaybe<Scalars["String"]["input"]>;
2008
2113
  propagate?: InputMaybe<PropagationMode>;
2009
2114
  };
2010
2115
  export type MutationDeleteDocumentsArgs = {
2011
- identifiers: ReadonlyArray<Scalars["String"]["input"]>;
2116
+ identifiers?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
2117
+ idsOrSlugs?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
2012
2118
  propagate?: InputMaybe<PropagationMode>;
2013
2119
  };
2014
2120
  export type MutationExecuteArgs = {
2015
2121
  actions: ReadonlyArray<ActionInput>;
2016
2122
  branch?: InputMaybe<Scalars["String"]["input"]>;
2017
- documentIdentifier: Scalars["String"]["input"];
2123
+ documentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2124
+ documentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2018
2125
  };
2019
2126
  export type MutationExecuteAsyncArgs = {
2020
2127
  actions: ReadonlyArray<ActionInput>;
2021
2128
  branch?: InputMaybe<Scalars["String"]["input"]>;
2022
- documentIdentifier: Scalars["String"]["input"];
2129
+ documentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2130
+ documentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2023
2131
  };
2024
2132
  export type MutationMoveRelationshipArgs = {
2025
2133
  branch?: InputMaybe<Scalars["String"]["input"]>;
2026
2134
  relationshipType: Scalars["String"]["input"];
2027
- sourceParentIdentifier: Scalars["String"]["input"];
2028
- targetIdentifier: Scalars["String"]["input"];
2029
- targetParentIdentifier: Scalars["String"]["input"];
2135
+ sourceParentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2136
+ sourceParentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2137
+ targetIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2138
+ targetIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2139
+ targetParentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2140
+ targetParentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2030
2141
  };
2031
2142
  export type MutationMutateDocumentArgs = {
2032
2143
  actions: ReadonlyArray<Scalars["JSONObject"]["input"]>;
@@ -2045,17 +2156,21 @@ export type MutationPushSyncEnvelopesArgs = {
2045
2156
  export type MutationRemoveRelationshipArgs = {
2046
2157
  branch?: InputMaybe<Scalars["String"]["input"]>;
2047
2158
  relationshipType: Scalars["String"]["input"];
2048
- sourceIdentifier: Scalars["String"]["input"];
2049
- targetIdentifier: Scalars["String"]["input"];
2159
+ sourceIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2160
+ sourceIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2161
+ targetIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2162
+ targetIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2050
2163
  };
2051
2164
  export type MutationRenameDocumentArgs = {
2052
2165
  branch?: InputMaybe<Scalars["String"]["input"]>;
2053
- documentIdentifier: Scalars["String"]["input"];
2166
+ documentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2167
+ documentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2054
2168
  name: Scalars["String"]["input"];
2055
2169
  };
2056
2170
  export type MutationSetPreferredEditorArgs = {
2057
2171
  branch?: InputMaybe<Scalars["String"]["input"]>;
2058
- documentIdentifier: Scalars["String"]["input"];
2172
+ documentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2173
+ documentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2059
2174
  preferredEditor?: InputMaybe<Scalars["String"]["input"]>;
2060
2175
  };
2061
2176
  export type MutationTouchChannelArgs = {
@@ -2065,8 +2180,10 @@ export type MutationUpdateRelationshipArgs = {
2065
2180
  branch?: InputMaybe<Scalars["String"]["input"]>;
2066
2181
  metadata?: InputMaybe<Scalars["JSONObject"]["input"]>;
2067
2182
  relationshipType: Scalars["String"]["input"];
2068
- sourceIdentifier: Scalars["String"]["input"];
2069
- targetIdentifier: Scalars["String"]["input"];
2183
+ sourceIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2184
+ sourceIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2185
+ targetIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2186
+ targetIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2070
2187
  };
2071
2188
  export type OperationContext = {
2072
2189
  readonly branch: Scalars["String"]["output"];
@@ -2103,7 +2220,9 @@ export type OperationWithContextInput = {
2103
2220
  export type OperationsFilterInput = {
2104
2221
  readonly actionTypes?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
2105
2222
  readonly branch?: InputMaybe<Scalars["String"]["input"]>;
2106
- readonly documentId: Scalars["String"]["input"];
2223
+ /** @deprecated Use documentIdOrSlug. */
2224
+ readonly documentId?: InputMaybe<Scalars["String"]["input"]>;
2225
+ readonly documentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2107
2226
  readonly scopes?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
2108
2227
  readonly sinceRevision?: InputMaybe<Scalars["Int"]["input"]>;
2109
2228
  readonly timestampFrom?: InputMaybe<Scalars["String"]["input"]>;
@@ -2218,19 +2337,22 @@ export type Query = {
2218
2337
  readonly syncHolds: ReadonlyArray<SyncHold>;
2219
2338
  };
2220
2339
  export type QueryDocumentArgs = {
2221
- identifier: Scalars["String"]["input"];
2340
+ idOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2341
+ identifier?: InputMaybe<Scalars["String"]["input"]>;
2222
2342
  view?: InputMaybe<ViewFilterInput>;
2223
2343
  };
2224
2344
  export type QueryDocumentIncomingRelationshipEdgesArgs = {
2225
2345
  paging?: InputMaybe<PagingInput>;
2226
2346
  relationshipType?: InputMaybe<Scalars["String"]["input"]>;
2227
- targetIdentifier: Scalars["String"]["input"];
2347
+ targetIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2348
+ targetIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2228
2349
  view?: InputMaybe<ViewFilterInput>;
2229
2350
  };
2230
2351
  export type QueryDocumentIncomingRelationshipsArgs = {
2231
2352
  paging?: InputMaybe<PagingInput>;
2232
2353
  relationshipType: Scalars["String"]["input"];
2233
- targetIdentifier: Scalars["String"]["input"];
2354
+ targetIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2355
+ targetIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2234
2356
  view?: InputMaybe<ViewFilterInput>;
2235
2357
  };
2236
2358
  export type QueryDocumentModelsArgs = {
@@ -2244,19 +2366,22 @@ export type QueryDocumentOperationsArgs = {
2244
2366
  export type QueryDocumentOutgoingRelationshipEdgesArgs = {
2245
2367
  paging?: InputMaybe<PagingInput>;
2246
2368
  relationshipType?: InputMaybe<Scalars["String"]["input"]>;
2247
- sourceIdentifier: Scalars["String"]["input"];
2369
+ sourceIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2370
+ sourceIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2248
2371
  view?: InputMaybe<ViewFilterInput>;
2249
2372
  };
2250
2373
  export type QueryDocumentOutgoingRelationshipsArgs = {
2251
2374
  paging?: InputMaybe<PagingInput>;
2252
2375
  relationshipType: Scalars["String"]["input"];
2253
- sourceIdentifier: Scalars["String"]["input"];
2376
+ sourceIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2377
+ sourceIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2254
2378
  view?: InputMaybe<ViewFilterInput>;
2255
2379
  };
2256
2380
  export type QueryEvaluateActionsArgs = {
2257
2381
  branch?: InputMaybe<Scalars["String"]["input"]>;
2258
2382
  candidates: ReadonlyArray<ActionCandidateInput>;
2259
- documentIdentifier: Scalars["String"]["input"];
2383
+ documentIdOrSlug?: InputMaybe<Scalars["String"]["input"]>;
2384
+ documentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
2260
2385
  };
2261
2386
  export type QueryFindDocumentsArgs = {
2262
2387
  paging?: InputMaybe<PagingInput>;
@@ -2344,6 +2469,7 @@ export type Revision = {
2344
2469
  readonly scope: Scalars["String"]["output"];
2345
2470
  };
2346
2471
  export type SearchFilterInput = {
2472
+ /** @deprecated Ignored. Filter by type or parentId. */
2347
2473
  readonly identifiers?: InputMaybe<ReadonlyArray<Scalars["String"]["input"]>>;
2348
2474
  readonly parentId?: InputMaybe<Scalars["String"]["input"]>;
2349
2475
  readonly type?: InputMaybe<Scalars["String"]["input"]>;
@@ -2394,6 +2520,7 @@ export type SyncHoldReason = {
2394
2520
  export type SyncRefusalInput = {
2395
2521
  readonly branch: Scalars["String"]["input"];
2396
2522
  readonly documentId: Scalars["String"]["input"];
2523
+ readonly kind?: InputMaybe<Scalars["String"]["input"]>;
2397
2524
  };
2398
2525
  export type TouchChannelInput = {
2399
2526
  readonly collectionId: Scalars["String"]["input"];
@@ -3335,22 +3462,22 @@ export type MoveRelationshipResultResolvers<ContextType = Context, ParentType ex
3335
3462
  target?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType>;
3336
3463
  }>;
3337
3464
  export type MutationResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Mutation"] = ResolversParentTypes["Mutation"]> = ResolversObject<{
3338
- addRelationship?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationAddRelationshipArgs, "relationshipType" | "sourceIdentifier" | "targetIdentifier">>;
3465
+ addRelationship?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationAddRelationshipArgs, "relationshipType">>;
3339
3466
  createDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationCreateDocumentArgs, "document">>;
3340
3467
  createEmptyDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationCreateEmptyDocumentArgs, "documentType">>;
3341
- deleteDocument?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, RequireFields<MutationDeleteDocumentArgs, "identifier">>;
3342
- deleteDocuments?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, RequireFields<MutationDeleteDocumentsArgs, "identifiers">>;
3343
- execute?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationExecuteArgs, "actions" | "documentIdentifier">>;
3344
- executeAsync?: Resolver<ResolversTypes["JobInfo"], ParentType, ContextType, RequireFields<MutationExecuteAsyncArgs, "actions" | "documentIdentifier">>;
3345
- moveRelationship?: Resolver<ResolversTypes["MoveRelationshipResult"], ParentType, ContextType, RequireFields<MutationMoveRelationshipArgs, "relationshipType" | "sourceParentIdentifier" | "targetIdentifier" | "targetParentIdentifier">>;
3468
+ deleteDocument?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, Partial<MutationDeleteDocumentArgs>>;
3469
+ deleteDocuments?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, Partial<MutationDeleteDocumentsArgs>>;
3470
+ execute?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationExecuteArgs, "actions">>;
3471
+ executeAsync?: Resolver<ResolversTypes["JobInfo"], ParentType, ContextType, RequireFields<MutationExecuteAsyncArgs, "actions">>;
3472
+ moveRelationship?: Resolver<ResolversTypes["MoveRelationshipResult"], ParentType, ContextType, RequireFields<MutationMoveRelationshipArgs, "relationshipType">>;
3346
3473
  mutateDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationMutateDocumentArgs, "actions" | "documentIdentifier">>;
3347
3474
  mutateDocumentAsync?: Resolver<ResolversTypes["String"], ParentType, ContextType, RequireFields<MutationMutateDocumentAsyncArgs, "actions" | "documentIdentifier">>;
3348
3475
  pushSyncEnvelopes?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, RequireFields<MutationPushSyncEnvelopesArgs, "envelopes">>;
3349
- removeRelationship?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationRemoveRelationshipArgs, "relationshipType" | "sourceIdentifier" | "targetIdentifier">>;
3350
- renameDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationRenameDocumentArgs, "documentIdentifier" | "name">>;
3351
- setPreferredEditor?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationSetPreferredEditorArgs, "documentIdentifier">>;
3476
+ removeRelationship?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationRemoveRelationshipArgs, "relationshipType">>;
3477
+ renameDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationRenameDocumentArgs, "name">>;
3478
+ setPreferredEditor?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, Partial<MutationSetPreferredEditorArgs>>;
3352
3479
  touchChannel?: Resolver<ResolversTypes["TouchChannelResult"], ParentType, ContextType, RequireFields<MutationTouchChannelArgs, "input">>;
3353
- updateRelationship?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationUpdateRelationshipArgs, "relationshipType" | "sourceIdentifier" | "targetIdentifier">>;
3480
+ updateRelationship?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationUpdateRelationshipArgs, "relationshipType">>;
3354
3481
  }>;
3355
3482
  export type OperationContextResolvers<ContextType = Context, ParentType extends ResolversParentTypes["OperationContext"] = ResolversParentTypes["OperationContext"]> = ResolversObject<{
3356
3483
  branch?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
@@ -3406,14 +3533,14 @@ export type PollSyncEnvelopesResultResolvers<ContextType = Context, ParentType e
3406
3533
  peerManifestRevision?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
3407
3534
  }>;
3408
3535
  export type QueryResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Query"] = ResolversParentTypes["Query"]> = ResolversObject<{
3409
- document?: Resolver<Maybe<ResolversTypes["DocumentWithChildren"]>, ParentType, ContextType, RequireFields<QueryDocumentArgs, "identifier">>;
3410
- documentIncomingRelationshipEdges?: Resolver<ResolversTypes["DocumentRelationshipResultPage"], ParentType, ContextType, RequireFields<QueryDocumentIncomingRelationshipEdgesArgs, "targetIdentifier">>;
3411
- documentIncomingRelationships?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, RequireFields<QueryDocumentIncomingRelationshipsArgs, "relationshipType" | "targetIdentifier">>;
3536
+ document?: Resolver<Maybe<ResolversTypes["DocumentWithChildren"]>, ParentType, ContextType, Partial<QueryDocumentArgs>>;
3537
+ documentIncomingRelationshipEdges?: Resolver<ResolversTypes["DocumentRelationshipResultPage"], ParentType, ContextType, Partial<QueryDocumentIncomingRelationshipEdgesArgs>>;
3538
+ documentIncomingRelationships?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, RequireFields<QueryDocumentIncomingRelationshipsArgs, "relationshipType">>;
3412
3539
  documentModels?: Resolver<ResolversTypes["DocumentModelResultPage"], ParentType, ContextType, Partial<QueryDocumentModelsArgs>>;
3413
3540
  documentOperations?: Resolver<ResolversTypes["ReactorOperationResultPage"], ParentType, ContextType, RequireFields<QueryDocumentOperationsArgs, "filter">>;
3414
- documentOutgoingRelationshipEdges?: Resolver<ResolversTypes["DocumentRelationshipResultPage"], ParentType, ContextType, RequireFields<QueryDocumentOutgoingRelationshipEdgesArgs, "sourceIdentifier">>;
3415
- documentOutgoingRelationships?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, RequireFields<QueryDocumentOutgoingRelationshipsArgs, "relationshipType" | "sourceIdentifier">>;
3416
- evaluateActions?: Resolver<ResolversTypes["ActionEvaluations"], ParentType, ContextType, RequireFields<QueryEvaluateActionsArgs, "candidates" | "documentIdentifier">>;
3541
+ documentOutgoingRelationshipEdges?: Resolver<ResolversTypes["DocumentRelationshipResultPage"], ParentType, ContextType, Partial<QueryDocumentOutgoingRelationshipEdgesArgs>>;
3542
+ documentOutgoingRelationships?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, RequireFields<QueryDocumentOutgoingRelationshipsArgs, "relationshipType">>;
3543
+ evaluateActions?: Resolver<ResolversTypes["ActionEvaluations"], ParentType, ContextType, RequireFields<QueryEvaluateActionsArgs, "candidates">>;
3417
3544
  findDocuments?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, Partial<QueryFindDocumentsArgs>>;
3418
3545
  jobStatus?: Resolver<Maybe<ResolversTypes["JobInfo"]>, ParentType, ContextType, RequireFields<QueryJobStatusArgs, "jobId">>;
3419
3546
  peerAgreement?: Resolver<ResolversTypes["PeerAgreement"], ParentType, ContextType, RequireFields<QueryPeerAgreementArgs, "collectionId">>;
@@ -3875,6 +4002,13 @@ export declare class AuthEvaluationUnsupportedError extends GraphQLError {
3875
4002
  export declare class MalformedStoredOperationError extends GraphQLError {
3876
4003
  constructor(detail: string);
3877
4004
  }
4005
+ /**
4006
+ * The marker refusals a poll carried were not recorded, so the poll fails.
4007
+ * The code is recoverable: the client keeps polling and reports them again.
4008
+ */
4009
+ export declare class RefusalNotRecordedError extends GraphQLError {
4010
+ constructor(cause: unknown);
4011
+ }
3878
4012
  //#endregion
3879
4013
  //#region src/packages/import-loader.d.ts
3880
4014
  /**
@@ -4119,6 +4253,8 @@ export declare function initializeAndStartAPI(clientInitializer: (documentModels
4119
4253
  readiness: ReadinessGate;
4120
4254
  attachmentReferenceProjection: AttachmentReferenceProjectionCapability;
4121
4255
  packageManager: PackageManager;
4256
+ /** Set under DOCUMENT_PERMISSIONS; the privacy add-on erases through it. */
4257
+ documentPermissionService: DocumentPermissionService | undefined;
4122
4258
  }>;
4123
4259
  //#endregion
4124
4260
  //#region src/services/renown-credential-verifier.d.ts
@@ -4128,6 +4264,25 @@ export interface RenownCredentialVerifierConfig {
4128
4264
  }
4129
4265
  export declare function createRenownCredentialVerifier(config?: RenownCredentialVerifierConfig): Promise<CredentialVerifier>;
4130
4266
  //#endregion
4267
+ //#region src/services/privacy-permissions.d.ts
4268
+ /** One permission row naming an address, as reactor-privacy discloses it. */
4269
+ export type PrivacyPermissionRow = {
4270
+ table: string;
4271
+ column: string;
4272
+ documentId: string | null;
4273
+ detail?: Record<string, unknown>;
4274
+ };
4275
+ /**
4276
+ * reactor-privacy's permission lookup and eraser, over this host's
4277
+ * DocumentPermissionService. Typed structurally on the privacy side.
4278
+ */
4279
+ export declare class PrivacyPermissionAdapter {
4280
+ private readonly service;
4281
+ constructor(service: DocumentPermissionService);
4282
+ rowsForAddress(address: string): Promise<PrivacyPermissionRow[]>;
4283
+ erasePermissions(documentId: string): Promise<Record<string, number>>;
4284
+ }
4285
+ //#endregion
4131
4286
  //#region src/utils/create-schema.d.ts
4132
4287
  export declare const buildSubgraphSchemaModule: (documentModels: DocumentModelModule[], resolvers: GraphQLResolverMap<Context$1>, typeDefs: DocumentNode) => GraphQLSchemaModule;
4133
4288
  export declare const createSchema: (documentModels: DocumentModelModule[], resolvers: GraphQLResolverMap<Context$1>, typeDefs: DocumentNode) => import("graphql").GraphQLSchema;