@cedarjs/graphql-server 5.0.7-next.338 → 5.0.7

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 (127) hide show
  1. package/dist/cjs/cors.d.ts +10 -0
  2. package/dist/cjs/cors.d.ts.map +1 -0
  3. package/dist/cjs/cors.js +70 -0
  4. package/dist/cjs/createGraphQLYoga.d.ts +6 -0
  5. package/dist/cjs/createGraphQLYoga.d.ts.map +1 -0
  6. package/dist/cjs/createGraphQLYoga.js +193 -0
  7. package/dist/cjs/directives/makeDirectives.d.ts +8 -0
  8. package/dist/cjs/directives/makeDirectives.d.ts.map +1 -0
  9. package/dist/cjs/directives/makeDirectives.js +89 -0
  10. package/dist/cjs/errors.d.ts +32 -0
  11. package/dist/cjs/errors.d.ts.map +1 -0
  12. package/dist/cjs/errors.js +101 -0
  13. package/dist/cjs/functions/graphql.d.ts +15 -0
  14. package/dist/cjs/functions/graphql.d.ts.map +1 -0
  15. package/dist/cjs/functions/graphql.js +201 -0
  16. package/dist/cjs/functions/useRequireAuth.d.ts +12 -0
  17. package/dist/cjs/functions/useRequireAuth.d.ts.map +1 -0
  18. package/dist/cjs/functions/useRequireAuth.js +70 -0
  19. package/dist/cjs/global.api-auto-imports.d.ts +7 -0
  20. package/dist/cjs/global.api-auto-imports.d.ts.map +1 -0
  21. package/dist/cjs/global.api-auto-imports.js +1 -0
  22. package/dist/cjs/globalContext.d.ts +25 -0
  23. package/dist/cjs/globalContext.d.ts.map +1 -0
  24. package/dist/cjs/globalContext.js +55 -0
  25. package/dist/cjs/globalContextStore.d.ts +9 -0
  26. package/dist/cjs/globalContextStore.d.ts.map +1 -0
  27. package/dist/cjs/globalContextStore.js +35 -0
  28. package/dist/cjs/graphiql.d.ts +8 -0
  29. package/dist/cjs/graphiql.d.ts.map +1 -0
  30. package/dist/cjs/graphiql.js +45 -0
  31. package/dist/cjs/index.d.ts +14 -0
  32. package/dist/cjs/index.d.ts.map +1 -0
  33. package/dist/cjs/index.js +75 -0
  34. package/dist/cjs/introspection.d.ts +7 -0
  35. package/dist/cjs/introspection.d.ts.map +1 -0
  36. package/dist/cjs/introspection.js +36 -0
  37. package/dist/cjs/makeMergedSchema.d.ts +17 -0
  38. package/dist/cjs/makeMergedSchema.d.ts.map +1 -0
  39. package/dist/cjs/makeMergedSchema.js +283 -0
  40. package/dist/cjs/package.json +1 -0
  41. package/dist/cjs/plugins/index.d.ts +10 -0
  42. package/dist/cjs/plugins/index.d.ts.map +1 -0
  43. package/dist/cjs/plugins/index.js +52 -0
  44. package/dist/cjs/plugins/useArmor.d.ts +4 -0
  45. package/dist/cjs/plugins/useArmor.d.ts.map +1 -0
  46. package/dist/cjs/plugins/useArmor.js +69 -0
  47. package/dist/{plugins/useCedarAuthContext.d.ts → cjs/plugins/useRedwoodAuthContext.d.ts} +2 -2
  48. package/dist/cjs/plugins/useRedwoodAuthContext.d.ts.map +1 -0
  49. package/dist/cjs/plugins/useRedwoodAuthContext.js +74 -0
  50. package/dist/cjs/plugins/useRedwoodDirective.d.ts +83 -0
  51. package/dist/cjs/plugins/useRedwoodDirective.d.ts.map +1 -0
  52. package/dist/cjs/plugins/useRedwoodDirective.js +166 -0
  53. package/dist/{plugins/useCedarError.d.ts → cjs/plugins/useRedwoodError.d.ts} +4 -4
  54. package/dist/cjs/plugins/useRedwoodError.d.ts.map +1 -0
  55. package/dist/cjs/plugins/useRedwoodError.js +62 -0
  56. package/dist/{plugins/useCedarGlobalContextSetter.d.ts → cjs/plugins/useRedwoodGlobalContextSetter.d.ts} +2 -2
  57. package/dist/cjs/plugins/useRedwoodGlobalContextSetter.d.ts.map +1 -0
  58. package/dist/cjs/plugins/useRedwoodGlobalContextSetter.js +35 -0
  59. package/dist/{plugins/useCedarLogger.d.ts → cjs/plugins/useRedwoodLogger.d.ts} +2 -2
  60. package/dist/cjs/plugins/useRedwoodLogger.d.ts.map +1 -0
  61. package/dist/cjs/plugins/useRedwoodLogger.js +156 -0
  62. package/dist/{plugins/useCedarOpenTelemetry.d.ts → cjs/plugins/useRedwoodOpenTelemetry.d.ts} +3 -3
  63. package/dist/cjs/plugins/useRedwoodOpenTelemetry.d.ts.map +1 -0
  64. package/dist/cjs/plugins/useRedwoodOpenTelemetry.js +156 -0
  65. package/dist/{plugins/useCedarPopulateContext.d.ts → cjs/plugins/useRedwoodPopulateContext.d.ts} +2 -2
  66. package/dist/cjs/plugins/useRedwoodPopulateContext.d.ts.map +1 -0
  67. package/dist/cjs/plugins/useRedwoodPopulateContext.js +35 -0
  68. package/dist/{plugins/useCedarTrustedDocuments.d.ts → cjs/plugins/useRedwoodTrustedDocuments.d.ts} +3 -5
  69. package/dist/cjs/plugins/useRedwoodTrustedDocuments.d.ts.map +1 -0
  70. package/dist/cjs/plugins/useRedwoodTrustedDocuments.js +80 -0
  71. package/dist/cjs/rootSchema.d.ts +25 -0
  72. package/dist/cjs/rootSchema.d.ts.map +1 -0
  73. package/dist/cjs/rootSchema.js +108 -0
  74. package/dist/cjs/subscriptions/makeSubscriptions.d.ts +18 -0
  75. package/dist/cjs/subscriptions/makeSubscriptions.d.ts.map +1 -0
  76. package/dist/cjs/subscriptions/makeSubscriptions.js +40 -0
  77. package/dist/cjs/types.d.ts +231 -0
  78. package/dist/cjs/types.d.ts.map +1 -0
  79. package/dist/cjs/types.js +16 -0
  80. package/dist/createGraphQLYoga.js +19 -19
  81. package/dist/directives/makeDirectives.d.ts +2 -2
  82. package/dist/directives/makeDirectives.d.ts.map +1 -1
  83. package/dist/index.d.ts +2 -2
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +0 -2
  86. package/dist/makeMergedSchema.d.ts +6 -6
  87. package/dist/makeMergedSchema.d.ts.map +1 -1
  88. package/dist/plugins/index.d.ts +8 -8
  89. package/dist/plugins/index.d.ts.map +1 -1
  90. package/dist/plugins/index.js +16 -20
  91. package/dist/plugins/useRedwoodAuthContext.d.ts +9 -0
  92. package/dist/plugins/useRedwoodAuthContext.d.ts.map +1 -0
  93. package/dist/plugins/useRedwoodAuthContext.js +50 -0
  94. package/dist/plugins/useRedwoodDirective.d.ts +3 -9
  95. package/dist/plugins/useRedwoodDirective.d.ts.map +1 -1
  96. package/dist/plugins/useRedwoodDirective.js +1 -3
  97. package/dist/plugins/useRedwoodError.d.ts +20 -0
  98. package/dist/plugins/useRedwoodError.d.ts.map +1 -0
  99. package/dist/plugins/{useCedarError.js → useRedwoodError.js} +5 -5
  100. package/dist/plugins/useRedwoodGlobalContextSetter.d.ts +9 -0
  101. package/dist/plugins/useRedwoodGlobalContextSetter.d.ts.map +1 -0
  102. package/dist/plugins/{useCedarGlobalContextSetter.js → useRedwoodGlobalContextSetter.js} +2 -2
  103. package/dist/plugins/useRedwoodLogger.d.ts +115 -0
  104. package/dist/plugins/useRedwoodLogger.d.ts.map +1 -0
  105. package/dist/plugins/{useCedarLogger.js → useRedwoodLogger.js} +2 -2
  106. package/dist/plugins/useRedwoodOpenTelemetry.d.ts +22 -0
  107. package/dist/plugins/useRedwoodOpenTelemetry.d.ts.map +1 -0
  108. package/dist/plugins/{useCedarOpenTelemetry.js → useRedwoodOpenTelemetry.js} +3 -3
  109. package/dist/plugins/useRedwoodPopulateContext.d.ts +9 -0
  110. package/dist/plugins/useRedwoodPopulateContext.d.ts.map +1 -0
  111. package/dist/plugins/{useCedarPopulateContext.js → useRedwoodPopulateContext.js} +2 -2
  112. package/dist/plugins/useRedwoodTrustedDocuments.d.ts +23 -0
  113. package/dist/plugins/useRedwoodTrustedDocuments.d.ts.map +1 -0
  114. package/dist/plugins/{useCedarTrustedDocuments.js → useRedwoodTrustedDocuments.js} +13 -20
  115. package/dist/subscriptions/makeSubscriptions.d.ts +3 -3
  116. package/dist/subscriptions/makeSubscriptions.d.ts.map +1 -1
  117. package/dist/types.d.ts +9 -13
  118. package/dist/types.d.ts.map +1 -1
  119. package/package.json +24 -16
  120. package/dist/plugins/useCedarAuthContext.d.ts.map +0 -1
  121. package/dist/plugins/useCedarAuthContext.js +0 -30
  122. package/dist/plugins/useCedarError.d.ts.map +0 -1
  123. package/dist/plugins/useCedarGlobalContextSetter.d.ts.map +0 -1
  124. package/dist/plugins/useCedarLogger.d.ts.map +0 -1
  125. package/dist/plugins/useCedarOpenTelemetry.d.ts.map +0 -1
  126. package/dist/plugins/useCedarPopulateContext.d.ts.map +0 -1
  127. package/dist/plugins/useCedarTrustedDocuments.d.ts.map +0 -1
