netcup-node
Version:
A node wrapper for the Netcup CCP API (https://www.netcup-wiki.de/wiki/CCP_API)
74 lines (73 loc) • 2.61 kB
TypeScript
import { InitParams } from './@types/InitParams';
import { NetcupAuth } from './@types/NetcupAuth';
import { InfoDNSRecordsParam, InfoDNSZoneParam, UpdateDNSRecordsParam, UpdateDnsRecordWithCurrentIpParams } from './@types/Requests';
import { InfoDNSRecordsResponse, InfoDNSZoneResponse, UpdateDNSRecordsResponse } from './@types/Responses';
import NetcupRestApi from './api';
declare class NetcupApi {
private authData;
readonly restApi: NetcupRestApi;
private checkAndRefreshAuth;
/**
* Initializes authentication parameters
*/
init(params: InitParams): Promise<NetcupApi>;
/**
* Returns information about the DNS zone of a domain
* @example await api.infoDnsZone({ domainname: 'example.com' })
*/
infoDnsZone(params: InfoDNSZoneParam): Promise<InfoDNSZoneResponse>;
/**
* Returns information about the DNS records of a domain
* @example await api.infoDnsRecords({ domainname: 'example.com' })
*/
infoDnsRecords(params: InfoDNSRecordsParam): Promise<InfoDNSRecordsResponse>;
/**
* Updates DNS records of a domain and only those that are specified.
* @example
* await api.updateDnsRecords({
domainname: 'example.com',
dnsrecordset: {
dnsrecords: [{ name: 'www', type: 'A', destination: 'some-ip' }],
},
})
* @example
* // can also be used to delete records
* await api.updateDnsRecords({
domainname: 'example.com',
dnsrecordset: {
dnsrecords: [
{ name: 'www', type: 'A', destination: 'some-ip', deleterecord: true },
],
},
})
*/
updateDnsRecords(params: UpdateDNSRecordsParam): Promise<UpdateDNSRecordsResponse>;
/**
* Updates DNS records of a domain with the current public ip.
* @example
* // update ipv4 only
* await api.updateDnsRecordsWithCurrentIp({
domainname: 'example.com',
hostname: 'www',
})
* @example
* // update ipv4 and ipv6
* await api.updateDnsRecordsWithCurrentIp({
domainname: 'example.com',
hostname: 'www',
useIpv4AndIpv6: true,
})
* @example
* // update ipv6 only
* await api.updateDnsRecordsWithCurrentIp({
domainname: 'example.com',
hostname: 'www',
useIpv6Only: true,
})
*/
updateDnsRecordWithCurrentIp(params: UpdateDnsRecordWithCurrentIpParams): Promise<UpdateDNSRecordsResponse>;
getAuthData(): NetcupAuth;
}
export * from './@types';
export { NetcupRestApi, NetcupApi };
export default NetcupApi;