@powerhousedao/reactor-api 6.2.2-dev.50 → 6.2.2-dev.52

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.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0fa604a4-1713-5d00-989b-ce10e0cf5cdb")}catch(e){}}();
3
- import { _ as createAuthorizationService, a as isSubgraphClass, d as loadSubgraphs, f as BaseSubgraph, g as AuthorizedDocumentHandle, h as AuthorizationPolicy, i as buildGraphqlOperations, l as loadDocumentModels, m as createCanonicalDocumentIdResolver, n as buildGraphQlDriveDocument, o as debounce, p as CanonicalDocumentIdResolutionError, r as buildGraphqlOperation, s as extractUpgradeManifests, t as buildGraphQlDocument, u as loadProcessors } from "./utils-bcfC5Kc1.mjs";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3473708d-6af5-5eab-859e-41e65d41fe17")}catch(e){}}();
3
+ import { _ as createAuthorizationService, a as isSubgraphClass, d as loadSubgraphs, f as BaseSubgraph, g as AuthorizedDocumentHandle, h as AuthorizationPolicy, i as buildGraphqlOperations, l as loadDocumentModels, m as createCanonicalDocumentIdResolver, n as buildGraphQlDriveDocument, o as debounce, p as CanonicalDocumentIdResolutionError, r as buildGraphqlOperation, s as extractUpgradeManifests, t as buildGraphQlDocument, u as loadProcessors, v as AuthEvaluationUnsupportedError } from "./utils-Tw4hVMpc.mjs";
4
4
  import { AnalyticsQueryEngine } from "@powerhousedao/analytics-engine-core";
5
5
  import { AnalyticsModel, AnalyticsResolvers, typedefs } from "@powerhousedao/analytics-engine-graphql";
6
6
  import { gql } from "graphql-tag";
7
7
  import { GraphQLError, Kind, parse, print } from "graphql";
8
- import { DEFAULT_DRIVE_CONTAINER_TYPES, DriveCollectionId, PropagationMode as PropagationMode$1, consolidateSyncOperations, driveIdFromUrl, envelopesToSyncOperations, parseDriveUrl, syncOperationErrorType } from "@powerhousedao/reactor";
8
+ import { AuthEnforcementDisabledError, DEFAULT_DRIVE_CONTAINER_TYPES, DriveCollectionId, PropagationMode as PropagationMode$1, consolidateSyncOperations, driveIdFromUrl, envelopesToSyncOperations, parseDriveUrl, syncOperationErrorType } from "@powerhousedao/reactor";
9
9
  import { ConsoleLogger, childLogger, documentModelDocumentModelModule } from "document-model";
10
10
  import path from "node:path";
11
11
  import { match } from "path-to-regexp";
@@ -929,6 +929,11 @@ function generateNewApiSchema(documentName, specification, _stateSchemaTypes, pr
929
929
  }
930
930
  //#endregion
931
931
  //#region src/graphql/reactor/gen/graphql.ts
