@geekmidas/edge 0.0.0-stage → 10.0.0-alpha.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/dist/certificates/local.cjs +393 -0
- package/dist/certificates/local.cjs.map +1 -0
- package/dist/certificates/local.d.cts +92 -0
- package/dist/certificates/local.d.cts.map +1 -0
- package/dist/certificates/local.d.mts +92 -0
- package/dist/certificates/local.d.mts.map +1 -0
- package/dist/certificates/local.mjs +361 -0
- package/dist/certificates/local.mjs.map +1 -0
- package/dist/compose-BHWyQvsD.cjs +22 -0
- package/dist/compose-BHWyQvsD.cjs.map +1 -0
- package/dist/compose-CcNlj65h.mjs +17 -0
- package/dist/compose-CcNlj65h.mjs.map +1 -0
- package/dist/dns/godaddy/index.cjs +448 -0
- package/dist/dns/godaddy/index.cjs.map +1 -0
- package/dist/dns/godaddy/index.d.cts +164 -0
- package/dist/dns/godaddy/index.d.cts.map +1 -0
- package/dist/dns/godaddy/index.d.mts +164 -0
- package/dist/dns/godaddy/index.d.mts.map +1 -0
- package/dist/dns/godaddy/index.mjs +435 -0
- package/dist/dns/godaddy/index.mjs.map +1 -0
- package/dist/dns/hostinger/index.cjs +252 -0
- package/dist/dns/hostinger/index.cjs.map +1 -0
- package/dist/dns/hostinger/index.d.cts +143 -0
- package/dist/dns/hostinger/index.d.cts.map +1 -0
- package/dist/dns/hostinger/index.d.mts +143 -0
- package/dist/dns/hostinger/index.d.mts.map +1 -0
- package/dist/dns/hostinger/index.mjs +249 -0
- package/dist/dns/hostinger/index.mjs.map +1 -0
- package/dist/dns/index.cjs +76 -0
- package/dist/dns/index.cjs.map +1 -0
- package/dist/dns/index.d.cts +144 -0
- package/dist/dns/index.d.cts.map +1 -0
- package/dist/dns/index.d.mts +144 -0
- package/dist/dns/index.d.mts.map +1 -0
- package/dist/dns/index.mjs +71 -0
- package/dist/dns/index.mjs.map +1 -0
- package/dist/dns/route53.cjs +210 -0
- package/dist/dns/route53.cjs.map +1 -0
- package/dist/dns/route53.d.cts +45 -0
- package/dist/dns/route53.d.cts.map +1 -0
- package/dist/dns/route53.d.mts +45 -0
- package/dist/dns/route53.d.mts.map +1 -0
- package/dist/dns/route53.mjs +209 -0
- package/dist/dns/route53.mjs.map +1 -0
- package/dist/errors-CO33_TDV.mjs +16 -0
- package/dist/errors-CO33_TDV.mjs.map +1 -0
- package/dist/errors-DBZfelEN.d.cts +13 -0
- package/dist/errors-DBZfelEN.d.cts.map +1 -0
- package/dist/errors-DBZfelEN.d.mts +13 -0
- package/dist/errors-DBZfelEN.d.mts.map +1 -0
- package/dist/errors-DlRLQOyZ.cjs +27 -0
- package/dist/errors-DlRLQOyZ.cjs.map +1 -0
- package/dist/index.cjs +6 -0
- package/dist/index.d.cts +15 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/proxy/caddy.cjs +167 -0
- package/dist/proxy/caddy.cjs.map +1 -0
- package/dist/proxy/caddy.d.cts +35 -0
- package/dist/proxy/caddy.d.cts.map +1 -0
- package/dist/proxy/caddy.d.mts +35 -0
- package/dist/proxy/caddy.d.mts.map +1 -0
- package/dist/proxy/caddy.mjs +164 -0
- package/dist/proxy/caddy.mjs.map +1 -0
- package/dist/proxy/traefik.cjs +460 -0
- package/dist/proxy/traefik.cjs.map +1 -0
- package/dist/proxy/traefik.d.cts +129 -0
- package/dist/proxy/traefik.d.cts.map +1 -0
- package/dist/proxy/traefik.d.mts +129 -0
- package/dist/proxy/traefik.d.mts.map +1 -0
- package/dist/proxy/traefik.mjs +437 -0
- package/dist/proxy/traefik.mjs.map +1 -0
- package/dist/routes/index.cjs +49 -0
- package/dist/routes/index.cjs.map +1 -0
- package/dist/routes/index.d.cts +205 -0
- package/dist/routes/index.d.cts.map +1 -0
- package/dist/routes/index.d.mts +205 -0
- package/dist/routes/index.d.mts.map +1 -0
- package/dist/routes/index.mjs +44 -0
- package/dist/routes/index.mjs.map +1 -0
- package/package.json +131 -3
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { t as EdgeError } from "../../errors-DBZfelEN.cjs";
|
|
2
|
+
import { DeleteDnsRecord, DeleteResult, DnsProvider, DnsRecord, UpsertDnsRecord, UpsertResult } from "../index.cjs";
|
|
3
|
+
//#region src/dns/godaddy/api.d.ts
|
|
4
|
+
/** A GoDaddy Personal Access Token, sent as `Authorization: Bearer <token>`. */
|
|
5
|
+
interface GoDaddyCredential {
|
|
6
|
+
token: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const GODADDY_API_BASE = "https://api.godaddy.com";
|
|
9
|
+
/** GoDaddy refuses a TTL below this. */
|
|
10
|
+
export declare const GODADDY_MIN_TTL = 600;
|
|
11
|
+
/** The record types gkm writes. Never TXT, NS, SOA, SRV or CAA. */
|
|
12
|
+
export declare const GODADDY_MANAGED_TYPES: readonly ['A', 'AAAA', 'CNAME', 'MX'];
|
|
13
|
+
type GoDaddyRecordType = (typeof GODADDY_MANAGED_TYPES)[number];
|
|
14
|
+
/** One record as GoDaddy returns it. */
|
|
15
|
+
interface GoDaddyRecord {
|
|
16
|
+
type: string;
|
|
17
|
+
name: string;
|
|
18
|
+
data: string;
|
|
19
|
+
ttl?: number;
|
|
20
|
+
/** An MX record's: GoDaddy keeps it apart from `data`. */
|
|
21
|
+
priority?: number;
|
|
22
|
+
}
|
|
23
|
+
/** One value of a record set, as a write sends it. */
|
|
24
|
+
interface GoDaddyRecordValue {
|
|
25
|
+
data: string;
|
|
26
|
+
/** An MX record's. */
|
|
27
|
+
priority?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The token is good, and GoDaddy will not let it use the API: since 2024 the
|
|
31
|
+
* Domains and DNS APIs answer only accounts with 10 or more domains, or a
|
|
32
|
+
* Discount Domain Club Premier membership.
|
|
33
|
+
*/
|
|
34
|
+
export declare class GoDaddyApiAccessDenied extends EdgeError {
|
|
35
|
+
readonly domain: string;
|
|
36
|
+
readonly detail?: string | undefined;
|
|
37
|
+
constructor(domain: string, detail?: string | undefined);
|
|
38
|
+
}
|
|
39
|
+
/** The token lacks the scope a records call needs. */
|
|
40
|
+
export declare class GoDaddyScopeMissing extends EdgeError {
|
|
41
|
+
readonly method: string;
|
|
42
|
+
readonly domain: string;
|
|
43
|
+
readonly scope: string;
|
|
44
|
+
readonly detail?: string | undefined;
|
|
45
|
+
constructor(method: string, domain: string, scope: string, detail?: string | undefined);
|
|
46
|
+
}
|
|
47
|
+
/** GoDaddy did not accept the token at all. */
|
|
48
|
+
export declare class GoDaddyCredentialsInvalid extends EdgeError {
|
|
49
|
+
readonly code?: string | undefined;
|
|
50
|
+
constructor(code?: string | undefined);
|
|
51
|
+
}
|
|
52
|
+
/** The domain is not in the account the token belongs to. */
|
|
53
|
+
export declare class GoDaddyDomainNotFound extends EdgeError {
|
|
54
|
+
readonly domain: string;
|
|
55
|
+
readonly code?: string | undefined;
|
|
56
|
+
constructor(domain: string, code?: string | undefined);
|
|
57
|
+
}
|
|
58
|
+
/** Still rate limited after waiting it out. */
|
|
59
|
+
export declare class GoDaddyRateLimited extends EdgeError {
|
|
60
|
+
readonly attempts: number;
|
|
61
|
+
readonly retryAfterSec?: number | undefined;
|
|
62
|
+
constructor(attempts: number, retryAfterSec?: number | undefined);
|
|
63
|
+
}
|
|
64
|
+
/** Any other failure from GoDaddy. */
|
|
65
|
+
export declare class GoDaddyRequestFailed extends Error {
|
|
66
|
+
readonly method: string;
|
|
67
|
+
readonly path: string;
|
|
68
|
+
readonly status: number;
|
|
69
|
+
readonly code?: string | undefined;
|
|
70
|
+
readonly detail?: string | undefined;
|
|
71
|
+
constructor(method: string, path: string, status: number, code?: string | undefined, detail?: string | undefined);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A write gkm was about to make to a record type it never manages, or to a
|
|
75
|
+
* name it was not asked for.
|
|
76
|
+
*/
|
|
77
|
+
export declare class GoDaddyRecordNotAllowed extends EdgeError {
|
|
78
|
+
readonly domain: string;
|
|
79
|
+
readonly type: string;
|
|
80
|
+
readonly recordName: string;
|
|
81
|
+
readonly reason: string;
|
|
82
|
+
constructor(domain: string, type: string, recordName: string, reason: string);
|
|
83
|
+
}
|
|
84
|
+
interface GoDaddyApiOptions {
|
|
85
|
+
credential: GoDaddyCredential;
|
|
86
|
+
/** The API's base URL. GoDaddy's production API by default. */
|
|
87
|
+
baseUrl?: string;
|
|
88
|
+
/** How a 429 or 504 is waited out — `setTimeout` by default; tests pass their own. */
|
|
89
|
+
sleep?: (ms: number) => Promise<void>;
|
|
90
|
+
/** How many times one request is sent before a 429 or 504 is final. Default 4. */
|
|
91
|
+
maxAttempts?: number;
|
|
92
|
+
}
|
|
93
|
+
/** The client. Every method touches one record set, by type and name. */
|
|
94
|
+
export declare class GoDaddyApi {
|
|
95
|
+
private readonly baseUrl;
|
|
96
|
+
private readonly sleep;
|
|
97
|
+
private readonly maxAttempts;
|
|
98
|
+
private readonly authorization;
|
|
99
|
+
/** Whether a read has succeeded: a later 403 is then the token's scope. */
|
|
100
|
+
private readSucceeded;
|
|
101
|
+
constructor(options: GoDaddyApiOptions);
|
|
102
|
+
/** The records of one name and type — empty when there are none. */
|
|
103
|
+
getRecordSet(domain: string, type: GoDaddyRecordType, name: string): Promise<GoDaddyRecord[]>;
|
|
104
|
+
/** Replace one name's records of one type with `values`. */
|
|
105
|
+
replaceRecordSet(domain: string, type: GoDaddyRecordType, name: string, values: readonly GoDaddyRecordValue[], ttl: number): Promise<void>;
|
|
106
|
+
/** Delete one name's records of one type. */
|
|
107
|
+
deleteRecordSet(domain: string, type: GoDaddyRecordType, name: string): Promise<void>;
|
|
108
|
+
private recordPath;
|
|
109
|
+
/** Only A, AAAA, CNAME and MX, at a real record name. */
|
|
110
|
+
private guard;
|
|
111
|
+
private request;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/dns/godaddy/index.d.ts
|
|
115
|
+
export interface GoDaddyProviderOptions {
|
|
116
|
+
/**
|
|
117
|
+
* Where the token comes from, asked the first time the API is called. It
|
|
118
|
+
* throws when there is none: what to do about a missing token is the
|
|
119
|
+
* caller's to say.
|
|
120
|
+
*/
|
|
121
|
+
credential: () => Promise<GoDaddyCredential>;
|
|
122
|
+
/** The API's base URL, for tests. */
|
|
123
|
+
baseUrl?: string;
|
|
124
|
+
/** How a 429 is waited out, for tests. */
|
|
125
|
+
sleep?: GoDaddyApiOptions['sleep'];
|
|
126
|
+
maxAttempts?: number;
|
|
127
|
+
/** Where the write-only notice goes — `console.log` by default. */
|
|
128
|
+
log?: (line: string) => void;
|
|
129
|
+
}
|
|
130
|
+
/** GoDaddy cannot list a zone through the records-by-name endpoints. */
|
|
131
|
+
export declare class GoDaddyZoneListingUnsupported extends EdgeError {
|
|
132
|
+
readonly domain: string;
|
|
133
|
+
constructor(domain: string);
|
|
134
|
+
}
|
|
135
|
+
export declare class GoDaddyProvider implements DnsProvider {
|
|
136
|
+
private readonly options;
|
|
137
|
+
readonly name = "godaddy";
|
|
138
|
+
private api;
|
|
139
|
+
/** Set once a read is refused: every write is then a blind PUT. */
|
|
140
|
+
private writeOnly;
|
|
141
|
+
constructor(options: GoDaddyProviderOptions);
|
|
142
|
+
/** Whether the token turned out unable to read records. */
|
|
143
|
+
get readsDenied(): boolean;
|
|
144
|
+
private getApi;
|
|
145
|
+
private assertManaged;
|
|
146
|
+
/** Never: the whole zone is not read. See {@link GoDaddyZoneListingUnsupported}. */
|
|
147
|
+
getRecords(domain: string): Promise<DnsRecord[]>;
|
|
148
|
+
/**
|
|
149
|
+
* The records of exactly these names and types, one request each.
|
|
150
|
+
*
|
|
151
|
+
* @throws {DnsRecordsUnreadable} when the token may not read records
|
|
152
|
+
*/
|
|
153
|
+
readRecords(domain: string, wanted: readonly DeleteDnsRecord[]): Promise<DnsRecord[]>;
|
|
154
|
+
/**
|
|
155
|
+
* Each record set to exactly its one value: read it, and write it only
|
|
156
|
+
* when it differs — or, with a token that cannot read, write it. Only the
|
|
157
|
+
* name and type of each record handed in is touched.
|
|
158
|
+
*/
|
|
159
|
+
upsertRecords(domain: string, records: UpsertDnsRecord[]): Promise<UpsertResult[]>;
|
|
160
|
+
deleteRecords(domain: string, records: DeleteDnsRecord[]): Promise<DeleteResult[]>;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export type { GoDaddyApiOptions, GoDaddyCredential, GoDaddyRecord, GoDaddyRecordType, GoDaddyRecordValue };
|
|
164
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../../src/dns/godaddy/api.ts","../../../src/dns/godaddy/index.ts"],"mappings":";;;;UA2BiB;EAChB;;qBAGY;;qBAGA;;qBAGA;KAED,4BAA4B;;UAGvB;EAChB;EACA;EACA;EACA;;EAEA;;;UAIgB;EAChB;;EAEA;;;;;;;qBAeY,+BAA+B;WAEjC;WACA;EAFV,YACU,gBACA;;;qBAiBE,4BAA4B;WAE9B;WACA;WACA;WACA;EAJV,YACU,gBACA,gBACA,eACA;;;qBAcE,kCAAkC;WACzB;EAArB,YAAqB;;;qBAYT,8BAA8B;WAEhC;WACA;EAFV,YACU,gBACA;;;qBAWE,2BAA2B;WAE7B;WACA;EAFV,YACU,kBACA;;;qBAaE,6BAA6B;WAE/B;WACA;WACA;WACA;WACA;EALV,YACU,gBACA,cACA,gBACA,2BACA;;;;;;qBAiBE,gCAAgC;WAElC;WACA;WACA;WACA;EAJV,YACU,gBACA,cACA,oBACA;;UAWM;EAChB,YAAY;;EAEZ;;EAEA,SAAS,eAAe;;EAExB;;;qBAkBY;mBACK;mBACA;mBACA;mBACA;;UAET;EAER,YAAY,SAAS;;EAUf,aACL,gBACA,MAAM,mBACN,eACE,QAAQ;;EAWL,iBACL,gBACA,MAAM,mBACN,cACA,iBAAiB,sBACjB,cACE;;EAeG,gBACL,gBACA,MAAM,mBACN,eACE;UAKK;;UAKA;UAmBM;;;;iBChQE;;;;;;EAMhB,kBAAkB,QAAQ;;EAE1B;;EAEA,QAAQ;EACR;;EAEA,OAAO;;;qBAIK,sCAAsC;WAC7B;EAArB,YAAqB;;qBAyCT,2BAA2B;mBAMV;WALpB;UACD;;UAEA;EAER,YAA6B,SAAS;;MAGlC;UAIU;UAcN;;EAYF,WAAW,iBAAiB,QAAQ;;;;;;EASpC,YACL,gBACA,iBAAiB,oBACf,QAAQ;;;;;;EAqCL,cACL,gBACA,SAAS,oBACP,QAAQ;EA+CL,cACL,gBACA,SAAS,oBACP,QAAQ"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { t as EdgeError } from "../../errors-DBZfelEN.mjs";
|
|
2
|
+
import { DeleteDnsRecord, DeleteResult, DnsProvider, DnsRecord, UpsertDnsRecord, UpsertResult } from "../index.mjs";
|
|
3
|
+
//#region src/dns/godaddy/api.d.ts
|
|
4
|
+
/** A GoDaddy Personal Access Token, sent as `Authorization: Bearer <token>`. */
|
|
5
|
+
interface GoDaddyCredential {
|
|
6
|
+
token: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const GODADDY_API_BASE = "https://api.godaddy.com";
|
|
9
|
+
/** GoDaddy refuses a TTL below this. */
|
|
10
|
+
export declare const GODADDY_MIN_TTL = 600;
|
|
11
|
+
/** The record types gkm writes. Never TXT, NS, SOA, SRV or CAA. */
|
|
12
|
+
export declare const GODADDY_MANAGED_TYPES: readonly ['A', 'AAAA', 'CNAME', 'MX'];
|
|
13
|
+
type GoDaddyRecordType = (typeof GODADDY_MANAGED_TYPES)[number];
|
|
14
|
+
/** One record as GoDaddy returns it. */
|
|
15
|
+
interface GoDaddyRecord {
|
|
16
|
+
type: string;
|
|
17
|
+
name: string;
|
|
18
|
+
data: string;
|
|
19
|
+
ttl?: number;
|
|
20
|
+
/** An MX record's: GoDaddy keeps it apart from `data`. */
|
|
21
|
+
priority?: number;
|
|
22
|
+
}
|
|
23
|
+
/** One value of a record set, as a write sends it. */
|
|
24
|
+
interface GoDaddyRecordValue {
|
|
25
|
+
data: string;
|
|
26
|
+
/** An MX record's. */
|
|
27
|
+
priority?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The token is good, and GoDaddy will not let it use the API: since 2024 the
|
|
31
|
+
* Domains and DNS APIs answer only accounts with 10 or more domains, or a
|
|
32
|
+
* Discount Domain Club Premier membership.
|
|
33
|
+
*/
|
|
34
|
+
export declare class GoDaddyApiAccessDenied extends EdgeError {
|
|
35
|
+
readonly domain: string;
|
|
36
|
+
readonly detail?: string | undefined;
|
|
37
|
+
constructor(domain: string, detail?: string | undefined);
|
|
38
|
+
}
|
|
39
|
+
/** The token lacks the scope a records call needs. */
|
|
40
|
+
export declare class GoDaddyScopeMissing extends EdgeError {
|
|
41
|
+
readonly method: string;
|
|
42
|
+
readonly domain: string;
|
|
43
|
+
readonly scope: string;
|
|
44
|
+
readonly detail?: string | undefined;
|
|
45
|
+
constructor(method: string, domain: string, scope: string, detail?: string | undefined);
|
|
46
|
+
}
|
|
47
|
+
/** GoDaddy did not accept the token at all. */
|
|
48
|
+
export declare class GoDaddyCredentialsInvalid extends EdgeError {
|
|
49
|
+
readonly code?: string | undefined;
|
|
50
|
+
constructor(code?: string | undefined);
|
|
51
|
+
}
|
|
52
|
+
/** The domain is not in the account the token belongs to. */
|
|
53
|
+
export declare class GoDaddyDomainNotFound extends EdgeError {
|
|
54
|
+
readonly domain: string;
|
|
55
|
+
readonly code?: string | undefined;
|
|
56
|
+
constructor(domain: string, code?: string | undefined);
|
|
57
|
+
}
|
|
58
|
+
/** Still rate limited after waiting it out. */
|
|
59
|
+
export declare class GoDaddyRateLimited extends EdgeError {
|
|
60
|
+
readonly attempts: number;
|
|
61
|
+
readonly retryAfterSec?: number | undefined;
|
|
62
|
+
constructor(attempts: number, retryAfterSec?: number | undefined);
|
|
63
|
+
}
|
|
64
|
+
/** Any other failure from GoDaddy. */
|
|
65
|
+
export declare class GoDaddyRequestFailed extends Error {
|
|
66
|
+
readonly method: string;
|
|
67
|
+
readonly path: string;
|
|
68
|
+
readonly status: number;
|
|
69
|
+
readonly code?: string | undefined;
|
|
70
|
+
readonly detail?: string | undefined;
|
|
71
|
+
constructor(method: string, path: string, status: number, code?: string | undefined, detail?: string | undefined);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A write gkm was about to make to a record type it never manages, or to a
|
|
75
|
+
* name it was not asked for.
|
|
76
|
+
*/
|
|
77
|
+
export declare class GoDaddyRecordNotAllowed extends EdgeError {
|
|
78
|
+
readonly domain: string;
|
|
79
|
+
readonly type: string;
|
|
80
|
+
readonly recordName: string;
|
|
81
|
+
readonly reason: string;
|
|
82
|
+
constructor(domain: string, type: string, recordName: string, reason: string);
|
|
83
|
+
}
|
|
84
|
+
interface GoDaddyApiOptions {
|
|
85
|
+
credential: GoDaddyCredential;
|
|
86
|
+
/** The API's base URL. GoDaddy's production API by default. */
|
|
87
|
+
baseUrl?: string;
|
|
88
|
+
/** How a 429 or 504 is waited out — `setTimeout` by default; tests pass their own. */
|
|
89
|
+
sleep?: (ms: number) => Promise<void>;
|
|
90
|
+
/** How many times one request is sent before a 429 or 504 is final. Default 4. */
|
|
91
|
+
maxAttempts?: number;
|
|
92
|
+
}
|
|
93
|
+
/** The client. Every method touches one record set, by type and name. */
|
|
94
|
+
export declare class GoDaddyApi {
|
|
95
|
+
private readonly baseUrl;
|
|
96
|
+
private readonly sleep;
|
|
97
|
+
private readonly maxAttempts;
|
|
98
|
+
private readonly authorization;
|
|
99
|
+
/** Whether a read has succeeded: a later 403 is then the token's scope. */
|
|
100
|
+
private readSucceeded;
|
|
101
|
+
constructor(options: GoDaddyApiOptions);
|
|
102
|
+
/** The records of one name and type — empty when there are none. */
|
|
103
|
+
getRecordSet(domain: string, type: GoDaddyRecordType, name: string): Promise<GoDaddyRecord[]>;
|
|
104
|
+
/** Replace one name's records of one type with `values`. */
|
|
105
|
+
replaceRecordSet(domain: string, type: GoDaddyRecordType, name: string, values: readonly GoDaddyRecordValue[], ttl: number): Promise<void>;
|
|
106
|
+
/** Delete one name's records of one type. */
|
|
107
|
+
deleteRecordSet(domain: string, type: GoDaddyRecordType, name: string): Promise<void>;
|
|
108
|
+
private recordPath;
|
|
109
|
+
/** Only A, AAAA, CNAME and MX, at a real record name. */
|
|
110
|
+
private guard;
|
|
111
|
+
private request;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/dns/godaddy/index.d.ts
|
|
115
|
+
export interface GoDaddyProviderOptions {
|
|
116
|
+
/**
|
|
117
|
+
* Where the token comes from, asked the first time the API is called. It
|
|
118
|
+
* throws when there is none: what to do about a missing token is the
|
|
119
|
+
* caller's to say.
|
|
120
|
+
*/
|
|
121
|
+
credential: () => Promise<GoDaddyCredential>;
|
|
122
|
+
/** The API's base URL, for tests. */
|
|
123
|
+
baseUrl?: string;
|
|
124
|
+
/** How a 429 is waited out, for tests. */
|
|
125
|
+
sleep?: GoDaddyApiOptions['sleep'];
|
|
126
|
+
maxAttempts?: number;
|
|
127
|
+
/** Where the write-only notice goes — `console.log` by default. */
|
|
128
|
+
log?: (line: string) => void;
|
|
129
|
+
}
|
|
130
|
+
/** GoDaddy cannot list a zone through the records-by-name endpoints. */
|
|
131
|
+
export declare class GoDaddyZoneListingUnsupported extends EdgeError {
|
|
132
|
+
readonly domain: string;
|
|
133
|
+
constructor(domain: string);
|
|
134
|
+
}
|
|
135
|
+
export declare class GoDaddyProvider implements DnsProvider {
|
|
136
|
+
private readonly options;
|
|
137
|
+
readonly name = "godaddy";
|
|
138
|
+
private api;
|
|
139
|
+
/** Set once a read is refused: every write is then a blind PUT. */
|
|
140
|
+
private writeOnly;
|
|
141
|
+
constructor(options: GoDaddyProviderOptions);
|
|
142
|
+
/** Whether the token turned out unable to read records. */
|
|
143
|
+
get readsDenied(): boolean;
|
|
144
|
+
private getApi;
|
|
145
|
+
private assertManaged;
|
|
146
|
+
/** Never: the whole zone is not read. See {@link GoDaddyZoneListingUnsupported}. */
|
|
147
|
+
getRecords(domain: string): Promise<DnsRecord[]>;
|
|
148
|
+
/**
|
|
149
|
+
* The records of exactly these names and types, one request each.
|
|
150
|
+
*
|
|
151
|
+
* @throws {DnsRecordsUnreadable} when the token may not read records
|
|
152
|
+
*/
|
|
153
|
+
readRecords(domain: string, wanted: readonly DeleteDnsRecord[]): Promise<DnsRecord[]>;
|
|
154
|
+
/**
|
|
155
|
+
* Each record set to exactly its one value: read it, and write it only
|
|
156
|
+
* when it differs — or, with a token that cannot read, write it. Only the
|
|
157
|
+
* name and type of each record handed in is touched.
|
|
158
|
+
*/
|
|
159
|
+
upsertRecords(domain: string, records: UpsertDnsRecord[]): Promise<UpsertResult[]>;
|
|
160
|
+
deleteRecords(domain: string, records: DeleteDnsRecord[]): Promise<DeleteResult[]>;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export type { GoDaddyApiOptions, GoDaddyCredential, GoDaddyRecord, GoDaddyRecordType, GoDaddyRecordValue };
|
|
164
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/dns/godaddy/api.ts","../../../src/dns/godaddy/index.ts"],"mappings":";;;;UA2BiB;EAChB;;qBAGY;;qBAGA;;qBAGA;KAED,4BAA4B;;UAGvB;EAChB;EACA;EACA;EACA;;EAEA;;;UAIgB;EAChB;;EAEA;;;;;;;qBAeY,+BAA+B;WAEjC;WACA;EAFV,YACU,gBACA;;;qBAiBE,4BAA4B;WAE9B;WACA;WACA;WACA;EAJV,YACU,gBACA,gBACA,eACA;;;qBAcE,kCAAkC;WACzB;EAArB,YAAqB;;;qBAYT,8BAA8B;WAEhC;WACA;EAFV,YACU,gBACA;;;qBAWE,2BAA2B;WAE7B;WACA;EAFV,YACU,kBACA;;;qBAaE,6BAA6B;WAE/B;WACA;WACA;WACA;WACA;EALV,YACU,gBACA,cACA,gBACA,2BACA;;;;;;qBAiBE,gCAAgC;WAElC;WACA;WACA;WACA;EAJV,YACU,gBACA,cACA,oBACA;;UAWM;EAChB,YAAY;;EAEZ;;EAEA,SAAS,eAAe;;EAExB;;;qBAkBY;mBACK;mBACA;mBACA;mBACA;;UAET;EAER,YAAY,SAAS;;EAUf,aACL,gBACA,MAAM,mBACN,eACE,QAAQ;;EAWL,iBACL,gBACA,MAAM,mBACN,cACA,iBAAiB,sBACjB,cACE;;EAeG,gBACL,gBACA,MAAM,mBACN,eACE;UAKK;;UAKA;UAmBM;;;;iBChQE;;;;;;EAMhB,kBAAkB,QAAQ;;EAE1B;;EAEA,QAAQ;EACR;;EAEA,OAAO;;;qBAIK,sCAAsC;WAC7B;EAArB,YAAqB;;qBAyCT,2BAA2B;mBAMV;WALpB;UACD;;UAEA;EAER,YAA6B,SAAS;;MAGlC;UAIU;UAcN;;EAYF,WAAW,iBAAiB,QAAQ;;;;;;EASpC,YACL,gBACA,iBAAiB,oBACf,QAAQ;;;;;;EAqCL,cACL,gBACA,SAAS,oBACP,QAAQ;EA+CL,cACL,gBACA,SAAS,oBACP,QAAQ"}
|