From 23975e5b778b581c47847fcf8eb9be894b8b86ec Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Tue, 26 Jan 2016 13:10:36 +0100 Subject: [PATCH 1/3] Create Gandi definitions --- gandi/gandi-tests.ts | 8 ++++++++ gandi/gandi.d.ts | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gandi/gandi-tests.ts create mode 100644 gandi/gandi.d.ts diff --git a/gandi/gandi-tests.ts b/gandi/gandi-tests.ts new file mode 100644 index 000000000..cc4448e33 --- /dev/null +++ b/gandi/gandi-tests.ts @@ -0,0 +1,8 @@ +/// + +let zone: ZoneRecord = { + rrset_name: "MyZone", + rrset_type: "AAAA", + rrset_ttl: 10800, + rrset_values: [] +} diff --git a/gandi/gandi.d.ts b/gandi/gandi.d.ts new file mode 100644 index 000000000..eedbd5927 --- /dev/null +++ b/gandi/gandi.d.ts @@ -0,0 +1,42 @@ +// Type definitions for Gandi LiveDNS +// Project: http://doc.livedns.gandi.net/ +// Definitions by: Xavier Stouder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface Zone { + uuid: string; + name: string; + primary_ns: string; + apex_alias: string; + email: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minimum: number; +} + +interface ZoneRecord { + rrset_name: string; + /** + * One of A, AAA, CNAME, MX, NS, TXT, WKS, SRV, LOC, SPF, SSHFP, DNAME + */ + rrset_type: string; + rrset_ttl: number; + rrset_values: string[]; +} + +interface Domain { + fqdn: string; + zone_uuid: string; +} + +interface Snapshot { + serial: number; + zone_uuid: string; + /** + * Can be used as a date with "new Date(change_time);" + */ + change_time: string; + zone_data: ZoneRecord[]; +} \ No newline at end of file From 1ff071439a9deb010e392d108ffebba24c6a5df4 Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Tue, 26 Jan 2016 13:14:49 +0100 Subject: [PATCH 2/3] Correct API name --- gandi/gandi-tests.ts => gandi-livedns/gandi-livedns-tests.ts | 2 +- gandi/gandi.d.ts => gandi-livedns/gandi-livedns.d.ts | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename gandi/gandi-tests.ts => gandi-livedns/gandi-livedns-tests.ts (73%) rename gandi/gandi.d.ts => gandi-livedns/gandi-livedns.d.ts (100%) diff --git a/gandi/gandi-tests.ts b/gandi-livedns/gandi-livedns-tests.ts similarity index 73% rename from gandi/gandi-tests.ts rename to gandi-livedns/gandi-livedns-tests.ts index cc4448e33..36ff0f14d 100644 --- a/gandi/gandi-tests.ts +++ b/gandi-livedns/gandi-livedns-tests.ts @@ -1,4 +1,4 @@ -/// +/// let zone: ZoneRecord = { rrset_name: "MyZone", diff --git a/gandi/gandi.d.ts b/gandi-livedns/gandi-livedns.d.ts similarity index 100% rename from gandi/gandi.d.ts rename to gandi-livedns/gandi-livedns.d.ts From 0f4d651f755fd7012ccd0df15f893ceda85922a0 Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Wed, 27 Jan 2016 13:50:07 +0100 Subject: [PATCH 3/3] Fix tab --- gandi-livedns/gandi-livedns-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gandi-livedns/gandi-livedns-tests.ts b/gandi-livedns/gandi-livedns-tests.ts index 36ff0f14d..882f60a64 100644 --- a/gandi-livedns/gandi-livedns-tests.ts +++ b/gandi-livedns/gandi-livedns-tests.ts @@ -1,7 +1,7 @@ /// let zone: ZoneRecord = { - rrset_name: "MyZone", + rrset_name: "MyZone", rrset_type: "AAAA", rrset_ttl: 10800, rrset_values: []