Skip to content

Commit

Permalink
Added missing API descriptions of the Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaskardo committed Aug 30, 2020
1 parent 4b2cff2 commit d4ac580
Showing 1 changed file with 70 additions and 9 deletions.
79 changes: 70 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Torus Tools - Domains

A promise-based SDK that standarizes interaction with various different domain registrars.
A promise-based javascript SDK that standarizes interactions with various different domain registrars providers.

## Currently Supporting
- aws
-godaddy
- AWS
- Godaddy

**If you are interested in adding new providers create the feature request and we will add it to our pipeline; or feel free to submit your own PR** :sunglasses:

Expand Down Expand Up @@ -34,7 +34,7 @@ the records parameter has the following format
- TXT

# API
The API standardizes operations accross different providers. As shown in the examnple bellow, all of the methods must be used in the format `[PROVIDER].method`
The API standardizes operations accross different providers. As shown in the example below, all of the methods must be used in the format `[PROVIDER].method`

```
const {godaddy} = require('@torus-tools/domains')
Expand All @@ -55,7 +55,7 @@ godaddy.getNameservers('mydomain.com')

## updateNameservers(domain, nameservers)
- **description**: updates the nameservers for a particular domain
- **params**: (domain)
- **params**: (domain, nameservers)
- **domain**: STRING: REQUIRED: the root domain of your site i.e. yoursite.com
- **nameservers**: ARRAY: REQUIRED: an array of nameserver strings
- **returns**: promise(resolve, reject)
Expand All @@ -64,19 +64,80 @@ godaddy.getNameservers('mydomain.com')
- **reject**: (error)

## listRecords(domain)
- **description**: updates the nameservers for a particular domain
- **description**: Lists the records of a particular domain
- **params**: (domain)
- **domain**: STRING: REQUIRED: the root domain of your site i.e. yoursite.com
- **returns**: promise(resolve, reject)
- **resolve**: ('All Done')
- **recordSet**: an object with the record set of the given domain
- **reject**: (error)

## upsertRecords(domain, records)
- **description**: It will create or update the specified records for a given domain. if onew of the records exists it will updated, otherwise it will be created.
- **description**: It will create or update the specified records for a given domain. If one of the records exists it will updated, otherwise it will be created.
- **params**: (domain, records)
- **domain**: STRING: REQUIRED: the root domain of your site i.e. yoursite.com
- **records**: OBJECT: REQUIRED: the record set that includes:
- Record name
- Record type
- Record data
- Record ttl
- **returns**: promise(resolve, reject)
- **resolve**: ('All Done')
- **record**: an array with the new record data that has been created or updated
- **reject**: (error)


## deleteRecords(doamin, records)
## deleteRecords(domain, records)
- **description**: deletes the specified records for a given domain.
- **params**: (domain, records)
- **domain**: STRING: REQUIRED: the root domain of your site i.e. yoursite.com
- **records**: OBJECT: REQUIRED: the record sets that will be deleted
- **returns**: promise(resolve, reject)
- **resolve**: ('recordSet deleted')
- **recordSet**: an object with the record set hat has been deleted
- **reject**: (error)


## deleteAllRecords(doamin, records)
- **description**: Deletes all DNS records for a given domain.
- **params**: (domain)
- **domain**: STRING: REQUIRED: the root domain of your site i.e. yoursite.com
- **returns**: promise(resolve, reject)
- **resolve**: ('All recordSets deleted')
- **reject**: (error)

## createRedirect(domain, url)
- **description**: creates a 301 redirect for the given domian to a specified url.
- **params**: (domain, url)
- **domain**: STRING: REQUIRED: the root domain of your site i.e. yoursite.com
- **url**: STRING: REQUIRED: the url address you want to redirect
- **returns**: promise(resolve, reject)
- **resolve**: ('All Done')
- **type**: a string with the value "REDIRECT_PERMANENT"
- **url**: a string for the redirect url address
- **reject**: (error)


## addRecord(domain, records)
- **description**: It will add the specified records to the given domain.
- **params**: (domain, records)
- **domain**: STRING: REQUIRED: the root domain of your site i.e. yoursite.com
- **records**: OBJECT: REQUIRED: the record set that includes:
- Record name
- Record type
- Record data
- Record ttl
- **returns**: promise(resolve, reject)
- **resolve**: ('All Done')
- **record**: an object with the record that has been added
- **reject**: (error)


## getZone(domain)
- **description**: gets the DNS zone Id for a given domain.
- **description**: gets the DNS zone Id for a given domain.
- **params**: (domain)
- **domain**: STRING: REQUIRED: the root domain of your site i.e. yoursite.com
- **returns**: promise(resolve, reject)
- **resolve**: ('All Done')
- **HostedZones**: An array with the hosted zone ID of given domain.
- **reject**: ('no hosted zones exist for the given domain')

0 comments on commit d4ac580

Please sign in to comment.