@cedarjs/api 6.0.0-canary.2807 → 6.0.0-canary.2810
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.js +3 -3
- package/dist/runtime.d.ts +26 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +2 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7,9 +7,9 @@ export * from "./transforms.js";
|
|
|
7
7
|
export * from "./cors.js";
|
|
8
8
|
export * from "./event.js";
|
|
9
9
|
const prismaVersion = "7.8.0";
|
|
10
|
-
const redwoodVersion = "6.0.0-canary.
|
|
11
|
-
const cedarjsVersion = "6.0.0-canary.
|
|
12
|
-
const cedarVersion = "6.0.0-canary.
|
|
10
|
+
const redwoodVersion = "6.0.0-canary.2810";
|
|
11
|
+
const cedarjsVersion = "6.0.0-canary.2810";
|
|
12
|
+
const cedarVersion = "6.0.0-canary.2810";
|
|
13
13
|
export {
|
|
14
14
|
cedarVersion,
|
|
15
15
|
cedarjsVersion,
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import type { APIGatewayProxyEvent, APIGatewayProxyResult, Context as LambdaContext } from 'aws-lambda';
|
|
2
2
|
import { getAuthenticationContext } from './auth/index.js';
|
|
3
|
+
import type { Decoder } from './auth/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* A decoder that decodes nothing.
|
|
6
|
+
*
|
|
7
|
+
* Resolving `serverAuthState` has to happen before the GraphQL server reads
|
|
8
|
+
* the request body:
|
|
9
|
+
*
|
|
10
|
+
* 1. Resolving it materialises the request body — `getAuthenticationContext`
|
|
11
|
+
* builds a Lambda-style event via `requestToBaseEvent`, which does
|
|
12
|
+
* `request.clone().text()`
|
|
13
|
+
* 2. `clone()` only works while the body is untouched
|
|
14
|
+
* 3. So once the GraphQL server has read the body, resolving throws
|
|
15
|
+
* `TypeError: unusable`
|
|
16
|
+
*
|
|
17
|
+
* `buildCedarContext` only resolves auth state when it's given a decoder, so
|
|
18
|
+
* GraphQL call sites pass this one for projects that have no auth set up, to
|
|
19
|
+
* keep the resolve eager. Resolving with it produces the same payload as
|
|
20
|
+
* resolving with no decoders at all.
|
|
21
|
+
*
|
|
22
|
+
* (When it isn't resolved eagerly, `useRedwoodAuthContext` resolves it during
|
|
23
|
+
* context building instead — too late. That's how this surfaces.)
|
|
24
|
+
*
|
|
25
|
+
* TODO: Remove this once the request body is captured at the entry point rather
|
|
26
|
+
* than read lazily from the auth path, which drops the ordering constraint.
|
|
27
|
+
*/
|
|
28
|
+
export declare const noopAuthDecoder: Decoder;
|
|
3
29
|
export interface CedarRequestContext {
|
|
4
30
|
params: Record<string, string>;
|
|
5
31
|
query: URLSearchParams;
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAEpB,qBAAqB,EACrB,OAAO,IAAI,aAAa,EACzB,MAAM,YAAY,CAAA;AAInB,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAEpB,qBAAqB,EACrB,OAAO,IAAI,aAAa,EACzB,MAAM,YAAY,CAAA;AAInB,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAG9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,EAAE,OAA0B,CAAA;AAExD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,KAAK,EAAE,eAAe,CAAA;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O,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAA;AAmCvD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,mBAAmB,CAAC,CAiC9B;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,eAAe,EAAE,GAC5B,YAAY,CAMd;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,EAAE,GACzB,gBAAgB,EAAE,CAOpB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAEtE;AAED,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,aAAa,EAC5B,OAAO,GAAE,wBAA6B,GACrC,YAAY,CAQd;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,mBAAmB,GACvB,OAAO,CAAC,oBAAoB,CAAC,CAqB/B;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,mBAAmB,GAAG,QAAQ,CAsD5E"}
|
package/dist/runtime.js
CHANGED
|
@@ -2,6 +2,7 @@ import * as cookie from "cookie";
|
|
|
2
2
|
import { parse } from "picoquery";
|
|
3
3
|
import { getAuthenticationContext } from "./auth/index.js";
|
|
4
4
|
import { requestToBaseEvent } from "./transforms.js";
|
|
5
|
+
const noopAuthDecoder = async () => null;
|
|
5
6
|
const DEFAULT_LAMBDA_CONTEXT = {
|
|
6
7
|
callbackWaitsForEmptyEventLoop: false,
|
|
7
8
|
functionName: "cedar",
|
|
@@ -151,6 +152,7 @@ export {
|
|
|
151
152
|
composeCedarMiddleware,
|
|
152
153
|
createRouteManifest,
|
|
153
154
|
legacyResultToResponse,
|
|
155
|
+
noopAuthDecoder,
|
|
154
156
|
requestToLegacyEvent,
|
|
155
157
|
routeManifestToJSON,
|
|
156
158
|
wrapLegacyHandler
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/api",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2810",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"title-case": "3.0.3"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@cedarjs/framework-tools": "6.0.0-canary.
|
|
87
|
+
"@cedarjs/framework-tools": "6.0.0-canary.2810",
|
|
88
88
|
"@types/aws-lambda": "8.10.162",
|
|
89
89
|
"@types/jsonwebtoken": "9.0.10",
|
|
90
90
|
"@types/memjs": "1",
|