@cedarjs/api 8.0.0-canary.3587 → 8.0.0-canary.3589
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergePrismaWithSdlTypes.test-d.d.ts","sourceRoot":"","sources":["../../src/__tests__/mergePrismaWithSdlTypes.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.1";
|
|
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.3589";
|
|
12
|
+
const cedarjsVersion = "8.0.0-canary.3589";
|
|
13
|
+
const cedarVersion = "8.0.0-canary.3589";
|
|
14
14
|
export {
|
|
15
15
|
cedarVersion,
|
|
16
16
|
cedarjsVersion,
|
package/dist/types.d.ts
CHANGED
|
@@ -8,18 +8,28 @@ import type { O, A } from 'ts-toolbelt';
|
|
|
8
8
|
* Prisma types is source of truth for VALUES (unless SDL-only field)
|
|
9
9
|
*/
|
|
10
10
|
type AnyObject = Record<string | symbol | number, unknown>;
|
|
11
|
-
type SdlOnlyFields<TPrisma, TSdl> = Omit<TSdl, keyof TPrisma
|
|
11
|
+
type SdlOnlyFields<TPrisma, TSdl, TResolved extends PropertyKey> = Omit<TSdl, keyof TPrisma | TResolved> & {
|
|
12
|
+
[k in Exclude<Extract<keyof TSdl, TResolved>, keyof TPrisma>]?: TSdl[k];
|
|
13
|
+
};
|
|
12
14
|
type PrismaTypeWithOptionalKeysFromSdl<TPrisma extends AnyObject, TSdl extends AnyObject> = Pick<TPrisma, O.OptionalKeys<TSdl>>;
|
|
13
15
|
type PrismaTypeWithOptionalKeysAndNullableValues<TPrisma extends AnyObject, TSdl extends AnyObject> = {
|
|
14
16
|
[k in keyof PrismaTypeWithOptionalKeysFromSdl<TPrisma, TSdl>]?: PrismaTypeWithOptionalKeysFromSdl<TPrisma, TSdl>[k] | null;
|
|
15
17
|
};
|
|
16
|
-
type PrismaTypeWithRequiredKeysFromSdl<TPrisma extends AnyObject, TSdl extends AnyObject> = Pick<TPrisma, O.RequiredKeys<TSdl>>;
|
|
17
|
-
type OptionalsAndSdlOnly<TPrisma extends AnyObject, TSdl extends AnyObject> = PrismaTypeWithOptionalKeysAndNullableValues<TPrisma, TSdl> & SdlOnlyFields<TPrisma, TSdl>;
|
|
18
|
+
type PrismaTypeWithRequiredKeysFromSdl<TPrisma extends AnyObject, TSdl extends AnyObject> = Pick<TPrisma, Extract<O.RequiredKeys<TSdl>, keyof TPrisma>>;
|
|
19
|
+
type OptionalsAndSdlOnly<TPrisma extends AnyObject, TSdl extends AnyObject, TResolved extends PropertyKey> = PrismaTypeWithOptionalKeysAndNullableValues<TPrisma, TSdl> & SdlOnlyFields<TPrisma, TSdl, TResolved>;
|
|
18
20
|
export type MakeRelationsOptional<T, TAllMappedModels> = {
|
|
19
21
|
[key in keyof T as T[key] extends TAllMappedModels ? key : never]?: MakeRelationsOptional<T[key], TAllMappedModels>;
|
|
20
22
|
} & {
|
|
21
23
|
[key in keyof T as T[key] extends TAllMappedModels ? never : key]: T[key];
|
|
22
24
|
};
|
|
23
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The type resolvers return for a GraphQL type that's backed by a Prisma model.
|
|
27
|
+
*
|
|
28
|
+
* `TResolved` is the union of field names the type's field resolvers (the
|
|
29
|
+
* service export named after the type) provide. SDL-only fields in that union
|
|
30
|
+
* are optional. Fields that also exist on the Prisma model stay as Prisma
|
|
31
|
+
* types them, because their field resolvers read them from `root`.
|
|
32
|
+
*/
|
|
33
|
+
export type MergePrismaWithSdlTypes<TPrisma extends AnyObject, TSdl extends AnyObject, TAllMappedModels, TResolved extends PropertyKey = never> = A.Compute<OptionalsAndSdlOnly<TPrisma, MakeRelationsOptional<TSdl, TAllMappedModels>, TResolved> & PrismaTypeWithRequiredKeysFromSdl<TPrisma, MakeRelationsOptional<TSdl, TAllMappedModels>>>;
|
|
24
34
|
export {};
|
|
25
35
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;GAIG;AAEH,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;GAIG;AAEH,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAA;AAI1D,KAAK,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,SAAS,WAAW,IAAI,IAAI,CACrE,IAAI,EACJ,MAAM,OAAO,GAAG,SAAS,CAC1B,GAAG;KACD,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;CACxE,CAAA;AAGD,KAAK,iCAAiC,CACpC,OAAO,SAAS,SAAS,EACzB,IAAI,SAAS,SAAS,IACpB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA;AAGvC,KAAK,2CAA2C,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C,SAAS,CACV,GACC,iCAAiC,CAC/B,OAAO,EACP,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAC9C,CACJ,CAAA"}
|
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.3589",
|
|
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.3589",
|
|
88
88
|
"@prisma/client": "7.10.1",
|
|
89
89
|
"@types/aws-lambda": "8.10.164",
|
|
90
90
|
"@types/memjs": "1",
|