Class ShortUrl

Implements

Constructors

Properties

crawlable: boolean
dateCreated: Date
deviceLongUrls: {
    android: null | string;
    desktop: null | string;
    ios: null | string;
}
domain: string
forwardQuery: boolean
longUrl: string
meta: {
    maxVisits: null | number;
    validSince: null | Date;
    validUntil: null | Date;
}
shortCode: string
shortUrl: string
tags: string[]
title: null | string
visitsCount: number
visitsSummary: {
    bots: number;
    nonBots: number;
    total: number;
}

Methods

  • Get all configured domains from this server

    Returns Promise<{
        default: {
            baseUrlRedirect: null | string;
            invalidShortUrlRedirect: null | string;
            regular404Redirect: null | string;
        };
        domains: Domain[];
    }>

  • Get the QR-Code for this ShortUrl

    Parameters

    • size: number = 300
    • margin: number = 0
    • format: "png" | "svg" = "png"
    • errorCorrection: CorrectionTypes = CorrectionTypes.LOW

    Returns Promise<Buffer>

  • Get the visits from this url

    Parameters

    • OptionalstartDate: Date
    • OptionalendDate: Date
    • Optionalpage: number
    • OptionalitemsPerPage: number
    • OptionalexcludeBots: boolean

    Returns Promise<{
        maxPages: number;
        page: number;
        visits: Visit[];
    }>

  • Set the android redirect url for this short url

    Parameters

    • url: string | URL

    Returns Promise<void>

  • Set the crawlable flag for this short url

    Parameters

    • crawlable: boolean

    Returns Promise<void>

  • Set the desktop redirect url for this short url

    Parameters

    • url: string | URL

    Returns Promise<void>

  • Set the forward query flag for this short url

    Parameters

    • forward: boolean

    Returns Promise<void>

  • Set the ios redirect url for this short url

    Parameters

    • url: string | URL

    Returns Promise<void>

  • Set the long url for this short url

    Parameters

    • longUrl: string | URL

    Returns Promise<void>

  • Set the max visits for this short url

    Parameters

    • limit: null | number

    Returns Promise<void>

  • Set the tags for this short url

    Parameters

    • tags: string[]

    Returns Promise<void>

  • Set the title for this short url

    Parameters

    • title: null | string

    Returns Promise<void>

  • Set the valid since date for this short url

    Parameters

    • date: null | Date

    Returns Promise<void>

  • Set the valid until date for this short url

    Parameters

    • date: null | Date

    Returns Promise<void>