@serve.zone/dcrouter-apiclient 32.3.0
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/dist_ts_apiclient/classes.apitoken.d.ts +41 -0
- package/dist_ts_apiclient/classes.apitoken.js +115 -0
- package/dist_ts_apiclient/classes.certificate.d.ts +57 -0
- package/dist_ts_apiclient/classes.certificate.js +69 -0
- package/dist_ts_apiclient/classes.config.d.ts +7 -0
- package/dist_ts_apiclient/classes.config.js +11 -0
- package/dist_ts_apiclient/classes.dcrouterapiclient.d.ts +54 -0
- package/dist_ts_apiclient/classes.dcrouterapiclient.js +97 -0
- package/dist_ts_apiclient/classes.email.d.ts +30 -0
- package/dist_ts_apiclient/classes.email.js +52 -0
- package/dist_ts_apiclient/classes.gatewayclient.d.ts +28 -0
- package/dist_ts_apiclient/classes.gatewayclient.js +52 -0
- package/dist_ts_apiclient/classes.logs.d.ts +28 -0
- package/dist_ts_apiclient/classes.logs.js +69 -0
- package/dist_ts_apiclient/classes.radius.d.ts +59 -0
- package/dist_ts_apiclient/classes.radius.js +95 -0
- package/dist_ts_apiclient/classes.remoteingress.d.ts +66 -0
- package/dist_ts_apiclient/classes.remoteingress.js +164 -0
- package/dist_ts_apiclient/classes.route.d.ts +39 -0
- package/dist_ts_apiclient/classes.route.js +125 -0
- package/dist_ts_apiclient/classes.stats.d.ts +47 -0
- package/dist_ts_apiclient/classes.stats.js +38 -0
- package/dist_ts_apiclient/classes.testing.d.ts +65 -0
- package/dist_ts_apiclient/classes.testing.js +120 -0
- package/dist_ts_apiclient/index.d.ts +12 -0
- package/dist_ts_apiclient/index.js +16 -0
- package/dist_ts_apiclient/plugins.d.ts +4 -0
- package/dist_ts_apiclient/plugins.js +6 -0
- package/dist_ts_interfaces/data/acme-config.d.ts +23 -0
- package/dist_ts_interfaces/data/acme-config.js +2 -0
- package/dist_ts_interfaces/data/auth.d.ts +8 -0
- package/dist_ts_interfaces/data/auth.js +2 -0
- package/dist_ts_interfaces/data/config-events.d.ts +34 -0
- package/dist_ts_interfaces/data/config-events.js +8 -0
- package/dist_ts_interfaces/data/dns-authority.d.ts +98 -0
- package/dist_ts_interfaces/data/dns-authority.js +26 -0
- package/dist_ts_interfaces/data/dns-provider.d.ts +136 -0
- package/dist_ts_interfaces/data/dns-provider.js +41 -0
- package/dist_ts_interfaces/data/dns-record.d.ts +48 -0
- package/dist_ts_interfaces/data/dns-record.js +2 -0
- package/dist_ts_interfaces/data/domain.d.ts +35 -0
- package/dist_ts_interfaces/data/domain.js +2 -0
- package/dist_ts_interfaces/data/email-domain.d.ts +177 -0
- package/dist_ts_interfaces/data/email-domain.js +2 -0
- package/dist_ts_interfaces/data/email-settings.d.ts +68 -0
- package/dist_ts_interfaces/data/email-settings.js +2 -0
- package/dist_ts_interfaces/data/index.d.ts +18 -0
- package/dist_ts_interfaces/data/index.js +19 -0
- package/dist_ts_interfaces/data/remoteingress.d.ts +181 -0
- package/dist_ts_interfaces/data/remoteingress.js +15 -0
- package/dist_ts_interfaces/data/route-management.d.ts +270 -0
- package/dist_ts_interfaces/data/route-management.js +130 -0
- package/dist_ts_interfaces/data/security-policy.d.ts +32 -0
- package/dist_ts_interfaces/data/security-policy.js +2 -0
- package/dist_ts_interfaces/data/smtp-account.d.ts +50 -0
- package/dist_ts_interfaces/data/smtp-account.js +9 -0
- package/dist_ts_interfaces/data/stats.d.ts +283 -0
- package/dist_ts_interfaces/data/stats.js +2 -0
- package/dist_ts_interfaces/data/target-profile.d.ts +30 -0
- package/dist_ts_interfaces/data/target-profile.js +2 -0
- package/dist_ts_interfaces/data/testing.d.ts +191 -0
- package/dist_ts_interfaces/data/testing.js +20 -0
- package/dist_ts_interfaces/data/vpn.d.ts +65 -0
- package/dist_ts_interfaces/data/vpn.js +2 -0
- package/dist_ts_interfaces/data/workhoster.d.ts +63 -0
- package/dist_ts_interfaces/data/workhoster.js +2 -0
- package/dist_ts_interfaces/index.d.ts +5 -0
- package/dist_ts_interfaces/index.js +8 -0
- package/dist_ts_interfaces/plugins.d.ts +2 -0
- package/dist_ts_interfaces/plugins.js +4 -0
- package/dist_ts_interfaces/requests/acme-config.d.ts +42 -0
- package/dist_ts_interfaces/requests/acme-config.js +2 -0
- package/dist_ts_interfaces/requests/admin.d.ts +69 -0
- package/dist_ts_interfaces/requests/admin.js +3 -0
- package/dist_ts_interfaces/requests/api-tokens.d.ts +85 -0
- package/dist_ts_interfaces/requests/api-tokens.js +2 -0
- package/dist_ts_interfaces/requests/certificate.d.ts +87 -0
- package/dist_ts_interfaces/requests/certificate.js +5 -0
- package/dist_ts_interfaces/requests/combined.stats.d.ts +29 -0
- package/dist_ts_interfaces/requests/combined.stats.js +2 -0
- package/dist_ts_interfaces/requests/config-events.d.ts +35 -0
- package/dist_ts_interfaces/requests/config-events.js +4 -0
- package/dist_ts_interfaces/requests/config.d.ts +93 -0
- package/dist_ts_interfaces/requests/config.js +3 -0
- package/dist_ts_interfaces/requests/dns-authority.d.ts +80 -0
- package/dist_ts_interfaces/requests/dns-authority.js +3 -0
- package/dist_ts_interfaces/requests/dns-providers.d.ts +117 -0
- package/dist_ts_interfaces/requests/dns-providers.js +2 -0
- package/dist_ts_interfaces/requests/dns-records.d.ts +89 -0
- package/dist_ts_interfaces/requests/dns-records.js +2 -0
- package/dist_ts_interfaces/requests/domains.d.ts +142 -0
- package/dist_ts_interfaces/requests/domains.js +2 -0
- package/dist_ts_interfaces/requests/email-domains.d.ts +154 -0
- package/dist_ts_interfaces/requests/email-domains.js +2 -0
- package/dist_ts_interfaces/requests/email-ops.d.ts +211 -0
- package/dist_ts_interfaces/requests/email-ops.js +3 -0
- package/dist_ts_interfaces/requests/email-settings.d.ts +26 -0
- package/dist_ts_interfaces/requests/email-settings.js +2 -0
- package/dist_ts_interfaces/requests/index.d.ts +29 -0
- package/dist_ts_interfaces/requests/index.js +30 -0
- package/dist_ts_interfaces/requests/logs.d.ts +43 -0
- package/dist_ts_interfaces/requests/logs.js +4 -0
- package/dist_ts_interfaces/requests/network-targets.d.ts +102 -0
- package/dist_ts_interfaces/requests/network-targets.js +2 -0
- package/dist_ts_interfaces/requests/radius.d.ts +280 -0
- package/dist_ts_interfaces/requests/radius.js +3 -0
- package/dist_ts_interfaces/requests/realtime.d.ts +38 -0
- package/dist_ts_interfaces/requests/realtime.js +12 -0
- package/dist_ts_interfaces/requests/remoteingress.d.ts +162 -0
- package/dist_ts_interfaces/requests/remoteingress.js +3 -0
- package/dist_ts_interfaces/requests/route-management.d.ts +147 -0
- package/dist_ts_interfaces/requests/route-management.js +2 -0
- package/dist_ts_interfaces/requests/security-policy.d.ts +105 -0
- package/dist_ts_interfaces/requests/security-policy.js +2 -0
- package/dist_ts_interfaces/requests/smtp-accounts.d.ts +125 -0
- package/dist_ts_interfaces/requests/smtp-accounts.js +2 -0
- package/dist_ts_interfaces/requests/source-profiles.d.ts +102 -0
- package/dist_ts_interfaces/requests/source-profiles.js +2 -0
- package/dist_ts_interfaces/requests/stats.d.ts +196 -0
- package/dist_ts_interfaces/requests/stats.js +4 -0
- package/dist_ts_interfaces/requests/target-profiles.d.ts +105 -0
- package/dist_ts_interfaces/requests/target-profiles.js +2 -0
- package/dist_ts_interfaces/requests/testing.d.ts +169 -0
- package/dist_ts_interfaces/requests/testing.js +2 -0
- package/dist_ts_interfaces/requests/users.d.ts +53 -0
- package/dist_ts_interfaces/requests/users.js +3 -0
- package/dist_ts_interfaces/requests/vpn.d.ts +188 -0
- package/dist_ts_interfaces/requests/vpn.js +3 -0
- package/dist_ts_interfaces/requests/workhoster.d.ts +79 -0
- package/dist_ts_interfaces/requests/workhoster.js +2 -0
- package/license +21 -0
- package/package.json +67 -0
- package/readme.md +218 -0
- package/ts_apiclient/classes.apitoken.ts +157 -0
- package/ts_apiclient/classes.certificate.ts +124 -0
- package/ts_apiclient/classes.config.ts +17 -0
- package/ts_apiclient/classes.dcrouterapiclient.ts +138 -0
- package/ts_apiclient/classes.email.ts +77 -0
- package/ts_apiclient/classes.gatewayclient.ts +110 -0
- package/ts_apiclient/classes.logs.ts +91 -0
- package/ts_apiclient/classes.radius.ts +180 -0
- package/ts_apiclient/classes.remoteingress.ts +217 -0
- package/ts_apiclient/classes.route.ts +166 -0
- package/ts_apiclient/classes.stats.ts +111 -0
- package/ts_apiclient/classes.testing.ts +152 -0
- package/ts_apiclient/index.ts +17 -0
- package/ts_apiclient/plugins.ts +10 -0
- package/ts_apiclient/readme.md +218 -0
- package/ts_interfaces/data/acme-config.ts +23 -0
- package/ts_interfaces/data/auth.ts +8 -0
- package/ts_interfaces/data/config-events.ts +38 -0
- package/ts_interfaces/data/dns-authority.ts +106 -0
- package/ts_interfaces/data/dns-provider.ts +174 -0
- package/ts_interfaces/data/dns-record.ts +50 -0
- package/ts_interfaces/data/domain.ts +36 -0
- package/ts_interfaces/data/email-domain.ts +206 -0
- package/ts_interfaces/data/email-settings.ts +75 -0
- package/ts_interfaces/data/index.ts +18 -0
- package/ts_interfaces/data/remoteingress.ts +204 -0
- package/ts_interfaces/data/route-management.ts +436 -0
- package/ts_interfaces/data/security-policy.ts +37 -0
- package/ts_interfaces/data/smtp-account.ts +63 -0
- package/ts_interfaces/data/stats.ts +305 -0
- package/ts_interfaces/data/target-profile.ts +31 -0
- package/ts_interfaces/data/testing.ts +184 -0
- package/ts_interfaces/data/vpn.ts +68 -0
- package/ts_interfaces/data/workhoster.ts +72 -0
- package/ts_interfaces/index.ts +9 -0
- package/ts_interfaces/plugins.ts +6 -0
- package/ts_interfaces/readme.md +194 -0
- package/ts_interfaces/requests/acme-config.ts +54 -0
- package/ts_interfaces/requests/admin.ts +96 -0
- package/ts_interfaces/requests/api-tokens.ts +109 -0
- package/ts_interfaces/requests/certificate.ts +106 -0
- package/ts_interfaces/requests/combined.stats.ts +30 -0
- package/ts_interfaces/requests/config-events.ts +45 -0
- package/ts_interfaces/requests/config.ts +94 -0
- package/ts_interfaces/requests/dns-authority.ts +104 -0
- package/ts_interfaces/requests/dns-providers.ts +154 -0
- package/ts_interfaces/requests/dns-records.ts +113 -0
- package/ts_interfaces/requests/domains.ts +178 -0
- package/ts_interfaces/requests/email-domains.ts +193 -0
- package/ts_interfaces/requests/email-ops.ts +266 -0
- package/ts_interfaces/requests/email-settings.ts +34 -0
- package/ts_interfaces/requests/index.ts +29 -0
- package/ts_interfaces/requests/logs.ts +58 -0
- package/ts_interfaces/requests/network-targets.ts +127 -0
- package/ts_interfaces/requests/radius.ts +341 -0
- package/ts_interfaces/requests/realtime.ts +59 -0
- package/ts_interfaces/requests/remoteingress.ts +202 -0
- package/ts_interfaces/requests/route-management.ts +194 -0
- package/ts_interfaces/requests/security-policy.ts +144 -0
- package/ts_interfaces/requests/smtp-accounts.ts +163 -0
- package/ts_interfaces/requests/source-profiles.ts +127 -0
- package/ts_interfaces/requests/stats.ts +207 -0
- package/ts_interfaces/requests/target-profiles.ts +130 -0
- package/ts_interfaces/requests/testing.ts +186 -0
- package/ts_interfaces/requests/users.ts +66 -0
- package/ts_interfaces/requests/vpn.ts +238 -0
- package/ts_interfaces/requests/workhoster.ts +100 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import * as authInterfaces from '../data/auth.js';
|
|
3
|
+
|
|
4
|
+
export interface IConfigData {
|
|
5
|
+
system: {
|
|
6
|
+
baseDir: string;
|
|
7
|
+
dataDir: string;
|
|
8
|
+
publicIp: string | null;
|
|
9
|
+
proxyIps: string[];
|
|
10
|
+
uptime: number;
|
|
11
|
+
storageBackend: 'smartdata-local' | 'smartdata-external';
|
|
12
|
+
storagePath: string | null;
|
|
13
|
+
};
|
|
14
|
+
smartProxy: {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
routeCount: number;
|
|
17
|
+
acme: {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
accountEmail: string;
|
|
20
|
+
useProduction: boolean;
|
|
21
|
+
autoRenew: boolean;
|
|
22
|
+
renewThresholdDays: number;
|
|
23
|
+
} | null;
|
|
24
|
+
};
|
|
25
|
+
email: {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
ports: number[];
|
|
28
|
+
portMapping: Record<string, number> | null;
|
|
29
|
+
hostname: string | null;
|
|
30
|
+
outboundMode: import('../data/email-settings.js').TEmailOutboundMode;
|
|
31
|
+
domains: string[];
|
|
32
|
+
emailRouteCount: number;
|
|
33
|
+
receivedEmailsPath: string | null;
|
|
34
|
+
};
|
|
35
|
+
dns: {
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
port: number;
|
|
38
|
+
nsDomains: string[];
|
|
39
|
+
scopes: string[];
|
|
40
|
+
recordCount: number;
|
|
41
|
+
records: Array<{ name: string; type: string; value: string; ttl?: number }>;
|
|
42
|
+
dnsChallenge: boolean;
|
|
43
|
+
};
|
|
44
|
+
tls: {
|
|
45
|
+
contactEmail: string | null;
|
|
46
|
+
domain: string | null;
|
|
47
|
+
source: 'acme' | 'static' | 'none';
|
|
48
|
+
certPath: string | null;
|
|
49
|
+
keyPath: string | null;
|
|
50
|
+
};
|
|
51
|
+
cache: {
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
storagePath: string | null;
|
|
54
|
+
dbName: string | null;
|
|
55
|
+
defaultTTLDays: number;
|
|
56
|
+
cleanupIntervalHours: number;
|
|
57
|
+
ttlConfig: Record<string, number>;
|
|
58
|
+
};
|
|
59
|
+
radius: {
|
|
60
|
+
enabled: boolean;
|
|
61
|
+
authPort: number | null;
|
|
62
|
+
acctPort: number | null;
|
|
63
|
+
bindAddress: string | null;
|
|
64
|
+
clientCount: number;
|
|
65
|
+
vlanDefaultVlan: number | null;
|
|
66
|
+
vlanAllowUnknownMacs: boolean | null;
|
|
67
|
+
vlanMappingCount: number;
|
|
68
|
+
};
|
|
69
|
+
remoteIngress: {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
tunnelPort: number | null;
|
|
72
|
+
hubDomain: string | null;
|
|
73
|
+
tlsMode: 'custom' | 'acme' | 'self-signed';
|
|
74
|
+
connectedEdgeIps: string[];
|
|
75
|
+
performance?: import('../data/remoteingress.js').IRemoteIngressPerformanceConfig;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Get Configuration (read-only)
|
|
80
|
+
export interface IReq_GetConfiguration extends plugins.typedrequestInterfaces.implementsTR<
|
|
81
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
82
|
+
IReq_GetConfiguration
|
|
83
|
+
> {
|
|
84
|
+
method: 'getConfiguration';
|
|
85
|
+
request: {
|
|
86
|
+
identity?: authInterfaces.IIdentity;
|
|
87
|
+
apiToken?: string;
|
|
88
|
+
section?: string;
|
|
89
|
+
};
|
|
90
|
+
response: {
|
|
91
|
+
config: IConfigData;
|
|
92
|
+
section?: string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import * as authInterfaces from '../data/auth.js';
|
|
3
|
+
import type {
|
|
4
|
+
IDnsAuthorityDrift,
|
|
5
|
+
IDnsAuthoritySettings,
|
|
6
|
+
IDnsDelegationProbe,
|
|
7
|
+
} from '../data/dns-authority.js';
|
|
8
|
+
|
|
9
|
+
export interface IReq_GetDnsAuthority extends plugins.typedrequestInterfaces.implementsTR<
|
|
10
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
11
|
+
IReq_GetDnsAuthority
|
|
12
|
+
> {
|
|
13
|
+
method: 'getDnsAuthority';
|
|
14
|
+
request: {
|
|
15
|
+
identity?: authInterfaces.IIdentity;
|
|
16
|
+
apiToken?: string;
|
|
17
|
+
};
|
|
18
|
+
response: {
|
|
19
|
+
settings: IDnsAuthoritySettings;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Probe a zone's public delegation without changing anything. Lets an operator
|
|
25
|
+
* see the evidence before claiming authority.
|
|
26
|
+
*/
|
|
27
|
+
export interface IReq_ProbeDnsAuthorityZone extends plugins.typedrequestInterfaces.implementsTR<
|
|
28
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
29
|
+
IReq_ProbeDnsAuthorityZone
|
|
30
|
+
> {
|
|
31
|
+
method: 'probeDnsAuthorityZone';
|
|
32
|
+
request: {
|
|
33
|
+
identity?: authInterfaces.IIdentity;
|
|
34
|
+
apiToken?: string;
|
|
35
|
+
zone: string;
|
|
36
|
+
};
|
|
37
|
+
response: {
|
|
38
|
+
probe: IDnsDelegationProbe;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Claim authority over a zone. Succeeds only when the zone's public delegation
|
|
44
|
+
* names our nameservers; the claim is then persisted and reconciled in-process,
|
|
45
|
+
* with no restart.
|
|
46
|
+
*/
|
|
47
|
+
export interface IReq_VerifyDnsAuthorityZone extends plugins.typedrequestInterfaces.implementsTR<
|
|
48
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
49
|
+
IReq_VerifyDnsAuthorityZone
|
|
50
|
+
> {
|
|
51
|
+
method: 'verifyDnsAuthorityZone';
|
|
52
|
+
request: {
|
|
53
|
+
identity?: authInterfaces.IIdentity;
|
|
54
|
+
apiToken?: string;
|
|
55
|
+
zone: string;
|
|
56
|
+
};
|
|
57
|
+
response: {
|
|
58
|
+
success: boolean;
|
|
59
|
+
message?: string;
|
|
60
|
+
probe?: IDnsDelegationProbe;
|
|
61
|
+
settings?: IDnsAuthoritySettings;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Drop a previously verified zone. Every zone in the authority set is revocable
|
|
67
|
+
* through this call: there is no deployment-declared floor left that would need
|
|
68
|
+
* a redeploy to withdraw.
|
|
69
|
+
*/
|
|
70
|
+
export interface IReq_RevokeDnsAuthorityZone extends plugins.typedrequestInterfaces.implementsTR<
|
|
71
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
72
|
+
IReq_RevokeDnsAuthorityZone
|
|
73
|
+
> {
|
|
74
|
+
method: 'revokeDnsAuthorityZone';
|
|
75
|
+
request: {
|
|
76
|
+
identity?: authInterfaces.IIdentity;
|
|
77
|
+
apiToken?: string;
|
|
78
|
+
zone: string;
|
|
79
|
+
};
|
|
80
|
+
response: {
|
|
81
|
+
success: boolean;
|
|
82
|
+
message?: string;
|
|
83
|
+
settings?: IDnsAuthoritySettings;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Compare declared authority against observed delegation in both directions.
|
|
89
|
+
* This is the check whose absence let one zone sit declared while four live
|
|
90
|
+
* zones were delegated to us and unclaimed.
|
|
91
|
+
*/
|
|
92
|
+
export interface IReq_GetDnsAuthorityDrift extends plugins.typedrequestInterfaces.implementsTR<
|
|
93
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
94
|
+
IReq_GetDnsAuthorityDrift
|
|
95
|
+
> {
|
|
96
|
+
method: 'getDnsAuthorityDrift';
|
|
97
|
+
request: {
|
|
98
|
+
identity?: authInterfaces.IIdentity;
|
|
99
|
+
apiToken?: string;
|
|
100
|
+
};
|
|
101
|
+
response: {
|
|
102
|
+
drift: IDnsAuthorityDrift[];
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import type * as authInterfaces from '../data/auth.js';
|
|
3
|
+
import type {
|
|
4
|
+
IDnsProviderPublic,
|
|
5
|
+
IProviderDomainListing,
|
|
6
|
+
TDnsProviderType,
|
|
7
|
+
TDnsProviderCredentials,
|
|
8
|
+
} from '../data/dns-provider.js';
|
|
9
|
+
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// DNS Provider Endpoints
|
|
12
|
+
// ============================================================================
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Get all DNS providers (public view, no secrets).
|
|
16
|
+
*/
|
|
17
|
+
export interface IReq_GetDnsProviders extends plugins.typedrequestInterfaces.implementsTR<
|
|
18
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
19
|
+
IReq_GetDnsProviders
|
|
20
|
+
> {
|
|
21
|
+
method: 'getDnsProviders';
|
|
22
|
+
request: {
|
|
23
|
+
identity?: authInterfaces.IIdentity;
|
|
24
|
+
apiToken?: string;
|
|
25
|
+
};
|
|
26
|
+
response: {
|
|
27
|
+
providers: IDnsProviderPublic[];
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get a single DNS provider by id.
|
|
33
|
+
*/
|
|
34
|
+
export interface IReq_GetDnsProvider extends plugins.typedrequestInterfaces.implementsTR<
|
|
35
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
36
|
+
IReq_GetDnsProvider
|
|
37
|
+
> {
|
|
38
|
+
method: 'getDnsProvider';
|
|
39
|
+
request: {
|
|
40
|
+
identity?: authInterfaces.IIdentity;
|
|
41
|
+
apiToken?: string;
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
44
|
+
response: {
|
|
45
|
+
provider: IDnsProviderPublic | null;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Create a new DNS provider.
|
|
51
|
+
*/
|
|
52
|
+
export interface IReq_CreateDnsProvider extends plugins.typedrequestInterfaces.implementsTR<
|
|
53
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
54
|
+
IReq_CreateDnsProvider
|
|
55
|
+
> {
|
|
56
|
+
method: 'createDnsProvider';
|
|
57
|
+
request: {
|
|
58
|
+
identity?: authInterfaces.IIdentity;
|
|
59
|
+
apiToken?: string;
|
|
60
|
+
name: string;
|
|
61
|
+
type: TDnsProviderType;
|
|
62
|
+
credentials: TDnsProviderCredentials;
|
|
63
|
+
};
|
|
64
|
+
response: {
|
|
65
|
+
success: boolean;
|
|
66
|
+
id?: string;
|
|
67
|
+
message?: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Update a DNS provider. Only supplied fields are updated.
|
|
73
|
+
* Pass `credentials` to rotate the secret.
|
|
74
|
+
*/
|
|
75
|
+
export interface IReq_UpdateDnsProvider extends plugins.typedrequestInterfaces.implementsTR<
|
|
76
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
77
|
+
IReq_UpdateDnsProvider
|
|
78
|
+
> {
|
|
79
|
+
method: 'updateDnsProvider';
|
|
80
|
+
request: {
|
|
81
|
+
identity?: authInterfaces.IIdentity;
|
|
82
|
+
apiToken?: string;
|
|
83
|
+
id: string;
|
|
84
|
+
name?: string;
|
|
85
|
+
credentials?: TDnsProviderCredentials;
|
|
86
|
+
};
|
|
87
|
+
response: {
|
|
88
|
+
success: boolean;
|
|
89
|
+
message?: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Delete a DNS provider. Fails if any IDomain still references it
|
|
95
|
+
* unless `force: true` is set.
|
|
96
|
+
*/
|
|
97
|
+
export interface IReq_DeleteDnsProvider extends plugins.typedrequestInterfaces.implementsTR<
|
|
98
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
99
|
+
IReq_DeleteDnsProvider
|
|
100
|
+
> {
|
|
101
|
+
method: 'deleteDnsProvider';
|
|
102
|
+
request: {
|
|
103
|
+
identity?: authInterfaces.IIdentity;
|
|
104
|
+
apiToken?: string;
|
|
105
|
+
id: string;
|
|
106
|
+
force?: boolean;
|
|
107
|
+
};
|
|
108
|
+
response: {
|
|
109
|
+
success: boolean;
|
|
110
|
+
message?: string;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Test the connection to a DNS provider. Used both for newly-saved
|
|
116
|
+
* providers and on demand from the UI.
|
|
117
|
+
*/
|
|
118
|
+
export interface IReq_TestDnsProvider extends plugins.typedrequestInterfaces.implementsTR<
|
|
119
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
120
|
+
IReq_TestDnsProvider
|
|
121
|
+
> {
|
|
122
|
+
method: 'testDnsProvider';
|
|
123
|
+
request: {
|
|
124
|
+
identity?: authInterfaces.IIdentity;
|
|
125
|
+
apiToken?: string;
|
|
126
|
+
id: string;
|
|
127
|
+
};
|
|
128
|
+
response: {
|
|
129
|
+
ok: boolean;
|
|
130
|
+
error?: string;
|
|
131
|
+
testedAt: number;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* List the domains visible to a DNS provider's API account.
|
|
137
|
+
* Used when importing — does NOT persist anything.
|
|
138
|
+
*/
|
|
139
|
+
export interface IReq_ListProviderDomains extends plugins.typedrequestInterfaces.implementsTR<
|
|
140
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
141
|
+
IReq_ListProviderDomains
|
|
142
|
+
> {
|
|
143
|
+
method: 'listProviderDomains';
|
|
144
|
+
request: {
|
|
145
|
+
identity?: authInterfaces.IIdentity;
|
|
146
|
+
apiToken?: string;
|
|
147
|
+
providerId: string;
|
|
148
|
+
};
|
|
149
|
+
response: {
|
|
150
|
+
success: boolean;
|
|
151
|
+
domains?: IProviderDomainListing[];
|
|
152
|
+
message?: string;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import type * as authInterfaces from '../data/auth.js';
|
|
3
|
+
import type { IDnsRecord, TDnsRecordType } from '../data/dns-record.js';
|
|
4
|
+
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// DNS Record Endpoints
|
|
7
|
+
// ============================================================================
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get all DNS records for a domain.
|
|
11
|
+
*/
|
|
12
|
+
export interface IReq_GetDnsRecords extends plugins.typedrequestInterfaces.implementsTR<
|
|
13
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
14
|
+
IReq_GetDnsRecords
|
|
15
|
+
> {
|
|
16
|
+
method: 'getDnsRecords';
|
|
17
|
+
request: {
|
|
18
|
+
identity?: authInterfaces.IIdentity;
|
|
19
|
+
apiToken?: string;
|
|
20
|
+
domainId: string;
|
|
21
|
+
};
|
|
22
|
+
response: {
|
|
23
|
+
records: IDnsRecord[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get a single DNS record by id.
|
|
29
|
+
*/
|
|
30
|
+
export interface IReq_GetDnsRecord extends plugins.typedrequestInterfaces.implementsTR<
|
|
31
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
32
|
+
IReq_GetDnsRecord
|
|
33
|
+
> {
|
|
34
|
+
method: 'getDnsRecord';
|
|
35
|
+
request: {
|
|
36
|
+
identity?: authInterfaces.IIdentity;
|
|
37
|
+
apiToken?: string;
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
40
|
+
response: {
|
|
41
|
+
record: IDnsRecord | null;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Create a new DNS record.
|
|
47
|
+
*
|
|
48
|
+
* For dcrouter-hosted domains: registers the record with the embedded DnsServer.
|
|
49
|
+
* For provider domains: pushes the record to the provider API.
|
|
50
|
+
*/
|
|
51
|
+
export interface IReq_CreateDnsRecord extends plugins.typedrequestInterfaces.implementsTR<
|
|
52
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
53
|
+
IReq_CreateDnsRecord
|
|
54
|
+
> {
|
|
55
|
+
method: 'createDnsRecord';
|
|
56
|
+
request: {
|
|
57
|
+
identity?: authInterfaces.IIdentity;
|
|
58
|
+
apiToken?: string;
|
|
59
|
+
domainId: string;
|
|
60
|
+
name: string;
|
|
61
|
+
type: TDnsRecordType;
|
|
62
|
+
value: string;
|
|
63
|
+
ttl?: number;
|
|
64
|
+
proxied?: boolean;
|
|
65
|
+
};
|
|
66
|
+
response: {
|
|
67
|
+
success: boolean;
|
|
68
|
+
id?: string;
|
|
69
|
+
message?: string;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Update a DNS record.
|
|
75
|
+
*/
|
|
76
|
+
export interface IReq_UpdateDnsRecord extends plugins.typedrequestInterfaces.implementsTR<
|
|
77
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
78
|
+
IReq_UpdateDnsRecord
|
|
79
|
+
> {
|
|
80
|
+
method: 'updateDnsRecord';
|
|
81
|
+
request: {
|
|
82
|
+
identity?: authInterfaces.IIdentity;
|
|
83
|
+
apiToken?: string;
|
|
84
|
+
id: string;
|
|
85
|
+
name?: string;
|
|
86
|
+
value?: string;
|
|
87
|
+
ttl?: number;
|
|
88
|
+
proxied?: boolean;
|
|
89
|
+
};
|
|
90
|
+
response: {
|
|
91
|
+
success: boolean;
|
|
92
|
+
message?: string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Delete a DNS record.
|
|
98
|
+
*/
|
|
99
|
+
export interface IReq_DeleteDnsRecord extends plugins.typedrequestInterfaces.implementsTR<
|
|
100
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
101
|
+
IReq_DeleteDnsRecord
|
|
102
|
+
> {
|
|
103
|
+
method: 'deleteDnsRecord';
|
|
104
|
+
request: {
|
|
105
|
+
identity?: authInterfaces.IIdentity;
|
|
106
|
+
apiToken?: string;
|
|
107
|
+
id: string;
|
|
108
|
+
};
|
|
109
|
+
response: {
|
|
110
|
+
success: boolean;
|
|
111
|
+
message?: string;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import type * as authInterfaces from '../data/auth.js';
|
|
3
|
+
import type { IDomain } from '../data/domain.js';
|
|
4
|
+
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Domain Endpoints
|
|
7
|
+
// ============================================================================
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get all domains under management.
|
|
11
|
+
*/
|
|
12
|
+
export interface IReq_GetDomains extends plugins.typedrequestInterfaces.implementsTR<
|
|
13
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
14
|
+
IReq_GetDomains
|
|
15
|
+
> {
|
|
16
|
+
method: 'getDomains';
|
|
17
|
+
request: {
|
|
18
|
+
identity?: authInterfaces.IIdentity;
|
|
19
|
+
apiToken?: string;
|
|
20
|
+
};
|
|
21
|
+
response: {
|
|
22
|
+
domains: IDomain[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get a single domain by id.
|
|
28
|
+
*/
|
|
29
|
+
export interface IReq_GetDomain extends plugins.typedrequestInterfaces.implementsTR<
|
|
30
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
31
|
+
IReq_GetDomain
|
|
32
|
+
> {
|
|
33
|
+
method: 'getDomain';
|
|
34
|
+
request: {
|
|
35
|
+
identity?: authInterfaces.IIdentity;
|
|
36
|
+
apiToken?: string;
|
|
37
|
+
id: string;
|
|
38
|
+
};
|
|
39
|
+
response: {
|
|
40
|
+
domain: IDomain | null;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Create a dcrouter-hosted (authoritative) domain. dcrouter will serve
|
|
46
|
+
* DNS records for this domain via the embedded smartdns.DnsServer.
|
|
47
|
+
*/
|
|
48
|
+
export interface IReq_CreateDomain extends plugins.typedrequestInterfaces.implementsTR<
|
|
49
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
50
|
+
IReq_CreateDomain
|
|
51
|
+
> {
|
|
52
|
+
method: 'createDomain';
|
|
53
|
+
request: {
|
|
54
|
+
identity?: authInterfaces.IIdentity;
|
|
55
|
+
apiToken?: string;
|
|
56
|
+
name: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
};
|
|
59
|
+
response: {
|
|
60
|
+
success: boolean;
|
|
61
|
+
id?: string;
|
|
62
|
+
message?: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Import one or more domains from a DNS provider. For each imported
|
|
68
|
+
* domain, records are pulled from the provider into DnsRecordDoc.
|
|
69
|
+
*/
|
|
70
|
+
export interface IReq_ImportDomain extends plugins.typedrequestInterfaces.implementsTR<
|
|
71
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
72
|
+
IReq_ImportDomain
|
|
73
|
+
> {
|
|
74
|
+
method: 'importDomain';
|
|
75
|
+
request: {
|
|
76
|
+
identity?: authInterfaces.IIdentity;
|
|
77
|
+
apiToken?: string;
|
|
78
|
+
providerId: string;
|
|
79
|
+
/** FQDN(s) of the zone(s) to import — must be visible to the provider account. */
|
|
80
|
+
domainNames: string[];
|
|
81
|
+
};
|
|
82
|
+
response: {
|
|
83
|
+
success: boolean;
|
|
84
|
+
importedIds?: string[];
|
|
85
|
+
message?: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Update a domain's metadata. Cannot change source / providerId once set.
|
|
91
|
+
*/
|
|
92
|
+
export interface IReq_UpdateDomain extends plugins.typedrequestInterfaces.implementsTR<
|
|
93
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
94
|
+
IReq_UpdateDomain
|
|
95
|
+
> {
|
|
96
|
+
method: 'updateDomain';
|
|
97
|
+
request: {
|
|
98
|
+
identity?: authInterfaces.IIdentity;
|
|
99
|
+
apiToken?: string;
|
|
100
|
+
id: string;
|
|
101
|
+
description?: string;
|
|
102
|
+
};
|
|
103
|
+
response: {
|
|
104
|
+
success: boolean;
|
|
105
|
+
message?: string;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Delete a domain and all of its DNS records.
|
|
111
|
+
* For provider-managed domains, this only removes dcrouter's local record —
|
|
112
|
+
* it does NOT delete the zone at the provider.
|
|
113
|
+
*/
|
|
114
|
+
export interface IReq_DeleteDomain extends plugins.typedrequestInterfaces.implementsTR<
|
|
115
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
116
|
+
IReq_DeleteDomain
|
|
117
|
+
> {
|
|
118
|
+
method: 'deleteDomain';
|
|
119
|
+
request: {
|
|
120
|
+
identity?: authInterfaces.IIdentity;
|
|
121
|
+
apiToken?: string;
|
|
122
|
+
id: string;
|
|
123
|
+
};
|
|
124
|
+
response: {
|
|
125
|
+
success: boolean;
|
|
126
|
+
message?: string;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Force-resync a provider-managed domain: re-pulls all records from the
|
|
132
|
+
* provider API, replacing the cached DnsRecordDocs.
|
|
133
|
+
* No-op for dcrouter-hosted domains.
|
|
134
|
+
*/
|
|
135
|
+
export interface IReq_SyncDomain extends plugins.typedrequestInterfaces.implementsTR<
|
|
136
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
137
|
+
IReq_SyncDomain
|
|
138
|
+
> {
|
|
139
|
+
method: 'syncDomain';
|
|
140
|
+
request: {
|
|
141
|
+
identity?: authInterfaces.IIdentity;
|
|
142
|
+
apiToken?: string;
|
|
143
|
+
id: string;
|
|
144
|
+
};
|
|
145
|
+
response: {
|
|
146
|
+
success: boolean;
|
|
147
|
+
recordCount?: number;
|
|
148
|
+
message?: string;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Migrate a domain between dcrouter-hosted and provider-managed (or between providers).
|
|
154
|
+
* Records are transferred to the target and the domain source/providerId are updated.
|
|
155
|
+
*/
|
|
156
|
+
export interface IReq_MigrateDomain extends plugins.typedrequestInterfaces.implementsTR<
|
|
157
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
158
|
+
IReq_MigrateDomain
|
|
159
|
+
> {
|
|
160
|
+
method: 'migrateDomain';
|
|
161
|
+
request: {
|
|
162
|
+
identity?: authInterfaces.IIdentity;
|
|
163
|
+
apiToken?: string;
|
|
164
|
+
id: string;
|
|
165
|
+
/** Target source type. */
|
|
166
|
+
targetSource: import('../data/domain.js').TDomainSource;
|
|
167
|
+
/** Required when targetSource is 'provider'. */
|
|
168
|
+
targetProviderId?: string;
|
|
169
|
+
/** When migrating to a provider: delete all existing records at the provider first. */
|
|
170
|
+
deleteExistingProviderRecords?: boolean;
|
|
171
|
+
};
|
|
172
|
+
response: {
|
|
173
|
+
success: boolean;
|
|
174
|
+
/** Number of records migrated. */
|
|
175
|
+
recordsMigrated?: number;
|
|
176
|
+
message?: string;
|
|
177
|
+
};
|
|
178
|
+
}
|