Socket
Socket
Sign inDemoInstall

domeneshop.js

Package Overview
Dependencies
4
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    domeneshop.js

Javascript package for the Domeneshop API


Version published
Maintainers
2
Install size
495 kB
Created

Changelog

Source

[0.1.5] - 2019-10-02

Added

  • DNS-record type NS
  • Test for NS DNS-record
  • Clean command to npm
  • Forwarding api support and tests
  • Invoices api support and tests
  • New example of listing unpaid invoices

Changed

  • Updated dependent packages
  • Fixed typos and spelling mistakes

Readme

Source

domeneshop.js

Javascript library for the Domeneshop API.

Installation

npm install domeneshop.js

Credentials

Use of this module requires Domeneshop API credentials.

You need an API token and secret. See the Domeneshop API documentation for more information (in Norwegian).

CAUTION: You should protect these API credentials as you would the password to your Domeneshop user account. Users who can read this information can use these credentials to issue arbitrary API calls on your behalf.

Usage example

const Domeneshop = require('domeneshop.js');

const api = new Domeneshop("<api token>","<api secret>");

api.getDomains().then((domains) => {
    for(let domain of domains) {
        api.dns.getRecords(domain.id).then((record) => {
            console.log(domain.domain);
            console.log(record);
        });
    }
}).catch((err)=>{
    console.error(err);
});

domeneshop.js API

new Domeneshop(token, secret)

Creates a new Domeneshop API instance.

Domeneshop.getDomain(domainId)

Get information about one of your domains.

Returns:
{
    "domain": "example.com",
    "expiry_date": "2120-01-01",
    "id": 1234567890,
    "nameservers": [ 
        "ns1.hyp.net", 
        "ns2.hyp.net", 
        "ns3.hyp.net" 
    ],
    "registered_date": "1990-01-01",
    "registrant": "ICANN",
    "renew": true,
    "services":
    { 
        "dns": true, 
        "email": false, 
        "registrar": true, 
        "webhotel": "none"
    },
    "status": "active"
}

Domeneshop.getDomains()

List all domains on your account.

Returns a list of objects in the same shape as getDomain(domainId).

Domeneshop.dns

This namespace contains all methods to manipulate DNS records for domains.

Domeneshop.dns.getRecord(domainId, recordId)

Get a specific DNS record for a domain.

Note:: The host field does not include the domain name. An A record for www.example.com should only have www in its host field.

Returns:
{
    "data": "127.0.0.1",
    "host": "www",
    "id": 1591030,
    "ttl": 3600,
    "type": "A"
}

Domeneshop.dns.getRecords(domainId)

List all DNS records for a domain.

Domeneshop.dns.createRecord(domainId, record)

Creates a new DNS record for a domain. The record format is JSON with required parameters like the one returned from getRecord.

For full definition see the TypeScript interfaces defined in src/lib/interfaces/dnsrecord.ts

Domeneshop.dns.modifyRecord(domainId, recordId, record)

Modifies a specific DNS record for a domain.

Note: You can't modify the host nor the type field. If you want to modify these fields, delete the existing DNS record and recreate it.

Domeneshop.dns.deleteRecord(domainId, recordId)

Deletes a specific DNS record for a domain.

Keywords

FAQs

Last updated on 02 Oct 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc