@powerhousedao/reactor-api 6.2.3-dev.1 → 6.2.3-dev.3

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.
Files changed (21) hide show
  1. package/dist/adapter-gateway-apollo-C_RdohOv.mjs +4 -0
  2. package/dist/{adapter-gateway-apollo-DdamNLPT.mjs → adapter-gateway-apollo-Cn9E96GF.mjs} +4 -4
  3. package/dist/{adapter-gateway-apollo-DdamNLPT.mjs.map → adapter-gateway-apollo-Cn9E96GF.mjs.map} +1 -1
  4. package/dist/{adapter-gateway-mercurius-CLmTtNJC.mjs → adapter-gateway-mercurius-CjaUcMgX.mjs} +3 -3
  5. package/dist/{adapter-gateway-mercurius-CLmTtNJC.mjs.map → adapter-gateway-mercurius-CjaUcMgX.mjs.map} +1 -1
  6. package/dist/adapter-gateway-stitching-HmWjRMhm.mjs +317 -0
  7. package/dist/adapter-gateway-stitching-HmWjRMhm.mjs.map +1 -0
  8. package/dist/{adapter-http-express-54gdI9bu.mjs → adapter-http-express-B39rPhqH.mjs} +4 -4
  9. package/dist/{adapter-http-express-54gdI9bu.mjs.map → adapter-http-express-B39rPhqH.mjs.map} +1 -1
  10. package/dist/{adapter-http-fastify-DmccBVOe.mjs → adapter-http-fastify-BwXO6rqE.mjs} +4 -4
  11. package/dist/{adapter-http-fastify-DmccBVOe.mjs.map → adapter-http-fastify-BwXO6rqE.mjs.map} +1 -1
  12. package/dist/index.d.mts +22 -9
  13. package/dist/index.d.mts.map +1 -1
  14. package/dist/index.mjs +35 -14
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/{path-normalize-DWWFLiy6.mjs → path-normalize-BOQwY9wR.mjs} +3 -3
  17. package/dist/{path-normalize-DWWFLiy6.mjs.map → path-normalize-BOQwY9wR.mjs.map} +1 -1
  18. package/dist/src/packages/vite-loader.d.mts +1 -1
  19. package/dist/{types-Bz2niABC.d.mts → types-DcYyNcHJ.d.mts} +1 -1
  20. package/dist/{types-Bz2niABC.d.mts.map → types-DcYyNcHJ.d.mts.map} +1 -1
  21. package/package.json +17 -14
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
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]="46ad8545-02e9-5fb8-b003-7b9b93f82f75")}catch(e){}}();
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]="5e1dfde6-8724-5f15-80bf-467e42b71238")}catch(e){}}();
3
3
  import { _ as createAuthorizationService, a as isSubgraphClass, b as MalformedStoredOperationError, 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, y as ForbiddenError } from "./utils-XWVecaNn.mjs";
4
4
  import { AnalyticsQueryEngine } from "@powerhousedao/analytics-engine-core";
5
5
  import { AnalyticsModel, AnalyticsResolvers, typedefs } from "@powerhousedao/analytics-engine-graphql";
@@ -311,23 +311,27 @@ function createAuthFetchMiddleware(authService) {
311
311
  async function createGatewayAdapter(type, logger) {
312
312
  switch (type) {
313
313
  case "apollo": {
314
- const { ApolloGatewayAdapter } = await import("./adapter-gateway-apollo-DdamNLPT.mjs");
314
+ const { ApolloGatewayAdapter } = await import("./adapter-gateway-apollo-C_RdohOv.mjs");
315
315
  return new ApolloGatewayAdapter(logger);
316
316
  }
317
317
  case "mercurius": {
318
- const { MercuriusGatewayAdapter } = await import("./adapter-gateway-mercurius-CLmTtNJC.mjs");
318
+ const { MercuriusGatewayAdapter } = await import("./adapter-gateway-mercurius-CjaUcMgX.mjs");
319
319
  return new MercuriusGatewayAdapter(logger);
320
320
  }
321
+ case "stitching": {
322
+ const { StitchingGatewayAdapter } = await import("./adapter-gateway-stitching-HmWjRMhm.mjs");
323
+ return new StitchingGatewayAdapter(logger);
324
+ }
321
325
  }
322
326
  }
323
327
  async function createHttpAdapter(type) {
324
328
  switch (type) {
325
329
  case "express": {
326
- const { createExpressHttpAdapter } = await import("./adapter-http-express-54gdI9bu.mjs");
330
+ const { createExpressHttpAdapter } = await import("./adapter-http-express-B39rPhqH.mjs");
327
331
  return createExpressHttpAdapter();
328
332
  }
329
333
  case "fastify": {
330
- const { createFastifyHttpAdapter } = await import("./adapter-http-fastify-DmccBVOe.mjs");
334
+ const { createFastifyHttpAdapter } = await import("./adapter-http-fastify-BwXO6rqE.mjs");
331
335
  return createFastifyHttpAdapter();
332
336
  }
333
337
  }
@@ -4823,11 +4827,15 @@ var GraphQLManager = class {
4823
4827
  #getSubgraphDefinitions() {
4824
4828
  const subgraphs = this.#getAllSubgraphs();
4825
4829
  const herokuOrLocal = process.env.HEROKU_APP_DEFAULT_DOMAIN_NAME ? `https://${process.env.HEROKU_APP_DEFAULT_DOMAIN_NAME}` : `http://localhost:${this.port}`;
4826
- return Array.from(subgraphs.entries()).map(([subgraphPath, subgraph]) => ({
4827
- name: subgraphPath.replace("/", ":"),
4828
- typeDefs: this.#buildSubgraphSchemaModule(subgraph).typeDefs,
4829
- url: `${herokuOrLocal}${subgraphPath}`
4830
- }));
4830
+ return Array.from(subgraphs.entries()).map(([subgraphPath, subgraph]) => {
4831
+ const module = this.#buildSubgraphSchemaModule(subgraph);
4832
+ return {
4833
+ name: subgraphPath.replace("/", ":"),
4834
+ typeDefs: module.typeDefs,
4835
+ resolvers: module.resolvers,
4836
+ url: `${herokuOrLocal}${subgraphPath}`
4837
+ };
4838
+ });
4831
4839
  }
4832
4840
  async #createSupergraphGateway() {
4833
4841
  const superGraphPath = path.posix.join(this.path, "graphql");
@@ -6023,10 +6031,10 @@ const ADMIN_USERS = getAdminUsers();
6023
6031
  //#endregion
6024
6032
  //#region src/graphql/system/version.ts
6025
6033
  function getVersion() {
6026
- return "6.2.3-dev.1";
6034
+ return "6.2.3-dev.3";
6027
6035
  }
6028
6036
  function getGitHash() {
6029
- return "4f706b751c94b165e31129acf22704dbb96b56c2";
6037
+ return "95368873997a75b7682107123c76184d56d51741";
6030
6038
  }
6031
6039
  function getGitUrl() {
6032
6040
  return buildTreeUrl(getGitHash());
@@ -7676,10 +7684,23 @@ function buildSyncServingGate(reactorModule, authorizationConfig, logger) {
7676
7684
  return new SyncScopeGate(new ModelReadGate(model, reactorModule.documentView, reactorModule.featureFlags.authGroups, reactorModule.operationIndex, logger, { withholdUninitialized: authorizationConfig.defaultProtection }), reactorModule.documentView, logger);
7677
7685
  }
7678
7686
  /**
7687
+ * Resolves the gateway adapter type from the `GATEWAY_ADAPTER` env var.
7688
+ * Defaults to "apollo" (the federation gateway, production behavior).
7689
+ * "stitching" selects the in-process graphql-tools merge gateway (#1565
7690
+ * prototype); "mercurius" the Fastify federation gateway.
7691
+ */
7692
+ function resolveGatewayAdapterType(logger) {
7693
+ const configured = process.env.GATEWAY_ADAPTER;
7694
+ if (configured === void 0) return "apollo";
7695
+ if (configured === "apollo" || configured === "mercurius" || configured === "stitching") return configured;
7696
+ logger.warn(`Unknown GATEWAY_ADAPTER="${configured}"; falling back to "apollo"`);
7697
+ return "apollo";
7698
+ }
7699
+ /**
7679
7700
  * Sets up the subgraph manager and registers subgraphs
7680
7701
  */
7681
7702
  async function setupGraphQLManager(httpAdapter, authFetchMiddleware, requireAuthFetchMiddleware, httpServer, wsServer, client, relationalDb, analyticsStore, syncManager, subgraphs, logger, authorizationService, authService, documentPermissionService, enableDocumentModelSubgraphs, port, reactorDriveClient, syncServingGate, httpRoutes) {
7682
- const graphqlManager = new GraphQLManager(config.basePath, httpServer, wsServer, client, relationalDb, analyticsStore, syncManager, logger, httpAdapter, await createGatewayAdapter("apollo", logger), authService, documentPermissionService, { enableDocumentModelSubgraphs }, port, authorizationService, reactorDriveClient, syncServingGate, httpRoutes);
7703
+ const graphqlManager = new GraphQLManager(config.basePath, httpServer, wsServer, client, relationalDb, analyticsStore, syncManager, logger, httpAdapter, await createGatewayAdapter(resolveGatewayAdapterType(logger), logger), authService, documentPermissionService, { enableDocumentModelSubgraphs }, port, authorizationService, reactorDriveClient, syncServingGate, httpRoutes);
7683
7704
  await graphqlManager.init(subgraphs.core, authFetchMiddleware, requireAuthFetchMiddleware);
7684
7705
  for (const [packageName, collection] of subgraphs.extended.entries()) for (const subgraph of collection) await graphqlManager.registerSubgraph(subgraph, "graphql", false, packageName);
7685
7706
  await graphqlManager.updateRouter();
@@ -8225,4 +8246,4 @@ var PackageManagementService = class {
8225
8246
  export { ADMIN_USERS, ActionCandidateInputSchema, ActionContextInputSchema, ActionInputSchema, AddRelationshipDocument, AnalyticsSubgraph, AttachmentAccessService, AuthDecision, AuthDecisionSchema, AuthService, AuthSubgraph, AuthorizationPolicy, AuthorizedDocumentHandle, BaseSubgraph, CORE_PACKAGE_NAME, CanonicalDocumentIdResolutionError, ChannelMetaInputSchema, CreateDocumentDocument, CreateEmptyDocumentDocument, DeleteDocumentDocument, DeleteDocumentsDocument, DocumentChangeType, DocumentChangeTypeSchema, DocumentChangesDocument, DocumentOperationsFilterInputSchema, DocumentPermissionService, EvaluateActionsDocument, FindDocumentsDocument, GetDocumentDocument, GetDocumentIncomingRelationshipsDocument, GetDocumentModelsDocument, GetDocumentOperationsDocument, GetDocumentOutgoingRelationshipsDocument, GetDocumentWithOperationsDocument, GetJobStatusDocument, GraphQLManager, HttpDocumentModelLoader, HttpPackageLoader, HttpRouteService, ImportPackageLoader, InMemoryPackageStorage, InvalidNamespaceError, JobChangesDocument, MemoryWebhookStore, MoveRelationshipDocument, MutateDocumentAsyncDocument, MutateDocumentDocument, OperationContextInputSchema, OperationInputSchema, OperationWithContextInputSchema, OperationsFilterInputSchema, PACKAGE_ROUTE_SEGMENT, PGLITE_UTC_PARSERS, PackageManagementService, PackageManager, PackagesSubgraph, PagingInputSchema, PhDocumentFieldsFragmentDoc, PollSyncEnvelopesDocument, PropagationMode, PropagationModeSchema, PushSyncEnvelopesDocument, ReactorSignerAppInputSchema, ReactorSignerInputSchema, ReactorSignerUserInputSchema, ReactorSubgraph, RelationalWebhookStore, RemoteCursorInputSchema, RemoteFilterInputSchema, RemoveRelationshipDocument, RenameDocumentDocument, SearchFilterInputSchema, SetPreferredEditorDocument, SyncEnvelopeInputSchema, SyncEnvelopeType, SyncEnvelopeTypeSchema, SystemSubgraph, TouchChannelDocument, TouchChannelInputSchema, ViewFilterInputSchema, WEBHOOK_SEGMENT, WebhookService, assertAuthRequiredForDocumentPermissions, assertCredentialVerifierForSource, assertHostMountPath, assertRequireAuthenticatedCallerAllowed, assertSkipCredentialVerificationAllowed, buildGraphQlDocument, buildGraphQlDriveDocument, buildGraphqlOperation, buildGraphqlOperations, buildSubgraphSchemaModule, createAuthFetchMiddleware, createCanonicalDocumentIdResolver, createGatewayAdapter, createHttpAdapter, createMergedSchema, createReactorGraphQLClient, createRenownCredentialVerifier, createSchema, decodeExplorerUrlState, definedNonNullAnySchema, driveIdFromUrl, extractSubgraphsFromModule, generateDocumentModelSchema, getAuthContext, getDbClient, getDocumentModelSchemaName, getDocumentModelTypeDefs, getExplorerPrefix, getGitHash, getGitUrl, getSdk, getUniqueDocumentModels, getUniqueUpgradeManifests, getVersion, initAnalyticsStoreSql, initializeAndStartAPI, isDefinedNonNullAny, isExpectedLoaderMiss, isSubgraphClass, namespacePath, namespaceSegments, newWebhookToken, parseDriveUrl, parseWebhookBody, redactHeaders, renderGraphqlPlayground, resolvePackageName, resolveRenownConfig, verifyWebhook };
8226
8247
 
8227
8248
  //# sourceMappingURL=index.mjs.map
8228
- //# debugId=46ad8545-02e9-5fb8-b003-7b9b93f82f75
8249
+ //# debugId=5e1dfde6-8724-5f15-80bf-467e42b71238