Skip to content

Commit 519c733

Browse files
committed
feat: added docs
1 parent 439304e commit 519c733

3 files changed

Lines changed: 171 additions & 81 deletions

File tree

README.md

Lines changed: 2 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
A node wrapper for the [Netcup CCP API](https://www.netcup-wiki.de/wiki/CCP_API).
1414

15+
Docs: [https://proohit.github.io/netcup-node/](https://proohit.github.io/netcup-node/)
16+
1517
## Current support
1618

1719
- only [JSON Rest API](https://www.netcup-wiki.de/wiki/CCP_API#Anmerkungen_zu_JSON-Requests), no SOAP yet
@@ -100,81 +102,3 @@ const api = await new NetcupApi().init({
100102
});
101103
const dnsInfo = await api.infoDnsZone({ domainname: 'YOUR.DOMAIN' });
102104
```
103-
104-
### Reference
105-
106-
```javascript
107-
/**
108-
* Initializes authentication parameters
109-
*/
110-
NetcupApi.init({
111-
apikey: 'YOUR_API_KEY',
112-
apipassword: 'YOUR_API_PASSWORD',
113-
customernumber: 'YOUR_CUSTOMER_NUMBER',
114-
});
115-
116-
/**
117-
* Retrieves information about a DNS zone
118-
* */
119-
NetcupApi.infoDnsZone({
120-
domainname: 'YOUR.DOMAIN',
121-
});
122-
123-
/**
124-
* Retrieves information about DNS records of a domain
125-
* */
126-
NetcupApi.infoDnsRecords({
127-
domainname: 'YOUR.DOMAIN',
128-
});
129-
130-
/**
131-
* Updates DNS records of a domain and only those that are specified.
132-
*/
133-
NetcupApi.updateDnsRecords({
134-
domainname: 'example.com',
135-
dnsrecordset: {
136-
dnsrecords: [{ name: 'www', type: 'A', destination: 'some-ip' }],
137-
},
138-
});
139-
// can also be used for deletion
140-
NetcupApi.updateDnsRecords({
141-
domainname: 'example.com',
142-
dnsrecordset: {
143-
dnsrecords: [
144-
{ name: 'www', type: 'A', destination: 'some-ip', deleterecord: true },
145-
],
146-
},
147-
});
148-
149-
/**
150-
* Updates DNS records of a domain with the current public ip.
151-
* @example
152-
* // update ipv4 only
153-
* await api.updateDnsRecordsWithCurrentIp({ domainname: 'example.com', dnsrecords: [{ hostname: 'www' }] })
154-
* @example
155-
* // update ipv4 and ipv6
156-
* await api.updateDnsRecordsWithCurrentIp({ domainname: 'example.com', dnsrecords: [{ hostname: 'www' }], useIpv4AndIpv6: true })
157-
* @example
158-
* // update ipv6 only
159-
* await api.updateDnsRecordsWithCurrentIp({ domainname: 'example.com', dnsrecords: [{ hostname: 'www' }], useIpv6Only: true })
160-
*/
161-
// update ipv4 only
162-
NetcupApi.updateDnsRecordWithCurrentIp({
163-
domainname: 'example.com',
164-
dnsrecordset: { dnsrecords: [{ hostname: 'www' }] },
165-
});
166-
167-
// update ipv4 and ipv6
168-
NetcupApi.updateDnsRecordWithCurrentIp({
169-
domainname: 'example.com',
170-
dnsrecordset: { dnsrecords: [{ hostname: 'www' }] },
171-
useIpv4AndIpv6: true,
172-
});
173-
174-
// update ipv6 only
175-
NetcupApi.updateDnsRecordWithCurrentIp({
176-
domainname: 'example.com',
177-
dnsrecordset: { dnsrecords: [{ hostname: 'www' }] },
178-
useIpv6Only: true,
179-
});
180-
```

package-lock.json

Lines changed: 164 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"lint": "eslint . --ext .ts,.tsx",
2727
"test": "jest --coverage",
2828
"test:watch": "jest --watch",
29-
"prerelease": "npm run build",
29+
"docs": "typedoc src/index.ts",
30+
"docs:release": "npm run docs && git add docs && git commit -m 'chore: update docs'",
31+
"prerelease": "npm run build && npm run docs:release",
3032
"release": "npm login && bump --tag && npm publish",
3133
"postrelease": "git push && git push --tags"
3234
},
@@ -64,10 +66,11 @@
6466
"ts-jest": "^27.1.4",
6567
"tsc-esm-fix": "^2.13.0",
6668
"tsutils": "^3.21.0",
69+
"typedoc": "^0.23.21",
6770
"typescript": "^4.6.3",
6871
"version-bump-prompt": "^6.1.0"
6972
},
7073
"engines": {
7174
"node": ">= 12.20"
7275
}
73-
}
76+
}

0 commit comments

Comments
 (0)