@cedarjs/api 5.0.5 → 5.0.6
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/cjs/index.js +3 -3
- package/dist/cjs/runtime.d.ts +26 -0
- package/dist/cjs/runtime.d.ts.map +1 -1
- package/dist/cjs/runtime.js +3 -0
- 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/cjs/index.js
CHANGED
|
@@ -34,9 +34,9 @@ __reExport(index_exports, require("./transforms.js"), module.exports);
|
|
|
34
34
|
__reExport(index_exports, require("./cors.js"), module.exports);
|
|
35
35
|
__reExport(index_exports, require("./event.js"), module.exports);
|
|
36
36
|
const prismaVersion = "7.8.0";
|
|
37
|
-
const redwoodVersion = "5.0.
|
|
38
|
-
const cedarjsVersion = "5.0.
|
|
39
|
-
const cedarVersion = "5.0.
|
|
37
|
+
const redwoodVersion = "5.0.6";
|
|
38
|
+
const cedarjsVersion = "5.0.6";
|
|
39
|
+
const cedarVersion = "5.0.6";
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
41
|
0 && (module.exports = {
|
|
42
42
|
cedarVersion,
|
package/dist/cjs/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;
|
|
@@ -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;AAEx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B,GAAG,QAAQ,CAAA;AAElE,MAAM,MAAM,aAAa,GAAG,CAC1B,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,aAAa,KACnB,OAAO,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/cjs/runtime.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(runtime_exports, {
|
|
|
32
32
|
composeCedarMiddleware: () => composeCedarMiddleware,
|
|
33
33
|
createRouteManifest: () => createRouteManifest,
|
|
34
34
|
legacyResultToResponse: () => legacyResultToResponse,
|
|
35
|
+
noopAuthDecoder: () => noopAuthDecoder,
|
|
35
36
|
requestToLegacyEvent: () => requestToLegacyEvent,
|
|
36
37
|
routeManifestToJSON: () => routeManifestToJSON,
|
|
37
38
|
wrapLegacyHandler: () => wrapLegacyHandler
|
|
@@ -41,6 +42,7 @@ var cookie = __toESM(require("cookie"), 1);
|
|
|
41
42
|
var import_picoquery = require("picoquery");
|
|
42
43
|
var import_auth = require("./auth/index.js");
|
|
43
44
|
var import_transforms = require("./transforms.js");
|
|
45
|
+
const noopAuthDecoder = async () => null;
|
|
44
46
|
const DEFAULT_LAMBDA_CONTEXT = {
|
|
45
47
|
callbackWaitsForEmptyEventLoop: false,
|
|
46
48
|
functionName: "cedar",
|
|
@@ -191,6 +193,7 @@ function toMultiValueQueryStringParameters(url) {
|
|
|
191
193
|
composeCedarMiddleware,
|
|
192
194
|
createRouteManifest,
|
|
193
195
|
legacyResultToResponse,
|
|
196
|
+
noopAuthDecoder,
|
|
194
197
|
requestToLegacyEvent,
|
|
195
198
|
routeManifestToJSON,
|
|
196
199
|
wrapLegacyHandler
|
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 = "5.0.
|
|
11
|
-
const cedarjsVersion = "5.0.
|
|
12
|
-
const cedarVersion = "5.0.
|
|
10
|
+
const redwoodVersion = "5.0.6";
|
|
11
|
+
const cedarjsVersion = "5.0.6";
|
|
12
|
+
const cedarVersion = "5.0.6";
|
|
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;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A;CAClC;AAED,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,GAAG,QAAQ,CAAA;AAElE,MAAM,MAAM,aAAa,GAAG,CAC1B,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,aAAa,KACnB,OAAO,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": "5.0.
|
|
3
|
+
"version": "5.0.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"title-case": "3.0.3"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@cedarjs/framework-tools": "5.0.
|
|
111
|
+
"@cedarjs/framework-tools": "5.0.6",
|
|
112
112
|
"@types/aws-lambda": "8.10.162",
|
|
113
113
|
"@types/jsonwebtoken": "9.0.10",
|
|
114
114
|
"@types/memjs": "1",
|