Class Link

See

https://docs.kutt.it/#tag/links

Example

const links = new Link(config);

Hierarchy

Constructors

Properties

#request: {
    (options: string | RequestOptions | URL, callback?: ((res: IncomingMessage) => void)): ClientRequest;
    (url: string | URL, options: RequestOptions, callback?: ((res: IncomingMessage) => void)): ClientRequest;
} | {
    (options: string | RequestOptions | URL, callback?: ((res: IncomingMessage) => void)): http.ClientRequest;
    (url: string | URL, options: RequestOptions, callback?: ((res: IncomingMessage) => void)): http.ClientRequest;
}
config: ConfigI
prefix: "/links" = "/links"

Methods

  • Creates a short link.

    Example

    const link = await links.create({
    target: "string",
    description: "string",
    expire_in: "2 minutes/hours/days",
    password: "string",
    customurl: "string",
    reuse: false,
    domain: "string",
    });

    Parameters

    Returns Promise<LinkI>

  • Protected

    Type Parameters

    • Response = unknown

    Parameters

    • Optional url: string

    Returns Promise<Response>

  • Protected

    =

    Type Parameters

    • Response = unknown

    Parameters

    • Optional url: string

    Returns Promise<Response>

  • Protected

    Type Parameters

    • Response = unknown

    Parameters

    • params: ParamsT
    • Optional url: string

    Returns Promise<Response>

  • Protected

    Type Parameters

    • Response = unknown

    Parameters

    • data: BodyT
    • Optional url: string

    Returns Promise<Response>

  • Protected

    Type Parameters

    • Response = unknown

    Parameters

    • data: BodyT
    • Optional url: string

    Returns Promise<Response>

  • Deletes a link.

    Example

    const message = await links.remove(link.id);
    

    Parameters

    • id: string

    Returns Promise<string>

  • Updates a link.

    Example

    const updatedLink = await links.update(link.id, {
    target: "string",
    address: "string",
    description: "string",
    expire_in: "2 minutes/hours/days",
    });

    Parameters

    Returns Promise<LinkI>

  • Protected

    Parameters

    • url: string

    Returns string

Generated using TypeDoc