@powerhousedao/reactor-api 6.2.2-dev.8 → 6.2.2-dev.81
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/{adapter-gateway-apollo-CxV_hMTv.mjs → adapter-gateway-apollo-DdamNLPT.mjs} +10 -4
- package/dist/adapter-gateway-apollo-DdamNLPT.mjs.map +1 -0
- package/dist/index.d.mts +458 -36
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +928 -139
- package/dist/index.mjs.map +1 -1
- package/dist/src/packages/https-hooks.mjs +1 -1
- package/dist/src/packages/vite-loader.d.mts +3 -2
- package/dist/src/packages/vite-loader.d.mts.map +1 -1
- package/dist/src/packages/vite-loader.mjs +21 -8
- package/dist/src/packages/vite-loader.mjs.map +1 -1
- package/dist/{types-DnHgkahK.d.mts → types-D2ZrjmCk.d.mts} +8 -2
- package/dist/types-D2ZrjmCk.d.mts.map +1 -0
- package/dist/{utils-iibOQ50e.mjs → utils-lHoPB-ft.mjs} +130 -23
- package/dist/utils-lHoPB-ft.mjs.map +1 -0
- package/package.json +21 -19
- package/dist/adapter-gateway-apollo-CxV_hMTv.mjs.map +0 -1
- package/dist/types-DnHgkahK.d.mts.map +0 -1
- package/dist/utils-iibOQ50e.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { i as IPackageManagerOptions, n as IPackageLoaderOptions, r as IPackageManager, s as PackageManagerResult, t as IPackageLoader } from "./types-
|
|
1
|
+
import { i as IPackageManagerOptions, n as IPackageLoaderOptions, r as IPackageManager, s as PackageManagerResult, t as IPackageLoader } from "./types-D2ZrjmCk.mjs";
|
|
2
2
|
import { IAnalyticsStore } from "@powerhousedao/analytics-engine-core";
|
|
3
3
|
import { AnalyticsModel } from "@powerhousedao/analytics-engine-graphql";
|
|
4
4
|
import * as graphql from "graphql";
|
|
5
5
|
import { DocumentNode, GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig, GraphQLSchema } from "graphql";
|
|
6
|
-
import { IDocumentModelLoader, IDocumentModelRegistry, IDriveClient, IReactorClient, IRelationalDb, ISyncManager, InProcessReactorClientModule, ParsedDriveUrl, driveIdFromUrl, parseDriveUrl } from "@powerhousedao/reactor";
|
|
6
|
+
import { AttachmentRef, IDocumentModelLoader, IDocumentModelRegistry, IDriveClient, IReactorClient, IReactorProcessorHostModuleBase, IRelationalDb, ISyncManager, InProcessReactorClientModule, ParsedDriveUrl, ProcessorFactoryBuilder as ProcessorFactoryBuilder$1, SyncScopeGate, driveIdFromUrl, parseDriveUrl } from "@powerhousedao/reactor";
|
|
7
7
|
import { ILogger } from "document-model";
|
|
8
|
-
import {
|
|
8
|
+
import { GraphQLResolverMap, GraphQLSchemaModule } from "@apollo/subgraph";
|
|
9
|
+
import { AuthSubject, DocumentModelGlobalState as DocumentModelGlobalState$1, DocumentModelModule, Operation, PHDocument, UpgradeManifest } from "@powerhousedao/shared/document-model";
|
|
9
10
|
import * as z$1 from "zod";
|
|
10
11
|
import { DocumentDriveDocument, DocumentDriveGlobalState } from "@powerhousedao/shared/document-drive";
|
|
11
|
-
import { AttachmentBuildResult } from "@powerhousedao/reactor-attachments";
|
|
12
|
+
import { AttachmentBuildResult, AttachmentReferenceIndexBuildResult, IAttachmentReferenceReader, IAttachmentReferenceWriter } from "@powerhousedao/reactor-attachments";
|
|
12
13
|
import { IAttachmentClient } from "@powerhousedao/reactor-attachments/client";
|
|
13
14
|
import { WebSocketServer } from "ws";
|
|
14
|
-
import {
|
|
15
|
+
import { IRelationalDb as IRelationalDb$1, ProcessorApp, ProcessorFactory } from "@powerhousedao/shared/processors";
|
|
15
16
|
import { Generated, Kysely } from "kysely";
|
|
16
17
|
import { PGlite } from "@electric-sql/pglite";
|
|
17
18
|
import { Knex } from "knex";
|
|
18
19
|
import http from "node:http";
|
|
19
20
|
import { CorsOptions } from "cors";
|
|
20
|
-
import { GraphQLResolverMap, GraphQLSchemaModule } from "@apollo/subgraph/dist/schema-helper/resolverMap.js";
|
|
21
21
|
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";
|
|
22
22
|
import { IncomingHttpHeaders } from "http";
|
|
23
23
|
import { Pool } from "pg";
|
|
24
|
+
import { PHReactorRenown } from "@powerhousedao/shared/clis";
|
|
24
25
|
|
|
25
26
|
//#region src/utils/db.d.ts
|
|
26
27
|
/**
|
|
@@ -63,6 +64,9 @@ interface OperationUserPermissionTable {
|
|
|
63
64
|
createdAt: Date;
|
|
64
65
|
}
|
|
65
66
|
type Db = Kysely<any>;
|
|
67
|
+
declare const PGLITE_UTC_PARSERS: {
|
|
68
|
+
readonly 1114: (value: string) => Date;
|
|
69
|
+
};
|
|
66
70
|
/**
|
|
67
71
|
* Optional factory used by callers (e.g. Switchboard) to inject a
|
|
68
72
|
* version-specific PGLite instance — e.g. `pglite-legacy-02` when an existing
|
|
@@ -215,7 +219,7 @@ declare class DocumentPermissionService {
|
|
|
215
219
|
* must key on the canonical id, so branding it forces every caller to resolve a
|
|
216
220
|
* slug to its id before consulting this service, closing the slug-aliasing
|
|
217
221
|
* bypass (S-C1). The only sanctioned cast from string to CanonicalDocumentId
|
|
218
|
-
* lives in
|
|
222
|
+
* lives in createCanonicalDocumentIdResolver, immediately after the shared
|
|
219
223
|
* resolveIdOrSlug lookup returns.
|
|
220
224
|
*/
|
|
221
225
|
type CanonicalDocumentId = string & {
|
|
@@ -293,7 +297,8 @@ type Context = {
|
|
|
293
297
|
user?: {
|
|
294
298
|
address: string;
|
|
295
299
|
chainId: number;
|
|
296
|
-
networkId: string;
|
|
300
|
+
networkId: string; /** The did:key of the app instance that issued this request's token. */
|
|
301
|
+
appKey: string;
|
|
297
302
|
};
|
|
298
303
|
};
|
|
299
304
|
type ISubgraph = {
|
|
@@ -305,6 +310,7 @@ type ISubgraph = {
|
|
|
305
310
|
relationalDb: IRelationalDb;
|
|
306
311
|
hasSubscriptions?: boolean;
|
|
307
312
|
onSetup?: () => Promise<void>;
|
|
313
|
+
onDisconnect?: () => Promise<void>;
|
|
308
314
|
};
|
|
309
315
|
type SubgraphArgs = {
|
|
310
316
|
reactorClient: IReactorClient;
|
|
@@ -314,6 +320,12 @@ type SubgraphArgs = {
|
|
|
314
320
|
syncManager: ISyncManager;
|
|
315
321
|
documentPermissionService?: DocumentPermissionService;
|
|
316
322
|
authorizationService: IAuthorizationService;
|
|
323
|
+
/**
|
|
324
|
+
* Evaluates a document's own policy when serving sync. Absent below
|
|
325
|
+
* `authEnforcement`, where there is no model to enforce and serving falls back
|
|
326
|
+
* to the host's permission tables alone.
|
|
327
|
+
*/
|
|
328
|
+
syncServingGate?: SyncScopeGate;
|
|
317
329
|
path?: string;
|
|
318
330
|
};
|
|
319
331
|
type GqlSigner = {
|
|
@@ -386,8 +398,10 @@ declare class BaseSubgraph implements ISubgraph$1 {
|
|
|
386
398
|
syncManager: ISyncManager;
|
|
387
399
|
documentPermissionService?: DocumentPermissionService;
|
|
388
400
|
authorizationService: IAuthorizationService;
|
|
401
|
+
syncServingGate?: SyncScopeGate;
|
|
389
402
|
constructor(args: SubgraphArgs$1);
|
|
390
403
|
onSetup(): Promise<void>;
|
|
404
|
+
onDisconnect(): Promise<void>;
|
|
391
405
|
/**
|
|
392
406
|
* Resolves a caller-supplied identifier (id or slug) to its canonical
|
|
393
407
|
* document id, memoized per request. Both the decision layer and the data
|
|
@@ -411,6 +425,17 @@ declare class BaseSubgraph implements ISubgraph$1 {
|
|
|
411
425
|
* layer, such as a fetched document's id). Performs no slug resolution.
|
|
412
426
|
*/
|
|
413
427
|
canReadDocument(documentId: CanonicalDocumentId, ctx: Context): Promise<boolean>;
|
|
428
|
+
/**
|
|
429
|
+
* The principal a request decides as: the authenticated caller's address, and
|
|
430
|
+
* the did:key of the app instance whose token authenticated it.
|
|
431
|
+
*
|
|
432
|
+
* Both, because a policy can name either. The key is what a document records
|
|
433
|
+
* as its creator, so a subject built without one cannot match the creator's
|
|
434
|
+
* standing permission over the auth scope -- the document's own creator would
|
|
435
|
+
* be refused an operation the write path accepts, since a signed action
|
|
436
|
+
* carries the same key. Anonymous callers supply neither.
|
|
437
|
+
*/
|
|
438
|
+
protected viewSubject(ctx: Context): AuthSubject;
|
|
414
439
|
/**
|
|
415
440
|
* Asserts read access, resolving a slug first. Returns a handle whose
|
|
416
441
|
* `fetchIdentifier` the caller reuses for the data fetch; a denial throws.
|
|
@@ -594,16 +619,56 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
594
619
|
}
|
|
595
620
|
//#endregion
|
|
596
621
|
//#region src/services/auth.service.d.ts
|
|
622
|
+
type CredentialVerifier = (params: {
|
|
623
|
+
address: string;
|
|
624
|
+
chainId: number;
|
|
625
|
+
appId: string;
|
|
626
|
+
}) => Promise<boolean>;
|
|
597
627
|
interface AuthConfig {
|
|
628
|
+
/**
|
|
629
|
+
* Whether the authorization policy enforces anything: it selects `ADMIN_ONLY`
|
|
630
|
+
* over `OPEN`, and it is what `AuthContext.auth_enabled` reports to callers
|
|
631
|
+
* that gate on "is authentication being enforced" (the attachment routes do).
|
|
632
|
+
*
|
|
633
|
+
* It does NOT decide whether the bearer is read — see {@link resolveIdentity}.
|
|
634
|
+
*/
|
|
598
635
|
enabled: boolean;
|
|
636
|
+
/**
|
|
637
|
+
* Whether the bearer is verified and `AuthContext.user` populated at all.
|
|
638
|
+
*
|
|
639
|
+
* Defaults to {@link enabled}, which is the behaviour every deployment had
|
|
640
|
+
* before this option existed. Setting it independently is what lets a server
|
|
641
|
+
* know who is calling while leaving the policy `OPEN` — resolving an identity
|
|
642
|
+
* and enforcing one are different concerns, and welding them together left
|
|
643
|
+
* consumers choosing between an unauthenticated caller and locking every
|
|
644
|
+
* non-admin out.
|
|
645
|
+
*
|
|
646
|
+
* It resolves an identity and enforces nothing: a request with no token is
|
|
647
|
+
* still admitted, with no user.
|
|
648
|
+
*/
|
|
649
|
+
resolveIdentity?: boolean;
|
|
599
650
|
admins: string[];
|
|
600
651
|
skipCredentialVerification?: boolean;
|
|
601
652
|
credentialVerificationCacheTtlMs?: number;
|
|
653
|
+
verifyCredential?: CredentialVerifier;
|
|
602
654
|
}
|
|
603
655
|
interface User {
|
|
604
656
|
address: string;
|
|
605
657
|
chainId: number;
|
|
606
658
|
networkId: string;
|
|
659
|
+
/**
|
|
660
|
+
* The did:key of the app instance that issued this request's token, taken
|
|
661
|
+
* from the verified credential's issuer.
|
|
662
|
+
*
|
|
663
|
+
* It is the same value a signer presents as its app key when it signs an
|
|
664
|
+
* action, which is what a document records as its creator. Carrying it here
|
|
665
|
+
* is what lets a request decide as the same principal the write path
|
|
666
|
+
* presents, rather than as an address with no key.
|
|
667
|
+
*
|
|
668
|
+
* Authenticated, not asserted: the token is verified by resolving this very
|
|
669
|
+
* DID, so a caller cannot name someone else's.
|
|
670
|
+
*/
|
|
671
|
+
appKey: string;
|
|
607
672
|
}
|
|
608
673
|
interface AuthContext {
|
|
609
674
|
user?: User;
|
|
@@ -614,6 +679,13 @@ declare class AuthService {
|
|
|
614
679
|
private readonly config;
|
|
615
680
|
private readonly credentialCache;
|
|
616
681
|
constructor(config: AuthConfig);
|
|
682
|
+
/**
|
|
683
|
+
* Whether this service reads the bearer at all. Defaults to `enabled`, so a
|
|
684
|
+
* config written before `resolveIdentity` existed behaves exactly as it did.
|
|
685
|
+
*/
|
|
686
|
+
private get resolvesIdentity();
|
|
687
|
+
/** The context an unresolved request gets: no user, and no admin list to match against. */
|
|
688
|
+
private anonymousContext;
|
|
617
689
|
authenticateRequest(request: globalThis.Request): Promise<AuthContext | globalThis.Response>;
|
|
618
690
|
/**
|
|
619
691
|
* Verify a Bearer token regardless of HTTP method. Use this from non-GraphQL
|
|
@@ -626,7 +698,12 @@ declare class AuthService {
|
|
|
626
698
|
*/
|
|
627
699
|
private verifyToken;
|
|
628
700
|
/**
|
|
629
|
-
* Extract user information from verification result
|
|
701
|
+
* Extract user information from verification result.
|
|
702
|
+
*
|
|
703
|
+
* The issuer is required along with the credential subject. A credential that
|
|
704
|
+
* verified must carry one -- resolving it is how the signature was checked --
|
|
705
|
+
* so this rejects a shape that cannot have come from verification rather than
|
|
706
|
+
* admitting a keyless principal.
|
|
630
707
|
*/
|
|
631
708
|
private extractUserFromVerification;
|
|
632
709
|
/**
|
|
@@ -803,6 +880,7 @@ declare class GraphQLManager {
|
|
|
803
880
|
private readonly documentPermissionService?;
|
|
804
881
|
private readonly featureFlags;
|
|
805
882
|
private readonly port;
|
|
883
|
+
private readonly syncServingGate?;
|
|
806
884
|
private initialized;
|
|
807
885
|
private coreSubgraphsMap;
|
|
808
886
|
private contextFields;
|
|
@@ -819,7 +897,7 @@ declare class GraphQLManager {
|
|
|
819
897
|
*/
|
|
820
898
|
readonly reactorDriveClient?: IDriveClient;
|
|
821
899
|
private readonly authorizationService;
|
|
822
|
-
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);
|
|
900
|
+
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);
|
|
823
901
|
init(coreSubgraphs: SubgraphClass$1[], authMiddleware?: AuthFetchMiddleware): Promise<void>;
|
|
824
902
|
/**
|
|
825
903
|
* Regenerate document model subgraphs when models are dynamically loaded.
|
|
@@ -842,6 +920,14 @@ declare class GraphQLManager {
|
|
|
842
920
|
*/
|
|
843
921
|
getAuthorizationService(): IAuthorizationService;
|
|
844
922
|
registerSubgraph(subgraph: SubgraphClass$1, supergraph?: string, core?: boolean): Promise<ISubgraph$1>;
|
|
923
|
+
/** Find a registered subgraph by name, core or package-contributed. */
|
|
924
|
+
getSubgraphByName(name: string): ISubgraph$1 | undefined;
|
|
925
|
+
/** Whether a registered subgraph has a live handler, i.e. whether
|
|
926
|
+
* {@link executeSubgraphQuery} can reach it right now. */
|
|
927
|
+
hasSubgraphHandler(name: string): boolean;
|
|
928
|
+
/** Run a query against one registered subgraph in-process: the subgraph's own
|
|
929
|
+
* handler, without a socket or the auth/drive middleware. Trusted callers. */
|
|
930
|
+
executeSubgraphQuery<T>(subgraphName: string, query: string, variables: Record<string, unknown>): Promise<T>;
|
|
845
931
|
updateRouter: (immediate?: boolean) => Promise<void>;
|
|
846
932
|
private _updateRouter;
|
|
847
933
|
getAdditionalContextFields: () => Record<string, any>;
|
|
@@ -874,11 +960,88 @@ declare class InMemoryPackageStorage implements IPackageStorage {
|
|
|
874
960
|
has(name: string): Promise<boolean>;
|
|
875
961
|
}
|
|
876
962
|
//#endregion
|
|
963
|
+
//#region src/services/canonical-document-id.d.ts
|
|
964
|
+
/**
|
|
965
|
+
* Raised when a caller-supplied identifier cannot be resolved to a canonical
|
|
966
|
+
* document id. Carries no detail on purpose: resolution failures must not act
|
|
967
|
+
* as a document-existence oracle, so consumers map this to their generic
|
|
968
|
+
* fail-closed response.
|
|
969
|
+
*/
|
|
970
|
+
declare class CanonicalDocumentIdResolutionError extends Error {
|
|
971
|
+
constructor();
|
|
972
|
+
}
|
|
973
|
+
type CanonicalDocumentIdResolver = (identifier: string) => Promise<CanonicalDocumentId>;
|
|
974
|
+
/**
|
|
975
|
+
* The sanctioned string-to-CanonicalDocumentId cast: both the GraphQL layer
|
|
976
|
+
* and server routes must resolve caller identifiers through this helper so
|
|
977
|
+
* decision and data layers always agree on the subject document.
|
|
978
|
+
*/
|
|
979
|
+
declare function createCanonicalDocumentIdResolver(client: Pick<IReactorClient, "resolveIdOrSlug">): CanonicalDocumentIdResolver;
|
|
980
|
+
//#endregion
|
|
981
|
+
//#region src/services/attachment-access.service.d.ts
|
|
982
|
+
/**
|
|
983
|
+
* Whether the active Reactor composition hosts the attachment-reference
|
|
984
|
+
* projection. Reported by the client initializer: the built-in stack always
|
|
985
|
+
* registers it, while a caller-provided Reactor may lack the live
|
|
986
|
+
* registration capability. Consumers of reference evidence must fail closed
|
|
987
|
+
* when it is unavailable.
|
|
988
|
+
*/
|
|
989
|
+
type AttachmentReferenceProjectionCapability = {
|
|
990
|
+
status: "available";
|
|
991
|
+
} | {
|
|
992
|
+
status: "unavailable";
|
|
993
|
+
reason: "live-read-model-registration-unsupported" | "in-process-reactor-module-unavailable" | "initializer-did-not-report";
|
|
994
|
+
};
|
|
995
|
+
/**
|
|
996
|
+
* Outcome of an attachment read authorization. `denied` intentionally covers
|
|
997
|
+
* both an unreadable document and an absent document/ref relationship so the
|
|
998
|
+
* route layer cannot leak which check failed. `projection-unavailable` means
|
|
999
|
+
* the reference index is not being maintained in this composition; it is
|
|
1000
|
+
* returned before any document-authorization or reference lookup runs.
|
|
1001
|
+
*/
|
|
1002
|
+
type AttachmentAccessResult = {
|
|
1003
|
+
kind: "allowed";
|
|
1004
|
+
documentId: CanonicalDocumentId;
|
|
1005
|
+
ref: AttachmentRef;
|
|
1006
|
+
} | {
|
|
1007
|
+
kind: "denied";
|
|
1008
|
+
} | {
|
|
1009
|
+
kind: "projection-unavailable";
|
|
1010
|
+
};
|
|
1011
|
+
interface AttachmentAccessRequest {
|
|
1012
|
+
documentId: string;
|
|
1013
|
+
attachmentRef: string;
|
|
1014
|
+
userAddress?: string;
|
|
1015
|
+
}
|
|
1016
|
+
interface IAttachmentAccessService {
|
|
1017
|
+
canReadAttachment(request: AttachmentAccessRequest): Promise<AttachmentAccessResult>;
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* Composes document authorization with the projected document/ref
|
|
1021
|
+
* relationship. Order is fixed: validate ref, resolve the canonical document
|
|
1022
|
+
* id, check `canRead`, then check the reference index. A denied document
|
|
1023
|
+
* never reaches the reference reader, and the facade never touches
|
|
1024
|
+
* attachment metadata, storage backends, or presigners.
|
|
1025
|
+
*/
|
|
1026
|
+
declare class AttachmentAccessService implements IAttachmentAccessService {
|
|
1027
|
+
private readonly resolveCanonicalId;
|
|
1028
|
+
private readonly authorization;
|
|
1029
|
+
private readonly references;
|
|
1030
|
+
private readonly projection;
|
|
1031
|
+
constructor(resolveCanonicalId: CanonicalDocumentIdResolver, authorization: IAuthorizationService, references: IAttachmentReferenceReader, projection: AttachmentReferenceProjectionCapability);
|
|
1032
|
+
canReadAttachment(request: AttachmentAccessRequest): Promise<AttachmentAccessResult>;
|
|
1033
|
+
}
|
|
1034
|
+
//#endregion
|
|
877
1035
|
//#region src/types.d.ts
|
|
878
|
-
|
|
879
|
-
|
|
1036
|
+
/**
|
|
1037
|
+
* Module hosts pass to processor factories: the reactor-level module plus the
|
|
1038
|
+
* attachment client, which shared and reactor cannot name.
|
|
1039
|
+
*/
|
|
1040
|
+
interface IProcessorHostModule extends IReactorProcessorHostModuleBase {
|
|
880
1041
|
attachments: IAttachmentClient;
|
|
881
1042
|
}
|
|
1043
|
+
/** @deprecated Use `IProcessorHostModule`. */
|
|
1044
|
+
type IReactorProcessorHostModule = IProcessorHostModule;
|
|
882
1045
|
type ReadinessGate = {
|
|
883
1046
|
isReady: () => boolean;
|
|
884
1047
|
markReady: () => void;
|
|
@@ -888,6 +1051,8 @@ type API = {
|
|
|
888
1051
|
graphqlManager: GraphQLManager$1;
|
|
889
1052
|
packages: IPackageManager;
|
|
890
1053
|
attachments: AttachmentBuildResult;
|
|
1054
|
+
attachmentReferenceIndex: AttachmentReferenceIndexBuildResult; /** Document-authorized attachment read decisions; see AttachmentAccessService. */
|
|
1055
|
+
attachmentAccess: IAttachmentAccessService;
|
|
891
1056
|
authService: AuthService | undefined;
|
|
892
1057
|
/**
|
|
893
1058
|
* Releases resources owned by the API: shuts down the GraphQL gateway,
|
|
@@ -902,13 +1067,10 @@ type ReactorModule = {
|
|
|
902
1067
|
analyticsStore: IAnalyticsStore;
|
|
903
1068
|
relationalDb: IRelationalDb$1;
|
|
904
1069
|
};
|
|
905
|
-
/**
|
|
906
|
-
type ProcessorDriveFactory =
|
|
907
|
-
/**
|
|
908
|
-
|
|
909
|
-
* Shape: `(module) => (driveHeader) => ...`
|
|
910
|
-
*/
|
|
911
|
-
type ProcessorFactoryBuilder = (module: IProcessorHostModule) => ProcessorDriveFactory | Promise<ProcessorDriveFactory>;
|
|
1070
|
+
/** @deprecated Use `ProcessorFactory`. */
|
|
1071
|
+
type ProcessorDriveFactory = ProcessorFactory;
|
|
1072
|
+
/** Builds a per-drive factory from the host module (e.g. vetra `processorFactory`). */
|
|
1073
|
+
type ProcessorFactoryBuilder = ProcessorFactoryBuilder$1<IProcessorHostModule>;
|
|
912
1074
|
/** Multiple initializers per package name (e.g. Switchboard `processors` option). */
|
|
913
1075
|
type Processor = ProcessorFactoryBuilder[];
|
|
914
1076
|
//#endregion
|
|
@@ -955,6 +1117,7 @@ declare class HttpPackageLoader implements IPackageLoader {
|
|
|
955
1117
|
*/
|
|
956
1118
|
private parsePackageSpec;
|
|
957
1119
|
loadDocumentModels(packageSpec: string): Promise<DocumentModelModule[]>;
|
|
1120
|
+
loadUpgradeManifests(packageSpec: string): Promise<UpgradeManifest<readonly number[]>[]>;
|
|
958
1121
|
loadSubgraphs(packageSpec: string): Promise<SubgraphClass$1[]>;
|
|
959
1122
|
loadProcessors(packageSpec: string): Promise<ProcessorFactoryBuilder | null>;
|
|
960
1123
|
/**
|
|
@@ -1128,12 +1291,63 @@ type Action = {
|
|
|
1128
1291
|
readonly timestampUtcMs: Scalars["String"]["output"];
|
|
1129
1292
|
readonly type: Scalars["String"]["output"];
|
|
1130
1293
|
};
|
|
1294
|
+
/**
|
|
1295
|
+
* One operation an authorization preflight predicts a verdict for.
|
|
1296
|
+
*
|
|
1297
|
+
* `input` is what a conditional grant reads, so a candidate standing for a
|
|
1298
|
+
* filled-in form carries that form's input. Omitting it predicts the verdict an
|
|
1299
|
+
* empty input earns, not the verdict the filled-in form will get.
|
|
1300
|
+
*/
|
|
1301
|
+
type ActionCandidateInput = {
|
|
1302
|
+
readonly input?: InputMaybe<Scalars["JSONObject"]["input"]>;
|
|
1303
|
+
readonly scope: Scalars["String"]["input"];
|
|
1304
|
+
readonly type: Scalars["String"]["input"];
|
|
1305
|
+
};
|
|
1131
1306
|
type ActionContext = {
|
|
1132
1307
|
readonly signer?: Maybe<ReactorSigner>;
|
|
1133
1308
|
};
|
|
1309
|
+
/**
|
|
1310
|
+
* An action's context, as a caller submits it.
|
|
1311
|
+
*
|
|
1312
|
+
* Declares every field `ActionContext` carries, because an input object rejects a
|
|
1313
|
+
* field it does not declare: an action stamped with the head it applies to - which
|
|
1314
|
+
* is what a signing client sends - is refused outright if these are missing, and
|
|
1315
|
+
* that refusal is a whole-request one, not a per-field one.
|
|
1316
|
+
*
|
|
1317
|
+
* `prevOpHash` and `prevOpIndex` are the scope head the action was composed
|
|
1318
|
+
* against. They are recorded rather than enforced; a signature is verified from
|
|
1319
|
+
* the params carried in its own tuple, which do not include them.
|
|
1320
|
+
*/
|
|
1134
1321
|
type ActionContextInput = {
|
|
1322
|
+
/** Covers replay of an operation that would otherwise be a no-op. */readonly nonce?: InputMaybe<Scalars["String"]["input"]>; /** The hash of the state the action applies to. */
|
|
1323
|
+
readonly prevOpHash?: InputMaybe<Scalars["String"]["input"]>; /** The index of the last operation in the scope the action applies to. */
|
|
1324
|
+
readonly prevOpIndex?: InputMaybe<Scalars["Int"]["input"]>;
|
|
1135
1325
|
readonly signer?: InputMaybe<ReactorSignerInput>;
|
|
1136
1326
|
};
|
|
1327
|
+
/**
|
|
1328
|
+
* One candidate's predicted verdict. `reason` carries the refusal a DENY is
|
|
1329
|
+
* recorded with, and is null on an ALLOW.
|
|
1330
|
+
*/
|
|
1331
|
+
type ActionEvaluation = {
|
|
1332
|
+
readonly decision: AuthDecision;
|
|
1333
|
+
readonly reason?: Maybe<Scalars["String"]["output"]>;
|
|
1334
|
+
};
|
|
1335
|
+
/**
|
|
1336
|
+
* The predicted verdicts for a set of candidates, in the order they were given,
|
|
1337
|
+
* with the aggregates a caller branches on.
|
|
1338
|
+
*
|
|
1339
|
+
* The aggregates are redundant -- a verdict is binary -- and all four are returned
|
|
1340
|
+
* so a caller reads the one its question is phrased in rather than negating
|
|
1341
|
+
* another. Over no candidates every aggregate is false: nothing is allowed and
|
|
1342
|
+
* nothing is denied.
|
|
1343
|
+
*/
|
|
1344
|
+
type ActionEvaluations = {
|
|
1345
|
+
readonly allAllowed: Scalars["Boolean"]["output"];
|
|
1346
|
+
readonly allDenied: Scalars["Boolean"]["output"];
|
|
1347
|
+
readonly anyAllowed: Scalars["Boolean"]["output"];
|
|
1348
|
+
readonly anyDenied: Scalars["Boolean"]["output"];
|
|
1349
|
+
readonly evaluations: ReadonlyArray<ActionEvaluation>;
|
|
1350
|
+
};
|
|
1137
1351
|
type ActionInput = {
|
|
1138
1352
|
readonly context?: InputMaybe<ActionContextInput>;
|
|
1139
1353
|
readonly id: Scalars["String"]["input"];
|
|
@@ -1142,6 +1356,10 @@ type ActionInput = {
|
|
|
1142
1356
|
readonly timestampUtcMs: Scalars["String"]["input"];
|
|
1143
1357
|
readonly type: Scalars["String"]["input"];
|
|
1144
1358
|
};
|
|
1359
|
+
declare enum AuthDecision {
|
|
1360
|
+
Allow = "ALLOW",
|
|
1361
|
+
Deny = "DENY"
|
|
1362
|
+
}
|
|
1145
1363
|
type ChannelMeta = {
|
|
1146
1364
|
readonly id: Scalars["String"]["output"];
|
|
1147
1365
|
};
|
|
@@ -1152,6 +1370,12 @@ type DeadLetterInfo = {
|
|
|
1152
1370
|
readonly branch: Scalars["String"]["output"];
|
|
1153
1371
|
readonly documentId: Scalars["String"]["output"];
|
|
1154
1372
|
readonly error: Scalars["String"]["output"];
|
|
1373
|
+
/**
|
|
1374
|
+
* How the origin classified the failure. A peer needs this to mirror the origin's
|
|
1375
|
+
* quarantine decision; without it a held auth operation would freeze the document
|
|
1376
|
+
* on the peer side while the origin kept syncing.
|
|
1377
|
+
*/
|
|
1378
|
+
readonly errorType?: Maybe<Scalars["String"]["output"]>;
|
|
1155
1379
|
readonly jobId: Scalars["String"]["output"];
|
|
1156
1380
|
readonly operationCount: Scalars["Int"]["output"];
|
|
1157
1381
|
readonly scopes: ReadonlyArray<Scalars["String"]["output"]>;
|
|
@@ -1211,7 +1435,11 @@ type JobInfo = {
|
|
|
1211
1435
|
readonly createdAt: Scalars["DateTime"]["output"];
|
|
1212
1436
|
readonly error?: Maybe<Scalars["String"]["output"]>;
|
|
1213
1437
|
readonly id: Scalars["String"]["output"];
|
|
1214
|
-
|
|
1438
|
+
/**
|
|
1439
|
+
* What the job produced, once it has produced anything. Null until then, which
|
|
1440
|
+
* is the state every job is in when it is handed back from a submission.
|
|
1441
|
+
*/
|
|
1442
|
+
readonly result?: Maybe<Scalars["JSONObject"]["output"]>;
|
|
1215
1443
|
readonly status: Scalars["String"]["output"];
|
|
1216
1444
|
};
|
|
1217
1445
|
type MoveRelationshipResult = {
|
|
@@ -1224,8 +1452,30 @@ type Mutation = {
|
|
|
1224
1452
|
readonly createEmptyDocument: PhDocument;
|
|
1225
1453
|
readonly deleteDocument: Scalars["Boolean"]["output"];
|
|
1226
1454
|
readonly deleteDocuments: Scalars["Boolean"]["output"];
|
|
1227
|
-
|
|
1228
|
-
|
|
1455
|
+
/**
|
|
1456
|
+
* Applies actions to a document and waits for the result.
|
|
1457
|
+
*
|
|
1458
|
+
* Each action is coerced against `ActionInput`, so one missing a field the wire
|
|
1459
|
+
* declares is refused before any work starts. The id in particular: it is hashed
|
|
1460
|
+
* into the operation id and replay dedupes by it, so an action without one is
|
|
1461
|
+
* stored under an operation id shared by every id-less operation on the same
|
|
1462
|
+
* document, scope and branch.
|
|
1463
|
+
*
|
|
1464
|
+
* Named for `IReactorClient.execute`, which this is the wire form of. `branch`
|
|
1465
|
+
* defaults to `main`.
|
|
1466
|
+
*/
|
|
1467
|
+
readonly execute: PhDocument;
|
|
1468
|
+
/**
|
|
1469
|
+
* Submits actions to a document and returns the job that will apply them.
|
|
1470
|
+
*
|
|
1471
|
+
* Coerced exactly as `execute` is, so a malformed action is refused here rather
|
|
1472
|
+
* than surfacing later as a failed job. Returns the job rather than only its id,
|
|
1473
|
+
* so a caller has the status and the creation time it would otherwise have to
|
|
1474
|
+
* ask for; `result` is null until the job produces one.
|
|
1475
|
+
*/
|
|
1476
|
+
readonly executeAsync: JobInfo;
|
|
1477
|
+
readonly moveRelationship: MoveRelationshipResult; /** @deprecated Use execute. Actions here are untyped, so a malformed one is refused by a hand-written check rather than by the schema, and `view.scopes` is accepted but ignored. */
|
|
1478
|
+
readonly mutateDocument: PhDocument; /** @deprecated Use executeAsync, which is typed and returns the job rather than only its id. */
|
|
1229
1479
|
readonly mutateDocumentAsync: Scalars["String"]["output"];
|
|
1230
1480
|
readonly pushSyncEnvelopes: Scalars["Boolean"]["output"];
|
|
1231
1481
|
readonly removeRelationship: PhDocument;
|
|
@@ -1255,6 +1505,16 @@ type MutationDeleteDocumentsArgs = {
|
|
|
1255
1505
|
identifiers: ReadonlyArray<Scalars["String"]["input"]>;
|
|
1256
1506
|
propagate?: InputMaybe<PropagationMode>;
|
|
1257
1507
|
};
|
|
1508
|
+
type MutationExecuteArgs = {
|
|
1509
|
+
actions: ReadonlyArray<ActionInput>;
|
|
1510
|
+
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
1511
|
+
documentIdentifier: Scalars["String"]["input"];
|
|
1512
|
+
};
|
|
1513
|
+
type MutationExecuteAsyncArgs = {
|
|
1514
|
+
actions: ReadonlyArray<ActionInput>;
|
|
1515
|
+
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
1516
|
+
documentIdentifier: Scalars["String"]["input"];
|
|
1517
|
+
};
|
|
1258
1518
|
type MutationMoveRelationshipArgs = {
|
|
1259
1519
|
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
1260
1520
|
relationshipType: Scalars["String"]["input"];
|
|
@@ -1310,6 +1570,7 @@ type OperationContextInput = {
|
|
|
1310
1570
|
};
|
|
1311
1571
|
type OperationInput = {
|
|
1312
1572
|
readonly action: ActionInput;
|
|
1573
|
+
readonly deniedReason?: InputMaybe<Scalars["String"]["input"]>;
|
|
1313
1574
|
readonly error?: InputMaybe<Scalars["String"]["input"]>;
|
|
1314
1575
|
readonly hash: Scalars["String"]["input"];
|
|
1315
1576
|
readonly id?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -1378,8 +1639,47 @@ type Query = {
|
|
|
1378
1639
|
readonly documentModels: DocumentModelResultPage;
|
|
1379
1640
|
readonly documentOperations: ReactorOperationResultPage;
|
|
1380
1641
|
readonly documentOutgoingRelationships: PhDocumentResultPage;
|
|
1642
|
+
/**
|
|
1643
|
+
* Predicts whether the calling subject would be admitted to execute each of a
|
|
1644
|
+
* set of candidate operations, without submitting any of them. A UI asks this to
|
|
1645
|
+
* disable a control rather than offer an action that fails on submit.
|
|
1646
|
+
*
|
|
1647
|
+
* The answer is a prediction, not a promise:
|
|
1648
|
+
*
|
|
1649
|
+
* - Real admission compiles an append condition over everything it read and the
|
|
1650
|
+
* store enforces it at write time. A preflight reads no future, so a policy
|
|
1651
|
+
* change landing between this answer and the submit changes the verdict. The
|
|
1652
|
+
* submit path stays the only authority.
|
|
1653
|
+
* - The verdict is evaluated at the stream heads, so it is correct for a
|
|
1654
|
+
* candidate about to be submitted. A backdated submission is out of contract;
|
|
1655
|
+
* the reactor decides that one by position.
|
|
1656
|
+
* - A candidate whose verdict depends on its input has to carry that input, since
|
|
1657
|
+
* a conditional grant reads it.
|
|
1658
|
+
*
|
|
1659
|
+
* The subject is the authenticated caller and cannot be named in the request:
|
|
1660
|
+
* answering for an arbitrary subject would disclose what a policy grants
|
|
1661
|
+
* somebody else. It carries both the caller's address and the did:key of the app
|
|
1662
|
+
* instance whose token authenticated the request, so a policy naming either
|
|
1663
|
+
* matches the same principal the write path presents.
|
|
1664
|
+
*
|
|
1665
|
+
* Requires the reactor's authEnforcement feature flag. Without it the reactor
|
|
1666
|
+
* holds no decision model, so this fails with extensions.code
|
|
1667
|
+
* AUTH_EVALUATION_UNSUPPORTED rather than guessing.
|
|
1668
|
+
*/
|
|
1669
|
+
readonly evaluateActions: ActionEvaluations;
|
|
1381
1670
|
readonly findDocuments: PhDocumentResultPage;
|
|
1382
1671
|
readonly jobStatus?: Maybe<JobInfo>;
|
|
1672
|
+
/**
|
|
1673
|
+
* Polls for sync envelopes from a channel.
|
|
1674
|
+
*
|
|
1675
|
+
* An operation stored before the API required an action id cannot be
|
|
1676
|
+
* represented by this schema, and rather than serving a partial response beside
|
|
1677
|
+
* a bare non-null violation, this fails with extensions.code
|
|
1678
|
+
* MALFORMED_STORED_OPERATION naming the operation. That code means the failure
|
|
1679
|
+
* is worth polling through: the document holding the operation needs repairing,
|
|
1680
|
+
* but the channel serves every other document, and a peer that stopped polling
|
|
1681
|
+
* would stop receiving those too.
|
|
1682
|
+
*/
|
|
1383
1683
|
readonly pollSyncEnvelopes: PollSyncEnvelopesResult;
|
|
1384
1684
|
};
|
|
1385
1685
|
type QueryDocumentArgs = {
|
|
@@ -1406,6 +1706,11 @@ type QueryDocumentOutgoingRelationshipsArgs = {
|
|
|
1406
1706
|
sourceIdentifier: Scalars["String"]["input"];
|
|
1407
1707
|
view?: InputMaybe<ViewFilterInput>;
|
|
1408
1708
|
};
|
|
1709
|
+
type QueryEvaluateActionsArgs = {
|
|
1710
|
+
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
1711
|
+
candidates: ReadonlyArray<ActionCandidateInput>;
|
|
1712
|
+
documentIdentifier: Scalars["String"]["input"];
|
|
1713
|
+
};
|
|
1409
1714
|
type QueryFindDocumentsArgs = {
|
|
1410
1715
|
paging?: InputMaybe<PagingInput>;
|
|
1411
1716
|
search?: InputMaybe<SearchFilterInput>;
|
|
@@ -1421,6 +1726,7 @@ type QueryPollSyncEnvelopesArgs = {
|
|
|
1421
1726
|
};
|
|
1422
1727
|
type ReactorOperation = {
|
|
1423
1728
|
readonly action: Action;
|
|
1729
|
+
readonly deniedReason?: Maybe<Scalars["String"]["output"]>;
|
|
1424
1730
|
readonly error?: Maybe<Scalars["String"]["output"]>;
|
|
1425
1731
|
readonly hash: Scalars["String"]["output"];
|
|
1426
1732
|
readonly id?: Maybe<Scalars["String"]["output"]>;
|
|
@@ -1615,6 +1921,7 @@ type GetDocumentWithOperationsQuery = {
|
|
|
1615
1921
|
readonly hash: string;
|
|
1616
1922
|
readonly skip: number;
|
|
1617
1923
|
readonly error?: string | null | undefined;
|
|
1924
|
+
readonly deniedReason?: string | null | undefined;
|
|
1618
1925
|
readonly id?: string | null | undefined;
|
|
1619
1926
|
readonly action: {
|
|
1620
1927
|
readonly id: string;
|
|
@@ -1742,6 +2049,7 @@ type GetDocumentOperationsQuery = {
|
|
|
1742
2049
|
readonly hash: string;
|
|
1743
2050
|
readonly skip: number;
|
|
1744
2051
|
readonly error?: string | null | undefined;
|
|
2052
|
+
readonly deniedReason?: string | null | undefined;
|
|
1745
2053
|
readonly id?: string | null | undefined;
|
|
1746
2054
|
readonly action: {
|
|
1747
2055
|
readonly id: string;
|
|
@@ -1774,12 +2082,29 @@ type GetJobStatusQuery = {
|
|
|
1774
2082
|
readonly jobStatus?: {
|
|
1775
2083
|
readonly id: string;
|
|
1776
2084
|
readonly status: string;
|
|
1777
|
-
readonly result
|
|
2085
|
+
readonly result?: NonNullable<unknown> | null | undefined;
|
|
1778
2086
|
readonly error?: string | null | undefined;
|
|
1779
2087
|
readonly createdAt: string | Date;
|
|
1780
2088
|
readonly completedAt?: string | Date | null | undefined;
|
|
1781
2089
|
} | null | undefined;
|
|
1782
2090
|
};
|
|
2091
|
+
type EvaluateActionsQueryVariables = Exact<{
|
|
2092
|
+
documentIdentifier: Scalars["String"]["input"];
|
|
2093
|
+
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
2094
|
+
candidates: ReadonlyArray<ActionCandidateInput>;
|
|
2095
|
+
}>;
|
|
2096
|
+
type EvaluateActionsQuery = {
|
|
2097
|
+
readonly evaluateActions: {
|
|
2098
|
+
readonly allAllowed: boolean;
|
|
2099
|
+
readonly anyAllowed: boolean;
|
|
2100
|
+
readonly allDenied: boolean;
|
|
2101
|
+
readonly anyDenied: boolean;
|
|
2102
|
+
readonly evaluations: ReadonlyArray<{
|
|
2103
|
+
readonly decision: AuthDecision;
|
|
2104
|
+
readonly reason?: string | null | undefined;
|
|
2105
|
+
}>;
|
|
2106
|
+
};
|
|
2107
|
+
};
|
|
1783
2108
|
type CreateDocumentMutationVariables = Exact<{
|
|
1784
2109
|
document: Scalars["JSONObject"]["input"];
|
|
1785
2110
|
parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -1820,8 +2145,8 @@ type CreateEmptyDocumentMutation = {
|
|
|
1820
2145
|
};
|
|
1821
2146
|
type MutateDocumentMutationVariables = Exact<{
|
|
1822
2147
|
documentIdentifier: Scalars["String"]["input"];
|
|
1823
|
-
actions: ReadonlyArray<
|
|
1824
|
-
|
|
2148
|
+
actions: ReadonlyArray<ActionInput>;
|
|
2149
|
+
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
1825
2150
|
}>;
|
|
1826
2151
|
type MutateDocumentMutation = {
|
|
1827
2152
|
readonly mutateDocument: {
|
|
@@ -1840,11 +2165,18 @@ type MutateDocumentMutation = {
|
|
|
1840
2165
|
};
|
|
1841
2166
|
type MutateDocumentAsyncMutationVariables = Exact<{
|
|
1842
2167
|
documentIdentifier: Scalars["String"]["input"];
|
|
1843
|
-
actions: ReadonlyArray<
|
|
1844
|
-
|
|
2168
|
+
actions: ReadonlyArray<ActionInput>;
|
|
2169
|
+
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
1845
2170
|
}>;
|
|
1846
2171
|
type MutateDocumentAsyncMutation = {
|
|
1847
|
-
readonly mutateDocumentAsync:
|
|
2172
|
+
readonly mutateDocumentAsync: {
|
|
2173
|
+
readonly id: string;
|
|
2174
|
+
readonly status: string;
|
|
2175
|
+
readonly result?: NonNullable<unknown> | null | undefined;
|
|
2176
|
+
readonly error?: string | null | undefined;
|
|
2177
|
+
readonly createdAt: string | Date;
|
|
2178
|
+
readonly completedAt?: string | Date | null | undefined;
|
|
2179
|
+
};
|
|
1848
2180
|
};
|
|
1849
2181
|
type RenameDocumentMutationVariables = Exact<{
|
|
1850
2182
|
documentIdentifier: Scalars["String"]["input"];
|
|
@@ -2039,6 +2371,7 @@ type PollSyncEnvelopesQuery = {
|
|
|
2039
2371
|
readonly hash: string;
|
|
2040
2372
|
readonly skip: number;
|
|
2041
2373
|
readonly error?: string | null | undefined;
|
|
2374
|
+
readonly deniedReason?: string | null | undefined;
|
|
2042
2375
|
readonly id?: string | null | undefined;
|
|
2043
2376
|
readonly action: {
|
|
2044
2377
|
readonly id: string;
|
|
@@ -2078,6 +2411,7 @@ type PollSyncEnvelopesQuery = {
|
|
|
2078
2411
|
readonly deadLetters: ReadonlyArray<{
|
|
2079
2412
|
readonly documentId: string;
|
|
2080
2413
|
readonly error: string;
|
|
2414
|
+
readonly errorType?: string | null | undefined;
|
|
2081
2415
|
}>;
|
|
2082
2416
|
};
|
|
2083
2417
|
};
|
|
@@ -2123,9 +2457,13 @@ type DirectiveResolverFn<TResult = Record<PropertyKey, never>, TParent = Record<
|
|
|
2123
2457
|
/** Mapping between all available schema types and the resolvers types */
|
|
2124
2458
|
type ResolversTypes = ResolversObject<{
|
|
2125
2459
|
Action: ResolverTypeWrapper<Action>;
|
|
2460
|
+
ActionCandidateInput: ActionCandidateInput;
|
|
2126
2461
|
ActionContext: ResolverTypeWrapper<ActionContext>;
|
|
2127
2462
|
ActionContextInput: ActionContextInput;
|
|
2463
|
+
ActionEvaluation: ResolverTypeWrapper<ActionEvaluation>;
|
|
2464
|
+
ActionEvaluations: ResolverTypeWrapper<ActionEvaluations>;
|
|
2128
2465
|
ActionInput: ActionInput;
|
|
2466
|
+
AuthDecision: AuthDecision;
|
|
2129
2467
|
Boolean: ResolverTypeWrapper<Scalars["Boolean"]["output"]>;
|
|
2130
2468
|
ChannelMeta: ResolverTypeWrapper<ChannelMeta>;
|
|
2131
2469
|
ChannelMetaInput: ChannelMetaInput;
|
|
@@ -2181,8 +2519,11 @@ type ResolversTypes = ResolversObject<{
|
|
|
2181
2519
|
/** Mapping between all available schema types and the resolvers parents */
|
|
2182
2520
|
type ResolversParentTypes = ResolversObject<{
|
|
2183
2521
|
Action: Action;
|
|
2522
|
+
ActionCandidateInput: ActionCandidateInput;
|
|
2184
2523
|
ActionContext: ActionContext;
|
|
2185
2524
|
ActionContextInput: ActionContextInput;
|
|
2525
|
+
ActionEvaluation: ActionEvaluation;
|
|
2526
|
+
ActionEvaluations: ActionEvaluations;
|
|
2186
2527
|
ActionInput: ActionInput;
|
|
2187
2528
|
Boolean: Scalars["Boolean"]["output"];
|
|
2188
2529
|
ChannelMeta: ChannelMeta;
|
|
@@ -2244,6 +2585,17 @@ type ActionResolvers<ContextType = Context, ParentType extends ResolversParentTy
|
|
|
2244
2585
|
type ActionContextResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ActionContext"] = ResolversParentTypes["ActionContext"]> = ResolversObject<{
|
|
2245
2586
|
signer?: Resolver<Maybe<ResolversTypes["ReactorSigner"]>, ParentType, ContextType>;
|
|
2246
2587
|
}>;
|
|
2588
|
+
type ActionEvaluationResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ActionEvaluation"] = ResolversParentTypes["ActionEvaluation"]> = ResolversObject<{
|
|
2589
|
+
decision?: Resolver<ResolversTypes["AuthDecision"], ParentType, ContextType>;
|
|
2590
|
+
reason?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
|
|
2591
|
+
}>;
|
|
2592
|
+
type ActionEvaluationsResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ActionEvaluations"] = ResolversParentTypes["ActionEvaluations"]> = ResolversObject<{
|
|
2593
|
+
allAllowed?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
|
|
2594
|
+
allDenied?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
|
|
2595
|
+
anyAllowed?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
|
|
2596
|
+
anyDenied?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType>;
|
|
2597
|
+
evaluations?: Resolver<ReadonlyArray<ResolversTypes["ActionEvaluation"]>, ParentType, ContextType>;
|
|
2598
|
+
}>;
|
|
2247
2599
|
type ChannelMetaResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ChannelMeta"] = ResolversParentTypes["ChannelMeta"]> = ResolversObject<{
|
|
2248
2600
|
id?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2249
2601
|
}>;
|
|
@@ -2254,6 +2606,7 @@ type DeadLetterInfoResolvers<ContextType = Context, ParentType extends Resolvers
|
|
|
2254
2606
|
branch?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2255
2607
|
documentId?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2256
2608
|
error?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2609
|
+
errorType?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
|
|
2257
2610
|
jobId?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2258
2611
|
operationCount?: Resolver<ResolversTypes["Int"], ParentType, ContextType>;
|
|
2259
2612
|
scopes?: Resolver<ReadonlyArray<ResolversTypes["String"]>, ParentType, ContextType>;
|
|
@@ -2299,7 +2652,7 @@ type JobInfoResolvers<ContextType = Context, ParentType extends ResolversParentT
|
|
|
2299
2652
|
createdAt?: Resolver<ResolversTypes["DateTime"], ParentType, ContextType>;
|
|
2300
2653
|
error?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
|
|
2301
2654
|
id?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2302
|
-
result?: Resolver<ResolversTypes["JSONObject"]
|
|
2655
|
+
result?: Resolver<Maybe<ResolversTypes["JSONObject"]>, ParentType, ContextType>;
|
|
2303
2656
|
status?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2304
2657
|
}>;
|
|
2305
2658
|
type MoveRelationshipResultResolvers<ContextType = Context, ParentType extends ResolversParentTypes["MoveRelationshipResult"] = ResolversParentTypes["MoveRelationshipResult"]> = ResolversObject<{
|
|
@@ -2312,6 +2665,8 @@ type MutationResolvers<ContextType = Context, ParentType extends ResolversParent
|
|
|
2312
2665
|
createEmptyDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationCreateEmptyDocumentArgs, "documentType">>;
|
|
2313
2666
|
deleteDocument?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, RequireFields<MutationDeleteDocumentArgs, "identifier">>;
|
|
2314
2667
|
deleteDocuments?: Resolver<ResolversTypes["Boolean"], ParentType, ContextType, RequireFields<MutationDeleteDocumentsArgs, "identifiers">>;
|
|
2668
|
+
execute?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationExecuteArgs, "actions" | "documentIdentifier">>;
|
|
2669
|
+
executeAsync?: Resolver<ResolversTypes["JobInfo"], ParentType, ContextType, RequireFields<MutationExecuteAsyncArgs, "actions" | "documentIdentifier">>;
|
|
2315
2670
|
moveRelationship?: Resolver<ResolversTypes["MoveRelationshipResult"], ParentType, ContextType, RequireFields<MutationMoveRelationshipArgs, "relationshipType" | "sourceParentIdentifier" | "targetIdentifier" | "targetParentIdentifier">>;
|
|
2316
2671
|
mutateDocument?: Resolver<ResolversTypes["PHDocument"], ParentType, ContextType, RequireFields<MutationMutateDocumentArgs, "actions" | "documentIdentifier">>;
|
|
2317
2672
|
mutateDocumentAsync?: Resolver<ResolversTypes["String"], ParentType, ContextType, RequireFields<MutationMutateDocumentAsyncArgs, "actions" | "documentIdentifier">>;
|
|
@@ -2363,12 +2718,14 @@ type QueryResolvers<ContextType = Context, ParentType extends ResolversParentTyp
|
|
|
2363
2718
|
documentModels?: Resolver<ResolversTypes["DocumentModelResultPage"], ParentType, ContextType, Partial<QueryDocumentModelsArgs>>;
|
|
2364
2719
|
documentOperations?: Resolver<ResolversTypes["ReactorOperationResultPage"], ParentType, ContextType, RequireFields<QueryDocumentOperationsArgs, "filter">>;
|
|
2365
2720
|
documentOutgoingRelationships?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, RequireFields<QueryDocumentOutgoingRelationshipsArgs, "relationshipType" | "sourceIdentifier">>;
|
|
2721
|
+
evaluateActions?: Resolver<ResolversTypes["ActionEvaluations"], ParentType, ContextType, RequireFields<QueryEvaluateActionsArgs, "candidates" | "documentIdentifier">>;
|
|
2366
2722
|
findDocuments?: Resolver<ResolversTypes["PHDocumentResultPage"], ParentType, ContextType, Partial<QueryFindDocumentsArgs>>;
|
|
2367
2723
|
jobStatus?: Resolver<Maybe<ResolversTypes["JobInfo"]>, ParentType, ContextType, RequireFields<QueryJobStatusArgs, "jobId">>;
|
|
2368
2724
|
pollSyncEnvelopes?: Resolver<ResolversTypes["PollSyncEnvelopesResult"], ParentType, ContextType, RequireFields<QueryPollSyncEnvelopesArgs, "channelId" | "outboxAck" | "outboxLatest">>;
|
|
2369
2725
|
}>;
|
|
2370
2726
|
type ReactorOperationResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ReactorOperation"] = ResolversParentTypes["ReactorOperation"]> = ResolversObject<{
|
|
2371
2727
|
action?: Resolver<ResolversTypes["Action"], ParentType, ContextType>;
|
|
2728
|
+
deniedReason?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
|
|
2372
2729
|
error?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
|
|
2373
2730
|
hash?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2374
2731
|
id?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
|
|
@@ -2425,6 +2782,8 @@ type TouchChannelResultResolvers<ContextType = Context, ParentType extends Resol
|
|
|
2425
2782
|
type Resolvers<ContextType = Context> = ResolversObject<{
|
|
2426
2783
|
Action?: ActionResolvers<ContextType>;
|
|
2427
2784
|
ActionContext?: ActionContextResolvers<ContextType>;
|
|
2785
|
+
ActionEvaluation?: ActionEvaluationResolvers<ContextType>;
|
|
2786
|
+
ActionEvaluations?: ActionEvaluationsResolvers<ContextType>;
|
|
2428
2787
|
ChannelMeta?: ChannelMetaResolvers<ContextType>;
|
|
2429
2788
|
DateTime?: GraphQLScalarType;
|
|
2430
2789
|
DeadLetterInfo?: DeadLetterInfoResolvers<ContextType>;
|
|
@@ -2459,9 +2818,11 @@ type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]> }>;
|
|
|
2459
2818
|
type definedNonNullAny = {};
|
|
2460
2819
|
declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
2461
2820
|
declare const definedNonNullAnySchema: z$1.ZodAny & z$1.ZodType<definedNonNullAny, any, z$1.core.$ZodTypeInternals<definedNonNullAny, any>>;
|
|
2821
|
+
declare const AuthDecisionSchema: z$1.ZodEnum<typeof AuthDecision>;
|
|
2462
2822
|
declare const DocumentChangeTypeSchema: z$1.ZodEnum<typeof DocumentChangeType>;
|
|
2463
2823
|
declare const PropagationModeSchema: z$1.ZodEnum<typeof PropagationMode>;
|
|
2464
2824
|
declare const SyncEnvelopeTypeSchema: z$1.ZodEnum<typeof SyncEnvelopeType>;
|
|
2825
|
+
declare function ActionCandidateInputSchema(): z$1.ZodObject<Properties<ActionCandidateInput>>;
|
|
2465
2826
|
declare function ActionContextInputSchema(): z$1.ZodObject<Properties<ActionContextInput>>;
|
|
2466
2827
|
declare function ActionInputSchema(): z$1.ZodObject<Properties<ActionInput>>;
|
|
2467
2828
|
declare function ChannelMetaInputSchema(): z$1.ZodObject<Properties<ChannelMetaInput>>;
|
|
@@ -2489,6 +2850,7 @@ declare const GetDocumentIncomingRelationshipsDocument: DocumentNode;
|
|
|
2489
2850
|
declare const FindDocumentsDocument: DocumentNode;
|
|
2490
2851
|
declare const GetDocumentOperationsDocument: DocumentNode;
|
|
2491
2852
|
declare const GetJobStatusDocument: DocumentNode;
|
|
2853
|
+
declare const EvaluateActionsDocument: DocumentNode;
|
|
2492
2854
|
declare const CreateDocumentDocument: DocumentNode;
|
|
2493
2855
|
declare const CreateEmptyDocumentDocument: DocumentNode;
|
|
2494
2856
|
declare const MutateDocumentDocument: DocumentNode;
|
|
@@ -2515,6 +2877,7 @@ declare function getSdk<C>(requester: Requester<C>): {
|
|
|
2515
2877
|
FindDocuments(variables?: FindDocumentsQueryVariables, options?: C): Promise<FindDocumentsQuery>;
|
|
2516
2878
|
GetDocumentOperations(variables: GetDocumentOperationsQueryVariables, options?: C): Promise<GetDocumentOperationsQuery>;
|
|
2517
2879
|
GetJobStatus(variables: GetJobStatusQueryVariables, options?: C): Promise<GetJobStatusQuery>;
|
|
2880
|
+
EvaluateActions(variables: EvaluateActionsQueryVariables, options?: C): Promise<EvaluateActionsQuery>;
|
|
2518
2881
|
CreateDocument(variables: CreateDocumentMutationVariables, options?: C): Promise<CreateDocumentMutation>;
|
|
2519
2882
|
CreateEmptyDocument(variables: CreateEmptyDocumentMutationVariables, options?: C): Promise<CreateEmptyDocumentMutation>;
|
|
2520
2883
|
MutateDocument(variables: MutateDocumentMutationVariables, options?: C): Promise<MutateDocumentMutation>;
|
|
@@ -2577,6 +2940,11 @@ declare function createReactorGraphQLClient(url: string, fetchImpl?: FetchLike,
|
|
|
2577
2940
|
GetJobStatus(variables: Exact<{
|
|
2578
2941
|
jobId: Scalars["String"]["input"];
|
|
2579
2942
|
}>, options?: {} | undefined): Promise<GetJobStatusQuery>;
|
|
2943
|
+
EvaluateActions(variables: Exact<{
|
|
2944
|
+
documentIdentifier: Scalars["String"]["input"];
|
|
2945
|
+
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
2946
|
+
candidates: ReadonlyArray<ActionCandidateInput>;
|
|
2947
|
+
}>, options?: {} | undefined): Promise<EvaluateActionsQuery>;
|
|
2580
2948
|
CreateDocument(variables: Exact<{
|
|
2581
2949
|
document: Scalars["JSONObject"]["input"];
|
|
2582
2950
|
parentIdentifier?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -2587,13 +2955,13 @@ declare function createReactorGraphQLClient(url: string, fetchImpl?: FetchLike,
|
|
|
2587
2955
|
}>, options?: {} | undefined): Promise<CreateEmptyDocumentMutation>;
|
|
2588
2956
|
MutateDocument(variables: Exact<{
|
|
2589
2957
|
documentIdentifier: Scalars["String"]["input"];
|
|
2590
|
-
actions: ReadonlyArray<
|
|
2591
|
-
|
|
2958
|
+
actions: ReadonlyArray<ActionInput>;
|
|
2959
|
+
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
2592
2960
|
}>, options?: {} | undefined): Promise<MutateDocumentMutation>;
|
|
2593
2961
|
MutateDocumentAsync(variables: Exact<{
|
|
2594
2962
|
documentIdentifier: Scalars["String"]["input"];
|
|
2595
|
-
actions: ReadonlyArray<
|
|
2596
|
-
|
|
2963
|
+
actions: ReadonlyArray<ActionInput>;
|
|
2964
|
+
branch?: InputMaybe<Scalars["String"]["input"]>;
|
|
2597
2965
|
}>, options?: {} | undefined): Promise<MutateDocumentAsyncMutation>;
|
|
2598
2966
|
RenameDocument(variables: Exact<{
|
|
2599
2967
|
documentIdentifier: Scalars["String"]["input"];
|
|
@@ -2708,6 +3076,7 @@ declare class ImportPackageLoader implements IPackageLoader {
|
|
|
2708
3076
|
private readonly logger;
|
|
2709
3077
|
readonly name = "ImportPackageLoader";
|
|
2710
3078
|
loadDocumentModels(identifier: string): Promise<DocumentModelModule[]>;
|
|
3079
|
+
loadUpgradeManifests(identifier: string): Promise<UpgradeManifest<readonly number[]>[]>;
|
|
2711
3080
|
loadSubgraphs(identifier: string): Promise<SubgraphClass$1[]>;
|
|
2712
3081
|
loadProcessors(identifier: string): Promise<ProcessorFactoryBuilder | null>;
|
|
2713
3082
|
}
|
|
@@ -2727,11 +3096,13 @@ declare class ImportPackageLoader implements IPackageLoader {
|
|
|
2727
3096
|
*/
|
|
2728
3097
|
declare function isExpectedLoaderMiss(error: unknown, pkg: string): boolean;
|
|
2729
3098
|
declare function getUniqueDocumentModels(...documentModels: readonly (readonly DocumentModelModule<any>[])[]): DocumentModelModule[];
|
|
3099
|
+
declare function getUniqueUpgradeManifests(...upgradeManifests: readonly (readonly UpgradeManifest<readonly number[]>[])[]): UpgradeManifest<readonly number[]>[];
|
|
2730
3100
|
declare class PackageManager implements IPackageManager {
|
|
2731
3101
|
protected options: IPackageManagerOptions;
|
|
2732
3102
|
private readonly logger;
|
|
2733
3103
|
private loaders;
|
|
2734
3104
|
private docModelsMap;
|
|
3105
|
+
private upgradeManifestsMap;
|
|
2735
3106
|
private subgraphsMap;
|
|
2736
3107
|
private processorMap;
|
|
2737
3108
|
private configWatcher;
|
|
@@ -2741,10 +3112,17 @@ declare class PackageManager implements IPackageManager {
|
|
|
2741
3112
|
init(): Promise<PackageManagerResult>;
|
|
2742
3113
|
private loadPackages;
|
|
2743
3114
|
private loadDocumentModels;
|
|
3115
|
+
/** Upgrade manifests currently loaded across all packages, one per type. */
|
|
3116
|
+
getUniqueUpgradeManifests(): UpgradeManifest<readonly number[]>[];
|
|
3117
|
+
private loadUpgradeManifests;
|
|
2744
3118
|
private loadSubgraphs;
|
|
2745
3119
|
private loadProcessors;
|
|
2746
3120
|
private maybeWarnAllLoadersFailed;
|
|
2747
3121
|
private updateDocumentModelsForPackage;
|
|
3122
|
+
private updateSubgraphsForPackage;
|
|
3123
|
+
private updateProcessorsForPackage;
|
|
3124
|
+
/** Debounced per key so repeated subscribePackages calls reuse one timer. */
|
|
3125
|
+
private getDebouncedUpdateCallback;
|
|
2748
3126
|
private subscribePackages;
|
|
2749
3127
|
private getAllPackageNames;
|
|
2750
3128
|
private getPackageNamesFromConfigFile;
|
|
@@ -2757,6 +3135,27 @@ declare class PackageManager implements IPackageManager {
|
|
|
2757
3135
|
onProcessorsChange(handler: (processors: Map<string, Processor$1>) => void): void;
|
|
2758
3136
|
}
|
|
2759
3137
|
//#endregion
|
|
3138
|
+
//#region src/services/renown-config.d.ts
|
|
3139
|
+
/** Where the credential check reads from: a remote Renown or Switchboard
|
|
3140
|
+
* instance, or this switchboard's own renown read model. */
|
|
3141
|
+
type RenownSource = NonNullable<PHReactorRenown["source"]>;
|
|
3142
|
+
/** The `auth.renown` config block: which Renown instance to authenticate
|
|
3143
|
+
* against, before env overrides are applied. */
|
|
3144
|
+
type RenownConfig = PHReactorRenown;
|
|
3145
|
+
/** Resolved renown coordinates. `url` also drives this reactor's own identity,
|
|
3146
|
+
* so it stays meaningful when `source` is "self". */
|
|
3147
|
+
type ResolvedRenownConfig = {
|
|
3148
|
+
source: RenownSource;
|
|
3149
|
+
url: string | undefined;
|
|
3150
|
+
switchboardUrl: string | undefined;
|
|
3151
|
+
};
|
|
3152
|
+
/** Reading credentials from this reactor's own read model needs a host-supplied
|
|
3153
|
+
* verifier: core has no idea which subgraph serves that read model. */
|
|
3154
|
+
declare function assertCredentialVerifierForSource(source: RenownSource, hasVerifier: boolean): void;
|
|
3155
|
+
/** Resolve `auth.renown`; RENOWN_SOURCE / RENOWN_URL / SWITCHBOARD_URL win
|
|
3156
|
+
* over the config file, which wins over the SDK defaults. */
|
|
3157
|
+
declare function resolveRenownConfig(configured: RenownConfig | undefined, env: NodeJS.ProcessEnv, logger: ILogger): ResolvedRenownConfig;
|
|
3158
|
+
//#endregion
|
|
2760
3159
|
//#region src/server.d.ts
|
|
2761
3160
|
type Options = {
|
|
2762
3161
|
port?: number;
|
|
@@ -2774,7 +3173,16 @@ type Options = {
|
|
|
2774
3173
|
auth?: {
|
|
2775
3174
|
enabled: boolean;
|
|
2776
3175
|
admins: string[];
|
|
3176
|
+
/** Read the bearer and populate `ctx.user` independently of `enabled`.
|
|
3177
|
+
* Defaults to `enabled`; `RESOLVE_CALLER_IDENTITY` overrides either. */
|
|
3178
|
+
resolveIdentity?: boolean;
|
|
2777
3179
|
};
|
|
3180
|
+
/** Renown coordinates the host already resolved, used verbatim instead of
|
|
3181
|
+
* resolving `auth.renown` and the env again (which would warn twice). */
|
|
3182
|
+
renown?: ResolvedRenownConfig;
|
|
3183
|
+
/** Credential check replacing the built-in remote Renown one; required when
|
|
3184
|
+
* the resolved source is "self" (see assertCredentialVerifierForSource). */
|
|
3185
|
+
verifyCredential?: CredentialVerifier;
|
|
2778
3186
|
https?: {
|
|
2779
3187
|
keyPath: string;
|
|
2780
3188
|
certPath: string;
|
|
@@ -2811,7 +3219,7 @@ declare function assertAuthRequiredForDocumentPermissions(authEnabled: boolean,
|
|
|
2811
3219
|
* opt-in: it removes the only binding between a token's claimed address and its
|
|
2812
3220
|
* signing key. Fail-closed — unset NODE_ENV counts as production.
|
|
2813
3221
|
*/
|
|
2814
|
-
declare function assertSkipCredentialVerificationAllowed(
|
|
3222
|
+
declare function assertSkipCredentialVerificationAllowed(resolvesCallerIdentity: boolean, skipCredentialVerification: boolean, env: NodeJS.ProcessEnv): void;
|
|
2815
3223
|
/**
|
|
2816
3224
|
* Initializes and starts the API server using an initializer function.
|
|
2817
3225
|
* This function first loads packages to get document models, then calls the initializer function
|
|
@@ -2830,14 +3238,28 @@ declare function assertSkipCredentialVerificationAllowed(authEnabled: boolean, s
|
|
|
2830
3238
|
interface ClientInitializerResult {
|
|
2831
3239
|
module: InProcessReactorClientModule;
|
|
2832
3240
|
reactorDriveClient?: IDriveClient;
|
|
3241
|
+
attachmentReferenceProjection?: AttachmentReferenceProjectionCapability;
|
|
3242
|
+
}
|
|
3243
|
+
interface ClientInitializerDependencies {
|
|
3244
|
+
attachmentReferenceWriter: IAttachmentReferenceWriter;
|
|
3245
|
+
/** Upgrade manifests exported by the loaded packages, one per type. */
|
|
3246
|
+
upgradeManifests: UpgradeManifest<readonly number[]>[];
|
|
2833
3247
|
}
|
|
2834
|
-
declare function initializeAndStartAPI(clientInitializer: (documentModels: DocumentModelModule[]) => Promise<ClientInitializerResult>, options: Options, processorApp: ProcessorApp): Promise<API & {
|
|
3248
|
+
declare function initializeAndStartAPI(clientInitializer: (documentModels: DocumentModelModule[], dependencies: ClientInitializerDependencies) => Promise<ClientInitializerResult>, options: Options, processorApp: ProcessorApp): Promise<API & {
|
|
2835
3249
|
client: IReactorClient;
|
|
2836
3250
|
syncManager: ISyncManager;
|
|
2837
3251
|
documentModelRegistry: IDocumentModelRegistry;
|
|
2838
3252
|
readiness: ReadinessGate;
|
|
3253
|
+
attachmentReferenceProjection: AttachmentReferenceProjectionCapability;
|
|
2839
3254
|
}>;
|
|
2840
3255
|
//#endregion
|
|
3256
|
+
//#region src/services/renown-credential-verifier.d.ts
|
|
3257
|
+
interface RenownCredentialVerifierConfig {
|
|
3258
|
+
renownUrl?: string;
|
|
3259
|
+
switchboardUrl?: string;
|
|
3260
|
+
}
|
|
3261
|
+
declare function createRenownCredentialVerifier(config?: RenownCredentialVerifierConfig): Promise<CredentialVerifier>;
|
|
3262
|
+
//#endregion
|
|
2841
3263
|
//#region src/utils/create-schema.d.ts
|
|
2842
3264
|
declare const buildSubgraphSchemaModule: (documentModels: DocumentModelModule[], resolvers: GraphQLResolverMap<Context$1>, typeDefs: DocumentNode) => GraphQLSchemaModule;
|
|
2843
3265
|
declare const createSchema: (documentModels: DocumentModelModule[], resolvers: GraphQLResolverMap<Context$1>, typeDefs: DocumentNode) => graphql.GraphQLSchema;
|
|
@@ -2871,5 +3293,5 @@ interface DocumentModelSchemaOptions {
|
|
|
2871
3293
|
*/
|
|
2872
3294
|
declare function generateDocumentModelSchema(documentModel: DocumentModelGlobalState$1, options?: DocumentModelSchemaOptions): DocumentNode;
|
|
2873
3295
|
//#endregion
|
|
2874
|
-
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 };
|
|
3296
|
+
export { ADMIN_USERS, API, Action, ActionCandidateInput, ActionCandidateInputSchema, ActionContext, ActionContextInput, ActionContextInputSchema, ActionContextResolvers, ActionEvaluation, ActionEvaluationResolvers, ActionEvaluations, ActionEvaluationsResolvers, ActionInput, ActionInputSchema, ActionResolvers, AddRelationshipDocument, AddRelationshipMutation, AddRelationshipMutationVariables, AnalyticsSubgraph, AttachmentAccessRequest, AttachmentAccessResult, AttachmentAccessService, type AttachmentReferenceProjectionCapability, AuthConfig, AuthContext, AuthDecision, AuthDecisionSchema, AuthFetchMiddleware, AuthService, AuthSubgraph, type AuthorizationConfig, AuthorizationPolicy, AuthorizedDocumentHandle, BaseSubgraph, type CanonicalDocumentId, CanonicalDocumentIdResolutionError, CanonicalDocumentIdResolver, ChannelMeta, ChannelMetaInput, ChannelMetaInputSchema, ChannelMetaResolvers, ClientInitializerDependencies, ClientInitializerResult, Context, CreateDocumentDocument, CreateDocumentMutation, CreateDocumentMutationVariables, CreateEmptyDocumentDocument, CreateEmptyDocumentMutation, CreateEmptyDocumentMutationVariables, CredentialVerifier, 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, EvaluateActionsDocument, EvaluateActionsQuery, EvaluateActionsQueryVariables, 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, IAttachmentAccessService, type IAuthorizationService, IGatewayAdapter, IHttpAdapter, type IPackageLoader, type IPackageLoaderOptions, IPackageStorage, IProcessorHostModule, 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, MutationExecuteArgs, MutationExecuteAsyncArgs, MutationMoveRelationshipArgs, MutationMutateDocumentArgs, MutationMutateDocumentAsyncArgs, MutationPushSyncEnvelopesArgs, MutationRemoveRelationshipArgs, MutationRenameDocumentArgs, MutationResolvers, MutationSetPreferredEditorArgs, MutationTouchChannelArgs, NextResolverFn, OperationContext, OperationContextInput, OperationContextInputSchema, OperationContextResolvers, OperationInput, OperationInputSchema, OperationUserPermissionEntry, OperationUserPermissionTable, OperationWithContext, OperationWithContextInput, OperationWithContextInputSchema, OperationWithContextResolvers, OperationsFilterInput, OperationsFilterInputSchema, PGLITE_UTC_PARSERS, 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, QueryEvaluateActionsArgs, 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, RenownConfig, RenownCredentialVerifierConfig, RenownSource, Requester, RequireFields, ResolvedRenownConfig, 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, assertCredentialVerifierForSource, assertSkipCredentialVerificationAllowed, buildGraphQlDocument, buildGraphQlDriveDocument, buildGraphqlOperation, buildGraphqlOperations, buildSubgraphSchemaModule, createAuthFetchMiddleware, createCanonicalDocumentIdResolver, createGatewayAdapter, createHttpAdapter, createMergedSchema, createReactorGraphQLClient, createRenownCredentialVerifier, createSchema, definedNonNullAnySchema, driveIdFromUrl, extractSubgraphsFromModule, generateDocumentModelSchema, getAuthContext, getDbClient, getDocumentModelSchemaName, getDocumentModelTypeDefs, getGitHash, getGitUrl, getSdk, getUniqueDocumentModels, getUniqueUpgradeManifests, getVersion, initAnalyticsStoreSql, initializeAndStartAPI, isDefinedNonNullAny, isExpectedLoaderMiss, isSubgraphClass, parseDriveUrl, renderGraphqlPlayground, resolveRenownConfig };
|
|
2875
3297
|
//# sourceMappingURL=index.d.mts.map
|