@cedarjs/api-server 7.0.0-canary.3083 → 7.0.0-canary.3086

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/bin.js CHANGED
@@ -586,7 +586,6 @@ import { pathToFileURL as pathToFileURL3 } from "node:url";
586
586
  import fastifyMultiPart from "@fastify/multipart";
587
587
  import fastifyUrlData2 from "@fastify/url-data";
588
588
  import fg2 from "fast-glob";
589
- import { buildCedarContext as buildCedarContext2 } from "@cedarjs/api/runtime";
590
589
  import { getAsyncStoreInstance as getAsyncStoreInstance3 } from "@cedarjs/context/dist/store";
591
590
  import { coerceRootPath as coerceRootPath3 } from "@cedarjs/fastify-web/dist/helpers.js";
592
591
  import { createGraphQLYoga } from "@cedarjs/graphql-server";
@@ -621,8 +620,8 @@ async function cedarFastifyGraphQLServer(fastify2, options) {
621
620
  if (graphqlOptions?.realtime?.subscriptions) {
622
621
  method.push("PUT");
623
622
  }
624
- const { yoga } = await createGraphQLYoga(graphqlOptions);
625
- const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
623
+ const graphqlServer = await createGraphQLYoga(graphqlOptions);
624
+ const graphqlEndpoint = trimSlashes(graphqlServer.yoga.graphqlEndpoint);
626
625
  const routePaths = ["", "/health", "/readiness", "/stream"];
627
626
  for (const routePath of routePaths) {
628
627
  fastify2.route({
@@ -630,11 +629,9 @@ async function cedarFastifyGraphQLServer(fastify2, options) {
630
629
  method,
631
630
  handler: async (req, reply) => {
632
631
  const request = createFetchRequest(req, reply);
633
- const cedarContext = await buildCedarContext2(request, {
634
- authDecoder: graphqlOptions.authDecoder
635
- });
632
+ const cedarContext = await graphqlServer.buildRequestContext(request);
636
633
  try {
637
- return await yoga.handle(request, {
634
+ return await graphqlServer.yoga.handle(request, {
638
635
  request,
639
636
  cedarContext,
640
637
  event: lambdaEventForFastifyRequest(req),
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/plugins/graphql.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,SAAS,CAAA;AAOhB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE;QACL,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;QAC5B,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;KACpE,CAAA;CACF;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,0BAA0B,iBAmIpC;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAc3D"}
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/plugins/graphql.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE;QACL,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;QAC5B,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;KACpE,CAAA;CACF;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,0BAA0B,iBAiIpC;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAc3D"}
@@ -2,7 +2,6 @@ import { pathToFileURL } from "node:url";
2
2
  import fastifyMultiPart from "@fastify/multipart";
3
3
  import fastifyUrlData from "@fastify/url-data";
4
4
  import fg from "fast-glob";
5
- import { buildCedarContext } from "@cedarjs/api/runtime";
6
5
  import { getAsyncStoreInstance } from "@cedarjs/context/dist/store";
7
6
  import { coerceRootPath } from "@cedarjs/fastify-web/dist/helpers.js";
8
7
  import { createGraphQLYoga } from "@cedarjs/graphql-server";
@@ -38,8 +37,8 @@ async function cedarFastifyGraphQLServer(fastify, options) {
38
37
  if (graphqlOptions?.realtime?.subscriptions) {
39
38
  method.push("PUT");
40
39
  }
41
- const { yoga } = await createGraphQLYoga(graphqlOptions);
42
- const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
40
+ const graphqlServer = await createGraphQLYoga(graphqlOptions);
41
+ const graphqlEndpoint = trimSlashes(graphqlServer.yoga.graphqlEndpoint);
43
42
  const routePaths = ["", "/health", "/readiness", "/stream"];
44
43
  for (const routePath of routePaths) {
45
44
  fastify.route({
@@ -47,11 +46,9 @@ async function cedarFastifyGraphQLServer(fastify, options) {
47
46
  method,
48
47
  handler: async (req, reply) => {
49
48
  const request = createFetchRequest(req, reply);
50
- const cedarContext = await buildCedarContext(request, {
51
- authDecoder: graphqlOptions.authDecoder
52
- });
49
+ const cedarContext = await graphqlServer.buildRequestContext(request);
53
50
  try {
54
- return await yoga.handle(request, {
51
+ return await graphqlServer.yoga.handle(request, {
55
52
  request,
56
53
  cedarContext,
57
54
  event: lambdaEventForFastifyRequest(req),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "7.0.0-canary.3083",
3
+ "version": "7.0.0-canary.3086",
4
4
  "description": "CedarJS's HTTP server for Serverless Functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -92,11 +92,11 @@
92
92
  "test:watch": "vitest watch"
93
93
  },
94
94
  "dependencies": {
95
- "@cedarjs/api": "7.0.0-canary.3083",
96
- "@cedarjs/context": "7.0.0-canary.3083",
97
- "@cedarjs/fastify-web": "7.0.0-canary.3083",
98
- "@cedarjs/project-config": "7.0.0-canary.3083",
99
- "@cedarjs/web-server": "7.0.0-canary.3083",
95
+ "@cedarjs/api": "7.0.0-canary.3086",
96
+ "@cedarjs/context": "7.0.0-canary.3086",
97
+ "@cedarjs/fastify-web": "7.0.0-canary.3086",
98
+ "@cedarjs/project-config": "7.0.0-canary.3086",
99
+ "@cedarjs/web-server": "7.0.0-canary.3086",
100
100
  "@fastify/multipart": "9.4.0",
101
101
  "@fastify/url-data": "6.0.4",
102
102
  "ansis": "4.3.1",
@@ -113,7 +113,7 @@
113
113
  "yargs": "17.7.3"
114
114
  },
115
115
  "devDependencies": {
116
- "@cedarjs/framework-tools": "7.0.0-canary.3083",
116
+ "@cedarjs/framework-tools": "7.0.0-canary.3086",
117
117
  "@fastify/compress": "9.2.0",
118
118
  "@types/aws-lambda": "8.10.162",
119
119
  "@types/dotenv-defaults": "^5.0.0",
@@ -129,7 +129,7 @@
129
129
  "vitest": "4.1.11"
130
130
  },
131
131
  "peerDependencies": {
132
- "@cedarjs/graphql-server": "7.0.0-canary.3083"
132
+ "@cedarjs/graphql-server": "7.0.0-canary.3086"
133
133
  },
134
134
  "peerDependenciesMeta": {
135
135
  "@cedarjs/graphql-server": {