@authup/server-api
Version:
This is a standalone application.
158 lines • 3.66 kB
TypeScript
import type { ParseOptions as CookieOptions } from '@routup/basic/cookie';
import type { OptionsInput as PrometheusOptions } from '@routup/prometheus';
import type { ParseOptions as QueryOptions } from '@routup/basic/query';
import type { OptionsInput as RateLimitOptions } from '@routup/rate-limit';
import type { UIOptions as SwaggerUIOptions } from '@routup/swagger';
import type { Options as BodyOptions } from '@routup/basic/body';
import type { Continu } from 'continu';
import type { CorsOptions } from 'cors';
import type { Client, ClientOptions } from 'redis-extension';
import type { SmtpConfig } from '@authup/server-core';
import type { DatabaseConnectionOptions } from './utils';
export type Options = {
/**
* default: 'development'
*/
env: string;
/**
* default: process.cwd()
*/
rootPath: string;
/**
* Relative or absolute path.
* If the path is relative, the rootPath will be appended.
*
* default: writable
*/
writableDirectoryPath: string;
/**
* default driver: better-sqlite3
*/
db: DatabaseConnectionOptions;
/**
* default: true
*/
redis: string | boolean | Client | ClientOptions;
/**
* default: false
*/
vault: string | boolean;
/**
* default: false
*/
smtp: string | boolean | SmtpConfig;
/**
* default: 3001
*/
port: number;
/**
* default: 0.0.0.0
*/
host: string;
/**
* default: http://127.0.0.1:3001
*/
publicUrl: string;
/**
* default: http://127.0.0.1:3000
*/
authorizeRedirectUrl: string;
/**
* use body middleware
*
* default: true
*/
middlewareBody: boolean | BodyOptions;
/**
* use cors middleware
*
* default: true
*/
middlewareCors: boolean | CorsOptions;
/**
* use cookie middleware
*
* default: true
*/
middlewareCookie: boolean | CookieOptions;
/**
* Prometheus middleware (options)
*/
middlewarePrometheus: boolean | PrometheusOptions;
/**
* Query middleware (options)
*/
middlewareQuery: boolean | QueryOptions;
/**
* Rate limit middleware (options).
*/
middlewareRateLimit: boolean | RateLimitOptions;
/**
* Swagger middleware (options)
*
* default: true
*/
middlewareSwagger: boolean | SwaggerUIOptions;
/**
* default: 3600
*/
tokenMaxAgeAccessToken: number;
/**
* default: 3600
*/
tokenMaxAgeRefreshToken: number;
/**
* Enable registration.
*
* default: false
*/
registration: boolean;
/**
* Email verification required for registration or login with identity provider.
*
* default: false
*/
emailVerification: boolean;
/**
* Allow password reset via email?
*
* default: false
*/
forgotPassword: boolean;
/**
* default: 'admin'
*/
adminUsername: string;
/**
* default: 'start123'
*/
adminPassword: string;
/**
* default: undefined
*/
adminPasswordReset?: boolean;
/**
* default: false
*/
robotEnabled: boolean;
/**
* default: undefined
*/
robotSecret?: string;
/**
* default: undefined
*/
robotSecretReset?: boolean;
/**
* default: []
*/
permissions: string[];
};
export type OptionsInput = Omit<Partial<Options>, 'permissions'> & {
/**
* default: []
*/
permissions?: string[] | string;
};
export type Config = Continu<Options, OptionsInput>;
//# sourceMappingURL=type.d.ts.map