@cedarjs/api 8.0.0-canary.3397 → 8.0.0-canary.3400
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/__tests__/removeNulls.test-d.d.ts +2 -0
- package/dist/__tests__/removeNulls.test-d.d.ts.map +1 -0
- package/dist/index.js +3 -3
- package/dist/transforms.d.ts +22 -4
- package/dist/transforms.d.ts.map +1 -1
- package/dist/transforms.js +11 -9
- package/dist/webhooks/__tests__/webhooks.test-d.d.ts +2 -0
- package/dist/webhooks/__tests__/webhooks.test-d.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeNulls.test-d.d.ts","sourceRoot":"","sources":["../../src/__tests__/removeNulls.test-d.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -8,9 +8,9 @@ export * from "./cors.js";
|
|
|
8
8
|
export * from "./event.js";
|
|
9
9
|
export * from "./signedTokens/index.js";
|
|
10
10
|
const prismaVersion = "7.10.0";
|
|
11
|
-
const redwoodVersion = "8.0.0-canary.
|
|
12
|
-
const cedarjsVersion = "8.0.0-canary.
|
|
13
|
-
const cedarVersion = "8.0.0-canary.
|
|
11
|
+
const redwoodVersion = "8.0.0-canary.3400";
|
|
12
|
+
const cedarjsVersion = "8.0.0-canary.3400";
|
|
13
|
+
const cedarVersion = "8.0.0-canary.3400";
|
|
14
14
|
export {
|
|
15
15
|
cedarVersion,
|
|
16
16
|
cedarjsVersion,
|
package/dist/transforms.d.ts
CHANGED
|
@@ -28,9 +28,27 @@ export declare const isFetchApiRequest: (event: Request | APIGatewayProxyEvent)
|
|
|
28
28
|
*/
|
|
29
29
|
export declare function normalizeRequest(event: APIGatewayProxyEvent | Request): Promise<PartialRequest>;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* See {@link https://www.prisma.io/docs/concepts/components/prisma-client/null-and-undefined Prisma docs: null vs undefined}
|
|
31
|
+
* The type of `T` after `removeNulls`: each field that can be `null` can be
|
|
32
|
+
* `undefined` instead.
|
|
34
33
|
*/
|
|
35
|
-
export
|
|
34
|
+
export type RemoveNulls<T> = {
|
|
35
|
+
[K in keyof T]: null extends T[K] ? Exclude<T[K], null> | undefined : T[K];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Returns a copy of `input` with every `null` field set to `undefined`.
|
|
39
|
+
*
|
|
40
|
+
* GraphQL input types make every field nullable, but Prisma doesn't accept
|
|
41
|
+
* `null` for required fields. `undefined` leaves the field unchanged, so this
|
|
42
|
+
* lets you pass a GraphQL mutation input straight to Prisma:
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* db.post.update({ data: removeNulls(input), where: { id } })
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* Only top-level fields are changed. Nested objects, such as `Json` field
|
|
49
|
+
* values, are passed through as they are.
|
|
50
|
+
*
|
|
51
|
+
* See {@link https://www.prisma.io/docs/orm/prisma-client/special-fields-and-types/null-and-undefined Prisma docs: null vs undefined}
|
|
52
|
+
*/
|
|
53
|
+
export declare function removeNulls<T extends object>(input: T): RemoveNulls<T>;
|
|
36
54
|
//# sourceMappingURL=transforms.d.ts.map
|
package/dist/transforms.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["../src/transforms.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAKtD,MAAM,WAAW,cAAc,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACzD,QAAQ,EAAE,KAAK,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,GAAG,CAAA;CACX;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,oBAAoB,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M,CAAC,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;CAC3E,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAiBtE"}
|
package/dist/transforms.js
CHANGED
|
@@ -131,16 +131,18 @@ async function normalizeRequest(event) {
|
|
|
131
131
|
jsonBody
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
input[key] = removeNulls(input[key]);
|
|
140
|
-
}
|
|
134
|
+
function removeNulls(input) {
|
|
135
|
+
if (Array.isArray(input)) {
|
|
136
|
+
return input.map(
|
|
137
|
+
(value) => value === null ? void 0 : value
|
|
138
|
+
);
|
|
141
139
|
}
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
const result = {};
|
|
141
|
+
for (const [key, value] of Object.entries(input)) {
|
|
142
|
+
result[key] = value === null ? void 0 : value;
|
|
143
|
+
}
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
144
146
|
export {
|
|
145
147
|
isFetchApiRequest,
|
|
146
148
|
normalizeRequest,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.test-d.d.ts","sourceRoot":"","sources":["../../../src/webhooks/__tests__/webhooks.test-d.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/api",
|
|
3
|
-
"version": "8.0.0-canary.
|
|
3
|
+
"version": "8.0.0-canary.3400",
|
|
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": "8.0.0-canary.
|
|
87
|
+
"@cedarjs/framework-tools": "8.0.0-canary.3400",
|
|
88
88
|
"@types/aws-lambda": "8.10.164",
|
|
89
89
|
"@types/jsonwebtoken": "9.0.10",
|
|
90
90
|
"@types/memjs": "1",
|