Skip to content

Commit 8029635

Browse files
committed
Fix TypeScript errors
1 parent 962aae0 commit 8029635

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/provider.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { OAuth2Provider, OAuth2ProviderWithPKCE } from "arctic";
22

33
export function defineProvider<
4-
OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE
4+
OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE,
5+
const Id extends string
56
>({
67
id,
78
displayName,
89
oAuthClient,
910
}: {
10-
id: string;
11+
id: Id;
1112
displayName: string;
1213
oAuthClient: OAuthClient;
1314
}) {

waspc/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type _WaspEntity = {= crud.entityUpper =}
3737
/**
3838
* PUBLIC API
3939
*/
40-
export namespace {= crud.name =} {
40+
export declare namespace {= crud.name =} {
4141
{=# crud.operations.GetAll =}
4242
export type GetAllQuery<Input extends Payload = never, Output extends Payload = Payload> = {= queryType =}<[_WaspEntityTagged], Input, Output>
4343
{=/ crud.operations.GetAll =}
@@ -91,7 +91,7 @@ export type GetQueryResolved = typeof _waspGetQuery
9191

9292
{=# crud.operations.Create =}
9393
{=^ overrides.Create.isDefined =}
94-
type CreateInput = Prisma.XOR<
94+
type CreateInput = Payload & Prisma.XOR<
9595
Prisma.{= crud.entityUpper =}CreateInput,
9696
Prisma.{= crud.entityUpper =}UncheckedCreateInput
9797
>
@@ -106,7 +106,7 @@ export type CreateActionResolved = typeof _waspCreateAction
106106

107107
{=# crud.operations.Update =}
108108
{=^ overrides.Update.isDefined =}
109-
type UpdateInput = Prisma.XOR<
109+
type UpdateInput = Payload & Prisma.XOR<
110110
Prisma.{= crud.entityUpper =}UpdateInput,
111111
Prisma.{= crud.entityUpper =}UncheckedUpdateInput
112112
>
@@ -123,7 +123,7 @@ export type UpdateActionResolved = typeof _waspUpdateAction
123123

124124
{=# crud.operations.Delete =}
125125
{=^ overrides.Delete.isDefined =}
126-
type DeleteInput = Prisma.{= crud.entityUpper =}WhereUniqueInput
126+
type DeleteInput = Payload & Prisma.{= crud.entityUpper =}WhereUniqueInput
127127
type DeleteOutput = _WaspEntity
128128
export type DeleteActionResolved = {= crud.name =}.DeleteAction<DeleteInput, DeleteOutput>
129129
{=/ overrides.Delete.isDefined =}

waspc/data/Generator/templates/sdk/wasp/server/utils.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ type RequestWithExtraFields = Request & {
1919
* if given middleware returns promise, reject of that promise will be correctly handled,
2020
* meaning that error will be forwarded to next().
2121
*/
22-
export const handleRejection = (
22+
export const handleRejection = <Req extends Request = RequestWithExtraFields, Res extends Response = Response>(
2323
middleware: (
24-
req: RequestWithExtraFields,
25-
res: Response,
24+
req: Req,
25+
res: Res,
2626
next: NextFunction
2727
) => any
2828
) =>
29-
async (req: RequestWithExtraFields, res: Response, next: NextFunction) => {
29+
async (req: Req, res: Res, next: NextFunction) => {
3030
try {
3131
await middleware(req, res, next)
3232
} catch (error) {

0 commit comments

Comments
 (0)