import { Middleware as Middleware$1, IError, Response as Response$1, Request as Request$1, Polka } from 'polka'; import { File } from 'formidable'; import * as express_session from 'express-session'; import { Session, Store } from 'express-session'; import { Validator as Validator$1 } from '@kodepandai/node-input-validator'; import { StorageManager } from '@kodepandai/flydrive'; import { AsyncLocalStorage } from 'async_hooks'; import { Command as Command$1 } from 'commander'; declare class Repository { static symbol: symbol; /** All configuration items */ protected items: ObjectOf; constructor(items: ObjectOf); /** * Determine if the given configuration value exists. */ has(key: string): boolean; /** * Get the specified configuration value. */ get(key?: string, defaultValue?: T): T; /** * Get all of the configuration items for the application. */ all(): ObjectOf; /** * Set a given configuration value. */ set(key: string, value: any | null): void; } interface Binding { concrete: Concrete; shared: boolean; } declare class Container { /** The container's shared instances. */ instances: Record; /** The container's bindings. */ protected bindings: Record; /** Register a binding with the container. */ bind(abstract: string | symbol, concrete: Concrete, shared?: boolean): void; /** Register shared binding in container. */ singleton(abstract: string | symbol, concrete: Concrete): void; /** Instantiate a concrete instance of the given type. */ build(abstract: string | symbol, params?: Record): T; /** Resolve the given type from the container. */ make(abstract: string | symbol, params?: {}): T; /** Register an existing instance as shared in the container. */ instance(abstract: string | symbol, instance: any): any; } interface Bootstrapper { bootstrap: (app: Application) => Promise; } declare class Command { protected lunox: Application; SUCCESS: 0; FAILURE: 1; INVALID: 2; protected signature: string; protected description: string; protected args: ObjectOf; protected opts: ObjectOf; handle(): Promise<0 | 1 | 2>; getSignature(): string; getDescription(): string; setArguments(args: ObjectOf): void; setOptions(opts: ObjectOf): void; setLunox(lunox: Application): void; arguments(): ObjectOf; argument(key: string): string; options(): ObjectOf; option(key: string): any; protected info(message: string): void; protected line(message: string): void; protected error(message: string): void; protected newLine(line?: number): void; protected comment(message: string): void; tryCommand(name: string, run: () => Promise, onError: (error: string) => void): Promise; shellExec(command: string, watch?: boolean): Promise; } declare class Kernel$1 { protected app: Application; protected program: Command$1; protected bootstrappers: Class[]; constructor(app: Application); handle(): Promise; /** * Register built in commans for the application */ protected builtinCommands(): Promise; /** * Register the Closure based commands for the application. */ protected commands(): Promise; protected load(paths: string): Promise; protected registerCommand(commandInstance: Command): void; } declare abstract class ServiceProvider { protected app: Application; constructor(app: Application); register(): Promise; boot(): Promise; commands(commands: (typeof Command)[]): void; } declare class Cookie { protected name: string; protected value: any; protected expires: number; protected path: string; protected domain: string | undefined | null; protected secure: boolean; protected httpOnly: boolean; protected raw: boolean; protected sameSite: "lax" | "strict" | "none" | undefined | null; constructor(name: string, value: any, expires?: number, path?: string, domain?: string | undefined | null, secure?: boolean, httpOnly?: boolean, raw?: boolean, sameSite?: "lax" | "strict" | "none" | undefined | null); static fromString(_cookie: string): Cookie | null; static getExpiresTimeFromLifeTime(lifetime: number | string): number; getName(): string; getExpiresTime(): number; getPath(): string; getDomain(): string | null | undefined; isSecure(): boolean; isHttpOnly(): boolean; isRaw(): boolean; getSameSite(): "lax" | "strict" | "none" | null | undefined; getValue(): any; toString(): string; } declare class Validator extends Validator$1 { protected _inputs: ObjectOf; constructor(data: ObjectOf, rules: ObjectOf, messages: ObjectOf, customAttributes?: ObjectOf); fails(): Promise; validate(inputs?: ObjectOf): Promise; } interface Rule { name: string; passes: (args: string[] | undefined, value: any) => Promise; message?: string; } declare class Factory { static symbol: symbol; protected app: Application; constructor(app: Application); make(data: ObjectOf, rules: ObjectOf, messages?: ObjectOf, customAttributes?: ObjectOf): Validator; extend(rule: Rule): void; } declare class FormRequest extends _default$a { /** * validator instance. */ protected validator: Validator | null; /** * Get rules for validator. */ rules(): Record; /** * Get custom messages for validator errors. */ messages(): Record; /** * Set validator instance. */ setValidator(validator: Validator): this; /** * Get custom attributes for validator errors. */ attributes(): Record; /** * Validate this form request. */ validateForm(): Promise; /** * Create default validator instance */ protected createDefaultValidator(factory: Factory): Validator; /** * Get validator instance for the request. */ protected getValidatorInstance(): Validator; } type NativeMiddleware = Middleware$1; type NextFunction = (req: Request) => Response; type MiddlewareStack = null | Middleware | string | (Middleware | string)[]; interface Middleware { handle?: (req: Request, next: NextFunction, ...args: any[]) => Promise; handleAfter?: (res: Response, req: Request) => Promise; handleNative?: NativeMiddleware; } declare class Kernel { protected app: Application; protected middleware: (Middleware | Class)[]; protected middlewareGroups: Record)[]>; protected routeMiddleware: Record>; protected bootstrappers: Class[]; constructor(app: Application); start(): Promise; private handleMiddleware; private send; protected reportException(e: string | IError): void; protected renderException(req: Request, e: string | IError): Promise; } type CipherTypes = "aes-128-cbc" | "aes-256-cbc" | "aes-128-gcm" | "aes-256-gcm"; interface JsonPayload { iv: string; mac: string; value: string; } declare class Encrypter { static symbol: symbol; protected key: Buffer; protected cipher: CipherTypes; private static supportedCiphers; constructor(key: Buffer, cipher?: CipherTypes); getKey(): Buffer; static supported(key: Buffer, cipher: CipherTypes): boolean; static generateKey(cipher: CipherTypes): Buffer; encrypt(value: any, needSerialize?: boolean): string; encryptString(value: string): string; decrypt(payloadString: string, needUnserialize?: boolean): any; decryptString(payloadString: string): any; hash(iv: string, value: string): string; hashHmac(algoritm: "sha1" | "sha256", data: string, key: Buffer): string; protected getJsonPayload(payload: string): JsonPayload; protected isValidPayload(payload: ObjectOf): boolean; protected isValidMac(payload: JsonPayload): boolean; static hashEquals(answer: string, guess: string): boolean; static base64Encode(value: string | Buffer): string; static base64Decode(value: string): Buffer; } interface AppConfig { name: string; env: string; key: string; cipher: CipherTypes; providers: (typeof ServiceProvider)[]; } interface SessionConfig { driver: "file" | "cookie" | "database"; lifetime: number; files: string; table: string; cookie: string; path: string; domain?: string; http_only: boolean; same_site: "lax" | "strict" | "none" | null; secure: boolean; } declare class VerifyCsrfToken implements Middleware { protected app: Application; protected encrypter: Encrypter; protected except: string[]; protected addHttpCookie: boolean; constructor(); handle(req: Request, next: NextFunction): Promise; protected isReading(req: Request): boolean; protected runningUnitTests(): boolean | null; protected inExceptArray(req: Request): boolean; protected tokensMatch(req: Request): boolean; protected getTokenFromRequest(req: Request): any; shouldAddXsrfTokenCookie(): boolean; protected addCookieToResponse(req: Request, res: Response): void; protected newCookie(req: Request, config: SessionConfig): Cookie; } interface ResponseHeaders { [key: string]: any; getCookies: () => Cookie[]; setCookie: (cookie: Cookie) => void; } declare class Response { protected original: any; protected status: number; protected _headers: Record; protected res?: Response$1; protected cookies: Cookie[]; constructor(content: any, status?: number, headers?: Record); getCookies(): Cookie[]; setCookie(cookie: Cookie): void; getOriginal(): any; getStatus(): number; get headers(): ResponseHeaders; setCookiesToHeaders(): void; setOriginal(data: any): this; setServerResponse(res: Response$1): this; mergeResponse(res: Response): void; getServerResponse(): Response$1 | undefined; setHeader(key: string, value: string | string[]): this; } interface ResponseRenderer { render(request: Request): Promise; } declare class Application extends Container { protected _basePath: string; protected isBooted: boolean; config: Repository; responseRenderers: Class[]; protected isRunningInConsole: boolean | null; constructor(basePath?: string | null); setBasePath(basePath: string | null): string; basePath(_path?: string): string; configPath(_path?: string): string; storagePath(_path?: string): string; bindPaths(): void; bootstrapWith(bootstrappers: Class[]): Promise; register(provider: ServiceProvider): Promise; registerConfiguredProviders(): Promise; boot(): Promise; protected registerBaseServiceProviders(): Promise; abort(code: number, message?: string, headers?: ObjectOf): void; runningInConsole(): boolean | null; runingUnitTests(): boolean; } declare class UploadedFile { protected file: File | File[]; constructor(file: File | File[]); path(): string; getClientOriginalExtension(): string; getClientOriginalName(): string | null; getClientMimeType(): string | null; move(directory: string, name?: string | null): void; private failIfArray; private moveFile; } interface ExtendedRequest extends Request$1 { session?: Session; } interface ExtendedSession extends Partial { __old?: any; __lastAccess?: any; sessionStore?: Store; [key: string]: any; } declare class SessionManager { static symbol: symbol; protected app: Application; protected session: ExtendedSession; protected request: Request; protected started: boolean; constructor(app: Application); setRequest(request: Request): this; get(key: string): any; /** * get flashed session. */ getFlashed(): any; old(key?: string): any; all(withFlashed?: boolean, withAuth?: boolean, withToken?: boolean): { [x: string]: any; __old?: any; __lastAccess?: any; sessionStore?: Store | undefined; id?: string | undefined; cookie?: express_session.Cookie | undefined; regenerate?: ((callback: (err: any) => void) => Session) | undefined; destroy?: ((callback: (err: any) => void) => Session) | undefined; reload?: ((callback: (err: any) => void) => Session) | undefined; resetMaxAge?: (() => Session) | undefined; save?: ((callback?: ((err: any) => void) | undefined) => Session) | undefined; touch?: (() => Session) | undefined; }; put(key: string, value: any): void; /** * flash session to view. Will be removed on next request. */ flash(key: string, value: any): void; has(key: string): boolean; exists(key: string): boolean; save(): Promise; flush(): Promise; remove(key: string): void; forget(keys: string[]): void; static getDefaultDriver(): string; static getStore(session: any): Promise; private static getStoreConfig; static getConfig(): SessionConfig; migrate(destroy?: boolean): Promise; start(): Promise; regenerateToken(): void; token(): any; isStarted(): boolean; } interface Authenticatable { getAuthIdentifierName(): string; getAuthPassword(): string; getAuthIdentifier(): string; /** * Get the token value for the "remember me" session. */ getRememberToken(): string; /** * Get the column name for the "remember me" token. */ getRememberTokenName(): string; /** * Set the token value for the "remember me" session. */ setRememberToken(token: string): void; } interface Credentials { password?: string; [key: string]: any; } interface Guard { check(): Promise; guest(): Promise; user(): Promise; id(): Promise; validate(credentials: Credentials): Promise; setUser(user: Authenticatable): void; } interface StatefulGuard extends Guard { attempt: (credentials: Credentials, remember?: boolean) => Promise; login(user: Authenticatable, remember?: boolean): Promise; logout(): Promise; } interface UserProvider { validateCredentials(user: Authenticatable, credentials: Credentials): boolean; retrieveByCredentials(credentials: Credentials): Promise; retrieveById(id: string): Promise; /** * Update the "remember me" token for the given user in storage. */ updateRememberToken(user: Authenticatable, token: string): Promise; /** * Retrieve a user by their unique identifier and "remember me" token. */ retrieveByToken(identifier: any, token: string): Promise; } interface ExceptionHandler { render(req: Request, e: Error): Promise; report(e: Error): void; } interface HttpExceptionInterface { getStatusCode(): number; getHeaders(): ObjectOf; getPrevious(): Error | null; } type Method = "post" | "delete" | "get" | "put" | "patch" | "all"; interface Routes { prefix: string; uri: string; method: Method; action: RouteCallback; middleware: (string | Middleware)[]; controllerMiddleware: (string | Middleware)[]; [key: string]: any; } type RouteCallback = (req: Request, ...params: any) => any; interface HttpController { [key: string]: RouteCallback; } interface Configuration { driver: string; url?: string; host: string; port: string; database: string; username: string; password: string; useNullAsDefault?: boolean; pool?: { min?: number; max?: number; idleTimeoutMillis?: number; }; } declare abstract class GuardHelper { protected _user?: Authenticatable; protected provider: UserProvider; user(): Promise; protected authenticate(): Authenticatable; check(): Promise; guest(): Promise; id(): Promise; getProvider(): UserProvider; setProvider(provider: UserProvider): void; } declare class Recaller { protected recaller: string; constructor(recaller: string); /** * Determine if the recaller is valid. */ valid(): boolean; /** * Determine if the recaller is an valid string. */ protected properString(): boolean; /** * Determine if the recaller has all segments. */ protected hasAllSegments(): boolean; /** * Get the user ID from the recaller */ id(): string; /** * Get the "remember token" from the recaller */ token(): string; } declare class SessionGuard extends GuardHelper implements StatefulGuard { name: string; session: SessionManager; request: Request; lastAttempted: Authenticatable | undefined; /** * The number of minutes that the "remember me" cookie should be valid for. */ protected rememberDuration: number; protected loggedOut: boolean; /** * Indicates if a token user retrieval has been attempted. */ protected recallAttempted: boolean; /** * Indicates if the user was authenticated via a recaller cookie. */ protected viaRemember: boolean; constructor(name: string, provider: UserProvider, session: SessionManager, request: Request); validate(credentials: Credentials): Promise; once(credentials: Credentials): Promise; attempt(credentials?: Credentials, remember?: boolean): Promise; protected hasValidCredentials(user: Authenticatable | undefined, credentials: Credentials): boolean; login(user: Authenticatable, remember?: boolean): Promise; /** * Queue the recaller cookie into the cookie jar. */ protected queueRecallerCookie(user: Authenticatable): void; /** * Create a "remember me" cookie for a given ID. */ protected createRecaller(value: string): Cookie; /** * Get the number of minutes the remember me cookie should be valid for. */ protected getRememberDuration(): number; /** * Set the number of minutes the remember me cookie should be valid for. */ setRememberDuration(minutes: number): this; /** * Create a new "remember me" token for the user if one doesn't already exist. */ protected ensureRememberTokenIsSet(user: Authenticatable): Promise; /** * Refresh the "remember me" token for the user. */ protected cycleRememberToken(user: Authenticatable): Promise; logout(): Promise; setUser(user: Authenticatable): this; getName(): string; protected updateSession(id: string): Promise; user(): Promise; /** * Pull a user from the repository by its "remember me" cookie token. */ protected userFromRecaller(recaller: Recaller): Promise; /** * Get the decrypted recaller cookie for the request. */ protected recaller(): Recaller | undefined; /** * Get the name of the cookie used to store the "recaller". */ protected getRecallerName(): string; /** * Remove the user data from the session and cookies. */ protected clearUserDataFromStorage(): void; } type UserProviderCreator = (config: Record) => UserProvider; declare class AuthManager { static symbol: symbol; protected app: Application; protected guards: Record; protected request: Request; protected static userProviders: Record; constructor(app: Application); setRequest(request: Request): this; guard(name?: string): StatefulGuard; getDefaultDriver(): string; static registerUserProvider(name: string, providerCreator: UserProviderCreator): void; protected resolve(name: string): StatefulGuard; protected getConfig(name: string): Record; protected createSessionDriver(name: string, config: Record): SessionGuard; createUserProvider(provider: string): UserProvider; protected getProviderConfiguration(provider?: string): Record | undefined; protected config(key: string): T; getDefaultUserProvider(): string; __get(method: keyof StatefulGuard): any; } declare const _default$c: typeof AuthManager & Class; type Macro = (...arg: any[]) => any; declare class Macroable { protected static macros: ObjectOf; /** * Register a custom macro */ static macro(name: string, macro: Macro): void; /** * Check if macro is registered */ static hasMacro(name: string): boolean; /** * Flush the existing macros */ static flushMacros(): void; /** * Dynamically handle call to the class */ protected static __getStatic(method: string): any; /** * Dynamically handle call to the class */ protected __get(method: string): any; } declare const _default$b: typeof Macroable; declare class CookieJar { protected _queued: ObjectOf>; /** * Create new Cookie instance */ make(name: string, value: any, minutes?: number, path?: string, domain?: string | undefined | null, secure?: boolean, httpOnly?: boolean, raw?: boolean, sameSite?: "lax" | "strict" | "none" | undefined | null): Cookie; /** * Queue a cookie to send with the next response. */ queue(...params: any[]): void; /** * Get the cookies which have been queued for the next request. */ getQueuedCookies(): Cookie[]; /** * Flush the cookies which have been queued for the next request. */ flushQueuedCookies(): this; /** * Expire the given cookie. */ forget(name: string, path?: string, domain?: string | undefined | null): Cookie; } interface RequestCookies { [key: string]: any; set: (key: string, value: any) => void; get: (key: string) => any; } declare class Request extends _default$b { protected static macros: Record; static symbol: symbol; protected app: Application; files: Record; protected req: ExtendedRequest; protected data: Record; protected sessionManager: SessionManager | null; protected authManager: (AuthManager & StatefulGuard) | null; protected _cookies: Record | null; protected _cookieJar: CookieJar | null; protected router: Partial; protected formRequest: FormRequest | null; constructor(app: Application, req: ExtendedRequest); get(key: string, defaultValue?: any): T; input(key: string, defaultValue?: any): any; header(key: string): string | string[] | undefined; only(keys: string[]): Record; all(): any; allFiles(): Record; file(key: string): UploadedFile; method(): string; merge(newData: Record): this; getOriginalRequest(): ExtendedRequest; instance(): this; session(): SessionManager; get cookies(): RequestCookies; get cookieJar(): CookieJar; protected setCookie(key: string, value: any): void; protected getCookie(key: string): any; auth(): AuthManager & StatefulGuard; wantsJson(): boolean; /** * Validate request inputs. */ validate(rules: Record, messages?: Record, customAttributes?: Record): Promise; /** * set Form Request for validation. */ setFormRequest(formRequest: typeof FormRequest): FormRequest; /** * Get Form Request instance */ getFormRequest(): FormRequest | null; is(...patterns: any[]): boolean; /** * Set router data to request instance */ setRouter(router: Routes): void; /** * Get router data from current route */ getRouter(): Partial; } interface Request { macro: (name: string, macro: Macro) => any; [key: string]: any; } declare const _default$a: typeof Request; type Concrete = NewableFunction | (() => any); type CallBack = (...params: any[]) => any; interface ObjectOf { [key: string]: T; } type Class = new (...args: Args) => I; type Server = Polka; type OnServer = (req: Request, ctx: any) => Promise>; type Trait = (s: Base) => T; declare const Traitable: (superclass: T) => TraitBuilder; declare class TraitBuilder { superclass: T; constructor(superclass: T); use(...traits: Trait[]): T; } declare const AuthenticatableTrait: Trait; declare class AuthServiceProvider extends ServiceProvider { register(): Promise; } declare class FilesystemServiceProvider extends ServiceProvider { register(): Promise; boot(): Promise; } declare class HttpException extends Error implements HttpExceptionInterface { private statusCode; private headers; private previous; constructor(statusCode: number, message?: string, previous?: Error | null, headers?: ObjectOf); getStatusCode(): number; getHeaders(): ObjectOf; getPrevious(): Error | null; } declare class NotFoundHttpException extends HttpException { constructor(message?: string, previous?: Error | null, headers?: ObjectOf); } declare class RedirectResponse extends Response { protected request: Request; protected isWithInput: boolean; protected inputExcept: string[]; protected session: ObjectOf; protected url: string; constructor(url: string); setRequest(req: Request): Request; withInput(options?: { except: string | string[]; }): this; with(session: ObjectOf): this; } declare abstract class ViewFactory implements ResponseRenderer { protected app: Application; protected path: string; protected data: Record; protected ctx: Record; constructor(app: Application); make(_path: string, data?: Record): this; withContext(ctx: Record): this; render(req: Request): Promise; } type renderUsing = (e: E, req: Request) => Response | ViewFactory; type reportUsing = (e: E) => void; interface renderCallback { exception: Class; renderUsing: renderUsing; } interface reportCallback { exception: Class; reportUsing: reportUsing; } declare class Handler implements ExceptionHandler { static symbol: symbol; protected container: Container; protected reportCallbacks: reportCallback[]; protected renderCallbacks: renderCallback[]; protected dontReport: Class[]; protected internalDontReport: Class[]; constructor(container: Container); render(req: Request, e: any): Promise; protected prepareException(e: any): any; report(e: any): void; reportable(exception: Class, reportUsing: reportUsing): void; renderable(exception: Class, renderUsing: renderUsing): void; protected register(): void; protected shouldntReport(e: Class): boolean; } declare class BadMethodCallException extends Error { } declare class RuntimeException extends Error { } interface IOptions { only: string | string[]; except: string | string[]; } declare class ControllerMiddlewareOptions { protected options: IOptions; constructor(options: IOptions); only(methods: string | string[]): this; except(methods: string | string[]): this; } declare abstract class Controller { protected middlewares: { middleware: string | Middleware; options: IOptions; }[]; /** * Execute an action on the controller. */ callAction(this: any, method: string, parameters: any[]): any; /** * Register middleware on the controller */ middleware(middleware: MiddlewareStack): ControllerMiddlewareOptions; /** * Get the middleware assigned to the controller. */ getMiddleware(): { middleware: string | Middleware; options: IOptions; }[]; } type RouteAction = RouteCallback | [Class, Exclude]; declare class Router extends _default$b { protected routes: Routes[]; protected prefixStack: string[]; protected middlewareStack: MiddlewareStack[]; protected deep: number; protected calledAction: string; protected static macros: ObjectOf; constructor(); private addRoutes; get: (uri: string, action: RouteAction, ctx?: ObjectOf) => this; post: (uri: string, action: RouteAction, ctx?: ObjectOf) => this; delete: (uri: string, action: RouteAction, ctx?: ObjectOf) => this; patch: (uri: string, action: RouteAction, ctx?: ObjectOf) => this; put: (uri: string, action: RouteAction, ctx?: ObjectOf) => this; all: (uri: string, action: RouteAction, ctx?: ObjectOf) => this; getRoutes(): Routes[]; prefix(prefix: string): this; middleware(middleware: MiddlewareStack): this; group(callback: string | CallBack): Promise; private flattenMiddleware; /** * This method just to reset calledAction when Route facade called * See implementation in Support/Facade class */ protected facadeCalled(): void; /** * determine if the given options should included in particular method */ private methodIncludedByOptions; } interface Router { macro: (name: string, macro: Macro) => any; [key: string]: any; } declare const _default$9: typeof Router; declare class RoutingServiceProvider extends ServiceProvider { register(): Promise; } declare const useMagic: (clazz: any, ...params: any[]) => T; declare class Str { protected static studlyCache: ObjectOf; static plural(value: string, count?: number): string; static ucfirst(value: string): string; static snake(value: string, glue?: string): string; static contains(haystack: string, needles: string | string[]): boolean; static is(pattern: string | string[], value: string): boolean; static random(length?: number): string; /** * Convert a value to studly caps case. */ static studly(value: string): string; } declare class Arr { static wrap(value: T[] | T | null): T[]; } declare abstract class Facade { protected static facadeId: string | null; protected static app: Application; protected static resolvedInstance: Record; static setApplicationFacade(app: Application): void; static getFacadeAccessor(): Class | string | symbol; static __getStatic(name: string, abstract: string | symbol): (...args: any) => any; protected static resolveFacadeInstance(abstract: string | symbol): any; } declare class ExtendedFacade extends Facade { } declare const _default$8: typeof Facade; declare class Env { static symbol: symbol; constructor(); get(key: string, defaultValue?: string | boolean | null | number): any; } declare const _default$7: Env & typeof ExtendedFacade; declare const _default$6: Encrypter & typeof ExtendedFacade; declare class ResponseFactory { static symbol: symbol; constructor(); make(content?: any, status?: number, headers?: ObjectOf): Response; } declare const _default$5: ResponseFactory & typeof ExtendedFacade; declare const _default$4: Router & typeof ExtendedFacade; declare class FilesystemManager extends StorageManager { static symbol: symbol; protected app: Application; constructor(app: Application); isUsingS3(): boolean; registerS3Driver(): Promise; } declare const _default$3: FilesystemManager & typeof ExtendedFacade; declare function useFacade(clazz: any): T & typeof ExtendedFacade; declare const _default$2: Factory & typeof ExtendedFacade; declare const _default$1: Repository & typeof ExtendedFacade; declare const _default: AsyncLocalStorage> & typeof ExtendedFacade; declare class ValidationException extends Error { status: number; protected validator: Validator; constructor(validator: Validator); errors(): any; } declare class ValidationServiceProvider extends ServiceProvider { register(): Promise; boot(): Promise; } declare const StartSession: Middleware; declare class SessionServiceProvider extends ServiceProvider { register(): Promise; boot(): Promise; } declare class TokenMismatchException extends Error { } declare class CookieValuePrefix { /** * Create a new cookie value prefix for the given cookie name. */ static create(cookieName: string, key: Buffer): string; /** * Validate a cookie value contains a valid prefix. If it does, return the cookie value with the prefix removed. Otherwise, return null. */ static validate(cookieName: string, cookieValue: string, key: Buffer): string | null; /** * Remove the cookie value prefix. */ static remove(cookieValue: string): string; } declare class AddQueuedCookiesToResponse implements Middleware { handleAfter(res: Response, req: Request): Promise; } declare class EncryptCookie implements Middleware { protected encrypter: Encrypter; protected except: string[]; constructor(encrypter?: Encrypter); handle(req: Request, next: NextFunction): Promise; handleAfter(res: Response): Promise; protected decrypt(req: Request): Request; protected encrypt(res: Response): Response; isDisabled(key: string): boolean; protected decryptCookie(cookie: string): string; /** * validate and remove the cookie value prefix from the value */ protected validateValue(key: string, value: string): string | null; /** * Duplicate a cookie with a new value. */ protected duplicate(cookie: Cookie, value: any): Cookie; } declare class DecryptException extends RuntimeException { } declare class EncryptionServiceProvider extends ServiceProvider { register(): Promise; protected parseKey(config: AppConfig): Buffer; protected key(config: AppConfig): string; } declare class MissingAppKeyException extends Error { constructor(message?: string); } declare abstract class TestCase { protected app: Application; static make(this: new () => T): T; /** * Setup the test environment */ protected setUp(): Promise; /** * Refresh the application instance */ protected refreshApplication(): Promise; abstract createApplication(): Promise; /** * Clean up the test environtment before next test. */ protected tearDown(): void; } export { AddQueuedCookiesToResponse, _default as Als, AppConfig, Application, Arr, _default$c as AuthManager, AuthServiceProvider, Authenticatable, AuthenticatableTrait, BadMethodCallException, Bootstrapper, CallBack, CipherTypes, Class, Command, Concrete, _default$1 as Config, Configuration, Kernel$1 as ConsoleKernel, Controller, Cookie, CookieValuePrefix, Credentials, _default$6 as Crypt, DecryptException, EncryptCookie, Encrypter, EncryptionServiceProvider, _default$7 as Env, ExceptionHandler, ExtendedFacade, ExtendedRequest, _default$8 as Facade, FilesystemServiceProvider, FormRequest, Guard, Handler, HttpController, HttpException, HttpExceptionInterface, Request as HttpRequest, Response as HttpResponse, JsonPayload, Kernel, Method, Middleware, MiddlewareStack, MissingAppKeyException, NativeMiddleware, NextFunction, NotFoundHttpException, ObjectOf, OnServer, RedirectResponse, _default$a as Request, _default$5 as Response, ResponseRenderer, _default$4 as Route, RouteCallback, _default$9 as Router, Routes, RoutingServiceProvider, Rule, RuntimeException, Server, ServiceProvider, SessionConfig, SessionManager, SessionServiceProvider, StartSession, StatefulGuard, _default$3 as Storage, Str, TestCase, TokenMismatchException, Trait, Traitable, UserProvider, ValidationException, ValidationServiceProvider, _default$2 as Validator, VerifyCsrfToken, ViewFactory, useFacade, useMagic };