diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest index c9a5e57b6c..94c6843dec 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest @@ -168,7 +168,6 @@ waspBuild/.wasp/build/sdk/wasp/ext-src/MainPage.jsx waspBuild/.wasp/build/sdk/wasp/ext-src/vite-env.d.ts waspBuild/.wasp/build/sdk/wasp/ext-src/waspLogo.png waspBuild/.wasp/build/sdk/wasp/package.json -waspBuild/.wasp/build/sdk/wasp/prisma-runtime-library.d.ts waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts waspBuild/.wasp/build/sdk/wasp/server/_types/index.ts waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts @@ -396,7 +395,6 @@ waspBuild/.wasp/out/sdk/wasp/ext-src/MainPage.jsx waspBuild/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts waspBuild/.wasp/out/sdk/wasp/ext-src/waspLogo.png waspBuild/.wasp/out/sdk/wasp/package.json -waspBuild/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts waspBuild/.wasp/out/sdk/wasp/server/_types/index.ts waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums index b0152c2820..efb6c45681 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums @@ -202,13 +202,6 @@ ], "529cb0efdb649a8bd61c7ab20b35b67366d66c8ed69a15b44be1bbeb7aac7842" ], - [ - [ - "file", - "../out/sdk/wasp/prisma-runtime-library.d.ts" - ], - "bc799a9bc3d16398433c97639a02c138b69682d64c627b0b04104ab430714148" - ], [ [ "file", @@ -340,7 +333,7 @@ "file", "../out/sdk/wasp/universal/types.ts" ], - "be0d749bf9ae2f44ca2c281e0fb65c4d30c1d07e375ba38407e6c4fa1f05cc87" + "60313eafaf4f2c7adc3f21706f6c9fd595d2bf6ff7c479df5a7431b25acf7481" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts index f92092c8ce..43143671be 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts @@ -5,3 +5,8 @@ export type _Awaited = T extends Promise ? _Awaited : T; export type _ReturnType unknown> = T extends (...args: never[]) => infer R ? R : never; export type Tail = T extends [unknown, ...infer R] ? R : never; export type IfAny = 0 extends (1 & Value) ? Then : Else; +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object ? RecursiveInterfaceToType : _DistributiveInterfaceToType; +}; +type _DistributiveInterfaceToType = T extends unknown ? RecursiveInterfaceToType : never; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/prisma-runtime-library.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/prisma-runtime-library.d.ts deleted file mode 100644 index c93423b579..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/prisma-runtime-library.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Without this import, Prisma types are resolved incorrectly. -import * as runtime from '@prisma/client/runtime'; - -// Prisma generated types which we use as default input and output types for CRUD -// operations internally use interfaces for some types. -// Our SuperJSON serialization types throw a type error when used with interfaces -// because interfaces don't have a index signature. -// We augment the Prisma generated types to have an index signature. -// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 -declare module '@prisma/client/runtime/library.js' { - export interface FieldRef { - [key: string]: any; - } -} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/types.ts index 46077a0e2e..afa82c2c45 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/types.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/types.ts @@ -37,3 +37,20 @@ export type Tail = T extends [unknown, ...inf // Source: https://stackoverflow.com/a/55541672 export type IfAny = 0 extends (1 & Value) ? Then : Else; + +// Prisma generated types which we use as default input and output types for CRUD +// operations internally use interfaces for some types. +// Our SuperJSON serialization types throw a type error when used with interfaces +// because interfaces don't have a index signature. +// We augment the Prisma generated types to have an index signature. +// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object + ? RecursiveInterfaceToType + : _DistributiveInterfaceToType +} + +// Applies the RecursiveInterfaceToType to all types in a union +type _DistributiveInterfaceToType = T extends unknown + ? RecursiveInterfaceToType + : never diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.d.ts index f92092c8ce..43143671be 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.d.ts @@ -5,3 +5,8 @@ export type _Awaited = T extends Promise ? _Awaited : T; export type _ReturnType unknown> = T extends (...args: never[]) => infer R ? R : never; export type Tail = T extends [unknown, ...infer R] ? R : never; export type IfAny = 0 extends (1 & Value) ? Then : Else; +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object ? RecursiveInterfaceToType : _DistributiveInterfaceToType; +}; +type _DistributiveInterfaceToType = T extends unknown ? RecursiveInterfaceToType : never; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts deleted file mode 100644 index c93423b579..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Without this import, Prisma types are resolved incorrectly. -import * as runtime from '@prisma/client/runtime'; - -// Prisma generated types which we use as default input and output types for CRUD -// operations internally use interfaces for some types. -// Our SuperJSON serialization types throw a type error when used with interfaces -// because interfaces don't have a index signature. -// We augment the Prisma generated types to have an index signature. -// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 -declare module '@prisma/client/runtime/library.js' { - export interface FieldRef { - [key: string]: any; - } -} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/types.ts index 46077a0e2e..afa82c2c45 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/types.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/types.ts @@ -37,3 +37,20 @@ export type Tail = T extends [unknown, ...inf // Source: https://stackoverflow.com/a/55541672 export type IfAny = 0 extends (1 & Value) ? Then : Else; + +// Prisma generated types which we use as default input and output types for CRUD +// operations internally use interfaces for some types. +// Our SuperJSON serialization types throw a type error when used with interfaces +// because interfaces don't have a index signature. +// We augment the Prisma generated types to have an index signature. +// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object + ? RecursiveInterfaceToType + : _DistributiveInterfaceToType +} + +// Applies the RecursiveInterfaceToType to all types in a union +type _DistributiveInterfaceToType = T extends unknown + ? RecursiveInterfaceToType + : never diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest index ec7c412b7c..4179789f16 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest @@ -167,7 +167,6 @@ waspCompile/.wasp/out/sdk/wasp/ext-src/MainPage.jsx waspCompile/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts waspCompile/.wasp/out/sdk/wasp/ext-src/waspLogo.png waspCompile/.wasp/out/sdk/wasp/package.json -waspCompile/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts waspCompile/.wasp/out/sdk/wasp/server/_types/index.ts waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums index 223ff22cfd..a56c0fc037 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums @@ -202,13 +202,6 @@ ], "529cb0efdb649a8bd61c7ab20b35b67366d66c8ed69a15b44be1bbeb7aac7842" ], - [ - [ - "file", - "../out/sdk/wasp/prisma-runtime-library.d.ts" - ], - "bc799a9bc3d16398433c97639a02c138b69682d64c627b0b04104ab430714148" - ], [ [ "file", @@ -340,7 +333,7 @@ "file", "../out/sdk/wasp/universal/types.ts" ], - "be0d749bf9ae2f44ca2c281e0fb65c4d30c1d07e375ba38407e6c4fa1f05cc87" + "60313eafaf4f2c7adc3f21706f6c9fd595d2bf6ff7c479df5a7431b25acf7481" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.d.ts index f92092c8ce..43143671be 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.d.ts @@ -5,3 +5,8 @@ export type _Awaited = T extends Promise ? _Awaited : T; export type _ReturnType unknown> = T extends (...args: never[]) => infer R ? R : never; export type Tail = T extends [unknown, ...infer R] ? R : never; export type IfAny = 0 extends (1 & Value) ? Then : Else; +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object ? RecursiveInterfaceToType : _DistributiveInterfaceToType; +}; +type _DistributiveInterfaceToType = T extends unknown ? RecursiveInterfaceToType : never; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts deleted file mode 100644 index c93423b579..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Without this import, Prisma types are resolved incorrectly. -import * as runtime from '@prisma/client/runtime'; - -// Prisma generated types which we use as default input and output types for CRUD -// operations internally use interfaces for some types. -// Our SuperJSON serialization types throw a type error when used with interfaces -// because interfaces don't have a index signature. -// We augment the Prisma generated types to have an index signature. -// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 -declare module '@prisma/client/runtime/library.js' { - export interface FieldRef { - [key: string]: any; - } -} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/types.ts index 46077a0e2e..afa82c2c45 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/types.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/types.ts @@ -37,3 +37,20 @@ export type Tail = T extends [unknown, ...inf // Source: https://stackoverflow.com/a/55541672 export type IfAny = 0 extends (1 & Value) ? Then : Else; + +// Prisma generated types which we use as default input and output types for CRUD +// operations internally use interfaces for some types. +// Our SuperJSON serialization types throw a type error when used with interfaces +// because interfaces don't have a index signature. +// We augment the Prisma generated types to have an index signature. +// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object + ? RecursiveInterfaceToType + : _DistributiveInterfaceToType +} + +// Applies the RecursiveInterfaceToType to all types in a union +type _DistributiveInterfaceToType = T extends unknown + ? RecursiveInterfaceToType + : never diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest index 1cca8a12a5..6ea2d6db28 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest @@ -390,7 +390,6 @@ waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/queries/bar.js waspComplexTest/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts waspComplexTest/.wasp/out/sdk/wasp/ext-src/waspLogo.png waspComplexTest/.wasp/out/sdk/wasp/package.json -waspComplexTest/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts waspComplexTest/.wasp/out/sdk/wasp/server/_types/index.ts waspComplexTest/.wasp/out/sdk/wasp/server/_types/serialization.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums index 58122aeafb..ab1141f0e0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums @@ -489,13 +489,6 @@ ], "865b586bae503309553b1f897b264a4a888400919e509b906047ec972c9b22a0" ], - [ - [ - "file", - "../out/sdk/wasp/prisma-runtime-library.d.ts" - ], - "bc799a9bc3d16398433c97639a02c138b69682d64c627b0b04104ab430714148" - ], [ [ "file", @@ -571,7 +564,7 @@ "file", "../out/sdk/wasp/server/crud/tasks.ts" ], - "f7f842a5d84e29fc897288adc80760c2c3f4a2e24c365a64cfe0b4a33f852b8c" + "a5064680bdf6b5809ffa436dbd412b738a0755185f52d30601092c9bed1027f5" ], [ [ @@ -760,7 +753,7 @@ "file", "../out/sdk/wasp/universal/types.ts" ], - "be0d749bf9ae2f44ca2c281e0fb65c4d30c1d07e375ba38407e6c4fa1f05cc87" + "60313eafaf4f2c7adc3f21706f6c9fd595d2bf6ff7c479df5a7431b25acf7481" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts index b6edb7895c..206ab8b9c8 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts @@ -2,7 +2,25 @@ import { GetQueryResolved, GetAllQueryResolved } from 'wasp/server/crud/tasks'; export declare const tasks: { get: { query: import("../operations/queries/core.js").QueryFor; - useQuery: (queryFnArgs?: import(".prisma/client").Prisma.TaskWhereUniqueInput, options?: any) => import("@tanstack/react-query").UseQueryResult<{ + useQuery: (queryFnArgs?: import("../../universal/types.js").RecursiveInterfaceToType<{ + id: number; + } & { + id?: number; + AND?: import(".prisma/client").Prisma.TaskWhereInput | import(".prisma/client").Prisma.TaskWhereInput[]; + OR?: import(".prisma/client").Prisma.TaskWhereInput[]; + NOT?: import(".prisma/client").Prisma.TaskWhereInput | import(".prisma/client").Prisma.TaskWhereInput[]; + description?: import(".prisma/client").Prisma.StringFilter<"Task"> | string; + isDone?: import(".prisma/client").Prisma.BoolFilter<"Task"> | boolean; + }> | import("../../universal/types.js").RecursiveInterfaceToType<{ + id: number; + } & { + id?: number; + AND?: import(".prisma/client").Prisma.TaskWhereInput | import(".prisma/client").Prisma.TaskWhereInput[]; + OR?: import(".prisma/client").Prisma.TaskWhereInput[]; + NOT?: import(".prisma/client").Prisma.TaskWhereInput | import(".prisma/client").Prisma.TaskWhereInput[]; + description?: import(".prisma/client").Prisma.StringFilter<"Task"> | string; + isDone?: import(".prisma/client").Prisma.BoolFilter<"Task"> | boolean; + }>, options?: any) => import("@tanstack/react-query").UseQueryResult<{ id: number; description: string; isDone: boolean; @@ -17,14 +35,14 @@ export declare const tasks: { }[], Error>; }; create: { - action: (args: (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput)) => Promise<{ + action: (args: import("../../universal/types.js").RecursiveInterfaceToType & import(".prisma/client").Prisma.TaskUncheckedCreateInput> | import("../../universal/types.js").RecursiveInterfaceToType & import(".prisma/client").Prisma.TaskCreateInput>) => Promise<{ id: number; description: string; isDone: boolean; }>; useAction: (actionOptions?: { - optimisticUpdates: import("../operations/hooks.js").OptimisticUpdateDefinition<(import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput), any>[]; - }) => (args: (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput)) => Promise<{ + optimisticUpdates: import("../operations/hooks.js").OptimisticUpdateDefinition & import(".prisma/client").Prisma.TaskUncheckedCreateInput> | import("../../universal/types.js").RecursiveInterfaceToType & import(".prisma/client").Prisma.TaskCreateInput>, any>[]; + }) => (args: import("../../universal/types.js").RecursiveInterfaceToType & import(".prisma/client").Prisma.TaskUncheckedCreateInput> | import("../../universal/types.js").RecursiveInterfaceToType & import(".prisma/client").Prisma.TaskCreateInput>) => Promise<{ id: number; description: string; isDone: boolean; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.d.ts index b8541b611f..d333573b2a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.d.ts @@ -1,6 +1,7 @@ import type { AuthenticatedActionDefinition, AuthenticatedQueryDefinition, _Task } from "../_types"; import type { Prisma } from "@prisma/client"; import type { Payload } from "../_types/serialization"; +import type { RecursiveInterfaceToType } from "../../universal/types"; import type { Task } from "wasp/entities"; type _WaspEntityTagged = _Task; type _WaspEntity = Task; @@ -21,10 +22,10 @@ export declare namespace tasks { type GetAllInput = {}; type GetAllOutput = _WaspEntity[]; export type GetAllQueryResolved = tasks.GetAllQuery; -type GetInput = Prisma.TaskWhereUniqueInput; +type GetInput = RecursiveInterfaceToType; type GetOutput = _WaspEntity | null; export type GetQueryResolved = tasks.GetQuery; -type CreateInput = Prisma.XOR; +type CreateInput = RecursiveInterfaceToType>; type CreateOutput = _WaspEntity; export type CreateActionResolved = tasks.CreateAction; export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts index 1d0f16f97d..2c78bb2f84 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts @@ -1,3 +1,3 @@ import Prisma from '@prisma/client'; -declare const dbClient: Prisma.PrismaClient; +declare const dbClient: Prisma.PrismaClient; export default dbClient; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts index 391dcfc649..327e428ebf 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts @@ -1,14 +1,14 @@ import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; import { type JobFn } from 'wasp/server/jobs/core/pgBoss'; declare const entities: { - User: import(".prisma/client").Prisma.UserDelegate; + User: import(".prisma/client").Prisma.UserDelegate; }; export type ReturnHelloJob = JobFn; export declare const returnHelloJob: { readonly defaultJobOptions: Parameters[2]; readonly startAfter: number | string | Date; readonly entities: { - User: import(".prisma/client").Prisma.UserDelegate; + User: import(".prisma/client").Prisma.UserDelegate; }; readonly jobSchedule: { cron: Parameters[1]; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.d.ts index f92092c8ce..43143671be 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.d.ts @@ -5,3 +5,8 @@ export type _Awaited = T extends Promise ? _Awaited : T; export type _ReturnType unknown> = T extends (...args: never[]) => infer R ? R : never; export type Tail = T extends [unknown, ...infer R] ? R : never; export type IfAny = 0 extends (1 & Value) ? Then : Else; +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object ? RecursiveInterfaceToType : _DistributiveInterfaceToType; +}; +type _DistributiveInterfaceToType = T extends unknown ? RecursiveInterfaceToType : never; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts deleted file mode 100644 index c93423b579..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Without this import, Prisma types are resolved incorrectly. -import * as runtime from '@prisma/client/runtime'; - -// Prisma generated types which we use as default input and output types for CRUD -// operations internally use interfaces for some types. -// Our SuperJSON serialization types throw a type error when used with interfaces -// because interfaces don't have a index signature. -// We augment the Prisma generated types to have an index signature. -// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 -declare module '@prisma/client/runtime/library.js' { - export interface FieldRef { - [key: string]: any; - } -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/tasks.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/tasks.ts index 7bef8c911e..72f5653c84 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/tasks.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/tasks.ts @@ -5,6 +5,7 @@ import type { } from "../_types"; import type { Prisma } from "@prisma/client"; import type { Payload } from "../_types/serialization"; +import type { RecursiveInterfaceToType } from "../../universal/types"; import type { Task, } from "wasp/entities"; @@ -35,14 +36,14 @@ type GetAllInput = {} type GetAllOutput = _WaspEntity[] export type GetAllQueryResolved = tasks.GetAllQuery -type GetInput = Prisma.TaskWhereUniqueInput +type GetInput = RecursiveInterfaceToType type GetOutput = _WaspEntity | null export type GetQueryResolved = tasks.GetQuery -type CreateInput = Prisma.XOR< +type CreateInput = RecursiveInterfaceToType +>> type CreateOutput = _WaspEntity export type CreateActionResolved = tasks.CreateAction diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/types.ts index 46077a0e2e..afa82c2c45 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/types.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/types.ts @@ -37,3 +37,20 @@ export type Tail = T extends [unknown, ...inf // Source: https://stackoverflow.com/a/55541672 export type IfAny = 0 extends (1 & Value) ? Then : Else; + +// Prisma generated types which we use as default input and output types for CRUD +// operations internally use interfaces for some types. +// Our SuperJSON serialization types throw a type error when used with interfaces +// because interfaces don't have a index signature. +// We augment the Prisma generated types to have an index signature. +// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object + ? RecursiveInterfaceToType + : _DistributiveInterfaceToType +} + +// Applies the RecursiveInterfaceToType to all types in a union +type _DistributiveInterfaceToType = T extends unknown + ? RecursiveInterfaceToType + : never diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest index 414cb3516b..7ed0ed09af 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest @@ -193,7 +193,6 @@ waspJob/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js waspJob/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts waspJob/.wasp/out/sdk/wasp/ext-src/waspLogo.png waspJob/.wasp/out/sdk/wasp/package.json -waspJob/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts waspJob/.wasp/out/sdk/wasp/server/HttpError.ts waspJob/.wasp/out/sdk/wasp/server/_types/index.ts waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums index 6e88431526..d043b8384f 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums @@ -209,13 +209,6 @@ ], "f8c7a28c0bb698259c715aeb5c3aa6e30860005c915431f96bc2df09d319b3e9" ], - [ - [ - "file", - "../out/sdk/wasp/prisma-runtime-library.d.ts" - ], - "bc799a9bc3d16398433c97639a02c138b69682d64c627b0b04104ab430714148" - ], [ [ "file", @@ -396,7 +389,7 @@ "file", "../out/sdk/wasp/universal/types.ts" ], - "be0d749bf9ae2f44ca2c281e0fb65c4d30c1d07e375ba38407e6c4fa1f05cc87" + "60313eafaf4f2c7adc3f21706f6c9fd595d2bf6ff7c479df5a7431b25acf7481" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.d.ts index f92092c8ce..43143671be 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.d.ts @@ -5,3 +5,8 @@ export type _Awaited = T extends Promise ? _Awaited : T; export type _ReturnType unknown> = T extends (...args: never[]) => infer R ? R : never; export type Tail = T extends [unknown, ...infer R] ? R : never; export type IfAny = 0 extends (1 & Value) ? Then : Else; +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object ? RecursiveInterfaceToType : _DistributiveInterfaceToType; +}; +type _DistributiveInterfaceToType = T extends unknown ? RecursiveInterfaceToType : never; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts deleted file mode 100644 index c93423b579..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Without this import, Prisma types are resolved incorrectly. -import * as runtime from '@prisma/client/runtime'; - -// Prisma generated types which we use as default input and output types for CRUD -// operations internally use interfaces for some types. -// Our SuperJSON serialization types throw a type error when used with interfaces -// because interfaces don't have a index signature. -// We augment the Prisma generated types to have an index signature. -// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 -declare module '@prisma/client/runtime/library.js' { - export interface FieldRef { - [key: string]: any; - } -} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/types.ts index 46077a0e2e..afa82c2c45 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/types.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/types.ts @@ -37,3 +37,20 @@ export type Tail = T extends [unknown, ...inf // Source: https://stackoverflow.com/a/55541672 export type IfAny = 0 extends (1 & Value) ? Then : Else; + +// Prisma generated types which we use as default input and output types for CRUD +// operations internally use interfaces for some types. +// Our SuperJSON serialization types throw a type error when used with interfaces +// because interfaces don't have a index signature. +// We augment the Prisma generated types to have an index signature. +// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object + ? RecursiveInterfaceToType + : _DistributiveInterfaceToType +} + +// Applies the RecursiveInterfaceToType to all types in a union +type _DistributiveInterfaceToType = T extends unknown + ? RecursiveInterfaceToType + : never diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest index d13ce87b9f..61f55a7a94 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest @@ -171,7 +171,6 @@ waspMigrate/.wasp/out/sdk/wasp/ext-src/MainPage.jsx waspMigrate/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts waspMigrate/.wasp/out/sdk/wasp/ext-src/waspLogo.png waspMigrate/.wasp/out/sdk/wasp/package.json -waspMigrate/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts waspMigrate/.wasp/out/sdk/wasp/server/_types/index.ts waspMigrate/.wasp/out/sdk/wasp/server/_types/serialization.ts diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums index 1f0c2ee72c..4e5cf3c552 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums @@ -202,13 +202,6 @@ ], "529cb0efdb649a8bd61c7ab20b35b67366d66c8ed69a15b44be1bbeb7aac7842" ], - [ - [ - "file", - "../out/sdk/wasp/prisma-runtime-library.d.ts" - ], - "bc799a9bc3d16398433c97639a02c138b69682d64c627b0b04104ab430714148" - ], [ [ "file", @@ -340,7 +333,7 @@ "file", "../out/sdk/wasp/universal/types.ts" ], - "be0d749bf9ae2f44ca2c281e0fb65c4d30c1d07e375ba38407e6c4fa1f05cc87" + "60313eafaf4f2c7adc3f21706f6c9fd595d2bf6ff7c479df5a7431b25acf7481" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts index 1d0f16f97d..2c78bb2f84 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts @@ -1,3 +1,3 @@ import Prisma from '@prisma/client'; -declare const dbClient: Prisma.PrismaClient; +declare const dbClient: Prisma.PrismaClient; export default dbClient; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.d.ts index f92092c8ce..43143671be 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.d.ts @@ -5,3 +5,8 @@ export type _Awaited = T extends Promise ? _Awaited : T; export type _ReturnType unknown> = T extends (...args: never[]) => infer R ? R : never; export type Tail = T extends [unknown, ...infer R] ? R : never; export type IfAny = 0 extends (1 & Value) ? Then : Else; +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object ? RecursiveInterfaceToType : _DistributiveInterfaceToType; +}; +type _DistributiveInterfaceToType = T extends unknown ? RecursiveInterfaceToType : never; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts deleted file mode 100644 index c93423b579..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/prisma-runtime-library.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Without this import, Prisma types are resolved incorrectly. -import * as runtime from '@prisma/client/runtime'; - -// Prisma generated types which we use as default input and output types for CRUD -// operations internally use interfaces for some types. -// Our SuperJSON serialization types throw a type error when used with interfaces -// because interfaces don't have a index signature. -// We augment the Prisma generated types to have an index signature. -// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 -declare module '@prisma/client/runtime/library.js' { - export interface FieldRef { - [key: string]: any; - } -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/types.ts index 46077a0e2e..afa82c2c45 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/types.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/types.ts @@ -37,3 +37,20 @@ export type Tail = T extends [unknown, ...inf // Source: https://stackoverflow.com/a/55541672 export type IfAny = 0 extends (1 & Value) ? Then : Else; + +// Prisma generated types which we use as default input and output types for CRUD +// operations internally use interfaces for some types. +// Our SuperJSON serialization types throw a type error when used with interfaces +// because interfaces don't have a index signature. +// We augment the Prisma generated types to have an index signature. +// Read more https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1320528385 +export type RecursiveInterfaceToType = { + [K in keyof T]: T[K] extends object + ? RecursiveInterfaceToType + : _DistributiveInterfaceToType +} + +// Applies the RecursiveInterfaceToType to all types in a union +type _DistributiveInterfaceToType = T extends unknown + ? RecursiveInterfaceToType + : never