@serve.zone/interfaces 32.124.0 → 32.125.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/changelog.md +9 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/certificateauthority.d.ts +57 -0
- package/dist_ts/data/certificateauthority.js +69 -0
- package/dist_ts/data/externaldns.d.ts +135 -0
- package/dist_ts/data/externaldns.js +138 -0
- package/dist_ts/data/gateway.d.ts +17 -0
- package/dist_ts/data/gateway.js +1 -1
- package/dist_ts/data/index.d.ts +3 -0
- package/dist_ts/data/index.js +4 -1
- package/dist_ts/data/pathrouting.d.ts +170 -0
- package/dist_ts/data/pathrouting.js +227 -0
- package/dist_ts/requests/certificateauthority.d.ts +118 -0
- package/dist_ts/requests/certificateauthority.js +2 -0
- package/dist_ts/requests/externaldns.d.ts +213 -0
- package/dist_ts/requests/externaldns.js +2 -0
- package/dist_ts/requests/index.d.ts +4 -1
- package/dist_ts/requests/index.js +5 -2
- package/dist_ts/requests/pathrouting.d.ts +107 -0
- package/dist_ts/requests/pathrouting.js +2 -0
- package/package.json +25 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/certificateauthority.ts +115 -0
- package/ts/data/externaldns.ts +273 -0
- package/ts/data/gateway.ts +17 -0
- package/ts/data/index.ts +3 -0
- package/ts/data/pathrouting.ts +410 -0
- package/ts/requests/certificateauthority.ts +139 -0
- package/ts/requests/externaldns.ts +263 -0
- package/ts/requests/index.ts +6 -0
- package/ts/requests/pathrouting.ts +134 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import type { ITypedRequest, implementsTR } from '@api.global/typedrequest-interfaces';
|
|
2
|
+
import type { IExternalDnsConflict, IExternalDnsDesiredRecord, IExternalDnsMutationJournalEntry, IExternalDnsProvider, IExternalDnsRecord, IExternalDnsReconcileSummary, IExternalDnsTakeoverPreview, IExternalDnsZone, TExternalDnsProviderType, TExternalDnsRefusalCode } from '../data/externaldns.js';
|
|
3
|
+
import type { IIdentityCredential } from '../data/user.js';
|
|
4
|
+
export type TExternalDnsResult<TData> = ({
|
|
5
|
+
ok: true;
|
|
6
|
+
} & TData) | {
|
|
7
|
+
ok: false;
|
|
8
|
+
code: TExternalDnsRefusalCode;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
export interface IReq_Admin_Cloudly_CreateExternalDnsProvider extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_CreateExternalDnsProvider> {
|
|
12
|
+
method: 'createExternalDnsProvider';
|
|
13
|
+
request: {
|
|
14
|
+
identity: IIdentityCredential;
|
|
15
|
+
name: string;
|
|
16
|
+
type: TExternalDnsProviderType;
|
|
17
|
+
/** Write-only provider API token (e.g. Cloudflare token). Sealed at rest; never returned or pushed to dcrouter. */
|
|
18
|
+
apiToken: string;
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
response: TExternalDnsResult<{
|
|
22
|
+
provider: IExternalDnsProvider;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface IReq_Admin_Cloudly_ListExternalDnsProviders extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_ListExternalDnsProviders> {
|
|
26
|
+
method: 'listExternalDnsProviders';
|
|
27
|
+
request: {
|
|
28
|
+
identity: IIdentityCredential;
|
|
29
|
+
};
|
|
30
|
+
response: TExternalDnsResult<{
|
|
31
|
+
providers: IExternalDnsProvider[];
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
export interface IReq_Admin_Cloudly_RotateExternalDnsProviderToken extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_RotateExternalDnsProviderToken> {
|
|
35
|
+
method: 'rotateExternalDnsProviderToken';
|
|
36
|
+
request: {
|
|
37
|
+
identity: IIdentityCredential;
|
|
38
|
+
providerId: string;
|
|
39
|
+
/** Write-only replacement API token. Never returned or logged. */
|
|
40
|
+
apiToken: string;
|
|
41
|
+
};
|
|
42
|
+
response: TExternalDnsResult<{
|
|
43
|
+
provider: IExternalDnsProvider;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
export interface IReq_Admin_Cloudly_DeleteExternalDnsProvider extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_DeleteExternalDnsProvider> {
|
|
47
|
+
method: 'deleteExternalDnsProvider';
|
|
48
|
+
request: {
|
|
49
|
+
identity: IIdentityCredential;
|
|
50
|
+
providerId: string;
|
|
51
|
+
};
|
|
52
|
+
response: TExternalDnsResult<{
|
|
53
|
+
deleted: true;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
export interface IReq_Admin_Cloudly_TestExternalDnsProvider extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_TestExternalDnsProvider> {
|
|
57
|
+
method: 'testExternalDnsProvider';
|
|
58
|
+
request: {
|
|
59
|
+
identity: IIdentityCredential;
|
|
60
|
+
providerId: string;
|
|
61
|
+
};
|
|
62
|
+
response: TExternalDnsResult<{
|
|
63
|
+
provider: IExternalDnsProvider;
|
|
64
|
+
reachable: boolean;
|
|
65
|
+
zoneCount: number;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
export interface IReq_Admin_Cloudly_SyncExternalDnsProvider extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_SyncExternalDnsProvider> {
|
|
69
|
+
method: 'syncExternalDnsProvider';
|
|
70
|
+
request: {
|
|
71
|
+
identity: IIdentityCredential;
|
|
72
|
+
providerId: string;
|
|
73
|
+
/** Optional single zone to sync instead of all zones on this provider. */
|
|
74
|
+
zoneName?: string;
|
|
75
|
+
};
|
|
76
|
+
response: TExternalDnsResult<{
|
|
77
|
+
provider: IExternalDnsProvider;
|
|
78
|
+
zones: IExternalDnsZone[];
|
|
79
|
+
syncedRecordCount: number;
|
|
80
|
+
}>;
|
|
81
|
+
}
|
|
82
|
+
export interface IReq_Admin_Cloudly_ListExternalDnsZones extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_ListExternalDnsZones> {
|
|
83
|
+
method: 'listExternalDnsZones';
|
|
84
|
+
request: {
|
|
85
|
+
identity: IIdentityCredential;
|
|
86
|
+
providerId?: string;
|
|
87
|
+
};
|
|
88
|
+
response: TExternalDnsResult<{
|
|
89
|
+
zones: IExternalDnsZone[];
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
export interface IReq_Admin_Cloudly_ListExternalDnsRecords extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_ListExternalDnsRecords> {
|
|
93
|
+
method: 'listExternalDnsRecords';
|
|
94
|
+
request: {
|
|
95
|
+
identity: IIdentityCredential;
|
|
96
|
+
providerId?: string;
|
|
97
|
+
zoneName?: string;
|
|
98
|
+
fqdn?: string;
|
|
99
|
+
};
|
|
100
|
+
response: TExternalDnsResult<{
|
|
101
|
+
records: IExternalDnsRecord[];
|
|
102
|
+
}>;
|
|
103
|
+
}
|
|
104
|
+
export interface IReq_Admin_Cloudly_ListExternalDnsConflicts extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_ListExternalDnsConflicts> {
|
|
105
|
+
method: 'listExternalDnsConflicts';
|
|
106
|
+
request: {
|
|
107
|
+
identity: IIdentityCredential;
|
|
108
|
+
providerId?: string;
|
|
109
|
+
zoneName?: string;
|
|
110
|
+
};
|
|
111
|
+
response: TExternalDnsResult<{
|
|
112
|
+
conflicts: IExternalDnsConflict[];
|
|
113
|
+
}>;
|
|
114
|
+
}
|
|
115
|
+
export interface IReq_Admin_Cloudly_ReconcileExternalDnsDesired extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_ReconcileExternalDnsDesired> {
|
|
116
|
+
method: 'reconcileExternalDnsDesired';
|
|
117
|
+
request: {
|
|
118
|
+
identity: IIdentityCredential;
|
|
119
|
+
providerId?: string;
|
|
120
|
+
zoneName?: string;
|
|
121
|
+
desiredRecords: IExternalDnsDesiredRecord[];
|
|
122
|
+
/** When true, Cloudly-owned records for the same ownerKey not present in desiredRecords are removed. */
|
|
123
|
+
pruneOwnedMissing?: boolean;
|
|
124
|
+
};
|
|
125
|
+
response: TExternalDnsResult<{
|
|
126
|
+
summaries: IExternalDnsReconcileSummary[];
|
|
127
|
+
}>;
|
|
128
|
+
}
|
|
129
|
+
export interface IReq_Admin_Cloudly_PreviewExternalDnsTakeover extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_PreviewExternalDnsTakeover> {
|
|
130
|
+
method: 'previewExternalDnsTakeover';
|
|
131
|
+
request: {
|
|
132
|
+
identity: IIdentityCredential;
|
|
133
|
+
fqdn: string;
|
|
134
|
+
desiredRecords: IExternalDnsDesiredRecord[];
|
|
135
|
+
providerId?: string;
|
|
136
|
+
};
|
|
137
|
+
response: TExternalDnsResult<{
|
|
138
|
+
preview: IExternalDnsTakeoverPreview;
|
|
139
|
+
}>;
|
|
140
|
+
}
|
|
141
|
+
export interface IReq_Admin_Cloudly_TakeOverExternalDnsRecord extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_TakeOverExternalDnsRecord> {
|
|
142
|
+
method: 'takeOverExternalDnsRecord';
|
|
143
|
+
request: {
|
|
144
|
+
identity: IIdentityCredential;
|
|
145
|
+
fqdn: string;
|
|
146
|
+
providerId?: string;
|
|
147
|
+
/** Exact providerRecordIds observed in preview (compare-and-swap guard against TOCTOU races). */
|
|
148
|
+
expectedBlockingRecordIds: string[];
|
|
149
|
+
/** Exact blocking values keyed by providerRecordId (compare-and-swap guard). */
|
|
150
|
+
expectedBlockingValues?: Record<string, string>;
|
|
151
|
+
desiredRecords: IExternalDnsDesiredRecord[];
|
|
152
|
+
reason?: string;
|
|
153
|
+
};
|
|
154
|
+
response: TExternalDnsResult<{
|
|
155
|
+
journalEntry: IExternalDnsMutationJournalEntry;
|
|
156
|
+
resultingRecords: IExternalDnsRecord[];
|
|
157
|
+
}>;
|
|
158
|
+
}
|
|
159
|
+
export interface IReq_Admin_Cloudly_DeleteExternalDnsRecord extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_DeleteExternalDnsRecord> {
|
|
160
|
+
method: 'deleteExternalDnsRecord';
|
|
161
|
+
request: {
|
|
162
|
+
identity: IIdentityCredential;
|
|
163
|
+
providerId: string;
|
|
164
|
+
zoneName: string;
|
|
165
|
+
providerRecordId: string;
|
|
166
|
+
/** Compare-and-swap guard: must match the current live record value at the provider. */
|
|
167
|
+
expectedValue: string;
|
|
168
|
+
reason?: string;
|
|
169
|
+
};
|
|
170
|
+
response: TExternalDnsResult<{
|
|
171
|
+
journalEntry: IExternalDnsMutationJournalEntry;
|
|
172
|
+
deleted: true;
|
|
173
|
+
}>;
|
|
174
|
+
}
|
|
175
|
+
export interface IReq_Admin_Cloudly_RollbackExternalDnsMutation extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_RollbackExternalDnsMutation> {
|
|
176
|
+
method: 'rollbackExternalDnsMutation';
|
|
177
|
+
request: {
|
|
178
|
+
identity: IIdentityCredential;
|
|
179
|
+
mutationId: string;
|
|
180
|
+
reason?: string;
|
|
181
|
+
};
|
|
182
|
+
response: TExternalDnsResult<{
|
|
183
|
+
journalEntry: IExternalDnsMutationJournalEntry;
|
|
184
|
+
restoredRecords: IExternalDnsRecord[];
|
|
185
|
+
}>;
|
|
186
|
+
}
|
|
187
|
+
export interface IReq_Admin_Cloudly_ListExternalDnsMutationJournal extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_ListExternalDnsMutationJournal> {
|
|
188
|
+
method: 'listExternalDnsMutationJournal';
|
|
189
|
+
request: {
|
|
190
|
+
identity: IIdentityCredential;
|
|
191
|
+
providerId?: string;
|
|
192
|
+
zoneName?: string;
|
|
193
|
+
fqdn?: string;
|
|
194
|
+
limit?: number;
|
|
195
|
+
};
|
|
196
|
+
response: TExternalDnsResult<{
|
|
197
|
+
entries: IExternalDnsMutationJournalEntry[];
|
|
198
|
+
}>;
|
|
199
|
+
}
|
|
200
|
+
export interface IReq_Admin_Cloudly_ImportExternalDnsProviderFromGatewayIntent extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_ImportExternalDnsProviderFromGatewayIntent> {
|
|
201
|
+
method: 'importExternalDnsProviderFromGatewayIntent';
|
|
202
|
+
request: {
|
|
203
|
+
identity: IIdentityCredential;
|
|
204
|
+
gatewayId: string;
|
|
205
|
+
/** Row id of the Cloudflare provider inside the gateway's stored `dns` intent table. */
|
|
206
|
+
gatewayProviderRowId: string;
|
|
207
|
+
/** Optional override name in Cloudly's external DNS store. */
|
|
208
|
+
name?: string;
|
|
209
|
+
};
|
|
210
|
+
response: TExternalDnsResult<{
|
|
211
|
+
provider: IExternalDnsProvider;
|
|
212
|
+
}>;
|
|
213
|
+
}
|
|
@@ -6,6 +6,8 @@ import * as backupRequests from './backup.js';
|
|
|
6
6
|
import * as backupMxRequests from './backupmx.js';
|
|
7
7
|
import * as hetznerRequests from './hetzner.js';
|
|
8
8
|
import * as certificateRequests from './certificate.js';
|
|
9
|
+
import * as certificateAuthorityRequests from './certificateauthority.js';
|
|
10
|
+
import * as pathRoutingRequests from './pathrouting.js';
|
|
9
11
|
import * as cloudAccessRequests from './cloudaccess.js';
|
|
10
12
|
import * as clusterRequests from './cluster.js';
|
|
11
13
|
import * as clusterIngressRequests from './clusteringress.js';
|
|
@@ -17,6 +19,7 @@ import * as corestoreRequests from './corestore.js';
|
|
|
17
19
|
import * as corestoreControlRequests from './corestorecontrol.js';
|
|
18
20
|
import * as deploymentRequests from './deployment.js';
|
|
19
21
|
import * as dnsRequests from './dns.js';
|
|
22
|
+
import * as externalDnsRequests from './externaldns.js';
|
|
20
23
|
import * as domainRequests from './domain.js';
|
|
21
24
|
import * as externalRegistryRequests from './externalregistry.js';
|
|
22
25
|
import * as fleetCutoverRequests from './fleetcutover.js';
|
|
@@ -45,7 +48,7 @@ import * as taskRequests from './task.js';
|
|
|
45
48
|
import * as versionRequests from './version.js';
|
|
46
49
|
import * as webPushRequests from './webpush.js';
|
|
47
50
|
import * as witnessRequests from './witness.js';
|
|
48
|
-
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, backupMxRequests as backupmx, hetznerRequests as hetzner, certificateRequests as certificate, cloudAccessRequests as cloudaccess, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, controllerRequests as controller, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, gatewayConnectorRequests as gatewayconnector, gatewayVpnRequests as gatewayvpn, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, locationRequests as location, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, witnessRequests as witness, };
|
|
51
|
+
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, backupMxRequests as backupmx, hetznerRequests as hetzner, certificateRequests as certificate, certificateAuthorityRequests as certificateauthority, pathRoutingRequests as pathrouting, cloudAccessRequests as cloudaccess, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, controllerRequests as controller, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, externalDnsRequests as externaldns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, gatewayConnectorRequests as gatewayconnector, gatewayVpnRequests as gatewayvpn, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, locationRequests as location, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, witnessRequests as witness, };
|
|
49
52
|
export * from './inform.js';
|
|
50
53
|
export * from './hostedapp.js';
|
|
51
54
|
export * from './mail.js';
|
|
@@ -7,6 +7,8 @@ import * as backupRequests from './backup.js';
|
|
|
7
7
|
import * as backupMxRequests from './backupmx.js';
|
|
8
8
|
import * as hetznerRequests from './hetzner.js';
|
|
9
9
|
import * as certificateRequests from './certificate.js';
|
|
10
|
+
import * as certificateAuthorityRequests from './certificateauthority.js';
|
|
11
|
+
import * as pathRoutingRequests from './pathrouting.js';
|
|
10
12
|
import * as cloudAccessRequests from './cloudaccess.js';
|
|
11
13
|
import * as clusterRequests from './cluster.js';
|
|
12
14
|
import * as clusterIngressRequests from './clusteringress.js';
|
|
@@ -18,6 +20,7 @@ import * as corestoreRequests from './corestore.js';
|
|
|
18
20
|
import * as corestoreControlRequests from './corestorecontrol.js';
|
|
19
21
|
import * as deploymentRequests from './deployment.js';
|
|
20
22
|
import * as dnsRequests from './dns.js';
|
|
23
|
+
import * as externalDnsRequests from './externaldns.js';
|
|
21
24
|
import * as domainRequests from './domain.js';
|
|
22
25
|
import * as externalRegistryRequests from './externalregistry.js';
|
|
23
26
|
import * as fleetCutoverRequests from './fleetcutover.js';
|
|
@@ -46,7 +49,7 @@ import * as taskRequests from './task.js';
|
|
|
46
49
|
import * as versionRequests from './version.js';
|
|
47
50
|
import * as webPushRequests from './webpush.js';
|
|
48
51
|
import * as witnessRequests from './witness.js';
|
|
49
|
-
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, backupMxRequests as backupmx, hetznerRequests as hetzner, certificateRequests as certificate, cloudAccessRequests as cloudaccess, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, controllerRequests as controller, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, gatewayConnectorRequests as gatewayconnector, gatewayVpnRequests as gatewayvpn, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, locationRequests as location, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, witnessRequests as witness, };
|
|
52
|
+
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, backupMxRequests as backupmx, hetznerRequests as hetzner, certificateRequests as certificate, certificateAuthorityRequests as certificateauthority, pathRoutingRequests as pathrouting, cloudAccessRequests as cloudaccess, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, controllerRequests as controller, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, externalDnsRequests as externaldns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, gatewayConnectorRequests as gatewayconnector, gatewayVpnRequests as gatewayvpn, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, locationRequests as location, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, witnessRequests as witness, };
|
|
50
53
|
export * from './inform.js';
|
|
51
54
|
export * from './hostedapp.js';
|
|
52
55
|
export * from './mail.js';
|
|
@@ -66,4 +69,4 @@ export * as corestorereplication from './corestorereplication.js';
|
|
|
66
69
|
export * as controlledtakeover from './controlledtakeover.js';
|
|
67
70
|
export * as diskencryption from './diskencryption.js';
|
|
68
71
|
export * as locationlock from './locationlock.js';
|
|
69
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQUV6QyxPQUFPLEtBQUssYUFBYSxNQUFNLFlBQVksQ0FBQztBQUM1QyxPQUFPLEtBQUssZ0JBQWdCLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sS0FBSyxpQkFBaUIsTUFBTSxnQkFBZ0IsQ0FBQztBQUNwRCxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssZ0JBQWdCLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sS0FBSyxlQUFlLE1BQU0sY0FBYyxDQUFDO0FBQ2hELE9BQU8sS0FBSyxtQkFBbUIsTUFBTSxrQkFBa0IsQ0FBQztBQUN4RCxPQUFPLEtBQUssNEJBQTRCLE1BQU0sMkJBQTJCLENBQUM7QUFDMUUsT0FBTyxLQUFLLG1CQUFtQixNQUFNLGtCQUFrQixDQUFDO0FBQ3hELE9BQU8sS0FBSyxtQkFBbUIsTUFBTSxrQkFBa0IsQ0FBQztBQUN4RCxPQUFPLEtBQUssZUFBZSxNQUFNLGNBQWMsQ0FBQztBQUNoRCxPQUFPLEtBQUssc0JBQXNCLE1BQU0scUJBQXFCLENBQUM7QUFDOUQsT0FBTyxLQUF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UIsQ0FBQztBQUN0RCxPQUFPLEtBQUssWUFBWSxNQUFNLG1CQUFtQixDQUFDIn0=
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { ITypedRequest, implementsTR } from '@api.global/typedrequest-interfaces';
|
|
2
|
+
import type { IGatewayPathProbeRequest, IGatewayPathProbeResult, IGatewayPathTelemetryReport, IServicePathDecision, IServicePathPolicy, TPathRoutingRefusalCode, TServiceRoutingProfile } from '../data/pathrouting.js';
|
|
3
|
+
import type { IIdentityCredential } from '../data/user.js';
|
|
4
|
+
export type TPathRoutingResult<TData> = ({
|
|
5
|
+
ok: true;
|
|
6
|
+
} & TData) | {
|
|
7
|
+
ok: false;
|
|
8
|
+
code: TPathRoutingRefusalCode;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Gateway-to-controller telemetry push over the authenticated gateway TypedSocket.
|
|
13
|
+
* Carries Hop 1 (RemoteIngress <-> dcrouter) and Hop 2 (dcrouter <-> backend) measurements.
|
|
14
|
+
*/
|
|
15
|
+
export interface IReq_Gateway_Cloudly_PushPathTelemetry extends implementsTR<ITypedRequest, IReq_Gateway_Cloudly_PushPathTelemetry> {
|
|
16
|
+
method: 'pushGatewayPathTelemetry';
|
|
17
|
+
request: {
|
|
18
|
+
report: IGatewayPathTelemetryReport;
|
|
19
|
+
};
|
|
20
|
+
response: {
|
|
21
|
+
accepted: boolean;
|
|
22
|
+
reevaluatedServices: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Controller-to-gateway on-demand bounded path probe over the authenticated gateway TypedSocket.
|
|
27
|
+
*/
|
|
28
|
+
export interface IReq_Cloudly_Gateway_RunPathProbe extends implementsTR<ITypedRequest, IReq_Cloudly_Gateway_RunPathProbe> {
|
|
29
|
+
method: 'runGatewayPathProbe';
|
|
30
|
+
request: IGatewayPathProbeRequest;
|
|
31
|
+
response: IGatewayPathProbeResult;
|
|
32
|
+
}
|
|
33
|
+
export interface IReq_Admin_Cloudly_UpsertServicePathPolicy extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_UpsertServicePathPolicy> {
|
|
34
|
+
method: 'upsertServicePathPolicy';
|
|
35
|
+
request: {
|
|
36
|
+
identity: IIdentityCredential;
|
|
37
|
+
serviceId: string;
|
|
38
|
+
hostname: string;
|
|
39
|
+
targetKey: string;
|
|
40
|
+
clusterId?: string | null;
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
profile?: TServiceRoutingProfile;
|
|
43
|
+
pinnedGatewayId?: string | null;
|
|
44
|
+
pinnedEdgeId?: string | null;
|
|
45
|
+
hysteresisMargin?: number;
|
|
46
|
+
minDwellMs?: number;
|
|
47
|
+
ttlSeconds?: number;
|
|
48
|
+
proxied?: boolean;
|
|
49
|
+
};
|
|
50
|
+
response: TPathRoutingResult<{
|
|
51
|
+
policy: IServicePathPolicy;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
export interface IReq_Admin_Cloudly_ListServicePathPolicies extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_ListServicePathPolicies> {
|
|
55
|
+
method: 'listServicePathPolicies';
|
|
56
|
+
request: {
|
|
57
|
+
identity: IIdentityCredential;
|
|
58
|
+
serviceId?: string;
|
|
59
|
+
};
|
|
60
|
+
response: TPathRoutingResult<{
|
|
61
|
+
policies: IServicePathPolicy[];
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
export interface IReq_Admin_Cloudly_DeleteServicePathPolicy extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_DeleteServicePathPolicy> {
|
|
65
|
+
method: 'deleteServicePathPolicy';
|
|
66
|
+
request: {
|
|
67
|
+
identity: IIdentityCredential;
|
|
68
|
+
serviceId: string;
|
|
69
|
+
};
|
|
70
|
+
response: TPathRoutingResult<{
|
|
71
|
+
deleted: true;
|
|
72
|
+
}>;
|
|
73
|
+
}
|
|
74
|
+
export interface IReq_Admin_Cloudly_ListServicePathDecisions extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_ListServicePathDecisions> {
|
|
75
|
+
method: 'listServicePathDecisions';
|
|
76
|
+
request: {
|
|
77
|
+
identity: IIdentityCredential;
|
|
78
|
+
serviceId?: string;
|
|
79
|
+
};
|
|
80
|
+
response: TPathRoutingResult<{
|
|
81
|
+
decisions: IServicePathDecision[];
|
|
82
|
+
}>;
|
|
83
|
+
}
|
|
84
|
+
export interface IReq_Admin_Cloudly_EvaluateServicePaths extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_EvaluateServicePaths> {
|
|
85
|
+
method: 'evaluateServicePaths';
|
|
86
|
+
request: {
|
|
87
|
+
identity: IIdentityCredential;
|
|
88
|
+
serviceId?: string;
|
|
89
|
+
/** When true, immediately reconciles winning edge IPs into CloudlyExternalDnsManager. */
|
|
90
|
+
applyDns?: boolean;
|
|
91
|
+
};
|
|
92
|
+
response: TPathRoutingResult<{
|
|
93
|
+
decisions: IServicePathDecision[];
|
|
94
|
+
dnsUpdatedCount: number;
|
|
95
|
+
}>;
|
|
96
|
+
}
|
|
97
|
+
export interface IReq_Admin_Cloudly_TriggerGatewayPathProbe extends implementsTR<ITypedRequest, IReq_Admin_Cloudly_TriggerGatewayPathProbe> {
|
|
98
|
+
method: 'triggerGatewayPathProbe';
|
|
99
|
+
request: {
|
|
100
|
+
identity: IIdentityCredential;
|
|
101
|
+
gatewayId: string;
|
|
102
|
+
probe: IGatewayPathProbeRequest;
|
|
103
|
+
};
|
|
104
|
+
response: TPathRoutingResult<{
|
|
105
|
+
result: IGatewayPathProbeResult;
|
|
106
|
+
}>;
|
|
107
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serve.zone/interfaces",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.125.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.",
|
|
6
6
|
"exports": {
|
|
@@ -24,6 +24,14 @@
|
|
|
24
24
|
"types": "./dist_ts/data/backupmx.d.ts",
|
|
25
25
|
"default": "./dist_ts/data/backupmx.js"
|
|
26
26
|
},
|
|
27
|
+
"./data/certificateauthority": {
|
|
28
|
+
"types": "./dist_ts/data/certificateauthority.d.ts",
|
|
29
|
+
"default": "./dist_ts/data/certificateauthority.js"
|
|
30
|
+
},
|
|
31
|
+
"./data/pathrouting": {
|
|
32
|
+
"types": "./dist_ts/data/pathrouting.d.ts",
|
|
33
|
+
"default": "./dist_ts/data/pathrouting.js"
|
|
34
|
+
},
|
|
27
35
|
"./data/hetzner": {
|
|
28
36
|
"types": "./dist_ts/data/hetzner.d.ts",
|
|
29
37
|
"default": "./dist_ts/data/hetzner.js"
|
|
@@ -52,6 +60,10 @@
|
|
|
52
60
|
"types": "./dist_ts/data/diskencryption.d.ts",
|
|
53
61
|
"default": "./dist_ts/data/diskencryption.js"
|
|
54
62
|
},
|
|
63
|
+
"./data/externaldns": {
|
|
64
|
+
"types": "./dist_ts/data/externaldns.d.ts",
|
|
65
|
+
"default": "./dist_ts/data/externaldns.js"
|
|
66
|
+
},
|
|
55
67
|
"./data/gateway": {
|
|
56
68
|
"types": "./dist_ts/data/gateway.d.ts",
|
|
57
69
|
"default": "./dist_ts/data/gateway.js"
|
|
@@ -92,6 +104,14 @@
|
|
|
92
104
|
"types": "./dist_ts/requests/backupmx.d.ts",
|
|
93
105
|
"default": "./dist_ts/requests/backupmx.js"
|
|
94
106
|
},
|
|
107
|
+
"./requests/certificateauthority": {
|
|
108
|
+
"types": "./dist_ts/requests/certificateauthority.d.ts",
|
|
109
|
+
"default": "./dist_ts/requests/certificateauthority.js"
|
|
110
|
+
},
|
|
111
|
+
"./requests/pathrouting": {
|
|
112
|
+
"types": "./dist_ts/requests/pathrouting.d.ts",
|
|
113
|
+
"default": "./dist_ts/requests/pathrouting.js"
|
|
114
|
+
},
|
|
95
115
|
"./requests/hetzner": {
|
|
96
116
|
"types": "./dist_ts/requests/hetzner.d.ts",
|
|
97
117
|
"default": "./dist_ts/requests/hetzner.js"
|
|
@@ -124,6 +144,10 @@
|
|
|
124
144
|
"types": "./dist_ts/requests/diskencryption.d.ts",
|
|
125
145
|
"default": "./dist_ts/requests/diskencryption.js"
|
|
126
146
|
},
|
|
147
|
+
"./requests/externaldns": {
|
|
148
|
+
"types": "./dist_ts/requests/externaldns.d.ts",
|
|
149
|
+
"default": "./dist_ts/requests/externaldns.js"
|
|
150
|
+
},
|
|
127
151
|
"./requests/gateway": {
|
|
128
152
|
"types": "./dist_ts/requests/gateway.d.ts",
|
|
129
153
|
"default": "./dist_ts/requests/gateway.js"
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export const cloudlyCertificateSources = Object.freeze([
|
|
2
|
+
'acme',
|
|
3
|
+
'imported',
|
|
4
|
+
'gateway-migrated',
|
|
5
|
+
] as const);
|
|
6
|
+
|
|
7
|
+
export type TCloudlyCertificateSource = typeof cloudlyCertificateSources[number];
|
|
8
|
+
|
|
9
|
+
export const cloudlyCertificateRefusalCodes = Object.freeze([
|
|
10
|
+
'administrator-required',
|
|
11
|
+
'fresh-sign-in-required',
|
|
12
|
+
'invalid-request',
|
|
13
|
+
'acme-not-configured',
|
|
14
|
+
'certificate-not-found',
|
|
15
|
+
'zone-not-found',
|
|
16
|
+
'issuance-failed',
|
|
17
|
+
'invalid-certificate-material',
|
|
18
|
+
'gateway-unavailable',
|
|
19
|
+
] as const);
|
|
20
|
+
|
|
21
|
+
export type TCloudlyCertificateRefusalCode = typeof cloudlyCertificateRefusalCodes[number];
|
|
22
|
+
|
|
23
|
+
export const cloudlyCertificateContract = Object.freeze({
|
|
24
|
+
defaultRenewBeforeDays: 30,
|
|
25
|
+
minimumRenewBeforeDays: 1,
|
|
26
|
+
maximumRenewBeforeDays: 60,
|
|
27
|
+
maximumAltNames: 100,
|
|
28
|
+
maximumBundleCertificates: 500,
|
|
29
|
+
acmeChallengePrefix: '_acme-challenge.',
|
|
30
|
+
acmeChallengeTtlSeconds: 60,
|
|
31
|
+
} as const);
|
|
32
|
+
|
|
33
|
+
export interface ICloudlyAcmeConfig {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
accountEmail: string;
|
|
36
|
+
useProduction: boolean;
|
|
37
|
+
directoryUrl: string | null;
|
|
38
|
+
renewBeforeDays: number;
|
|
39
|
+
accountRegisteredAt: number | null;
|
|
40
|
+
updatedAt: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Public certificate metadata returned to operators (never carries private key PEM). */
|
|
44
|
+
export interface ICloudlyCertificateSummary {
|
|
45
|
+
id: string;
|
|
46
|
+
domain: string;
|
|
47
|
+
altNames: string[];
|
|
48
|
+
issuer: string;
|
|
49
|
+
serialNumber: string;
|
|
50
|
+
fingerprintSha256: string;
|
|
51
|
+
validFrom: number;
|
|
52
|
+
validUntil: number;
|
|
53
|
+
source: TCloudlyCertificateSource;
|
|
54
|
+
autoRenew: boolean;
|
|
55
|
+
lastPushedRevision: number;
|
|
56
|
+
createdAt: number;
|
|
57
|
+
updatedAt: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Leaf certificate + private key bundle pushed exclusively from Cloudly to authenticated
|
|
62
|
+
* adopted dcrouter gateways over TypedSocket when `certificates.controllerPushed === true`.
|
|
63
|
+
*/
|
|
64
|
+
export interface ICloudlyCertificateBundleItem {
|
|
65
|
+
domain: string;
|
|
66
|
+
altNames: string[];
|
|
67
|
+
certPem: string;
|
|
68
|
+
keyPem: string;
|
|
69
|
+
caPem: string | null;
|
|
70
|
+
validFrom: number;
|
|
71
|
+
validUntil: number;
|
|
72
|
+
fingerprintSha256: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const certLabelPattern = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
76
|
+
|
|
77
|
+
export const normalizeCertificateDomain = (domainArg: unknown): string | null => {
|
|
78
|
+
if (typeof domainArg !== 'string') return null;
|
|
79
|
+
const trimmed = domainArg.trim().toLowerCase().replace(/\.+$/, '');
|
|
80
|
+
if (trimmed.length === 0 || trimmed.length > 253) return null;
|
|
81
|
+
const labels = trimmed.split('.');
|
|
82
|
+
if (labels.length < 2) return null;
|
|
83
|
+
const [first, ...rest] = labels;
|
|
84
|
+
if (first === '*') {
|
|
85
|
+
if (rest.length < 2) return null;
|
|
86
|
+
return rest.every((label) => certLabelPattern.test(label)) ? trimmed : null;
|
|
87
|
+
}
|
|
88
|
+
return labels.every((label) => certLabelPattern.test(label)) ? trimmed : null;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* RFC 6125 single-label wildcard & exact hostname matching for certificate lookup.
|
|
93
|
+
*/
|
|
94
|
+
export const certificateMatchesHostname = (
|
|
95
|
+
certDomainArg: string,
|
|
96
|
+
altNamesArg: readonly string[],
|
|
97
|
+
hostnameArg: string,
|
|
98
|
+
): boolean => {
|
|
99
|
+
const host = normalizeCertificateDomain(hostnameArg);
|
|
100
|
+
if (!host || host.startsWith('*.')) return false;
|
|
101
|
+
const candidates = [certDomainArg, ...altNamesArg];
|
|
102
|
+
for (const raw of candidates) {
|
|
103
|
+
const pattern = normalizeCertificateDomain(raw);
|
|
104
|
+
if (!pattern) continue;
|
|
105
|
+
if (pattern === host) return true;
|
|
106
|
+
if (pattern.startsWith('*.')) {
|
|
107
|
+
const suffix = pattern.slice(2);
|
|
108
|
+
if (host.endsWith(`.${suffix}`)) {
|
|
109
|
+
const prefix = host.slice(0, host.length - suffix.length - 1);
|
|
110
|
+
if (prefix.length > 0 && !prefix.includes('.')) return true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
};
|