Fix TypeScript compilation issues in packages
- Add explicit type annotations for isolatedDeclarations - Export Database type alias from db-schema - Fix import paths and add proper type exports - Update common schemas with better exports Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,41 +1,41 @@
|
||||
import { oc } from "@orpc/contract";
|
||||
import { z } from "zod";
|
||||
import {
|
||||
signupInputSchema,
|
||||
verifyEmailInputSchema,
|
||||
loginRequestInputSchema,
|
||||
loginRequestOutputSchema,
|
||||
loginPasswordInputSchema,
|
||||
loginStatusOutputSchema,
|
||||
forgotPasswordInputSchema,
|
||||
resetPasswordInputSchema,
|
||||
} from "./schemas/auth.js";
|
||||
import {
|
||||
userProfileSchema,
|
||||
setupProfileInputSchema,
|
||||
updateProfileInputSchema,
|
||||
setPasswordInputSchema,
|
||||
passkeyOutputSchema,
|
||||
sessionOutputSchema,
|
||||
deviceOutputSchema,
|
||||
trustDeviceInputSchema,
|
||||
} from "./schemas/user.js";
|
||||
import {
|
||||
createOrgInputSchema,
|
||||
orgOutputSchema,
|
||||
orgMemberOutputSchema,
|
||||
updateMemberRoleInputSchema,
|
||||
createInviteInputSchema,
|
||||
orgInviteOutputSchema,
|
||||
orgSiteOutputSchema,
|
||||
} from "./schemas/org.js";
|
||||
import {
|
||||
adminAddSiteInputSchema,
|
||||
adminCreateOrgInputSchema,
|
||||
adminCreateUserInputSchema,
|
||||
adminUpdateUserInputSchema,
|
||||
adminAddSiteInputSchema,
|
||||
} from "./schemas/admin.js";
|
||||
import {
|
||||
forgotPasswordInputSchema,
|
||||
loginPasswordInputSchema,
|
||||
loginRequestInputSchema,
|
||||
loginRequestOutputSchema,
|
||||
loginStatusOutputSchema,
|
||||
resetPasswordInputSchema,
|
||||
signupInputSchema,
|
||||
verifyEmailInputSchema,
|
||||
} from "./schemas/auth.js";
|
||||
import { emailSchema, slugSchema } from "./schemas/common.js";
|
||||
import {
|
||||
createInviteInputSchema,
|
||||
createOrgInputSchema,
|
||||
orgInviteOutputSchema,
|
||||
orgMemberOutputSchema,
|
||||
orgOutputSchema,
|
||||
orgSiteOutputSchema,
|
||||
updateMemberRoleInputSchema,
|
||||
} from "./schemas/org.js";
|
||||
import {
|
||||
deviceOutputSchema,
|
||||
passkeyOutputSchema,
|
||||
sessionOutputSchema,
|
||||
setPasswordInputSchema,
|
||||
setupProfileInputSchema,
|
||||
trustDeviceInputSchema,
|
||||
updateProfileInputSchema,
|
||||
userProfileSchema,
|
||||
} from "./schemas/user.js";
|
||||
|
||||
/**
|
||||
* oRPC API Contract for the Publisher Dashboard
|
||||
@@ -73,28 +73,28 @@ export const contract = oc.router({
|
||||
z.object({
|
||||
challengeId: z.number(),
|
||||
options: z.any(), // PublicKeyCredentialCreationOptionsJSON
|
||||
})
|
||||
}),
|
||||
),
|
||||
verifyRegistration: oc
|
||||
.input(
|
||||
z.object({
|
||||
challengeId: z.number(),
|
||||
response: z.any(), // RegistrationResponseJSON
|
||||
})
|
||||
}),
|
||||
)
|
||||
.output(z.void()),
|
||||
createAuthenticationOptions: oc.output(
|
||||
z.object({
|
||||
challengeId: z.number(),
|
||||
options: z.any(), // PublicKeyCredentialRequestOptionsJSON
|
||||
})
|
||||
}),
|
||||
),
|
||||
verifyAuthentication: oc
|
||||
.input(
|
||||
z.object({
|
||||
challengeId: z.number(),
|
||||
response: z.any(), // AuthenticationResponseJSON
|
||||
})
|
||||
}),
|
||||
)
|
||||
.output(z.void()),
|
||||
}),
|
||||
@@ -110,27 +110,31 @@ export const contract = oc.router({
|
||||
// Authentication settings
|
||||
setPassword: oc.input(setPasswordInputSchema).output(z.void()),
|
||||
listPasskeys: oc.output(z.array(passkeyOutputSchema)),
|
||||
createPasskey: oc
|
||||
.input(z.object({ name: z.string() }))
|
||||
.output(
|
||||
z.object({
|
||||
challengeId: z.number(),
|
||||
options: z.any(), // PublicKeyCredentialCreationOptionsJSON
|
||||
})
|
||||
),
|
||||
createPasskey: oc.input(z.object({ name: z.string() })).output(
|
||||
z.object({
|
||||
challengeId: z.number(),
|
||||
options: z.any(), // PublicKeyCredentialCreationOptionsJSON
|
||||
}),
|
||||
),
|
||||
renamePasskey: oc
|
||||
.input(z.object({ passkeyId: z.number(), name: z.string() }))
|
||||
.output(z.void()),
|
||||
deletePasskey: oc.input(z.object({ passkeyId: z.number() })).output(z.void()),
|
||||
deletePasskey: oc
|
||||
.input(z.object({ passkeyId: z.number() }))
|
||||
.output(z.void()),
|
||||
|
||||
// Sessions & devices
|
||||
listSessions: oc.output(z.array(sessionOutputSchema)),
|
||||
revokeSession: oc.input(z.object({ sessionId: z.number() })).output(z.void()),
|
||||
revokeSession: oc
|
||||
.input(z.object({ sessionId: z.number() }))
|
||||
.output(z.void()),
|
||||
revokeAllSessions: oc.output(z.void()),
|
||||
getDeviceInfo: oc.output(deviceOutputSchema),
|
||||
trustDevice: oc.input(trustDeviceInputSchema).output(z.void()),
|
||||
listTrustedDevices: oc.output(z.array(deviceOutputSchema)),
|
||||
untrustDevice: oc.input(z.object({ deviceId: z.number() })).output(z.void()),
|
||||
untrustDevice: oc
|
||||
.input(z.object({ deviceId: z.number() }))
|
||||
.output(z.void()),
|
||||
revokeAllTrustedDevices: oc.output(z.void()),
|
||||
}),
|
||||
|
||||
@@ -147,7 +151,7 @@ export const contract = oc.router({
|
||||
slug: slugSchema,
|
||||
displayName: z.string().optional(),
|
||||
logoUrl: z.string().optional(),
|
||||
})
|
||||
}),
|
||||
)
|
||||
.output(z.void()),
|
||||
delete: oc.input(z.object({ slug: slugSchema })).output(z.void()),
|
||||
@@ -198,7 +202,7 @@ export const contract = oc.router({
|
||||
slug: slugSchema,
|
||||
displayName: z.string().optional(),
|
||||
logoUrl: z.string().optional(),
|
||||
})
|
||||
}),
|
||||
)
|
||||
.output(z.void()),
|
||||
delete: oc.input(z.object({ slug: slugSchema })).output(z.void()),
|
||||
@@ -222,7 +226,9 @@ export const contract = oc.router({
|
||||
|
||||
// Admin auth management
|
||||
auth: oc.router({
|
||||
completeLogin: oc.input(z.object({ email: emailSchema })).output(z.void()),
|
||||
completeLogin: oc
|
||||
.input(z.object({ email: emailSchema }))
|
||||
.output(z.void()),
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user