node-transip
Node.JS Promise-based library to communicate with the TransIP API
This library creates a new instance of "TransIP" for you, exposing a few libraries and methods you can use to communicate.
Currently only the DomainService methods are supported
To start a new TransIP instance:
var TransIP = require ( ' transip ' ) ;
var transipInstance = new TransIP ( login , privateKey ) ;
login
is your TransIP login username. An example of the privateKey
can be found in config/data.example.js
.
Enable the TransIP API
The TransIP API is disabled by default, you will have to enable it manually in the control panel. You can create a private key and whitelist your servers after.
Running the integration tests
Unfortunately, it's not possible or safe for me to publish my private keys so you can run my tests directly. You'll have to adapt the tests to your environment. I run these tests by hand, for now.
DomainService
transipInstance.domainService.batchCheckAvailability
transipInstance . domainService . batchCheckAvailability ( [ ' dualdev.com ' , ' sillevis.net ' ] ) . then ( function ( domains ) {
} ) ;
transipInstance.domainService.checkAvailability
transipInstance . domainService . checkAvailability ( ' dualdev.com ' ) . then ( function ( domain ) {
} ) ;
transipInstance.domainService.getWhois
transipInstance . domainService . getWhois ( ' dualdev.com ' ) . then ( function ( whois ) {
} ) ;
transipInstance.domainService.getDomainNames
transipInstance . domainService . getDomainNames ( ) . then ( function ( domains ) {
} ) ;
transipInstance.domainService.getInfo
transipInstance . domainService . getInfo ( ' sillevis.net ' ) . then ( function ( info ) {
} )
transipInstance.domainService.batchGetInfo
transipInstance . domainService . batchGetInfo ( [ ' sillevis.net ' , ' sierveld.me ' ] ) . then ( function ( info ) {
} ) ;
transipInstance.domainService.getAuthCode
transipInstance . domainService . getAuthCode ( ' sillevis.net ' ) . then ( function ( authCode ) {
} )
transipInstance.domainService.getIsLocked
transipInstance . domainService . getIsLocked ( ' sillevis.net ' ) . then ( function ( isLocked ) {
} )
transipInstance.domainService.register
transipInstance . domainService . register ( {
' name ' : ' sillevis-test2.nl ' ,
' nameservers ' : {
' item ' : [ {
' hostname ' : ' ns01.dualdev.com ' ,
' ipv4 ' : ' ' ,
' ipv6 ' : ' '
} , {
' hostname ' : ' ns02.dualdev.com ' ,
' ipv4 ' : ' ' ,
' ipv6 ' : ' '
} , {
' hostname ' : ' ns03.dualdev.com ' ,
' ipv4 ' : ' ' ,
' ipv6 ' : ' '
} ]
} ,
' contacts ' : {
' item ' : [ {
' type ' : ' registrant ' ,
' firstName ' : ' Chase ' ,
' middleName ' : null ,
' lastName ' : ' Sillevis ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' info@dualdev.com ' ,
' country ' : ' NL '
} , {
' type ' : ' administrative ' ,
' firstName ' : ' René ' ,
' middleName ' : null ,
' lastName ' : ' van Sweeden ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' sales@dualdev.com ' ,
' country ' : ' NL '
} , {
' type ' : ' technical ' ,
' firstName ' : ' Chase ' ,
' middleName ' : null ,
' lastName ' : ' Sillevis ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' tech@dualdev.com ' ,
' country ' : ' NL '
} ]
}
} ) . then ( function ( response ) {
} )
transipInstance.domainService.cancel
Possible arguments for ending: end
or immediately
transipInstance . domainService . cancel ( ' sillevis.nl ' , ' end ' ) . then ( function ( response ) {
} )
transipInstance.domainService.transferWithOwnerChange
transipInstance . domainService . transferWithOwnerChange ( {
' name ' : ' sillevis-test2.nl ' ,
' contacts ' : {
' item ' : [ {
' type ' : ' registrant ' ,
' firstName ' : ' Chase ' ,
' middleName ' : null ,
' lastName ' : ' Sillevis ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' info@dualdev.com ' ,
' country ' : ' NL '
} , {
' type ' : ' administrative ' ,
' firstName ' : ' René ' ,
' middleName ' : null ,
' lastName ' : ' van Sweeden ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' sales@dualdev.com ' ,
' country ' : ' NL '
} , {
' type ' : ' technical ' ,
' firstName ' : ' Chase ' ,
' middleName ' : null ,
' lastName ' : ' Sillevis ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' tech@dualdev.com ' ,
' country ' : ' NL '
} ]
}
} , ' 12345abcdef ' ) . then ( function ( response ) {
} )
transipInstance.domainService.transferWithoutOwnerChange
transipInstance . domainService . transferWithoutOwnerChange ( {
' name ' : ' sillevis-test3.nl '
} , ' authCode ' ) . then ( function ( response ) {
} )
transipInstance.domainService.setNameservers
transipInstance . domainService . setNameservers ( ' sillevis.net ' , {
' hostname ' : ' dana.ns.cloudflare.com ' ,
' ipv4 ' : ' ' ,
' ipv6 ' : ' '
} , {
' hostname ' : ' tim.ns.cloudflare.com ' ,
' ipv4 ' : ' ' ,
' ipv6 ' : ' '
} ) . then ( function ( response ) {
} )
transipInstance.domainService.setLock
transipInstance . domainService . setLock ( ' sillevis.net ' ) . then ( function ( response ) {
} )
transipInstance.domainService.unsetLock
transipInstance . domainService . unsetLock ( ' sillevis.net ' ) . then ( function ( response ) {
} )
transipInstance.domainService.setDnsEntries
Please note that this function will replace all DNS entries
transipInstance . domainService . setDnsEntries ( ' sillevis.net ' , {
' item ' : [ {
' name ' : ' test ' ,
' expire ' : 10800 ,
' type ' : ' CNAME ' ,
' content ' : ' lb.dualdev.com. '
} ]
} ) . then ( function ( response ) {
} )
transipInstance.domainService.setOwner
transipInstance . domainService . setOwner ( ' sillevis.net ' , {
' type ' : ' registrant ' ,
' firstName ' : ' Chase ' ,
' middleName ' : null ,
' lastName ' : ' Sillevis ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' info@dualdev.com ' ,
' country ' : ' NL '
} ) . then ( function ( response ) {
} )
transipInstance.domainService.setContacts
transipInstance . domainService . setContacts ( ' sillevis.net ' , {
' item ' : [ {
' type ' : ' registrant ' ,
' firstName ' : ' Chase ' ,
' middleName ' : null ,
' lastName ' : ' Sillevis ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' info@dualdev.com ' ,
' country ' : ' NL '
} , {
' type ' : ' administrative ' ,
' firstName ' : ' René ' ,
' middleName ' : null ,
' lastName ' : ' van Sweeden ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' sales@dualdev.com ' ,
' country ' : ' NL '
} , {
' type ' : ' technical ' ,
' firstName ' : ' Chase ' ,
' middleName ' : null ,
' lastName ' : ' Sillevis ' ,
' companyName ' : ' DualDev ' ,
' companyKvk ' : ' 34372569 ' ,
' companyType ' : ' VOF ' ,
' street ' : ' Ravelrode ' ,
' number ' : ' 37 ' ,
' postalCode ' : ' 2717GD ' ,
' city ' : ' Zoetermeer ' ,
' phoneNumber ' : ' +31612345678 ' ,
' faxNumber ' : ' ' ,
' email ' : ' tech@dualdev.com ' ,
' country ' : ' NL '
} ]
} ) . then ( function ( response ) {
} )
transipInstance.domainService.getAllTldInfos
transipInstance . domainService . getAllTldInfos ( ) . then ( function ( response ) {
} )
transipInstance.domainService.getTldInfo
transipInstance . domainService . getTldInfo ( ' nl ' ) . then ( function ( response ) {
} )
transipInstance.domainService.getCurrentDomainAction
transipInstance . domainService . getCurrentDomainAction ( ' sillevis.net ' ) . then ( function ( response ) {
} )
transipInstance.domainService.retryCurrentDomainActionWithNewData
transipInstance . domainService . retryCurrentDomainActionWithNewData ( {
' name ' : ' sillevis.net '
} ) . then ( function ( response ) {
} )
transipInstance.domainService.retryTransferWithDifferentAuthCode
transipInstance . domainService . retryTransferWithDifferentAuthCode ( {
' name ' : ' sillevis-test4.nl '
} , ' 23456789 ' ) . then ( function ( response ) {
} )
transipInstance.domainService.cancelDomainAction
transipInstance . domainService . cancelDomainAction ( {
' name ' : ' sierveld.me '
} ) . then ( function ( response ) {
} )