UNPKG

@oberoncms/core

Version:

OberonCMS is a cloud deployable CMS written in typescript based on the Puck visual editor

1,125 lines 49 kB
import type { OberonBetterAuthAdapter, OberonSendAdapter } from "../lib/dtd"; export declare const cmsAuthBasePath = "/cms/api/auth"; export declare function createAuthOptions({ betterAuth: betterAuthAdapter, sendVerificationRequest, }: Pick<OberonSendAdapter, "sendVerificationRequest"> & { betterAuth?: OberonBetterAuthAdapter; }): { basePath: string; secret: string | undefined; user: { additionalFields: { role: { type: "string"; required: boolean; input: boolean; }; }; }; plugins: ({ id: "email-otp"; version: string; init(ctx: import("better-auth").AuthContext): { options: { emailVerification: { sendVerificationEmail(data: { user: import("better-auth").User; url: string; token: string; }, request: Request | undefined): Promise<void>; }; }; } | undefined; endpoints: { sendVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/send-verification-otp", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; type: import("zod").ZodEnum<{ "sign-in": "sign-in"; "change-email": "change-email"; "email-verification": "email-verification"; "forget-password": "forget-password"; }>; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; createVerificationOTP: import("better-auth").StrictEndpoint<string, { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; type: import("zod").ZodEnum<{ "sign-in": "sign-in"; "change-email": "change-email"; "email-verification": "email-verification"; "forget-password": "forget-password"; }>; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "string"; }; }; }; }; }; }; }; }, string>; getVerificationOTP: import("better-auth").StrictEndpoint<string, { method: "GET"; query: import("zod").ZodObject<{ email: import("zod").ZodString; type: import("zod").ZodEnum<{ "sign-in": "sign-in"; "change-email": "change-email"; "email-verification": "email-verification"; "forget-password": "forget-password"; }>; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { otp: { type: string; nullable: boolean; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { otp: null; } | { otp: string; }>; checkVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/check-verification-otp", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; type: import("zod").ZodEnum<{ "sign-in": "sign-in"; "change-email": "change-email"; "email-verification": "email-verification"; "forget-password": "forget-password"; }>; otp: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; verifyEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/verify-email", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; otp: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; description: string; enum: boolean[]; }; token: { type: string; nullable: boolean; description: string; }; user: { $ref: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { status: boolean; token: string; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record<string, any>; } | { status: boolean; token: null; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record<string, any>; }>; signInEmailOTP: import("better-auth").StrictEndpoint<"/sign-in/email-otp", { method: "POST"; body: import("zod").ZodIntersection<import("zod").ZodObject<{ email: import("zod").ZodString; otp: import("zod").ZodString; name: import("zod").ZodOptional<import("zod").ZodString>; image: import("zod").ZodOptional<import("zod").ZodString>; }, import("zod/v4/core").$strip>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; description: string; }; user: { $ref: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { token: string; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; requestPasswordResetEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-password-reset", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; description: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; forgetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/forget-password/email-otp", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; description: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; resetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/reset-password", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; otp: import("zod").ZodString; password: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; requestEmailChangeEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-email-change", { method: "POST"; body: import("zod").ZodObject<{ newEmail: import("zod").ZodString; otp: import("zod").ZodOptional<import("zod").ZodString>; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{ session: { session: Record<string, any> & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record<string, any> & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; changeEmailEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/change-email", { method: "POST"; body: import("zod").ZodObject<{ newEmail: import("zod").ZodString; otp: import("zod").ZodString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{ session: { session: Record<string, any> & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record<string, any> & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; }; hooks: { after: { matcher(context: import("better-auth").HookEndpointContext): boolean; handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>; }[]; }; rateLimit: ({ pathMatcher(path: string): path is "/email-otp/send-verification-otp"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/check-verification-otp"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/verify-email"; window: number; max: number; } | { pathMatcher(path: string): path is "/sign-in/email-otp"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/request-password-reset"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/reset-password"; window: number; max: number; } | { pathMatcher(path: string): path is "/forget-password/email-otp"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/request-email-change"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/change-email"; window: number; max: number; })[]; options: import("better-auth/plugins").EmailOTPOptions; $ERROR_CODES: { OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">; INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">; TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">; }; } | { id: "next-cookies"; version: string; hooks: { before: { matcher(ctx: import("better-auth").HookEndpointContext): boolean; handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>; }[]; after: { matcher(ctx: import("better-auth").HookEndpointContext): true; handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>; }[]; }; })[]; baseURL?: string | undefined; database?: any; }; export declare const auth: import("better-auth").Auth<{ basePath: string; secret: string | undefined; user: { additionalFields: { role: { type: "string"; required: boolean; input: boolean; }; }; }; plugins: ({ id: "email-otp"; version: string; init(ctx: import("better-auth").AuthContext): { options: { emailVerification: { sendVerificationEmail(data: { user: import("better-auth").User; url: string; token: string; }, request: Request | undefined): Promise<void>; }; }; } | undefined; endpoints: { sendVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/send-verification-otp", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; type: import("zod").ZodEnum<{ "sign-in": "sign-in"; "change-email": "change-email"; "email-verification": "email-verification"; "forget-password": "forget-password"; }>; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; createVerificationOTP: import("better-auth").StrictEndpoint<string, { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; type: import("zod").ZodEnum<{ "sign-in": "sign-in"; "change-email": "change-email"; "email-verification": "email-verification"; "forget-password": "forget-password"; }>; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "string"; }; }; }; }; }; }; }; }, string>; getVerificationOTP: import("better-auth").StrictEndpoint<string, { method: "GET"; query: import("zod").ZodObject<{ email: import("zod").ZodString; type: import("zod").ZodEnum<{ "sign-in": "sign-in"; "change-email": "change-email"; "email-verification": "email-verification"; "forget-password": "forget-password"; }>; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { otp: { type: string; nullable: boolean; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { otp: null; } | { otp: string; }>; checkVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/check-verification-otp", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; type: import("zod").ZodEnum<{ "sign-in": "sign-in"; "change-email": "change-email"; "email-verification": "email-verification"; "forget-password": "forget-password"; }>; otp: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; verifyEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/verify-email", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; otp: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; description: string; enum: boolean[]; }; token: { type: string; nullable: boolean; description: string; }; user: { $ref: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { status: boolean; token: string; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record<string, any>; } | { status: boolean; token: null; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record<string, any>; }>; signInEmailOTP: import("better-auth").StrictEndpoint<"/sign-in/email-otp", { method: "POST"; body: import("zod").ZodIntersection<import("zod").ZodObject<{ email: import("zod").ZodString; otp: import("zod").ZodString; name: import("zod").ZodOptional<import("zod").ZodString>; image: import("zod").ZodOptional<import("zod").ZodString>; }, import("zod/v4/core").$strip>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; description: string; }; user: { $ref: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { token: string; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; requestPasswordResetEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-password-reset", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; description: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; forgetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/forget-password/email-otp", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; description: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; resetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/reset-password", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; otp: import("zod").ZodString; password: import("zod").ZodString; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; requestEmailChangeEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-email-change", { method: "POST"; body: import("zod").ZodObject<{ newEmail: import("zod").ZodString; otp: import("zod").ZodOptional<import("zod").ZodString>; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{ session: { session: Record<string, any> & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record<string, any> & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; changeEmailEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/change-email", { method: "POST"; body: import("zod").ZodObject<{ newEmail: import("zod").ZodString; otp: import("zod").ZodString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{ session: { session: Record<string, any> & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record<string, any> & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; }; hooks: { after: { matcher(context: import("better-auth").HookEndpointContext): boolean; handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>; }[]; }; rateLimit: ({ pathMatcher(path: string): path is "/email-otp/send-verification-otp"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/check-verification-otp"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/verify-email"; window: number; max: number; } | { pathMatcher(path: string): path is "/sign-in/email-otp"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/request-password-reset"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/reset-password"; window: number; max: number; } | { pathMatcher(path: string): path is "/forget-password/email-otp"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/request-email-change"; window: number; max: number; } | { pathMatcher(path: string): path is "/email-otp/change-email"; window: number; max: number; })[]; options: import("better-auth/plugins").EmailOTPOptions; $ERROR_CODES: { OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">; INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">; TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">; }; } | { id: "next-cookies"; version: string; hooks: { before: { matcher(ctx: import("better-auth").HookEndpointContext): boolean; handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>; }[]; after: { matcher(ctx: import("better-auth").HookEndpointContext): true; handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>; }[]; }; })[]; baseURL?: string | undefined; database?: any; }>; //# sourceMappingURL=config.d.ts.map