Behaviors associated with CloudFlare. For example, creating, updating and deleting DNS records.

Constructors

Methods

  • Creates an Entry in CloudFlare

    Parameters

    • entry: ARecord | CNAMERecord | MXRecord | NSRecord

      The entry to create

    Returns Promise<void>

    if CloudFlare errors creating the entry

  • Deletes an entry in CloudFlare

    Parameters

    • recordId: string

      Record id to be deleted

    • zoneId: string

      Zone the record belongs to

    Returns Promise<void>

    if CloudFlare errors deleteing the entry

  • For the given zone, fetches the DNS entries from CloudFlare

    Parameters

    • zoneId: string

      Zone to fetch entries for

    Returns Promise<Record[]>

    A promise which resolves to the records in the zone

    If service isn't initialized.

    If CloudFlare errors fetching DNS records.

  • Given an array of CloudFlare Zones and a business object representing a DNS Entry. Determines which zone if any the entry belongs to.

    It does this by comparing the domain name suffix in the name of the entry to the zones.

    Will warn if no match is found.

    Parameters

    • zones: Zone[]

      List of zones to determine if the entry belong to

    • entry: DnsbaseEntry

      The entry to find the zone for

    Returns { isSuccessful: boolean; zone?: Zone }

    An object determining if the operation was successful. If it was, it also includes the result.

  • Fetches from CloudFlare all the zones that can be read

    Returns Promise<Zone[]>

    Promise which resolves to all the accessible CloudFlare Zones

  • Initializes the service. Required before calling any public methods that interact with CloudFlare directly.

    Configures CloudFlare.

    Returns void

    if already initialized when called.

  • Maps the CloudFlare DNS Records to the common DnsBaseCloudflareEntry type

    Parameters

    • zoneId: string

      ID of the CloudFlare Zone these records were loaded from

    • entries: Record[]

      DNS entries from CloudFlare

    Returns ICloudFlareEntry[]

    Entries transformed into DnsBaseCloudflareEntry entries

  • Updates an entry in CloudFlare

    Parameters

    • recordId: string

      The id of the record to update

    • entry: ARecord | CNAMERecord | MXRecord | NSRecord

      The entry to be updated

    Returns Promise<void>

    if CloudFlare errors updating the entry