932
+ let AuthDecision = /* @__PURE__ */ function(AuthDecision) {
933
+ AuthDecision["Allow"] = "ALLOW";
934
+ AuthDecision["Deny"] = "DENY";
935
+ return AuthDecision;
936
+ }({});
932
937
  let DocumentChangeType = /* @__PURE__ */ function(DocumentChangeType) {
933
938
  DocumentChangeType["ChildAdded"] = "CHILD_ADDED";
934
939
  DocumentChangeType["ChildRemoved"] = "CHILD_REMOVED";
@@ -951,9 +956,17 @@ let SyncEnvelopeType = /* @__PURE__ */ function(SyncEnvelopeType) {
951
956
  }({});
952
957
  const isDefinedNonNullAny = (v) => v !== void 0 && v !== null;
953
958
  const definedNonNullAnySchema = z$1.any().refine((v) => isDefinedNonNullAny(v));
959
+ const AuthDecisionSchema = z$1.enum(AuthDecision);
954
960
  const DocumentChangeTypeSchema = z$1.enum(DocumentChangeType);
955
961
  const PropagationModeSchema = z$1.enum(PropagationMode);
956
962
  const SyncEnvelopeTypeSchema = z$1.enum(SyncEnvelopeType);
963
+ function ActionCandidateInputSchema() {
964
+ return z$1.object({
965
+ input: z$1.custom((v) => v != null).nullish(),
966
+ scope: z$1.string(),
967
+ type: z$1.string()
968
+ });
969
+ }
957
970
  function ActionContextInputSchema() {
958
971
  return z$1.object({ signer: z$1.lazy(() => ReactorSignerInputSchema().nullish()) });
959
972
  }
@@ -1307,6 +1320,28 @@ const GetJobStatusDocument = gql`
1307
1320
  }
1308
1321
  }
1309
1322
  `;
1323
+ const EvaluateActionsDocument = gql`
1324
+ query EvaluateActions(
1325
+ $documentIdentifier: String!
1326
+ $branch: String
1327
+ $candidates: [ActionCandidateInput!]!
1328
+ ) {
1329
+ evaluateActions(
1330
+ documentIdentifier: $documentIdentifier
1331
+ branch: $branch
1332
+ candidates: $candidates
1333
+ ) {
1334
+ evaluations {
1335
+ decision
1336
+ reason
1337
+ }
1338
+ allAllowed
1339
+ anyAllowed
1340
+ allDenied
1341
+ anyDenied
1342
+ }
1343
+ }
1344
+ `;
1310
1345
  const CreateDocumentDocument = gql`
1311
1346
  mutation CreateDocument($document: JSONObject!, $parentIdentifier: String) {
1312
1347
  createDocument(document: $document, parentIdentifier: $parentIdentifier) {
@@ -1603,6 +1638,9 @@ function getSdk(requester) {
1603
1638
  GetJobStatus(variables, options) {
1604
1639
  return requester(GetJobStatusDocument, variables, options);
1605
1640
  },
1641
+ EvaluateActions(variables, options) {
1642
+ return requester(EvaluateActionsDocument, variables, options);
1643
+ },
1606
1644
  CreateDocument(variables, options) {
1607
1645
  return requester(CreateDocumentDocument, variables, options);
1608
1646
  },
@@ -1753,6 +1791,20 @@ function toReactorPropagationMode(gqlMode) {
1753
1791
  }
1754
1792
  }
1755
1793
  /**
1794
+ * Maps one predicted verdict to its GraphQL shape. A refusal's reason is the
1795
+ * consensus string the reactor would record for it, carried through verbatim so
1796
+ * a client can tell a deletion refusal from a missing grant; an allow has none.
1797
+ */
1798
+ function toGqlActionEvaluation(evaluation) {
1799
+ return evaluation.decision === "allow" ? {
1800
+ decision: AuthDecision.Allow,
1801
+ reason: null
1802
+ } : {
1803
+ decision: AuthDecision.Deny,
1804
+ reason: evaluation.reason
1805
+ };
1806
+ }
1807
+ /**
1756
1808
  * Converts readonly arrays to mutable arrays for ReactorClient
1757
1809
  */
1758
1810
  function toMutableArray(arr) {
@@ -2082,6 +2134,41 @@ async function documentOperations(reactorClient, args, subject) {
2082
2134
  throw new GraphQLError(`Failed to convert operations to GraphQL: ${error instanceof Error ? error.message : "Unknown error"}`);
2083
2135
  }
2084
2136
  }
2137
+ /**
2138
+ * Predicts the admission verdict for each candidate operation, deciding against
2139
+ * the document policy through the reactor's own decision model.
2140
+ *
2141
+ * The subject is supplied by the subgraph from the authenticated request, never
2142
+ * by the caller: answering for an arbitrary subject would disclose what a policy
2143
+ * grants somebody else. It carries the caller's address and the app key their
2144
+ * token authenticated with, which is the same pair a signed action presents, so
2145
+ * a grant naming either matches here exactly as it would at admission.
2146
+ *
2147
+ * A reactor without authEnforcement raises the named error, which becomes an
2148
+ * "unsupported" code rather than a denial.
2149
+ */
2150
+ async function evaluateActions(reactorClient, args, subject) {
2151
+ const branch = fromInputMaybe(args.branch) ?? "main";
2152
+ const candidates = args.candidates.map((candidate) => ({
2153
+ scope: candidate.scope,
2154
+ type: candidate.type,
2155
+ input: fromInputMaybe(candidate.input)
2156
+ }));
2157
+ let result;
2158
+ try {
2159
+ result = await reactorClient.evaluateActions(args.documentIdentifier, branch, candidates, subject);
2160
+ } catch (error) {
2161
+ if (AuthEnforcementDisabledError.isError(error)) throw new AuthEvaluationUnsupportedError();
2162
+ throw new GraphQLError(`Failed to evaluate actions: ${error instanceof Error ? error.message : "Unknown error"}`);
2163
+ }
2164
+ return {
2165
+ evaluations: result.evaluations.map(toGqlActionEvaluation),
2166
+ allAllowed: result.allAllowed,
2167
+ anyAllowed: result.anyAllowed,
2168
+ allDenied: result.allDenied,
2169
+ anyDenied: result.anyDenied
2170
+ };
2171
+ }
2085
2172
  async function createDocument(reactorClient, args, reactorDriveClient) {
2086
2173
  if (!args.document || typeof args.document !== "object") throw new GraphQLError("Invalid document: must be an object");
2087
2174
  const document = args.document;
@@ -2889,6 +2976,9 @@ var GraphQLManager = class {
2889
2976
  /** Cached document models for schema generation - updated on init and regenerate */
2890
2977
  cachedDocumentModels = [];
2891
2978
  subgraphHandlerCache = /* @__PURE__ */ new Map();
2979
+ /** Per-subgraph handlers by name, before auth/drive middleware is applied,
2980
+ * for in-process queries by trusted internals. */
2981
+ #internalSubgraphHandlers = /* @__PURE__ */ new Map();
2892
2982
  /**
2893
2983
  * Optional reactor-drive client. When the switchboard is configured with a
2894
2984
  * reactor-drive container, this is provided and the resolvers dispatch to
@@ -3054,6 +3144,44 @@ var GraphQLManager = class {
3054
3144
  });
3055
3145
  return this.#addSubgraphInstance(subgraphInstance, supergraph, core);
3056
3146
  }
3147
+ /** Find a registered subgraph by name, core or package-contributed. */
3148
+ getSubgraphByName(name) {
3149
+ for (const subgraphs of [...this.coreSubgraphsMap.values(), ...this.subgraphs.values()]) {
3150
+ const found = subgraphs.find((subgraph) => subgraph.name === name);
3151
+ if (found) return found;
3152
+ }
3153
+ }
3154
+ /** Whether a registered subgraph has a live handler, i.e. whether
3155
+ * {@link executeSubgraphQuery} can reach it right now. */
3156
+ hasSubgraphHandler(name) {
3157
+ return this.#internalSubgraphHandlers.has(name);
3158
+ }
3159
+ /** Run a query against one registered subgraph in-process: the subgraph's own
3160
+ * handler, without a socket or the auth/drive middleware. Trusted callers. */
3161
+ async executeSubgraphQuery(subgraphName, query, variables) {
3162
+ const entry = this.#internalSubgraphHandlers.get(subgraphName);
3163
+ if (!entry) throw new Error(this.getSubgraphByName(subgraphName) ? `Subgraph "${subgraphName}" is registered but has no handler yet` : `Subgraph "${subgraphName}" is not registered`);
3164
+ const url = new URL(entry.path, `http://localhost:${this.port}/`);
3165
+ const response = await entry.handler(new Request(url, {
3166
+ method: "POST",
3167
+ headers: {
3168
+ "content-type": "application/json",
3169
+ accept: "application/json"
3170
+ },
3171
+ body: JSON.stringify({
3172
+ query,
3173
+ variables
3174
+ })
3175
+ }));
3176
+ if (!response.ok) {
3177
+ const detail = await response.text().catch(() => "");
3178
+ throw new Error(`Subgraph "${subgraphName}" query failed: ${response.status}${detail ? ` ${detail}` : ""}`);
3179
+ }
3180
+ const body = await response.json();
3181
+ if (body.errors?.length) throw new Error(body.errors.map((error) => error.message).join("; "));
3182
+ if (!body.data) throw new Error(`Subgraph "${subgraphName}" returned no data`);
3183
+ return body.data;
3184
+ }
3057
3185
  updateRouter = debounce(this._updateRouter.bind(this), 1e3);
3058
3186
  async _updateRouter() {
3059
3187
  this.logger.debug("Updating router");
@@ -3129,6 +3257,20 @@ var GraphQLManager = class {
3129
3257
  #getSubgraphPath(subgraph, supergraph) {
3130
3258
  return path.join(subgraph.path ?? "", supergraph, subgraph.name);
3131
3259
  }
3260
+ /** The in-process handler map is keyed by bare name, so two distinct
3261
+ * subgraphs sharing one name would shadow each other: keep the first. */
3262
+ #setInternalSubgraphHandler(subgraph, subgraphPath, handler) {
3263
+ const existing = this.#internalSubgraphHandlers.get(subgraph.name);
3264
+ if (existing && existing.subgraph !== subgraph) {
3265
+ this.logger.warn("Two subgraphs are named @name (@kept and @ignored); in-process queries keep the first", subgraph.name, existing.path, subgraphPath);
3266
+ return;
3267
+ }
3268
+ this.#internalSubgraphHandlers.set(subgraph.name, {
3269
+ subgraph,
3270
+ path: subgraphPath,
3271
+ handler
3272
+ });
3273
+ }
3132
3274
  async #setupSubgraphs(subgraphsMap) {
