@@ -5,21 +5,22 @@ export interface AuthParam {
55 apikey : string ;
66 apisessionid : string ;
77}
8+
9+ export type WithAuthentication < R > = R & AuthParam ;
10+
811export interface InfoDNSRecordsRequest {
912 action : string ;
10- param : InfoDNSRecordsParam ;
13+ param : WithAuthentication < InfoDNSRecordsParam > ;
1114}
1215
13- export interface InfoDNSRecordsParam extends AuthParam {
14- domainname : string ;
15- }
1616export interface InfoDNSZoneRequest {
1717 action : string ;
18- param : InfoDNSZoneParam ;
18+ param : WithAuthentication < InfoDNSZoneParam > ;
1919}
2020
21- export interface InfoDNSZoneParam extends AuthParam {
22- domainname : string ;
21+ export interface UpdateDNSRecordsRequest {
22+ action : string ;
23+ param : WithAuthentication < UpdateDNSRecordsParam > ;
2324}
2425
2526export interface LoginRequest {
@@ -28,26 +29,63 @@ export interface LoginRequest {
2829}
2930
3031export interface LoginParam {
32+ /**
33+ * Your Netcup API key generated from the [customer control panel](https://www.customercontrolpanel.de/daten_aendern.php?sprung=api).
34+ */
3135 apikey : string ;
36+ /**
37+ * The associated password for the API key.
38+ */
3239 apipassword : string ;
40+ /**
41+ * Your customer number.
42+ */
3343 customernumber : string ;
3444}
3545
36- export interface UpdateDNSRecordsRequest {
37- action : string ;
38- param : UpdateDNSRecordsParam ;
46+ export interface InfoDNSZoneParam {
47+ /**
48+ * The name of the domain to retrieve the zone info from.
49+ * @example "example.com"
50+ */
51+ domainname : string ;
3952}
4053
41- export interface UpdateDNSRecordsParam extends AuthParam {
54+ export interface InfoDNSRecordsParam {
55+ /**
56+ * The name of the domain to retrieve the records from.
57+ */
4258 domainname : string ;
59+ }
60+
61+ export interface UpdateDNSRecordsParam {
62+ /**
63+ * The domain name for which the DNS records should be updated.
64+ */
65+ domainname : string ;
66+ /**
67+ * The DNS entries of the domain to update.
68+ */
4369 dnsrecordset : { dnsrecords : DnsRecord [ ] } ;
4470}
4571
46- export type UpdateDnsRecordWithCurrentIpParams =
47- // enforce domainname
48- Pick < UpdateDNSRecordsParam , 'domainname' > &
49- // omit id, type, state and desination
50- Omit < DnsRecord , 'id' | 'type' | 'state' | 'destination' > & {
51- useIpv6Only ?: boolean ;
52- useIpv4AndIpv6 ?: boolean ;
53- } ;
72+ export interface UpdateDnsRecordWithCurrentIpParams {
73+ /**
74+ * The domain name for which DNS records with the current IP should be updated.
75+ * @example "example.com"
76+ */
77+ domainname : UpdateDNSRecordsParam [ 'domainname' ] ;
78+ /**
79+ * The host name of the DNS entry.
80+ * @example "www" - refers to www.example.com
81+ */
82+ hostname : DnsRecord [ 'hostname' ] ;
83+ /**
84+ * Indicates to update IPv6 (AAAA records) only.
85+ */
86+ useIpv6Only ?: boolean ;
87+ /**
88+ * Indicates to update IPv4 (A records) and IPv6 (AAAA records) records.
89+ */
90+ useIpv4AndIpv6 ?: boolean ;
91+ }
0 commit comments