@@ -17,7 +17,7 @@ var AttributeName = /* @__PURE__ */ ((AttributeName2) => {
17
17
  return AttributeName2;
18
18
  })(AttributeName || {});
19
19
  const tracingSpanSymbol = "OPEN_TELEMETRY_GRAPHQL";
20
- const useCedarOpenTelemetry = (options) => {
20
+ const useRedwoodOpenTelemetry = (options) => {
21
21
  const spanKind = SpanKind.SERVER;
22
22
  const spanAdditionalAttributes = {};
23
23
  const tracer = opentelemetry.trace.getTracer("redwoodjs");
@@ -85,7 +85,7 @@ const useCedarOpenTelemetry = (options) => {
85
85
  if (isAsyncIterable(result)) {
86
86
  executionSpan.end();
87
87
  console.warn(
88
- `Plugin "CedarOpenTelemetry" encountered an AsyncIterator which is not supported yet, so tracing data is not available for the operation.`
88
+ `Plugin "RedwoodOpenTelemetry" encountered an AsyncIterator which is not supported yet, so tracing data is not available for the operation.`
89
89
  );
90
90
  return;
91
91
  }
@@ -117,5 +117,5 @@ const useCedarOpenTelemetry = (options) => {
117
117
  };
118
118
  export {
119
119
  AttributeName,
120
- useCedarOpenTelemetry
120
+ useRedwoodOpenTelemetry
121
121
  };
@@ -0,0 +1,9 @@
1
+ import type { Plugin } from 'graphql-yoga';
2
+ import type { CedarGraphQLContext, GraphQLHandlerOptions } from '../types.js';
3
+ /**
4
+ * This Envelop plugin enriches the context on a per-request basis
5
+ * by populating it with the results of a custom function
6
+ * @returns
7
+ */
8
+ export declare const useRedwoodPopulateContext: (populateContextBuilder: NonNullable<GraphQLHandlerOptions["context"]>) => Plugin<CedarGraphQLContext>;
9
+ //# sourceMappingURL=useRedwoodPopulateContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRedwoodPopulateContext.d.ts","sourceRoot":"","sources":["../../src/plugins/useRedwoodPopulateContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE7E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACpC,wBAAwB,WAAW,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,KACpE,MAAM,CAAC,mBAAmB,CAW5B,CAAA"}
@@ -1,4 +1,4 @@
1
- const useCedarPopulateContext = (populateContextBuilder) => {
1
+ const useRedwoodPopulateContext = (populateContextBuilder) => {
2
2
  return {
3
3
  async onContextBuilding({ context, extendContext }) {
4
4
  const populateContext = typeof populateContextBuilder === "function" ? await populateContextBuilder({ context }) : populateContextBuilder;
@@ -7,5 +7,5 @@ const useCedarPopulateContext = (populateContextBuilder) => {
7
7
  };
8
8
  };
9
9
  export {
10
- useCedarPopulateContext
10
+ useRedwoodPopulateContext
11
11
  };
@@ -0,0 +1,23 @@
1
+ import type { UsePersistedOperationsOptions } from '@graphql-yoga/plugin-persisted-operations';
2
+ import type { Plugin } from 'graphql-yoga';
3
+ import type { CedarGraphQLContext } from '../types.js';
4
+ export type RedwoodTrustedDocumentOptions = Omit<UsePersistedOperationsOptions, 'getPersistedOperation'> & {
5
+ /**
6
+ * Whether to disable the plugin
7
+ * @default false
8
+ */
9
+ disabled?: boolean;
10
+ /**
11
+ * The store to get the persisted operation hash from
12
+ * Required when the plugin is not disabled
13
+ */
14
+ store?: Readonly<Record<string, string>>;
15
+ } & ({
16
+ disabled: true;
17
+ store?: Readonly<Record<string, string>>;
18
+ } | {
19
+ disabled?: false;
20
+ store: Readonly<Record<string, string>>;
21
+ });
22
+ export declare const useRedwoodTrustedDocuments: (options: RedwoodTrustedDocumentOptions) => Plugin<CedarGraphQLContext>;
23
+ //# sourceMappingURL=useRedwoodTrustedDocuments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRedwoodTrustedDocuments.d.ts","sourceRoot":"","sources":["../../src/plugins/useRedwoodTrustedDocuments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAA;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,6BAA6B,EAC7B,uBAAuB,CACxB,GAAG;IACF;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACzC,GAAG,CACE;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,CAChE,CAAA;AAoEH,eAAO,MAAM,0BAA0B,GACrC,SAAS,6BAA6B,KACrC,MAAM,CAAC,mBAAmB,CA8B5B,CAAA"}
@@ -1,29 +1,30 @@
1
1
  import { usePersistedOperations } from "@graphql-yoga/plugin-persisted-operations";
2
- const CEDAR__AUTH_GET_CURRENT_USER_QUERY = "query __CEDAR__AUTH_GET_CURRENT_USER { cedar { currentUser } }";
3
- const CEDAR__STUDIO_RESYNC_MAIL_RENDERERS_MUTATION = "mutation { resyncMailRenderers }";
4
- const CEDAR__STUDIO_TEMPLATE_MUTATION = "mutation { resyncMailTemplate }";
5
- const allowCedarAuthCurrentUserQuery = (request, params) => {
2
+ const CEDAR__AUTH_GET_CURRENT_USER_QUERY = '{"query":"query __CEDAR__AUTH_GET_CURRENT_USER { cedar { currentUser } }"}';
3
+ const CEDAR__STUDIO_RESYNC_MAIL_RENDERERS_MUTATION = '{"query":"mutation { resyncMailRenderers }"}';
4
+ const CEDAR__STUDIO_TEMPLATE_MUTATION = '{"query":"mutation { resyncMailTemplate }"}';
5
+ const allowCedarAuthCurrentUserQuery = async (request) => {
6
6
  const headers = request.headers;
7
7
  const hasContentType = headers.get("content-type") === "application/json";
8
8
  const hasAuthProvider = !!headers.get("auth-provider");
9
9
  const hasAuthorization = !!headers.get("authorization");
10
10
  const hasAllowedHeaders = hasContentType && hasAuthProvider && hasAuthorization;
11
- const hasAllowedQuery = params?.query === CEDAR__AUTH_GET_CURRENT_USER_QUERY;
11
+ const query = await request.text();
12
+ const hasAllowedQuery = query === CEDAR__AUTH_GET_CURRENT_USER_QUERY;
12
13
  return hasAllowedHeaders && hasAllowedQuery;
13
14
  };
14
- const allowCedarStudioResyncMailMutations = (request, params) => {
15
+ const allowCedarStudioResyncMailMutations = async (request) => {
15
16
  const isLocalDevelopment = process.env.NODE_ENV === "development";
16
17
  if (!isLocalDevelopment) {
17
18
  return false;
18
19
  }
19
20
  const headers = request.headers;
20
21
  const hasContentType = headers.get("content-type") === "application/json";
21
- const isAllowedQuery = params?.query === CEDAR__STUDIO_RESYNC_MAIL_RENDERERS_MUTATION || params?.query === CEDAR__STUDIO_TEMPLATE_MUTATION;
22
+ const query = await request.text();
23
+ const isAllowedQuery = query === CEDAR__STUDIO_RESYNC_MAIL_RENDERERS_MUTATION || query === CEDAR__STUDIO_TEMPLATE_MUTATION;
22
24
  return hasContentType && isAllowedQuery;
23
25
  };
24
- const useCedarTrustedDocuments = (options) => {
25
- const paramsByRequest = /* @__PURE__ */ new WeakMap();
26
- const persistedOperations = usePersistedOperations({
26
+ const useRedwoodTrustedDocuments = (options) => {
27
+ return usePersistedOperations({
27
28
  ...options,
28
29
  customErrors: {
29
30
  persistedQueryOnly: "Use Trusted Only!",
@@ -46,18 +47,10 @@ const useCedarTrustedDocuments = (options) => {
46
47
  }
47
48
  }
48
49
  }
49
- const params = paramsByRequest.get(request);
50
- return allowCedarAuthCurrentUserQuery(request, params) || allowCedarStudioResyncMailMutations(request, params);
50
+ return allowCedarAuthCurrentUserQuery(request) || allowCedarStudioResyncMailMutations(request);
51
51
  }
52
52
  });
53
- return {
54
- ...persistedOperations,
55
- onParams(payload) {
56
- paramsByRequest.set(payload.request, payload.params);
57
- return persistedOperations.onParams?.(payload);
58
- }
59
- };
60
53
  };
61
54
  export {
62
- useCedarTrustedDocuments
55
+ useRedwoodTrustedDocuments
63
56
  };
@@ -5,14 +5,14 @@ import type { DocumentNode } from 'graphql';
5
5
  * But not fully supported in TS
6
6
  * {
7
7
  * schema: DocumentNode // <-- required
8
- * [string]: CedarSubscription
8
+ * [string]: RedwoodSubscription
9
9
  * }
10
10
  */
11
11
  export type SubscriptionGlobImports = Record<string, any>;
12
- export type CedarSubscription = {
12
+ export type RedwoodSubscription = {
13
13
  schema: DocumentNode;
14
14
  resolvers: any;
15
15
  name: string;
16
16
  };
17
- export declare const makeSubscriptions: (SubscriptionGlobs: SubscriptionGlobImports) => CedarSubscription[];
17
+ export declare const makeSubscriptions: (SubscriptionGlobs: SubscriptionGlobImports) => RedwoodSubscription[];
18
18
  //# sourceMappingURL=makeSubscriptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"makeSubscriptions.d.ts","sourceRoot":"","sources":["../../src/subscriptions/makeSubscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,YAAY,CAAA;IACpB,SAAS,EAAE,GAAG,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,mBAAmB,uBAAuB,KACzC,iBAAiB,EAmBnB,CAAA"}
1
+ {"version":3,"file":"makeSubscriptions.d.ts","sourceRoot":"","sources":["../../src/subscriptions/makeSubscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAEzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,YAAY,CAAA;IACpB,SAAS,EAAE,GAAG,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,mBAAmB,uBAAuB,KACzC,mBAAmB,EAmBrB,CAAA"}
package/dist/types.d.ts CHANGED
@@ -8,9 +8,9 @@ import type { AuthContextPayload, CorsConfig, Decoder } from '@cedarjs/api';
8
8
  import type { CedarRequestContext } from '@cedarjs/api/runtime';
9
9
  import type { CedarRealtimeOptions } from '@cedarjs/realtime';
10
10
  import type { DirectiveGlobImports } from './directives/makeDirectives.js';
11
- import type { LoggerConfig } from './plugins/useCedarLogger.js';
12
- import type { CedarTrustedDocumentOptions, RedwoodTrustedDocumentOptions } from './plugins/useCedarTrustedDocuments.js';
13
- import type { UseCedarDirectiveReturn, useRedwoodDirectiveReturn, DirectivePluginOptions } from './plugins/useRedwoodDirective.js';
11
+ import type { useRedwoodDirectiveReturn, DirectivePluginOptions } from './plugins/useRedwoodDirective.js';
12
+ import type { LoggerConfig } from './plugins/useRedwoodLogger.js';
13
+ import type { RedwoodTrustedDocumentOptions } from './plugins/useRedwoodTrustedDocuments.js';
14
14
  export type Resolver = (...args: unknown[]) => unknown;
15
15
  export type Services = {
16
16
  [funcName: string]: Resolver;
@@ -33,7 +33,7 @@ export interface MakeServicesInterface {
33
33
  }
34
34
  export type MakeServices = (args: MakeServicesInterface) => ServicesGlobImports;
35
35
  export type GraphQLTypeWithFields = GraphQLObjectType | GraphQLInterfaceType;
36
- export type { UseCedarDirectiveReturn, useRedwoodDirectiveReturn, DirectivePluginOptions, CedarTrustedDocumentOptions, RedwoodTrustedDocumentOptions, };
36
+ export type { useRedwoodDirectiveReturn, DirectivePluginOptions };
37
37
  export type GetCurrentUser = (decoded: AuthContextPayload[0], raw: AuthContextPayload[1], req?: AuthContextPayload[2]) => Promise<null | Record<string, unknown>>;
38
38
  export type GenerateGraphiQLHeader = () => string;
39
39
  export type Context = Record<string, unknown>;
@@ -65,7 +65,7 @@ export interface RedwoodGraphQLContext {
65
65
  currentUser?: ThenArg<ReturnType<GetCurrentUser>> | AuthContextPayload | null;
66
66
  [index: string]: unknown;
67
67
  }
68
- export interface CedarOpenTelemetryConfig {
68
+ export interface RedwoodOpenTelemetryConfig {
69
69
  /**
70
70
  * @description Enables the creation of a span for each resolver execution.
71
71
  */
@@ -79,13 +79,9 @@ export interface CedarOpenTelemetryConfig {
79
79
  */
80
80
  result: boolean;
81
81
  }
82
- /** @deprecated Please use CedarOpenTelemetryConfig */
83
- export type RedwoodOpenTelemetryConfig = CedarOpenTelemetryConfig;
84
- export interface CedarScalarConfig {
82
+ export interface RedwoodScalarConfig {
85
83
  File?: boolean;
86
84
  }
87
- /** @deprecated Please use CedarScalarConfig */
88
- export type RedwoodScalarConfig = CedarScalarConfig;
89
85
  /**
90
86
  * GraphQLYogaOptions
91
87
  */
@@ -212,18 +208,18 @@ export type GraphQLYogaOptions = {
212
208
  * @see https://benjie.dev/graphql/trusted-documents
213
209
  * @see https://the-guild.dev/graphql/yoga-server/docs/features/persisted-operations
214
210
  */
215
- trustedDocuments?: CedarTrustedDocumentOptions;
211
+ trustedDocuments?: RedwoodTrustedDocumentOptions;
216
212
  /**
217
213
  * @description Configure OpenTelemetry plugin behaviour
218
214
  */
219
- openTelemetryOptions?: CedarOpenTelemetryConfig;
215
+ openTelemetryOptions?: RedwoodOpenTelemetryConfig;
220
216
  /**
221
217
  * @description Configure which scalars to include in the schema. This should match your
222
218
  * `graphql.includeScalars` configuration in `cedar.toml`.
223
219
  *
224
220
  * The default is to include. You must set to `false` to exclude.
225
221
  */
226
- includeScalars?: CedarScalarConfig;
222
+ includeScalars?: RedwoodScalarConfig;
227
223
  };
228
224
  /**
229
225
  * @description Configure GraphQLHandler with options
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAC1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AAChF,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACb,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EACV,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,kC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Q,CAAC,EAAE,oBAAoB,CAAA;IAE/B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,6BAA6B,CAAA;IAEhD;;OAEG;IACH,oBAAoB,CAAC,EAAE,0BAA0B,CAAA;IAEjD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAA;CACrC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAA;AAEtD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,kBAAkB,EAClB,eAAe,GAAG,wBAAwB,CAC3C,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/graphql-server",
3
- "version": "5.0.7-next.338",
3
+ "version": "5.0.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
@@ -10,9 +10,13 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
- "default": {
13
+ "import": {
14
14
  "types": "./dist/index.d.ts",
15
15
  "default": "./dist/index.js"
16
+ },
17
+ "require": {
18
+ "types": "./dist/cjs/index.d.ts",
19
+ "default": "./dist/cjs/index.js"
16
20
  }
17
21
  }
18
22
  },
@@ -24,6 +28,7 @@
24
28
  "build": "node ./build.mts",
25
29
  "build:pack": "yarn pack -o cedarjs-graphql-server.tgz",
26
30
  "build:types": "tsc --build --verbose ./tsconfig.build.json",
31
+ "build:types-cjs": "tsc --build --verbose ./tsconfig.cjs.json",
27
32
  "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"",
28
33
  "check:attw": "yarn cedar-fwtools-attw",
29
34
  "check:package": "concurrently npm:check:attw yarn:publint",
@@ -32,41 +37,44 @@
32
37
  "test:watch": "yarn test --watch"
33
38
  },
34
39
  "dependencies": {
35
- "@cedarjs/api": "5.0.7-next.338",
36
- "@cedarjs/context": "5.0.7-next.338",
40
+ "@cedarjs/api": "5.0.7",
41
+ "@cedarjs/context": "5.0.7",
37
42
  "@envelop/core": "5.5.1",
43
+ "@envelop/depth-limit": "4.0.0",
38
44
  "@envelop/disable-introspection": "6.0.0",
39
45
  "@envelop/filter-operation-type": "6.0.0",
40
46
  "@envelop/on-resolve": "4.1.1",
41
47
  "@escape.tech/graphql-armor": "3.0.1",
42
- "@graphql-tools/merge": "9.2.3",
43
- "@graphql-tools/schema": "10.1.0",
48
+ "@graphql-tools/merge": "9.1.9",
49
+ "@graphql-tools/schema": "10.0.33",
44
50
  "@graphql-tools/utils": "10.11.0",
45
- "@graphql-yoga/plugin-persisted-operations": "3.21.3",
51
+ "@graphql-yoga/plugin-persisted-operations": "3.21.2",
46
52
  "@opentelemetry/api": "1.9.1",
47
53
  "cookie": "1.1.1",
48
54
  "graphql": "16.14.2",
49
- "graphql-scalars": "1.26.0",
55
+ "graphql-scalars": "1.25.0",
50
56
  "graphql-tag": "2.12.6",
51
- "graphql-yoga": "5.21.3",
57
+ "graphql-yoga": "5.21.2",
52
58
  "lodash": "4.18.1",
53
59
  "uuid": "11.1.0"
54
60
  },
55
61
  "devDependencies": {
56
- "@cedarjs/framework-tools": "5.0.7-next.338",
57
- "@cedarjs/realtime": "5.0.7-next.338",
62
+ "@babel/cli": "7.29.7",
63
+ "@babel/core": "^7.26.10",
64
+ "@cedarjs/framework-tools": "5.0.7",
65
+ "@cedarjs/project-config": "5.0.7",
66
+ "@cedarjs/realtime": "5.0.7",
58
67
  "@envelop/types": "5.2.1",
59
- "@escape.tech/graphql-armor-types": "0.7.0",
60
68
  "@types/aws-lambda": "8.10.162",
61
69
  "@types/jsonwebtoken": "9.0.10",
62
- "@types/lodash": "4.17.25",
70
+ "@types/lodash": "4.17.24",
71
+ "@whatwg-node/fetch": "0.10.13",
63
72
  "@whatwg-node/promise-helpers": "^1.3.0",
64
73
  "concurrently": "9.2.4",
65
- "fastify": "5.12.0",
66
74
  "jsonwebtoken": "9.0.3",
67
- "publint": "0.3.23",
75
+ "publint": "0.3.21",
68
76
  "typescript": "5.9.3",
69
- "vitest": "4.1.10"
77
+ "vitest": "3.2.6"
70
78
  },
71
79
  "engines": {
72
80
  "node": ">=24"
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCedarAuthContext.d.ts","sourceRoot":"","sources":["../../src/plugins/useCedarAuthContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAsB,OAAO,EAAE,MAAM,cAAc,CAAA;AAG/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE7E;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,gBAAgB,qBAAqB,CAAC,gBAAgB,CAAC,EACvD,cAAc,OAAO,GAAG,OAAO,EAAE,KAChC,MAAM,CAAC,mBAAmB,CA2C5B,CAAA"}
@@ -1,30 +0,0 @@
1
- import { hasAuthDecoder } from "@cedarjs/api";
2
- const useCedarAuthContext = (getCurrentUser, authDecoder) => {
3
- return {
4
- async onContextBuilding({ context, extendContext }) {
5
- if (!context.cedarContext && hasAuthDecoder(authDecoder)) {
6
- throw new Error(
7
- "Auth state is resolved when a request enters Cedar and passed on the GraphQL context, but this context has no `cedarContext`. Whatever is invoking `yoga.handle` needs to build one with `buildCedarContext` from `@cedarjs/api/runtime` and pass it as `cedarContext`."
8
- );
9
- }
10
- const authContext = context.cedarContext?.serverAuthState;
11
- try {
12
- if (authContext) {
13
- const currentUser = getCurrentUser ? await getCurrentUser(
14
- authContext[0],
15
- authContext[1],
16
- authContext[2]
17
- ) : null;
18
- if (currentUser) {
19
- extendContext({ currentUser });
20
- }
21
- }
22
- } catch (error) {
23
- throw new Error(`Exception in getCurrentUser: ${error.message}`);
24
- }
25
- }
26
- };
27
- };
28
- export {
29
- useCedarAuthContext
30
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCedarError.d.ts","sourceRoot":"","sources":["../../src/plugins/useCedarError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAO1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,MAAM,CAAC,mBAAmB,CAsCxE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCedarGlobalContextSetter.d.ts","sourceRoot":"","sources":["../../src/plugins/useCedarGlobalContextSetter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAI1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,QAAO,MAAM,CAAC,mBAAmB,CAMvE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCedarLogger.d.ts","sourceRoot":"","sources":["../../src/plugins/useCedarLogger.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAI1C,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAGlE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD;;;;;;;;;;;;;GAaG;AACH,KAAK,oBAAoB,GAAG;IAC1B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,EAAE,eAAe,GAAG,MAAM,CAAA;IAEhC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC7B,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA;AA+DD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,GACzB,cAAc,YAAY,KACzB,MAAM,CAAC,mBAAmB,CAgH5B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCedarOpenTelemetry.d.ts","sourceRoot":"","sources":["../../src/plugins/useCedarOpenTelemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAuB,MAAM,eAAe,CAAA;AAKhE,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAGnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAE3D,oBAAY,aAAa;IACvB,eAAe,0BAA0B;IACzC,gBAAgB,2BAA2B;IAC3C,kBAAkB,+BAA+B;IACjD,mBAAmB,+BAA+B;IAClD,kBAAkB,8BAA8B;IAChD,oBAAoB,gCAAgC;IACpD,aAAa,0BAA0B;IACvC,wBAAwB,kCAAkC;IAC1D,4BAA4B,6BAA6B;IACzD,mBAAmB,8BAA8B;CAClD;AAGD,QAAA,MAAM,iBAAiB,2BAA2B,CAAA;AAElD,KAAK,aAAa,GAAG;IACnB,CAAC,iBAAiB,CAAC,EAAE,aAAa,CAAC,IAAI,CAAA;CACxC,CAAA;AAED,eAAO,MAAM,qBAAqB,GAChC,SAAS,wBAAwB,KAChC,MAAM,CAAC,aAAa,CAgHtB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCedarPopulateContext.d.ts","sourceRoot":"","sources":["../../src/plugins/useCedarPopulateContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE7E;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,wBAAwB,WAAW,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,KACpE,MAAM,CAAC,mBAAmB,CAW5B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCedarTrustedDocuments.d.ts","sourceRoot":"","sources":["../../src/plugins/useCedarTrustedDocuments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAA;AAC9F,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,cAAc,CAAA;AAEzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,6BAA6B,EAC7B,uBAAuB,CACxB,GAAG;IACF;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACzC,GAAG,CACE;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,CAChE,CAAA;AAEH,6DAA6D;AAC7D,MAAM,MAAM,6BAA6B,GAAG,2BAA2B,CAAA;AAuEvE,eAAO,MAAM,wBAAwB,GACnC,SAAS,2BAA2B,KACnC,MAAM,C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