3133
3275
  for (const [supergraph, subgraphs] of subgraphsMap.entries()) for (const subgraph of subgraphs) {
3134
3276
  this.logger.debug(`Setting up subgraph ${subgraph.name}`);
@@ -3139,6 +3281,7 @@ var GraphQLManager = class {
3139
3281
  const rawHandler = await this.gatewayAdapter.createHandler(schema, this.#makeContextFactory());
3140
3282
  const fetchHandler = this.#composeFetchMiddleware(rawHandler);
3141
3283
  this.subgraphHandlerCache.set(subgraphPath, fetchHandler);
3284
+ this.#setInternalSubgraphHandler(subgraph, subgraphPath, rawHandler);
3142
3285
  this.httpAdapter.mount(subgraphPath, fetchHandler);
3143
3286
  if (subgraph.hasSubscriptions) {
3144
3287
  try {
@@ -3550,6 +3693,17 @@ const DocumentChangeEventDTO = z.object({
3550
3693
  documents: z.array(PHDocumentDTO),
3551
3694
  context: DocumentChangeContextDTO.nullable().optional()
3552
3695
  }).strip();
3696
+ const ActionEvaluationDTO = z.object({
3697
+ decision: z.enum(["ALLOW", "DENY"]),
3698
+ reason: z.string().nullable().optional()
3699
+ }).strip();
3700
+ const ActionEvaluationsDTO = z.object({
3701
+ evaluations: z.array(ActionEvaluationDTO),
3702
+ allAllowed: z.boolean(),
3703
+ anyAllowed: z.boolean(),
3704
+ allDenied: z.boolean(),
3705
+ anyDenied: z.boolean()
3706
+ }).strip();
3553
3707
  const JobChangeEventDTO = z.object({
3554
3708
  jobId: z.string(),
3555
3709
  status: z.string(),
@@ -3583,6 +3737,9 @@ const operationValidators = {
3583
3737
  GetJobStatus: (data) => {
3584
3738
  if (data.jobStatus) JobInfoDTO.parse(data.jobStatus);
3585
3739
  },
3740
+ EvaluateActions: (data) => {
3741
+ if (data.evaluateActions) ActionEvaluationsDTO.parse(data.evaluateActions);
3742
+ },
3586
3743
  CreateDocument: (data) => {
3587
3744
  if (data.createDocument) PHDocumentDTO.parse(data.createDocument);
3588
3745
  },
@@ -3645,7 +3802,7 @@ function createReactorGraphQLClient(url, fetchImpl = fetch, headers) {
3645
3802
  }
3646
3803
  //#endregion
3647
3804
  //#region src/graphql/reactor/schema.graphql
3648
- var schema_default = "# Scalar types (for codegen - also defined in create-schema.ts)\nscalar JSONObject\nscalar DateTime\n\n# Input types\ninput PagingInput {\n limit: Int\n offset: Int\n cursor: String\n}\n\ninput ViewFilterInput {\n branch: String\n scopes: [String!]\n}\n\ninput SearchFilterInput {\n type: String\n parentId: String\n identifiers: [String!]\n}\n\ninput OperationsFilterInput {\n documentId: String!\n branch: String\n scopes: [String!]\n actionTypes: [String!]\n sinceRevision: Int\n timestampFrom: String\n timestampTo: String\n}\n\ninput DocumentOperationsFilterInput {\n branch: String\n scopes: [String!]\n actionTypes: [String!]\n sinceRevision: Int\n timestampFrom: String\n timestampTo: String\n}\n\n# Enums\nenum PropagationMode {\n CASCADE\n ORPHAN\n}\n\nenum DocumentChangeType {\n CREATED\n DELETED\n UPDATED\n PARENT_ADDED\n PARENT_REMOVED\n CHILD_ADDED\n CHILD_REMOVED\n}\n\n# Object types\ntype DocumentModelGlobalState {\n id: String!\n name: String!\n namespace: String\n version: String\n specification: JSONObject!\n}\n\ntype DocumentModelResultPage {\n items: [DocumentModelGlobalState!]!\n totalCount: Int!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype Revision {\n scope: String!\n revision: Int!\n}\n\ntype PHDocument {\n id: String!\n slug: String\n preferredEditor: String\n name: String!\n documentType: String!\n state: JSONObject!\n revisionsList: [Revision!]!\n createdAtUtcIso: DateTime!\n lastModifiedAtUtcIso: DateTime!\n operations(\n filter: DocumentOperationsFilterInput\n paging: PagingInput\n ): ReactorOperationResultPage\n}\n\ntype PHDocumentResultPage {\n items: [PHDocument!]!\n totalCount: Int!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype ReactorOperationResultPage {\n items: [ReactorOperation!]!\n totalCount: Int!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype DeadLetterInfo {\n documentId: String!\n error: String!\n \"\"\"\n How the origin classified the failure. A peer needs this to mirror the origin's\n quarantine decision; without it a held auth operation would freeze the document\n on the peer side while the origin kept syncing.\n \"\"\"\n errorType: String\n jobId: String!\n branch: String!\n scopes: [String!]!\n operationCount: Int!\n}\n\ntype PollSyncEnvelopesResult {\n envelopes: [SyncEnvelope!]!\n ackOrdinal: Int!\n deadLetters: [DeadLetterInfo!]!\n hasMore: Boolean!\n}\n\ntype DocumentWithChildren {\n document: PHDocument!\n childIds: [String!]!\n}\n\ntype MoveRelationshipResult {\n source: PHDocument!\n target: PHDocument!\n}\n\ntype JobInfo {\n id: String!\n status: String!\n result: JSONObject!\n error: String\n createdAt: DateTime!\n completedAt: DateTime\n}\n\ntype DocumentChangeEvent {\n type: DocumentChangeType!\n documents: [PHDocument!]!\n context: DocumentChangeContext\n}\n\ntype DocumentChangeContext {\n parentId: String\n childId: String\n}\n\ntype JobChangeEvent {\n jobId: String!\n status: String!\n result: JSONObject!\n error: String\n}\n\ntype ReactorSignerUser {\n address: String!\n networkId: String!\n chainId: Int!\n}\n\ntype ReactorSignerApp {\n name: String!\n key: String!\n}\n\ntype ReactorSigner {\n user: ReactorSignerUser\n app: ReactorSignerApp\n signatures: [String!]!\n}\n\ntype ActionContext {\n signer: ReactorSigner\n}\n\ntype Action {\n id: String!\n type: String!\n timestampUtcMs: String!\n input: JSONObject!\n scope: String!\n context: ActionContext\n}\n\n# Input types for sync operations\ninput ActionContextInput {\n signer: ReactorSignerInput\n}\n\ninput ReactorSignerInput {\n user: ReactorSignerUserInput\n app: ReactorSignerAppInput\n signatures: [String!]!\n}\n\ninput ReactorSignerUserInput {\n address: String!\n networkId: String!\n chainId: Int!\n}\n\ninput ReactorSignerAppInput {\n name: String!\n key: String!\n}\n\ninput ActionInput {\n id: String!\n type: String!\n timestampUtcMs: String!\n input: JSONObject!\n scope: String!\n context: ActionContextInput\n}\n\n# Synchronization types\ntype ReactorOperation {\n index: Int!\n timestampUtcMs: String!\n hash: String!\n skip: Int!\n error: String\n deniedReason: String\n id: String\n action: Action!\n}\n\ninput OperationInput {\n index: Int!\n timestampUtcMs: String!\n hash: String!\n skip: Int!\n error: String\n deniedReason: String\n id: String\n action: ActionInput!\n}\n\ntype OperationContext {\n documentId: String!\n documentType: String!\n scope: String!\n branch: String!\n ordinal: Int!\n}\n\ninput OperationContextInput {\n documentId: String!\n documentType: String!\n scope: String!\n branch: String!\n ordinal: Int!\n}\n\ntype OperationWithContext {\n operation: ReactorOperation!\n context: OperationContext!\n}\n\ninput OperationWithContextInput {\n operation: OperationInput!\n context: OperationContextInput!\n}\n\ntype ChannelMeta {\n id: String!\n}\n\ninput ChannelMetaInput {\n id: String!\n}\n\ntype RemoteCursor {\n remoteName: String!\n cursorOrdinal: Int!\n lastSyncedAtUtcMs: String\n}\n\ninput RemoteCursorInput {\n remoteName: String!\n cursorOrdinal: Int!\n lastSyncedAtUtcMs: String\n}\n\nenum SyncEnvelopeType {\n OPERATIONS\n ACK\n}\n\ntype SyncEnvelope {\n type: SyncEnvelopeType!\n channelMeta: ChannelMeta!\n operations: [OperationWithContext!]\n cursor: RemoteCursor\n key: String\n dependsOn: [String!]\n}\n\ninput SyncEnvelopeInput {\n type: SyncEnvelopeType!\n channelMeta: ChannelMetaInput!\n operations: [OperationWithContextInput!]\n cursor: RemoteCursorInput\n key: String\n dependsOn: [String!]\n}\n\ninput RemoteFilterInput {\n documentId: [String!]!\n scope: [String!]!\n branch: String!\n}\n\ninput TouchChannelInput {\n id: String!\n name: String!\n collectionId: String!\n filter: RemoteFilterInput!\n sinceTimestampUtcMs: String!\n}\n\ntype TouchChannelResult {\n success: Boolean!\n ackOrdinal: Int!\n}\n\ntype Query {\n # Get document models for a namespace\n documentModels(\n namespace: String\n paging: PagingInput\n ): DocumentModelResultPage!\n\n # Get a specific document by ID or slug\n document(identifier: String!, view: ViewFilterInput): DocumentWithChildren\n\n # Get outgoing relationships of a given type from a source document\n documentOutgoingRelationships(\n sourceIdentifier: String!\n relationshipType: String!\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get incoming relationships of a given type to a target document\n documentIncomingRelationships(\n targetIdentifier: String!\n relationshipType: String!\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Find documents by search criteria\n findDocuments(\n search: SearchFilterInput\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get job status\n jobStatus(jobId: String!): JobInfo\n\n # Get operations for a document with filtering and pagination\n documentOperations(\n filter: OperationsFilterInput!\n paging: PagingInput\n ): ReactorOperationResultPage!\n\n # Poll for sync envelopes from a channel\n pollSyncEnvelopes(\n channelId: String!\n outboxAck: Int!\n outboxLatest: Int!\n ): PollSyncEnvelopesResult!\n}\n\ntype Mutation {\n # Create a new document\n createDocument(document: JSONObject!, parentIdentifier: String): PHDocument!\n\n # Create an empty document of specified type\n createEmptyDocument(\n documentType: String!\n parentIdentifier: String\n ): PHDocument!\n\n # Apply actions to a document (synchronous)\n mutateDocument(\n documentIdentifier: String!\n actions: [JSONObject!]!\n view: ViewFilterInput\n ): PHDocument!\n\n # Submit actions to a document (asynchronous)\n mutateDocumentAsync(\n documentIdentifier: String!\n actions: [JSONObject!]!\n view: ViewFilterInput\n ): String!\n\n # Rename a document\n renameDocument(\n documentIdentifier: String!\n name: String!\n branch: String\n ): PHDocument!\n\n # Update the preferred editor recorded in the document header meta.\n # Pass null/omit to clear it.\n setPreferredEditor(\n documentIdentifier: String!\n preferredEditor: String\n branch: String\n ): PHDocument!\n\n # Add a relationship between two documents\n addRelationship(\n sourceIdentifier: String!\n targetIdentifier: String!\n relationshipType: String!\n branch: String\n ): PHDocument!\n\n # Remove a relationship between two documents\n removeRelationship(\n sourceIdentifier: String!\n targetIdentifier: String!\n relationshipType: String!\n branch: String\n ): PHDocument!\n\n # Move a relationship from one source to another\n moveRelationship(\n sourceParentIdentifier: String!\n targetParentIdentifier: String!\n targetIdentifier: String!\n relationshipType: String!\n branch: String\n ): MoveRelationshipResult!\n\n # Delete a single document\n deleteDocument(identifier: String!, propagate: PropagationMode): Boolean!\n\n # Delete multiple documents\n deleteDocuments(identifiers: [String!]!, propagate: PropagationMode): Boolean!\n\n # Touch (create or update) a channel for sync\n touchChannel(input: TouchChannelInput!): TouchChannelResult!\n\n # Push sync envelopes to a channel\n pushSyncEnvelopes(envelopes: [SyncEnvelopeInput!]!): Boolean!\n}\n\ntype Subscription {\n # Subscribe to document changes\n documentChanges(\n search: SearchFilterInput\n view: ViewFilterInput\n ): DocumentChangeEvent!\n\n # Subscribe to job changes\n jobChanges(jobId: String!): JobChangeEvent!\n}\n";
3805
+ var schema_default = "# Scalar types (for codegen - also defined in create-schema.ts)\nscalar JSONObject\nscalar DateTime\n\n# Input types\ninput PagingInput {\n limit: Int\n offset: Int\n cursor: String\n}\n\ninput ViewFilterInput {\n branch: String\n scopes: [String!]\n}\n\ninput SearchFilterInput {\n type: String\n parentId: String\n identifiers: [String!]\n}\n\ninput OperationsFilterInput {\n documentId: String!\n branch: String\n scopes: [String!]\n actionTypes: [String!]\n sinceRevision: Int\n timestampFrom: String\n timestampTo: String\n}\n\ninput DocumentOperationsFilterInput {\n branch: String\n scopes: [String!]\n actionTypes: [String!]\n sinceRevision: Int\n timestampFrom: String\n timestampTo: String\n}\n\n# Enums\nenum PropagationMode {\n CASCADE\n ORPHAN\n}\n\nenum DocumentChangeType {\n CREATED\n DELETED\n UPDATED\n PARENT_ADDED\n PARENT_REMOVED\n CHILD_ADDED\n CHILD_REMOVED\n}\n\n# Object types\ntype DocumentModelGlobalState {\n id: String!\n name: String!\n namespace: String\n version: String\n specification: JSONObject!\n}\n\ntype DocumentModelResultPage {\n items: [DocumentModelGlobalState!]!\n totalCount: Int!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype Revision {\n scope: String!\n revision: Int!\n}\n\ntype PHDocument {\n id: String!\n slug: String\n preferredEditor: String\n name: String!\n documentType: String!\n state: JSONObject!\n revisionsList: [Revision!]!\n createdAtUtcIso: DateTime!\n lastModifiedAtUtcIso: DateTime!\n operations(\n filter: DocumentOperationsFilterInput\n paging: PagingInput\n ): ReactorOperationResultPage\n}\n\ntype PHDocumentResultPage {\n items: [PHDocument!]!\n totalCount: Int!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype ReactorOperationResultPage {\n items: [ReactorOperation!]!\n totalCount: Int!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype DeadLetterInfo {\n documentId: String!\n error: String!\n \"\"\"\n How the origin classified the failure. A peer needs this to mirror the origin's\n quarantine decision; without it a held auth operation would freeze the document\n on the peer side while the origin kept syncing.\n \"\"\"\n errorType: String\n jobId: String!\n branch: String!\n scopes: [String!]!\n operationCount: Int!\n}\n\ntype PollSyncEnvelopesResult {\n envelopes: [SyncEnvelope!]!\n ackOrdinal: Int!\n deadLetters: [DeadLetterInfo!]!\n hasMore: Boolean!\n}\n\ntype DocumentWithChildren {\n document: PHDocument!\n childIds: [String!]!\n}\n\ntype MoveRelationshipResult {\n source: PHDocument!\n target: PHDocument!\n}\n\ntype JobInfo {\n id: String!\n status: String!\n result: JSONObject!\n error: String\n createdAt: DateTime!\n completedAt: DateTime\n}\n\ntype DocumentChangeEvent {\n type: DocumentChangeType!\n documents: [PHDocument!]!\n context: DocumentChangeContext\n}\n\ntype DocumentChangeContext {\n parentId: String\n childId: String\n}\n\ntype JobChangeEvent {\n jobId: String!\n status: String!\n result: JSONObject!\n error: String\n}\n\ntype ReactorSignerUser {\n address: String!\n networkId: String!\n chainId: Int!\n}\n\ntype ReactorSignerApp {\n name: String!\n key: String!\n}\n\ntype ReactorSigner {\n user: ReactorSignerUser\n app: ReactorSignerApp\n signatures: [String!]!\n}\n\ntype ActionContext {\n signer: ReactorSigner\n}\n\ntype Action {\n id: String!\n type: String!\n timestampUtcMs: String!\n input: JSONObject!\n scope: String!\n context: ActionContext\n}\n\n\"\"\"\nOne operation an authorization preflight predicts a verdict for.\n\n`input` is what a conditional grant reads, so a candidate standing for a\nfilled-in form carries that form's input. Omitting it predicts the verdict an\nempty input earns, not the verdict the filled-in form will get.\n\"\"\"\ninput ActionCandidateInput {\n scope: String!\n type: String!\n input: JSONObject\n}\n\nenum AuthDecision {\n ALLOW\n DENY\n}\n\n\"\"\"\nOne candidate's predicted verdict. `reason` carries the refusal a DENY is\nrecorded with, and is null on an ALLOW.\n\"\"\"\ntype ActionEvaluation {\n decision: AuthDecision!\n reason: String\n}\n\n\"\"\"\nThe predicted verdicts for a set of candidates, in the order they were given,\nwith the aggregates a caller branches on.\n\nThe aggregates are redundant -- a verdict is binary -- and all four are returned\nso a caller reads the one its question is phrased in rather than negating\nanother. Over no candidates every aggregate is false: nothing is allowed and\nnothing is denied.\n\"\"\"\ntype ActionEvaluations {\n evaluations: [ActionEvaluation!]!\n allAllowed: Boolean!\n anyAllowed: Boolean!\n allDenied: Boolean!\n anyDenied: Boolean!\n}\n\n# Input types for sync operations\ninput ActionContextInput {\n signer: ReactorSignerInput\n}\n\ninput ReactorSignerInput {\n user: ReactorSignerUserInput\n app: ReactorSignerAppInput\n signatures: [String!]!\n}\n\ninput ReactorSignerUserInput {\n address: String!\n networkId: String!\n chainId: Int!\n}\n\ninput ReactorSignerAppInput {\n name: String!\n key: String!\n}\n\ninput ActionInput {\n id: String!\n type: String!\n timestampUtcMs: String!\n input: JSONObject!\n scope: String!\n context: ActionContextInput\n}\n\n# Synchronization types\ntype ReactorOperation {\n index: Int!\n timestampUtcMs: String!\n hash: String!\n skip: Int!\n error: String\n deniedReason: String\n id: String\n action: Action!\n}\n\ninput OperationInput {\n index: Int!\n timestampUtcMs: String!\n hash: String!\n skip: Int!\n error: String\n deniedReason: String\n id: String\n action: ActionInput!\n}\n\ntype OperationContext {\n documentId: String!\n documentType: String!\n scope: String!\n branch: String!\n ordinal: Int!\n}\n\ninput OperationContextInput {\n documentId: String!\n documentType: String!\n scope: String!\n branch: String!\n ordinal: Int!\n}\n\ntype OperationWithContext {\n operation: ReactorOperation!\n context: OperationContext!\n}\n\ninput OperationWithContextInput {\n operation: OperationInput!\n context: OperationContextInput!\n}\n\ntype ChannelMeta {\n id: String!\n}\n\ninput ChannelMetaInput {\n id: String!\n}\n\ntype RemoteCursor {\n remoteName: String!\n cursorOrdinal: Int!\n lastSyncedAtUtcMs: String\n}\n\ninput RemoteCursorInput {\n remoteName: String!\n cursorOrdinal: Int!\n lastSyncedAtUtcMs: String\n}\n\nenum SyncEnvelopeType {\n OPERATIONS\n ACK\n}\n\ntype SyncEnvelope {\n type: SyncEnvelopeType!\n channelMeta: ChannelMeta!\n operations: [OperationWithContext!]\n cursor: RemoteCursor\n key: String\n dependsOn: [String!]\n}\n\ninput SyncEnvelopeInput {\n type: SyncEnvelopeType!\n channelMeta: ChannelMetaInput!\n operations: [OperationWithContextInput!]\n cursor: RemoteCursorInput\n key: String\n dependsOn: [String!]\n}\n\ninput RemoteFilterInput {\n documentId: [String!]!\n scope: [String!]!\n branch: String!\n}\n\ninput TouchChannelInput {\n id: String!\n name: String!\n collectionId: String!\n filter: RemoteFilterInput!\n sinceTimestampUtcMs: String!\n}\n\ntype TouchChannelResult {\n success: Boolean!\n ackOrdinal: Int!\n}\n\ntype Query {\n # Get document models for a namespace\n documentModels(\n namespace: String\n paging: PagingInput\n ): DocumentModelResultPage!\n\n # Get a specific document by ID or slug\n document(identifier: String!, view: ViewFilterInput): DocumentWithChildren\n\n # Get outgoing relationships of a given type from a source document\n documentOutgoingRelationships(\n sourceIdentifier: String!\n relationshipType: String!\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get incoming relationships of a given type to a target document\n documentIncomingRelationships(\n targetIdentifier: String!\n relationshipType: String!\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Find documents by search criteria\n findDocuments(\n search: SearchFilterInput\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get job status\n jobStatus(jobId: String!): JobInfo\n\n # Get operations for a document with filtering and pagination\n documentOperations(\n filter: OperationsFilterInput!\n paging: PagingInput\n ): ReactorOperationResultPage!\n\n \"\"\"\n Predicts whether the calling subject would be admitted to execute each of a\n set of candidate operations, without submitting any of them. A UI asks this to\n disable a control rather than offer an action that fails on submit.\n\n The answer is a prediction, not a promise:\n\n - Real admission compiles an append condition over everything it read and the\n store enforces it at write time. A preflight reads no future, so a policy\n change landing between this answer and the submit changes the verdict. The\n submit path stays the only authority.\n - The verdict is evaluated at the stream heads, so it is correct for a\n candidate about to be submitted. A backdated submission is out of contract;\n the reactor decides that one by position.\n - A candidate whose verdict depends on its input has to carry that input, since\n a conditional grant reads it.\n\n The subject is the authenticated caller and cannot be named in the request:\n answering for an arbitrary subject would disclose what a policy grants\n somebody else. It carries both the caller's address and the did:key of the app\n instance whose token authenticated the request, so a policy naming either\n matches the same principal the write path presents.\n\n Requires the reactor's authEnforcement feature flag. Without it the reactor\n holds no decision model, so this fails with extensions.code\n AUTH_EVALUATION_UNSUPPORTED rather than guessing.\n \"\"\"\n evaluateActions(\n documentIdentifier: String!\n branch: String\n candidates: [ActionCandidateInput!]!\n ): ActionEvaluations!\n\n # Poll for sync envelopes from a channel\n pollSyncEnvelopes(\n channelId: String!\n outboxAck: Int!\n outboxLatest: Int!\n ): PollSyncEnvelopesResult!\n}\n\ntype Mutation {\n # Create a new document\n createDocument(document: JSONObject!, parentIdentifier: String): PHDocument!\n\n # Create an empty document of specified type\n createEmptyDocument(\n documentType: String!\n parentIdentifier: String\n ): PHDocument!\n\n # Apply actions to a document (synchronous)\n mutateDocument(\n documentIdentifier: String!\n actions: [JSONObject!]!\n view: ViewFilterInput\n ): PHDocument!\n\n # Submit actions to a document (asynchronous)\n mutateDocumentAsync(\n documentIdentifier: String!\n actions: [JSONObject!]!\n view: ViewFilterInput\n ): String!\n\n # Rename a document\n renameDocument(\n documentIdentifier: String!\n name: String!\n branch: String\n ): PHDocument!\n\n # Update the preferred editor recorded in the document header meta.\n # Pass null/omit to clear it.\n setPreferredEditor(\n documentIdentifier: String!\n preferredEditor: String\n branch: String\n ): PHDocument!\n\n # Add a relationship between two documents\n addRelationship(\n sourceIdentifier: String!\n targetIdentifier: String!\n relationshipType: String!\n branch: String\n ): PHDocument!\n\n # Remove a relationship between two documents\n removeRelationship(\n sourceIdentifier: String!\n targetIdentifier: String!\n relationshipType: String!\n branch: String\n ): PHDocument!\n\n # Move a relationship from one source to another\n moveRelationship(\n sourceParentIdentifier: String!\n targetParentIdentifier: String!\n targetIdentifier: String!\n relationshipType: String!\n branch: String\n ): MoveRelationshipResult!\n\n # Delete a single document\n deleteDocument(identifier: String!, propagate: PropagationMode): Boolean!\n\n # Delete multiple documents\n deleteDocuments(identifiers: [String!]!, propagate: PropagationMode): Boolean!\n\n # Touch (create or update) a channel for sync\n touchChannel(input: TouchChannelInput!): TouchChannelResult!\n\n # Push sync envelopes to a channel\n pushSyncEnvelopes(envelopes: [SyncEnvelopeInput!]!): Boolean!\n}\n\ntype Subscription {\n # Subscribe to document changes\n documentChanges(\n search: SearchFilterInput\n view: ViewFilterInput\n ): DocumentChangeEvent!\n\n # Subscribe to job changes\n jobChanges(jobId: String!): JobChangeEvent!\n}\n";
3649
3806
  //#endregion
3650
3807
  //#region src/graphql/reactor/pubsub.ts
3651
3808
  const pubSub = new PubSub();
@@ -3911,6 +4068,19 @@ var ReactorSubgraph = class extends BaseSubgraph {
3911
4068
  throw error;
3912
4069
  }
3913
4070
  },
4071
+ evaluateActions: async (_parent, args, ctx) => {
4072
+ this.logger.debug("evaluateActions(@args)", args);
4073
+ try {
4074
+ const handle = await this.assertCanRead(args.documentIdentifier, ctx);
4075
+ return await evaluateActions(this.reactorClient, {
4076
+ ...args,
4077
+ documentIdentifier: handle.fetchIdentifier
4078
+ }, this.viewSubject(ctx));
4079
+ } catch (error) {
4080
+ this.logger.error("Error in evaluateActions: @Error", error);
4081
+ throw error;
4082
+ }
4083
+ },
3914
4084
  pollSyncEnvelopes: async (_parent, args, ctx) => {
3915
4085
  this.logger.debug("pollSyncEnvelopes(@args)", args);
3916
4086
  try {
@@ -4219,10 +4389,10 @@ const ADMIN_USERS = getAdminUsers();
4219
4389
  //#endregion
4220
4390
  //#region src/graphql/system/version.ts
4221
4391
  function getVersion() {
4222
- return "6.2.2-dev.50";
4392
+ return "6.2.2-dev.52";
4223
4393
  }
4224
4394
  function getGitHash() {
4225
- return "3c0b735b95e21535a33d3cbe71f7478bd68c45f1";
4395
+ return "7723384716902fabd4f52372a716ee6879b364e4";
4226
4396
  }
4227
4397
  function getGitUrl() {
4228
4398
  return buildTreeUrl(getGitHash());
@@ -5047,8 +5217,7 @@ var AuthService = class {
5047
5217
  admins: [],
5048
5218
  auth_enabled: false
5049
5219
  };
5050
- const method = request.method;
5051
- if (method === "OPTIONS" || method === "GET") return {
5220
+ if (request.method === "OPTIONS") return {
5052
5221
  user: void 0,
5053
5222
  admins: this.config.admins,
5054
5223
  auth_enabled: true
@@ -5110,16 +5279,23 @@ var AuthService = class {
5110
5279
  return await verifyAuthBearerToken(token);
5111
5280
  }
5112
5281
  /**
5113
- * Extract user information from verification result
5282
+ * Extract user information from verification result.
5283
+ *
5284
+ * The issuer is required along with the credential subject. A credential that
5285
+ * verified must carry one -- resolving it is how the signature was checked --
5286
+ * so this rejects a shape that cannot have come from verification rather than
5287
+ * admitting a keyless principal.
5114
5288
  */
5115
5289
  extractUserFromVerification(verified) {
5116
5290
  try {
5117
5291
  const { address, chainId, networkId } = verified.verifiableCredential.credentialSubject;
5118
- if (!address || !chainId || !networkId) return null;
5292
+ const appKey = verified.issuer;
5293
+ if (!address || !chainId || !networkId || !appKey) return null;
5119
5294
  return {
5120
5295
  address,
5121
5296
  chainId,
5122
- networkId
5297
+ networkId,
5298
+ appKey
5123
5299
  };
5124
5300
  } catch {
5125
5301
  return null;
@@ -5510,7 +5686,35 @@ function createMcpRequestAuthorizer(authService, authorizationService) {
5510
5686
  };
5511
5687
  }
5512
5688
  //#endregion
5689
+ //#region src/services/renown-config.ts
5690
+ /** Reading credentials from this reactor's own read model needs a host-supplied
5691
+ * verifier: core has no idea which subgraph serves that read model. */
5692
+ function assertCredentialVerifierForSource(source, hasVerifier) {
5693
+ if (source !== "self" || hasVerifier) return;
5694
+ throw new Error("Renown credential verification is set to \"self\" (auth.renown.source or RENOWN_SOURCE) but no verifyCredential was provided. A host that reads its own read model must pass one — see apps/switchboard, which builds it from @renown/sdk createLocalCredentialVerifier — or set RENOWN_SOURCE=remote to verify against a Renown instance.");
5695
+ }
5696
+ function envOverride(value) {
5697
+ const trimmed = value?.trim();
5698
+ return trimmed ? trimmed : void 0;
5699
+ }
5700
+ /** Resolve `auth.renown`; RENOWN_SOURCE / RENOWN_URL / SWITCHBOARD_URL win
5701
+ * over the config file, which wins over the SDK defaults. */
5702
+ function resolveRenownConfig(configured, env, logger) {
5703
+ return {
5704
+ source: resolveRenownSource(envOverride(env.RENOWN_SOURCE) ?? configured?.source, logger),
5705
+ url: envOverride(env.RENOWN_URL) ?? configured?.url,
5706
+ switchboardUrl: envOverride(env.SWITCHBOARD_URL) ?? configured?.switchboardUrl
5707
+ };
5708
+ }
5709
+ function resolveRenownSource(value, logger) {
5710
+ if (value === void 0 || value === null) return "remote";
5711
+ if (value === "self" || value === "remote") return value;
5712
+ logger.warn(`Ignoring invalid renown source "${value}" (expected "self" or "remote") — using "remote"`);
5713
+ return "remote";
5714
+ }
5715
+ //#endregion
5513
5716
  //#region src/utils/db.ts
5717
+ const PGLITE_UTC_PARSERS = { 1114: (value) => /* @__PURE__ */ new Date(`${value.replace(" ", "T")}Z`) };
5514
5718
  function isPG(connectionString) {
5515
5719
  if (connectionString.startsWith("postgresql://") || connectionString.startsWith("postgres://")) return true;
5516
5720
  return false;
@@ -5541,7 +5745,10 @@ function getDbClient(connectionString = void 0, pgliteFactory) {
5541
5745
  if (cached) return cached;
5542
5746
  const isPg = connectionString && isPG(connectionString);
5543
5747
  const client = isPg ? "pg" : ClientPgLite;
5544
- const pgliteInstance = isPg ? void 0 : pgliteFactory ? pgliteFactory(connectionString) : connectionString ? new PGlite({ fs: new AtomicNodeFs(connectionString) }) : new PGlite();
5748
+ const pgliteInstance = isPg ? void 0 : pgliteFactory ? pgliteFactory(connectionString) : connectionString ? new PGlite({
5749
+ fs: new AtomicNodeFs(connectionString),
5750
+ parsers: PGLITE_UTC_PARSERS
5751
+ }) : new PGlite({ parsers: PGLITE_UTC_PARSERS });
5545
5752
  const connection = isPg ? { connectionString } : { pglite: pgliteInstance };
5546
5753
  if (connectionString && !isPg) {
5547
5754
  const dirPath = path.resolve(connectionString, "..");
@@ -5783,15 +5990,17 @@ async function _setupCommonInfrastructure(options) {
5783
5990
  const logger = options.logger ?? defaultLogger;
5784
5991
  let admins = [];
5785
5992
  let authEnabled = false;
5993
+ let configuredRenown;
5786
5994
  if (options.configFile) {
5787
5995
  const config = getConfig(options.configFile);
5788
5996
  admins = config.auth?.admins.map((a) => a.toLowerCase()) ?? [];
5789
5997
  authEnabled = config.auth?.enabled ?? false;
5998
+ configuredRenown = config.auth?.renown;
5790
5999
  } else if (options.auth) {
5791
6000
  admins = options.auth.admins.map((a) => a.toLowerCase());
5792
6001
  authEnabled = options.auth.enabled;
5793
6002
  }
5794
- const { AUTH_ENABLED, ADMINS, DEFAULT_PROTECTION, DOCUMENT_PERMISSIONS_ENABLED, SKIP_CREDENTIAL_VERIFICATION, CREDENTIAL_VERIFICATION_CACHE_TTL_MS, RENOWN_URL, SWITCHBOARD_URL } = process.env;
6003
+ const { AUTH_ENABLED, ADMINS, DEFAULT_PROTECTION, DOCUMENT_PERMISSIONS_ENABLED, SKIP_CREDENTIAL_VERIFICATION, CREDENTIAL_VERIFICATION_CACHE_TTL_MS } = process.env;
5795
6004
  if (AUTH_ENABLED !== void 0) authEnabled = AUTH_ENABLED === "true";
5796
6005
  if (ADMINS !== void 0) admins = ADMINS.split(",").map((a) => a.toLowerCase());
5797
6006
  let defaultProtection = false;
@@ -5823,14 +6032,18 @@ async function _setupCommonInfrastructure(options) {
5823
6032
  let authService;
5824
6033
  if (authEnabled) {
5825
6034
  logger.info("Setting up Auth middleware");
6035
+ const renown = options.renown ?? resolveRenownConfig(configuredRenown, process.env, logger);
6036
+ assertCredentialVerifierForSource(renown.source, options.verifyCredential !== void 0);
6037
+ if (options.verifyCredential) logger.info("Renown credentials will be verified by the host's verifier");
6038
+ else logger.info("Renown credentials will be verified against @url", renown.switchboardUrl ?? renown.url ?? "the default Renown instance");
5826
6039
  authService = new AuthService({
5827
6040
  enabled: authEnabled,
5828
6041
  admins,
5829
6042
  skipCredentialVerification,
5830
6043
  credentialVerificationCacheTtlMs,
5831
- verifyCredential: await createRenownCredentialVerifier({
5832
- renownUrl: RENOWN_URL,
5833
- switchboardUrl: SWITCHBOARD_URL
6044
+ verifyCredential: options.verifyCredential ?? await createRenownCredentialVerifier({
6045
+ renownUrl: renown.url,
6046
+ switchboardUrl: renown.switchboardUrl
5834
6047
  })
5835
6048
  });
5836
6049
  authFetchMiddleware = createAuthFetchMiddleware(authService);
@@ -6139,7 +6352,7 @@ var PackageManagementService = class {
6139
6352
  }
6140
6353
  };
6141
6354
  //#endregion
6142
- export { ADMIN_USERS, ActionContextInputSchema, ActionInputSchema, AddRelationshipDocument, AnalyticsSubgraph, AttachmentAccessService, AuthService, AuthSubgraph, AuthorizationPolicy, AuthorizedDocumentHandle, BaseSubgraph, CanonicalDocumentIdResolutionError, ChannelMetaInputSchema, CreateDocumentDocument, CreateEmptyDocumentDocument, DeleteDocumentDocument, DeleteDocumentsDocument, DocumentChangeType, DocumentChangeTypeSchema, DocumentChangesDocument, DocumentOperationsFilterInputSchema, DocumentPermissionService, FindDocumentsDocument, GetDocumentDocument, GetDocumentIncomingRelationshipsDocument, GetDocumentModelsDocument, GetDocumentOperationsDocument, GetDocumentOutgoingRelationshipsDocument, GetDocumentWithOperationsDocument, GetJobStatusDocument, GraphQLManager, HttpDocumentModelLoader, HttpPackageLoader, ImportPackageLoader, InMemoryPackageStorage, JobChangesDocument, MoveRelationshipDocument, MutateDocumentAsyncDocument, MutateDocumentDocument, OperationContextInputSchema, OperationInputSchema, OperationWithContextInputSchema, OperationsFilterInputSchema, PackageManagementService, PackageManager, PackagesSubgraph, PagingInputSchema, PhDocumentFieldsFragmentDoc, PollSyncEnvelopesDocument, PropagationMode, PropagationModeSchema, PushSyncEnvelopesDocument, ReactorSignerAppInputSchema, ReactorSignerInputSchema, ReactorSignerUserInputSchema, ReactorSubgraph, RemoteCursorInputSchema, RemoteFilterInputSchema, RemoveRelationshipDocument, RenameDocumentDocument, SearchFilterInputSchema, SetPreferredEditorDocument, SyncEnvelopeInputSchema, SyncEnvelopeType, SyncEnvelopeTypeSchema, SystemSubgraph, TouchChannelDocument, TouchChannelInputSchema, ViewFilterInputSchema, assertAuthRequiredForDocumentPermissions, 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 };
6355
+ export { ADMIN_USERS, ActionCandidateInputSchema, ActionContextInputSchema, ActionInputSchema, AddRelationshipDocument, AnalyticsSubgraph, AttachmentAccessService, AuthDecision, AuthDecisionSchema, AuthService, AuthSubgraph, AuthorizationPolicy, AuthorizedDocumentHandle, BaseSubgraph, CanonicalDocumentIdResolutionError, ChannelMetaInputSchema, CreateDocumentDocument, CreateEmptyDocumentDocument, DeleteDocumentDocument, DeleteDocumentsDocument, DocumentChangeType, DocumentChangeTypeSchema, DocumentChangesDocument, DocumentOperationsFilterInputSchema, DocumentPermissionService, EvaluateActionsDocument, FindDocumentsDocument, GetDocumentDocument, GetDocumentIncomingRelationshipsDocument, GetDocumentModelsDocument, GetDocumentOperationsDocument, GetDocumentOutgoingRelationshipsDocument, GetDocumentWithOperationsDocument, GetJobStatusDocument, GraphQLManager, HttpDocumentModelLoader, HttpPackageLoader, ImportPackageLoader, InMemoryPackageStorage, JobChangesDocument, MoveRelationshipDocument, MutateDocumentAsyncDocument, MutateDocumentDocument, OperationContextInputSchema, OperationInputSchema, OperationWithContextInputSchema, OperationsFilterInputSchema, PGLITE_UTC_PARSERS, PackageManagementService, PackageManager, PackagesSubgraph, PagingInputSchema, PhDocumentFieldsFragmentDoc, PollSyncEnvelopesDocument, PropagationMode, PropagationModeSchema, PushSyncEnvelopesDocument, ReactorSignerAppInputSchema, ReactorSignerInputSchema, ReactorSignerUserInputSchema, ReactorSubgraph, RemoteCursorInputSchema, RemoteFilterInputSchema, RemoveRelationshipDocument, RenameDocumentDocument, SearchFilterInputSchema, SetPreferredEditorDocument, SyncEnvelopeInputSchema, SyncEnvelopeType, SyncEnvelopeTypeSchema, SystemSubgraph, TouchChannelDocument, TouchChannelInputSchema, ViewFilterInputSchema, 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 };
6143
6356
 
6144
6357
  //# sourceMappingURL=index.mjs.map
6145
- //# debugId=0fa604a4-1713-5d00-989b-ce10e0cf5cdb
6358
+ //# debugId=3473708d-6af5-5eab-859e-41e65d41fe17