@cedarjs/api-server 4.0.0-canary.13852 → 4.0.0-canary.13854

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
@@ -370,7 +370,9 @@ var init_lambdaLoader = __esm({
370
370
  }
371
371
  return void 0;
372
372
  })();
373
- LAMBDA_FUNCTIONS.set(routeName, handler3);
373
+ if (handler3) {
374
+ LAMBDA_FUNCTIONS.set(routeName, handler3);
375
+ }
374
376
  if (cedarHandler) {
375
377
  CEDAR_HANDLERS.set(routeName, cedarHandler);
376
378
  } else if (handler3) {
@@ -564,22 +566,10 @@ async function redwoodFastifyGraphQLServer(fastify2, options) {
564
566
  redwoodOptions.graphql = __rw_graphqlOptions;
565
567
  }
566
568
  const graphqlOptions = redwoodOptions.graphql;
567
- if (graphqlOptions?.realtime) {
568
- const { useCedarRealtime } = await import("@cedarjs/realtime");
569
- const originalExtraPlugins = graphqlOptions.extraPlugins ?? [];
570
- originalExtraPlugins.push(
571
- // This type cast is needed because useCedarRealtime returns an
572
- // EnvelopPlugin and here we need a YogaPlugin. I can't change the
573
- // return type of `useCedarRealtime` yet, because it'd be a breaking
574
- // change.
575
- useCedarRealtime(graphqlOptions.realtime)
576
- );
577
- graphqlOptions.extraPlugins = originalExtraPlugins;
578
- if (graphqlOptions.realtime.subscriptions) {
579
- method.push("PUT");
580
- }
569
+ if (graphqlOptions?.realtime?.subscriptions) {
570
+ method.push("PUT");
581
571
  }
582
- const { yoga } = createGraphQLYoga(graphqlOptions);
572
+ const { yoga } = await createGraphQLYoga(graphqlOptions);
583
573
  const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
584
574
  const routePaths = ["", "/health", "/readiness", "/stream"];
585
575
  for (const routePath of routePaths) {
package/dist/cjs/bin.js CHANGED
@@ -392,7 +392,9 @@ var init_lambdaLoader = __esm({
392
392
  }
393
393
  return void 0;
394
394
  })();
395
- LAMBDA_FUNCTIONS.set(routeName, handler3);
395
+ if (handler3) {
396
+ LAMBDA_FUNCTIONS.set(routeName, handler3);
397
+ }
396
398
  if (cedarHandler) {
397
399
  CEDAR_HANDLERS.set(routeName, cedarHandler);
398
400
  } else if (handler3) {
@@ -578,22 +580,10 @@ async function redwoodFastifyGraphQLServer(fastify2, options) {
578
580
  redwoodOptions.graphql = __rw_graphqlOptions;
579
581
  }
580
582
  const graphqlOptions = redwoodOptions.graphql;
581
- if (graphqlOptions?.realtime) {
582
- const { useCedarRealtime } = await import("@cedarjs/realtime");
583
- const originalExtraPlugins = graphqlOptions.extraPlugins ?? [];
584
- originalExtraPlugins.push(
585
- // This type cast is needed because useCedarRealtime returns an
586
- // EnvelopPlugin and here we need a YogaPlugin. I can't change the
587
- // return type of `useCedarRealtime` yet, because it'd be a breaking
588
- // change.
589
- useCedarRealtime(graphqlOptions.realtime)
590
- );
591
- graphqlOptions.extraPlugins = originalExtraPlugins;
592
- if (graphqlOptions.realtime.subscriptions) {
593
- method.push("PUT");
594
- }
583
+ if (graphqlOptions?.realtime?.subscriptions) {
584
+ method.push("PUT");
595
585
  }
596
- const { yoga } = (0, import_graphql_server.createGraphQLYoga)(graphqlOptions);
586
+ const { yoga } = await (0, import_graphql_server.createGraphQLYoga)(graphqlOptions);
597
587
  const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
598
588
  const routePaths = ["", "/health", "/readiness", "/stream"];
599
589
  for (const routePath of routePaths) {
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/plugins/graphql.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,SAAS,CAAA;AAQ3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBA0HtC"}
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/plugins/graphql.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,SAAS,CAAA;AAO3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBAuGtC"}
@@ -65,22 +65,10 @@ async function redwoodFastifyGraphQLServer(fastify, options) {
65
65
  redwoodOptions.graphql = __rw_graphqlOptions;
66
66
  }
67
67
  const graphqlOptions = redwoodOptions.graphql;
68
- if (graphqlOptions?.realtime) {
69
- const { useCedarRealtime } = await import("@cedarjs/realtime");
70
- const originalExtraPlugins = graphqlOptions.extraPlugins ?? [];
71
- originalExtraPlugins.push(
72
- // This type cast is needed because useCedarRealtime returns an
73
- // EnvelopPlugin and here we need a YogaPlugin. I can't change the
74
- // return type of `useCedarRealtime` yet, because it'd be a breaking
75
- // change.
76
- useCedarRealtime(graphqlOptions.realtime)
77
- );
78
- graphqlOptions.extraPlugins = originalExtraPlugins;
79
- if (graphqlOptions.realtime.subscriptions) {
80
- method.push("PUT");
81
- }
68
+ if (graphqlOptions?.realtime?.subscriptions) {
69
+ method.push("PUT");
82
70
  }
83
- const { yoga } = (0, import_graphql_server.createGraphQLYoga)(graphqlOptions);
71
+ const { yoga } = await (0, import_graphql_server.createGraphQLYoga)(graphqlOptions);
84
72
  const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
85
73
  const routePaths = ["", "/health", "/readiness", "/stream"];
86
74
  for (const routePath of routePaths) {
@@ -2,7 +2,7 @@ import type { Handler } from 'aws-lambda';
2
2
  import type { Options as FastGlobOptions } from 'fast-glob';
3
3
  import type { FastifyReply, FastifyRequest, RequestGenericInterface } from 'fastify';
4
4
  import type { CedarHandler, CedarRouteRecord } from '@cedarjs/api/runtime';
5
- export declare const LAMBDA_FUNCTIONS: Map<string, Handler | undefined>;
5
+ export declare const LAMBDA_FUNCTIONS: Map<string, Handler>;
6
6
  export declare const CEDAR_HANDLERS: Map<string, CedarHandler>;
7
7
  /**
8
8
  * Exports a copy of the Cedar route manifest.
@@ -1 +1 @@
1
- {"version":3,"file":"lambdaLoader.d.ts","sourceRoot":"","sources":["../../../src/plugins/lambdaLoader.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAEjB,MAAM,sBAAsB,CAAA;AAO7B,eAAO,MAAM,gBAAgB,kCAAyC,CAAA;AACtE,eAAO,MAAM,cAAc,2BAAkC,CAAA;AAG7D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,0BAAgC,CAAA;AAIlE,eAAO,MAAM,kBAAkB,GAAU,gBAAgB,MAAM,EAAE,kBAsGhE,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1C,CAAA;AAGD,eAAO,MAAM,qBAAqB,GAChC,UAAS,4BAAiC,kBAe3C,CAAA;AA0BD,UAAU,oBAAqB,SAAQ,uBAAuB;IAC5D,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF;AAED;;;;IAII;AACJ,eAAO,MAAM,oBAAoB,GAC/B,KAAK,cAAc,CAAC,oBAAoB,CAAC,EACzC,OAAO,YAAY,kBAqEpB,CAAA"}
1
+ {"version":3,"file":"lambdaLoader.d.ts","sourceRoot":"","sources":["../../../src/plugins/lambdaLoader.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAEjB,MAAM,sBAAsB,CAAA;AAO7B,eAAO,MAAM,gBAAgB,sBAA6B,CAAA;AAC1D,eAAO,MAAM,cAAc,2BAAkC,CAAA;AAG7D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,0BAAgC,CAAA;AAIlE,eAAO,MAAM,kBAAkB,GAAU,gBAAgB,MAAM,EAAE,kBAwGhE,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1C,CAAA;AAGD,eAAO,MAAM,qBAAqB,GAChC,UAAS,4BAAiC,kBAe3C,CAAA;AA0BD,UAAU,oBAAqB,SAAQ,uBAAuB;IAC5D,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF;AAED;;;;IAII;AACJ,eAAO,MAAM,oBAAoB,GAC/B,KAAK,cAAc,CAAC,oBAAoB,CAAC,EACzC,OAAO,YAAY,kBAqEpB,CAAA"}
@@ -79,7 +79,9 @@ const setLambdaFunctions = async (foundFunctions) => {
79
79
  }
80
80
  return void 0;
81
81
  })();
82
- LAMBDA_FUNCTIONS.set(routeName, handler);
82
+ if (handler) {
83
+ LAMBDA_FUNCTIONS.set(routeName, handler);
84
+ }
83
85
  if (cedarHandler) {
84
86
  CEDAR_HANDLERS.set(routeName, cedarHandler);
85
87
  } else if (handler) {
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/plugins/graphql.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,SAAS,CAAA;AAQ3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBA0HtC"}
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/plugins/graphql.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,SAAS,CAAA;AAO3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBAuGtC"}
@@ -32,22 +32,10 @@ async function redwoodFastifyGraphQLServer(fastify, options) {
32
32
  redwoodOptions.graphql = __rw_graphqlOptions;
33
33
  }
34
34
  const graphqlOptions = redwoodOptions.graphql;
35
- if (graphqlOptions?.realtime) {
36
- const { useCedarRealtime } = await import("@cedarjs/realtime");
37
- const originalExtraPlugins = graphqlOptions.extraPlugins ?? [];
38
- originalExtraPlugins.push(
39
- // This type cast is needed because useCedarRealtime returns an
40
- // EnvelopPlugin and here we need a YogaPlugin. I can't change the
41
- // return type of `useCedarRealtime` yet, because it'd be a breaking
42
- // change.
43
- useCedarRealtime(graphqlOptions.realtime)
44
- );
45
- graphqlOptions.extraPlugins = originalExtraPlugins;
46
- if (graphqlOptions.realtime.subscriptions) {
47
- method.push("PUT");
48
- }
35
+ if (graphqlOptions?.realtime?.subscriptions) {
36
+ method.push("PUT");
49
37
  }
50
- const { yoga } = createGraphQLYoga(graphqlOptions);
38
+ const { yoga } = await createGraphQLYoga(graphqlOptions);
51
39
  const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
52
40
  const routePaths = ["", "/health", "/readiness", "/stream"];
53
41
  for (const routePath of routePaths) {
@@ -2,7 +2,7 @@ import type { Handler } from 'aws-lambda';
2
2
  import type { Options as FastGlobOptions } from 'fast-glob';
3
3
  import type { FastifyReply, FastifyRequest, RequestGenericInterface } from 'fastify';
4
4
  import type { CedarHandler, CedarRouteRecord } from '@cedarjs/api/runtime';
5
- export declare const LAMBDA_FUNCTIONS: Map<string, Handler | undefined>;
5
+ export declare const LAMBDA_FUNCTIONS: Map<string, Handler>;
6
6
  export declare const CEDAR_HANDLERS: Map<string, CedarHandler>;
7
7
  /**
8
8
  * Exports a copy of the Cedar route manifest.
@@ -1 +1 @@
1
- {"version":3,"file":"lambdaLoader.d.ts","sourceRoot":"","sources":["../../src/plugins/lambdaLoader.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAEjB,MAAM,sBAAsB,CAAA;AAO7B,eAAO,MAAM,gBAAgB,kCAAyC,CAAA;AACtE,eAAO,MAAM,cAAc,2BAAkC,CA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C,CAAA;AAGD,eAAO,MAAM,qBAAqB,GAChC,UAAS,4BAAiC,kBAe3C,CAAA;AA0BD,UAAU,oBAAqB,SAAQ,uBAAuB;IAC5D,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF;AAED;;;;IAII;AACJ,eAAO,MAAM,oBAAoB,GAC/B,KAAK,cAAc,CAAC,oBAAoB,CAAC,EACzC,OAAO,YAAY,kBAqEpB,CAAA"}
@@ -41,7 +41,9 @@ const setLambdaFunctions = async (foundFunctions) => {
41
41
  }
42
42
  return void 0;
43
43
  })();
44
- LAMBDA_FUNCTIONS.set(routeName, handler);
44
+ if (handler) {
45
+ LAMBDA_FUNCTIONS.set(routeName, handler);
46
+ }
45
47
  if (cedarHandler) {
46
48
  CEDAR_HANDLERS.set(routeName, cedarHandler);
47
49
  } else if (handler) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "4.0.0-canary.13852+7a35606dae",
3
+ "version": "4.0.0-canary.13854+9d523c78b1",
4
4
  "description": "CedarJS's HTTP server for Serverless Functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -113,11 +113,11 @@
113
113
  "test:watch": "vitest watch"
114
114
  },
115
115
  "dependencies": {
116
- "@cedarjs/context": "4.0.0-canary.13852",
117
- "@cedarjs/fastify-web": "4.0.0-canary.13852",
118
- "@cedarjs/internal": "4.0.0-canary.13852",
119
- "@cedarjs/project-config": "4.0.0-canary.13852",
120
- "@cedarjs/web-server": "4.0.0-canary.13852",
116
+ "@cedarjs/context": "4.0.0-canary.13854",
117
+ "@cedarjs/fastify-web": "4.0.0-canary.13854",
118
+ "@cedarjs/internal": "4.0.0-canary.13854",
119
+ "@cedarjs/project-config": "4.0.0-canary.13854",
120
+ "@cedarjs/web-server": "4.0.0-canary.13854",
121
121
  "@fastify/multipart": "9.4.0",
122
122
  "@fastify/url-data": "6.0.3",
123
123
  "ansis": "4.2.0",
@@ -134,7 +134,7 @@
134
134
  "yargs": "17.7.2"
135
135
  },
136
136
  "devDependencies": {
137
- "@cedarjs/framework-tools": "4.0.0-canary.13852",
137
+ "@cedarjs/framework-tools": "4.0.0-canary.13854",
138
138
  "@types/aws-lambda": "8.10.161",
139
139
  "@types/dotenv-defaults": "^5.0.0",
140
140
  "@types/split2": "4.2.3",
@@ -147,7 +147,7 @@
147
147
  "vitest": "3.2.4"
148
148
  },
149
149
  "peerDependencies": {
150
- "@cedarjs/graphql-server": "4.0.0-canary.13852"
150
+ "@cedarjs/graphql-server": "4.0.0-canary.13854"
151
151
  },
152
152
  "peerDependenciesMeta": {
153
153
  "@cedarjs/graphql-server": {
@@ -157,5 +157,5 @@
157
157
  "publishConfig": {
158
158
  "access": "public"
159
159
  },
160
- "gitHead": "7a35606dae967f2df102fd0845c37505d70d24b1"
160
+ "gitHead": "9d523c78b135181dcbcecfdae8e4e1143335f36a"
161
161
  }