Network Powering Makers

    @faasjs/http
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.3-beta.4 • Public • Published

    @faasjs/http

    License: MIT NPM Stable Version NPM Beta Version

    FaasJS's http plugin.

    Install

    npm install @faasjs/http
    

    Modules

    Classes

    Type Aliases

    Variables

    Functions

    Type Aliases

    CookieOptions

    Ƭ CookieOptions: Object

    Index signature

    [key: string]: any

    Type declaration

    Name Type
    domain? string
    expires? number
    httpOnly? boolean
    path? string
    sameSite? "Strict" | "Lax" | "None"
    secure? boolean
    session? SessionOptions

    HttpConfig

    Ƭ HttpConfig<TParams, TCookie, TSession>: Object

    Type parameters

    Name Type
    TParams extends Record<string, any> = any
    TCookie extends Record<string, string> = any
    TSession extends Record<string, string> = any

    Index signature

    [key: string]: any

    Type declaration

    Name Type
    config? { [key: string]: any; cookie?: CookieOptions ; functionName?: string ; ignorePathPrefix?: string ; method?: "BEGIN" | "GET" | "POST" | "DELETE" | "HEAD" | "PUT" | "OPTIONS" | "TRACE" | "PATCH" | "ANY" ; path?: string ; timeout?: number }
    config.cookie? CookieOptions
    config.functionName? string
    config.ignorePathPrefix? string
    config.method? "BEGIN" | "GET" | "POST" | "DELETE" | "HEAD" | "PUT" | "OPTIONS" | "TRACE" | "PATCH" | "ANY"
    config.path? string
    config.timeout? number
    name? string
    validator? ValidatorConfig<TParams, TCookie, TSession>

    Response

    Ƭ Response: Object

    Type declaration

    Name Type
    body? string
    headers? { [key: string]: string; }
    message? string
    statusCode? number

    SessionOptions

    Ƭ SessionOptions: Object

    Type declaration

    Name Type
    cipherName? string
    digest? string
    iterations? number
    key string
    keylen? number
    salt? string
    secret string
    signedSalt? string

    ValidatorConfig

    Ƭ ValidatorConfig<TParams, TCookie, TSession>: Object

    Type parameters

    Name Type
    TParams extends Record<string, any> = any
    TCookie extends Record<string, string> = any
    TSession extends Record<string, string> = any

    Type declaration

    Name Type
    before? BeforeOption
    cookie? ValidatorOptions<TCookie>
    params? ValidatorOptions<TParams>
    session? ValidatorOptions<TSession>

    ValidatorOptions

    Ƭ ValidatorOptions<Content>: Object

    Type parameters

    Name Type
    Content Record<string, any>

    Type declaration

    Name Type
    onError? (type: string, key: string | string[], value?: any) => { message: any ; statusCode?: number } | void
    rules { [k in keyof Content]?: ValidatorRuleOptions }
    whitelist? "error" | "ignore"

    ValidatorRuleOptions

    Ƭ ValidatorRuleOptions: Object

    Type declaration

    Name Type
    config? Partial<ValidatorOptions>
    default? any
    in? any[]
    regexp? RegExp
    required? boolean
    type? ValidatorRuleOptionsType

    Variables

    ContentType

    Const ContentType: Object

    Index signature

    [key: string]: string

    Functions

    useHttp

    useHttp<TParams, TCookie, TSession>(config?): Http<TParams, TCookie, TSession> & UseifyPlugin

    Type parameters

    Name Type
    TParams extends Record<string, any> = any
    TCookie extends Record<string, string> = any
    TSession extends Record<string, string> = any

    Parameters

    Name Type
    config? HttpConfig<TParams, TCookie, TSession>

    Returns

    Http<TParams, TCookie, TSession> & UseifyPlugin

    Keywords

    none

    Install

    npm i @faasjs/http

    DownloadsWeekly Downloads

    529

    Version

    0.0.3-beta.4

    License

    MIT

    Unpacked Size

    53.8 kB

    Total Files

    6

    Last publish

    Collaborators

    • zfben