@homeflare/distilled-unifi-network 0.2.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/LICENSE +201 -0
- package/README.md +125 -0
- package/dist/credentials.d.ts +24 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +78 -0
- package/dist/credentials.js.map +1 -0
- package/dist/errors.d.ts +74 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +49 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol.d.ts +18 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +59 -0
- package/dist/protocol.js.map +1 -0
- package/dist/retry.d.ts +57 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +50 -0
- package/dist/retry.js.map +1 -0
- package/dist/services/access_control_acl_rules.d.ts +222 -0
- package/dist/services/access_control_acl_rules.d.ts.map +1 -0
- package/dist/services/access_control_acl_rules.js +225 -0
- package/dist/services/access_control_acl_rules.js.map +1 -0
- package/dist/services/application_info.d.ts +15 -0
- package/dist/services/application_info.d.ts.map +1 -0
- package/dist/services/application_info.js +22 -0
- package/dist/services/application_info.js.map +1 -0
- package/dist/services/clients.d.ts +108 -0
- package/dist/services/clients.d.ts.map +1 -0
- package/dist/services/clients.js +122 -0
- package/dist/services/clients.js.map +1 -0
- package/dist/services/dns_policies.d.ts +143 -0
- package/dist/services/dns_policies.d.ts.map +1 -0
- package/dist/services/dns_policies.js +171 -0
- package/dist/services/dns_policies.js.map +1 -0
- package/dist/services/firewall.d.ts +473 -0
- package/dist/services/firewall.d.ts.map +1 -0
- package/dist/services/firewall.js +521 -0
- package/dist/services/firewall.js.map +1 -0
- package/dist/services/hotspot.d.ts +107 -0
- package/dist/services/hotspot.d.ts.map +1 -0
- package/dist/services/hotspot.js +145 -0
- package/dist/services/hotspot.js.map +1 -0
- package/dist/services/index.d.ts +14 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +15 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/networks.d.ts +251 -0
- package/dist/services/networks.d.ts.map +1 -0
- package/dist/services/networks.js +256 -0
- package/dist/services/networks.js.map +1 -0
- package/dist/services/sites.d.ts +31 -0
- package/dist/services/sites.d.ts.map +1 -0
- package/dist/services/sites.js +38 -0
- package/dist/services/sites.js.map +1 -0
- package/dist/services/supporting_resources.d.ts +238 -0
- package/dist/services/supporting_resources.d.ts.map +1 -0
- package/dist/services/supporting_resources.js +298 -0
- package/dist/services/supporting_resources.js.map +1 -0
- package/dist/services/switching.d.ts +168 -0
- package/dist/services/switching.d.ts.map +1 -0
- package/dist/services/switching.js +226 -0
- package/dist/services/switching.js.map +1 -0
- package/dist/services/traffic_matching_lists.d.ts +75 -0
- package/dist/services/traffic_matching_lists.d.ts.map +1 -0
- package/dist/services/traffic_matching_lists.js +126 -0
- package/dist/services/traffic_matching_lists.js.map +1 -0
- package/dist/services/unifi_devices.d.ts +280 -0
- package/dist/services/unifi_devices.d.ts.map +1 -0
- package/dist/services/unifi_devices.js +338 -0
- package/dist/services/unifi_devices.js.map +1 -0
- package/dist/services/wifi_broadcasts.d.ts +378 -0
- package/dist/services/wifi_broadcasts.d.ts.map +1 -0
- package/dist/services/wifi_broadcasts.js +396 -0
- package/dist/services/wifi_broadcasts.js.map +1 -0
- package/dist/traits.d.ts +11 -0
- package/dist/traits.d.ts.map +1 -0
- package/dist/traits.js +12 -0
- package/dist/traits.js.map +1 -0
- package/package.json +75 -0
- package/src/credentials.ts +112 -0
- package/src/errors.ts +103 -0
- package/src/index.ts +36 -0
- package/src/protocol.ts +86 -0
- package/src/retry.ts +83 -0
- package/src/services/access_control_acl_rules.ts +537 -0
- package/src/services/application_info.ts +44 -0
- package/src/services/clients.ts +272 -0
- package/src/services/dns_policies.ts +363 -0
- package/src/services/firewall.ts +1492 -0
- package/src/services/hotspot.ts +305 -0
- package/src/services/index.ts +14 -0
- package/src/services/networks.ts +613 -0
- package/src/services/sites.ts +81 -0
- package/src/services/supporting_resources.ts +650 -0
- package/src/services/switching.ts +496 -0
- package/src/services/traffic_matching_lists.ts +248 -0
- package/src/services/unifi_devices.ts +795 -0
- package/src/services/wifi_broadcasts.ts +992 -0
- package/src/traits.ts +45 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-unifi-network/specs/openapi.json). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
UnifiNetworkProtocol,
|
|
7
|
+
type UnifiNetworkOpError,
|
|
8
|
+
type UnifiNetworkOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { UnknownUnifiNetworkError } from "../errors.ts";
|
|
11
|
+
import * as Retry from "../retry.ts";
|
|
12
|
+
|
|
13
|
+
export type { UnifiNetworkOpError, UnifiNetworkOpContext };
|
|
14
|
+
|
|
15
|
+
export interface ExecuteConnectedClientActionRequest {
|
|
16
|
+
siteId: string;
|
|
17
|
+
clientId: string;
|
|
18
|
+
action: string;
|
|
19
|
+
/** (Optional) data usage limit in megabytes */
|
|
20
|
+
dataUsageLimitMBytes?: number;
|
|
21
|
+
/** (Optional) download rate limit in kilobits per second */
|
|
22
|
+
rxRateLimitKbps?: number;
|
|
23
|
+
/** (Optional) how long (in minutes) the guest will be authorized to access the network. If not specified, the default limit is used from the site settings */
|
|
24
|
+
timeLimitMinutes?: number;
|
|
25
|
+
/** (Optional) upload rate limit in kilobits per second */
|
|
26
|
+
txRateLimitKbps?: number;
|
|
27
|
+
}
|
|
28
|
+
export const ExecuteConnectedClientActionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
29
|
+
S.Struct({
|
|
30
|
+
siteId: S.String.pipe(T.Label()),
|
|
31
|
+
clientId: S.String.pipe(T.Label()),
|
|
32
|
+
action: S.String,
|
|
33
|
+
dataUsageLimitMBytes: S.optional(S.Number),
|
|
34
|
+
rxRateLimitKbps: S.optional(S.Number),
|
|
35
|
+
timeLimitMinutes: S.optional(S.Number),
|
|
36
|
+
txRateLimitKbps: S.optional(S.Number),
|
|
37
|
+
}).pipe(
|
|
38
|
+
T.Http({
|
|
39
|
+
method: "POST",
|
|
40
|
+
uri: "/v1/sites/{siteId}/clients/{clientId}/actions",
|
|
41
|
+
code: 200,
|
|
42
|
+
}),
|
|
43
|
+
),
|
|
44
|
+
).annotate({
|
|
45
|
+
identifier: "ExecuteConnectedClientActionRequest",
|
|
46
|
+
}) as any as S.Schema<ExecuteConnectedClientActionRequest>;
|
|
47
|
+
|
|
48
|
+
/** Guest authorization method (API, Voucher etc) */
|
|
49
|
+
export type GuestAuthorizationDetailsAuthorizationMethod =
|
|
50
|
+
| "VOUCHER"
|
|
51
|
+
| "API"
|
|
52
|
+
| "OTHER";
|
|
53
|
+
export const GuestAuthorizationDetailsAuthorizationMethod = S.String;
|
|
54
|
+
|
|
55
|
+
export interface GuestAuthorizationUsageDetails {
|
|
56
|
+
bytes: number;
|
|
57
|
+
durationSec: number;
|
|
58
|
+
rxBytes: number;
|
|
59
|
+
txBytes: number;
|
|
60
|
+
}
|
|
61
|
+
export const GuestAuthorizationUsageDetails = /*@__PURE__*/ S.suspend(() =>
|
|
62
|
+
S.Struct({
|
|
63
|
+
bytes: S.Number,
|
|
64
|
+
durationSec: S.Number,
|
|
65
|
+
rxBytes: S.Number,
|
|
66
|
+
txBytes: S.Number,
|
|
67
|
+
}),
|
|
68
|
+
).annotate({
|
|
69
|
+
identifier: "GuestAuthorizationUsageDetails",
|
|
70
|
+
}) as any as S.Schema<GuestAuthorizationUsageDetails>;
|
|
71
|
+
|
|
72
|
+
export interface GuestAuthorizationDetails {
|
|
73
|
+
/** Guest authorization method (API, Voucher etc) */
|
|
74
|
+
authorizationMethod: GuestAuthorizationDetailsAuthorizationMethod;
|
|
75
|
+
/** Timestamp when the guest has been authorized */
|
|
76
|
+
authorizedAt: string;
|
|
77
|
+
/** (Optional) data usage limit in megabytes */
|
|
78
|
+
dataUsageLimitMBytes?: number;
|
|
79
|
+
/** Timestamp when the guest will get automatically unauthorized */
|
|
80
|
+
expiresAt: string;
|
|
81
|
+
/** (Optional) download rate limit in kilobits per second */
|
|
82
|
+
rxRateLimitKbps?: number;
|
|
83
|
+
/** (Optional) upload rate limit in kilobits per second */
|
|
84
|
+
txRateLimitKbps?: number;
|
|
85
|
+
usage?: GuestAuthorizationUsageDetails;
|
|
86
|
+
}
|
|
87
|
+
export const GuestAuthorizationDetails = /*@__PURE__*/ S.suspend(() =>
|
|
88
|
+
S.Struct({
|
|
89
|
+
authorizationMethod: GuestAuthorizationDetailsAuthorizationMethod,
|
|
90
|
+
authorizedAt: S.String,
|
|
91
|
+
dataUsageLimitMBytes: S.optional(S.Number),
|
|
92
|
+
expiresAt: S.String,
|
|
93
|
+
rxRateLimitKbps: S.optional(S.Number),
|
|
94
|
+
txRateLimitKbps: S.optional(S.Number),
|
|
95
|
+
usage: S.optional(GuestAuthorizationUsageDetails),
|
|
96
|
+
}),
|
|
97
|
+
).annotate({
|
|
98
|
+
identifier: "GuestAuthorizationDetails",
|
|
99
|
+
}) as any as S.Schema<GuestAuthorizationDetails>;
|
|
100
|
+
|
|
101
|
+
export interface ClientActionResponse {
|
|
102
|
+
action: string;
|
|
103
|
+
/** Granted guest authorization */
|
|
104
|
+
grantedAuthorization?: GuestAuthorizationDetails;
|
|
105
|
+
/** (Optional) Revoked authorization in case the guest was already authorized at the time of this request */
|
|
106
|
+
revokedAuthorization?: GuestAuthorizationDetails;
|
|
107
|
+
}
|
|
108
|
+
export const ClientActionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
109
|
+
S.Struct({
|
|
110
|
+
action: S.String,
|
|
111
|
+
grantedAuthorization: S.optional(GuestAuthorizationDetails),
|
|
112
|
+
revokedAuthorization: S.optional(GuestAuthorizationDetails),
|
|
113
|
+
}),
|
|
114
|
+
).annotate({
|
|
115
|
+
identifier: "ClientActionResponse",
|
|
116
|
+
}) as any as S.Schema<ClientActionResponse>;
|
|
117
|
+
|
|
118
|
+
export interface GetConnectedClientDetailsRequest {
|
|
119
|
+
siteId: string;
|
|
120
|
+
clientId: string;
|
|
121
|
+
}
|
|
122
|
+
export const GetConnectedClientDetailsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
123
|
+
S.Struct({
|
|
124
|
+
siteId: S.String.pipe(T.Label()),
|
|
125
|
+
clientId: S.String.pipe(T.Label()),
|
|
126
|
+
}).pipe(
|
|
127
|
+
T.Http({
|
|
128
|
+
method: "GET",
|
|
129
|
+
uri: "/v1/sites/{siteId}/clients/{clientId}",
|
|
130
|
+
code: 200,
|
|
131
|
+
}),
|
|
132
|
+
),
|
|
133
|
+
).annotate({
|
|
134
|
+
identifier: "GetConnectedClientDetailsRequest",
|
|
135
|
+
}) as any as S.Schema<GetConnectedClientDetailsRequest>;
|
|
136
|
+
|
|
137
|
+
export interface ClientDetails {
|
|
138
|
+
/** Shape varies by variant — widened by scripts/convert.ts; see README. */
|
|
139
|
+
access: unknown;
|
|
140
|
+
connectedAt?: string;
|
|
141
|
+
id: string;
|
|
142
|
+
ipAddress?: string;
|
|
143
|
+
name: string;
|
|
144
|
+
type: string;
|
|
145
|
+
macAddress?: string;
|
|
146
|
+
uplinkDeviceId?: string;
|
|
147
|
+
}
|
|
148
|
+
export const ClientDetails = /*@__PURE__*/ S.suspend(() =>
|
|
149
|
+
S.Struct({
|
|
150
|
+
access: S.Unknown,
|
|
151
|
+
connectedAt: S.optional(S.String),
|
|
152
|
+
id: S.String,
|
|
153
|
+
ipAddress: S.optional(S.String),
|
|
154
|
+
name: S.String,
|
|
155
|
+
type: S.String,
|
|
156
|
+
macAddress: S.optional(S.String),
|
|
157
|
+
uplinkDeviceId: S.optional(S.String),
|
|
158
|
+
}),
|
|
159
|
+
).annotate({ identifier: "ClientDetails" }) as any as S.Schema<ClientDetails>;
|
|
160
|
+
|
|
161
|
+
export interface GetConnectedClientOverviewPageRequest {
|
|
162
|
+
siteId: string;
|
|
163
|
+
offset?: number;
|
|
164
|
+
limit?: number;
|
|
165
|
+
filter?: string;
|
|
166
|
+
}
|
|
167
|
+
export const GetConnectedClientOverviewPageRequest = /*@__PURE__*/ S.suspend(
|
|
168
|
+
() =>
|
|
169
|
+
S.Struct({
|
|
170
|
+
siteId: S.String.pipe(T.Label()),
|
|
171
|
+
offset: S.optional(S.Number.pipe(T.Query())),
|
|
172
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
173
|
+
filter: S.optional(S.String.pipe(T.Query())),
|
|
174
|
+
}).pipe(
|
|
175
|
+
T.Http({ method: "GET", uri: "/v1/sites/{siteId}/clients", code: 200 }),
|
|
176
|
+
),
|
|
177
|
+
).annotate({
|
|
178
|
+
identifier: "GetConnectedClientOverviewPageRequest",
|
|
179
|
+
}) as any as S.Schema<GetConnectedClientOverviewPageRequest>;
|
|
180
|
+
|
|
181
|
+
export interface ClientOverview {
|
|
182
|
+
/** Shape varies by variant — widened by scripts/convert.ts; see README. */
|
|
183
|
+
access: unknown;
|
|
184
|
+
connectedAt?: string;
|
|
185
|
+
id: string;
|
|
186
|
+
ipAddress?: string;
|
|
187
|
+
name: string;
|
|
188
|
+
type: string;
|
|
189
|
+
macAddress?: string;
|
|
190
|
+
uplinkDeviceId?: string;
|
|
191
|
+
}
|
|
192
|
+
export const ClientOverview = /*@__PURE__*/ S.suspend(() =>
|
|
193
|
+
S.Struct({
|
|
194
|
+
access: S.Unknown,
|
|
195
|
+
connectedAt: S.optional(S.String),
|
|
196
|
+
id: S.String,
|
|
197
|
+
ipAddress: S.optional(S.String),
|
|
198
|
+
name: S.String,
|
|
199
|
+
type: S.String,
|
|
200
|
+
macAddress: S.optional(S.String),
|
|
201
|
+
uplinkDeviceId: S.optional(S.String),
|
|
202
|
+
}),
|
|
203
|
+
).annotate({ identifier: "ClientOverview" }) as any as S.Schema<ClientOverview>;
|
|
204
|
+
|
|
205
|
+
export type ClientOverviewPageDataList = Array<ClientOverview>;
|
|
206
|
+
export const ClientOverviewPageDataList = /*@__PURE__*/ S.Array(
|
|
207
|
+
ClientOverview,
|
|
208
|
+
) as any as S.Schema<ClientOverviewPageDataList>;
|
|
209
|
+
|
|
210
|
+
export interface ClientOverviewPage {
|
|
211
|
+
count: number;
|
|
212
|
+
data: ClientOverviewPageDataList;
|
|
213
|
+
limit: number;
|
|
214
|
+
offset: number;
|
|
215
|
+
totalCount: number;
|
|
216
|
+
}
|
|
217
|
+
export const ClientOverviewPage = /*@__PURE__*/ S.suspend(() =>
|
|
218
|
+
S.Struct({
|
|
219
|
+
count: S.Number,
|
|
220
|
+
data: ClientOverviewPageDataList,
|
|
221
|
+
limit: S.Number,
|
|
222
|
+
offset: S.Number,
|
|
223
|
+
totalCount: S.Number,
|
|
224
|
+
}),
|
|
225
|
+
).annotate({
|
|
226
|
+
identifier: "ClientOverviewPage",
|
|
227
|
+
}) as any as S.Schema<ClientOverviewPage>;
|
|
228
|
+
|
|
229
|
+
export type ExecuteConnectedClientActionError = UnifiNetworkOpError;
|
|
230
|
+
/** Execute Client Action Perform an action on a specific connected client. The request body must include the action name and any applicable input arguments. */
|
|
231
|
+
export const executeConnectedClientAction: API.OperationMethod<
|
|
232
|
+
ExecuteConnectedClientActionRequest,
|
|
233
|
+
ClientActionResponse,
|
|
234
|
+
ExecuteConnectedClientActionError,
|
|
235
|
+
UnifiNetworkOpContext
|
|
236
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
237
|
+
input: ExecuteConnectedClientActionRequest,
|
|
238
|
+
output: ClientActionResponse,
|
|
239
|
+
errors: [UnknownUnifiNetworkError],
|
|
240
|
+
protocol: UnifiNetworkProtocol,
|
|
241
|
+
retry: Retry.Retry,
|
|
242
|
+
}));
|
|
243
|
+
|
|
244
|
+
export type GetConnectedClientDetailsError = UnifiNetworkOpError;
|
|
245
|
+
/** Get Connected Client Details Retrieve detailed information about a specific connected client, including name, IP address, MAC address, connection type and access information. */
|
|
246
|
+
export const getConnectedClientDetails: API.OperationMethod<
|
|
247
|
+
GetConnectedClientDetailsRequest,
|
|
248
|
+
ClientDetails,
|
|
249
|
+
GetConnectedClientDetailsError,
|
|
250
|
+
UnifiNetworkOpContext
|
|
251
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
252
|
+
input: GetConnectedClientDetailsRequest,
|
|
253
|
+
output: ClientDetails,
|
|
254
|
+
errors: [UnknownUnifiNetworkError],
|
|
255
|
+
protocol: UnifiNetworkProtocol,
|
|
256
|
+
retry: Retry.Retry,
|
|
257
|
+
}));
|
|
258
|
+
|
|
259
|
+
export type GetConnectedClientOverviewPageError = UnifiNetworkOpError;
|
|
260
|
+
/** List Connected Clients Retrieve a paginated list of all connected clients on a site, including physical devices (computers, smartphones) and active VPN connections. <details> <summary>Filterable properties (click to expand)</summary> </details> */
|
|
261
|
+
export const getConnectedClientOverviewPage: API.OperationMethod<
|
|
262
|
+
GetConnectedClientOverviewPageRequest,
|
|
263
|
+
ClientOverviewPage,
|
|
264
|
+
GetConnectedClientOverviewPageError,
|
|
265
|
+
UnifiNetworkOpContext
|
|
266
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
267
|
+
input: GetConnectedClientOverviewPageRequest,
|
|
268
|
+
output: ClientOverviewPage,
|
|
269
|
+
errors: [UnknownUnifiNetworkError],
|
|
270
|
+
protocol: UnifiNetworkProtocol,
|
|
271
|
+
retry: Retry.Retry,
|
|
272
|
+
}));
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-unifi-network/specs/openapi.json). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
UnifiNetworkProtocol,
|
|
7
|
+
type UnifiNetworkOpError,
|
|
8
|
+
type UnifiNetworkOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { UnknownUnifiNetworkError } from "../errors.ts";
|
|
11
|
+
import * as Retry from "../retry.ts";
|
|
12
|
+
|
|
13
|
+
export type { UnifiNetworkOpError, UnifiNetworkOpContext };
|
|
14
|
+
|
|
15
|
+
export interface CreateDnsPolicyRequest {
|
|
16
|
+
siteId: string;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
type: string;
|
|
19
|
+
domain?: string;
|
|
20
|
+
ipv6Address?: string;
|
|
21
|
+
/** Time to live in seconds. */
|
|
22
|
+
ttlSeconds?: number;
|
|
23
|
+
ipv4Address?: string;
|
|
24
|
+
targetDomain?: string;
|
|
25
|
+
/** IP address of the DNS Server that the DNS query is forwarded to. */
|
|
26
|
+
ipAddress?: string;
|
|
27
|
+
mailServerDomain?: string;
|
|
28
|
+
/** Priority. A lower number is preferred. */
|
|
29
|
+
priority?: number;
|
|
30
|
+
port?: number;
|
|
31
|
+
/** Protocol used by the service. */
|
|
32
|
+
protocol?: string;
|
|
33
|
+
/** Domain of the server that is running the service. */
|
|
34
|
+
serverDomain?: string;
|
|
35
|
+
/** Service associated with this SRV record. */
|
|
36
|
+
service?: string;
|
|
37
|
+
/** Weight. A relative value applicable for records with the same priority. A lower number is preferred. */
|
|
38
|
+
weight?: number;
|
|
39
|
+
/** The text value associated with this TXT DNS record. Text can contain up to four 255-character strings. Lines containing commas must be enclosed in double quotes ("). */
|
|
40
|
+
text?: string;
|
|
41
|
+
}
|
|
42
|
+
export const CreateDnsPolicyRequest = /*@__PURE__*/ S.suspend(() =>
|
|
43
|
+
S.Struct({
|
|
44
|
+
siteId: S.String.pipe(T.Label()),
|
|
45
|
+
enabled: S.Boolean,
|
|
46
|
+
type: S.String,
|
|
47
|
+
domain: S.optional(S.String),
|
|
48
|
+
ipv6Address: S.optional(S.String),
|
|
49
|
+
ttlSeconds: S.optional(S.Number),
|
|
50
|
+
ipv4Address: S.optional(S.String),
|
|
51
|
+
targetDomain: S.optional(S.String),
|
|
52
|
+
ipAddress: S.optional(S.String),
|
|
53
|
+
mailServerDomain: S.optional(S.String),
|
|
54
|
+
priority: S.optional(S.Number),
|
|
55
|
+
port: S.optional(S.Number),
|
|
56
|
+
protocol: S.optional(S.String),
|
|
57
|
+
serverDomain: S.optional(S.String),
|
|
58
|
+
service: S.optional(S.String),
|
|
59
|
+
weight: S.optional(S.Number),
|
|
60
|
+
text: S.optional(S.String),
|
|
61
|
+
}).pipe(
|
|
62
|
+
T.Http({
|
|
63
|
+
method: "POST",
|
|
64
|
+
uri: "/v1/sites/{siteId}/dns/policies",
|
|
65
|
+
code: 200,
|
|
66
|
+
}),
|
|
67
|
+
),
|
|
68
|
+
).annotate({
|
|
69
|
+
identifier: "CreateDnsPolicyRequest",
|
|
70
|
+
}) as any as S.Schema<CreateDnsPolicyRequest>;
|
|
71
|
+
|
|
72
|
+
export type UserDefinedEntityMetadataSource = "SDWAN";
|
|
73
|
+
export const UserDefinedEntityMetadataSource = S.String;
|
|
74
|
+
|
|
75
|
+
export interface UserDefinedEntityMetadata {
|
|
76
|
+
origin: string;
|
|
77
|
+
source?: UserDefinedEntityMetadataSource;
|
|
78
|
+
}
|
|
79
|
+
export const UserDefinedEntityMetadata = /*@__PURE__*/ S.suspend(() =>
|
|
80
|
+
S.Struct({
|
|
81
|
+
origin: S.String,
|
|
82
|
+
source: S.optional(UserDefinedEntityMetadataSource),
|
|
83
|
+
}),
|
|
84
|
+
).annotate({
|
|
85
|
+
identifier: "UserDefinedEntityMetadata",
|
|
86
|
+
}) as any as S.Schema<UserDefinedEntityMetadata>;
|
|
87
|
+
|
|
88
|
+
export interface DNSPolicy {
|
|
89
|
+
domain?: string;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
id: string;
|
|
92
|
+
metadata: UserDefinedEntityMetadata;
|
|
93
|
+
type: string;
|
|
94
|
+
ipv6Address?: string;
|
|
95
|
+
/** Time to live in seconds. */
|
|
96
|
+
ttlSeconds?: number;
|
|
97
|
+
ipv4Address?: string;
|
|
98
|
+
targetDomain?: string;
|
|
99
|
+
/** IP address of the DNS Server that the DNS query is forwarded to. */
|
|
100
|
+
ipAddress?: string;
|
|
101
|
+
mailServerDomain?: string;
|
|
102
|
+
/** Priority. A lower number is preferred. */
|
|
103
|
+
priority?: number;
|
|
104
|
+
port?: number;
|
|
105
|
+
/** Protocol used by the service. */
|
|
106
|
+
protocol?: string;
|
|
107
|
+
/** Domain of the server that is running the service. */
|
|
108
|
+
serverDomain?: string;
|
|
109
|
+
/** Service associated with this SRV record. */
|
|
110
|
+
service?: string;
|
|
111
|
+
/** Weight. A relative value applicable for records with the same priority. A lower number is preferred. */
|
|
112
|
+
weight?: number;
|
|
113
|
+
/** The text value associated with this TXT DNS record. Text can contain up to four 255-character strings. Lines containing commas must be enclosed in double quotes ("). */
|
|
114
|
+
text?: string;
|
|
115
|
+
}
|
|
116
|
+
export const DNSPolicy = /*@__PURE__*/ S.suspend(() =>
|
|
117
|
+
S.Struct({
|
|
118
|
+
domain: S.optional(S.String),
|
|
119
|
+
enabled: S.Boolean,
|
|
120
|
+
id: S.String,
|
|
121
|
+
metadata: UserDefinedEntityMetadata,
|
|
122
|
+
type: S.String,
|
|
123
|
+
ipv6Address: S.optional(S.String),
|
|
124
|
+
ttlSeconds: S.optional(S.Number),
|
|
125
|
+
ipv4Address: S.optional(S.String),
|
|
126
|
+
targetDomain: S.optional(S.String),
|
|
127
|
+
ipAddress: S.optional(S.String),
|
|
128
|
+
mailServerDomain: S.optional(S.String),
|
|
129
|
+
priority: S.optional(S.Number),
|
|
130
|
+
port: S.optional(S.Number),
|
|
131
|
+
protocol: S.optional(S.String),
|
|
132
|
+
serverDomain: S.optional(S.String),
|
|
133
|
+
service: S.optional(S.String),
|
|
134
|
+
weight: S.optional(S.Number),
|
|
135
|
+
text: S.optional(S.String),
|
|
136
|
+
}),
|
|
137
|
+
).annotate({ identifier: "DNSPolicy" }) as any as S.Schema<DNSPolicy>;
|
|
138
|
+
|
|
139
|
+
export interface DeleteDnsPolicyRequest {
|
|
140
|
+
siteId: string;
|
|
141
|
+
dnsPolicyId: string;
|
|
142
|
+
}
|
|
143
|
+
export const DeleteDnsPolicyRequest = /*@__PURE__*/ S.suspend(() =>
|
|
144
|
+
S.Struct({
|
|
145
|
+
siteId: S.String.pipe(T.Label()),
|
|
146
|
+
dnsPolicyId: S.String.pipe(T.Label()),
|
|
147
|
+
}).pipe(
|
|
148
|
+
T.Http({
|
|
149
|
+
method: "DELETE",
|
|
150
|
+
uri: "/v1/sites/{siteId}/dns/policies/{dnsPolicyId}",
|
|
151
|
+
code: 200,
|
|
152
|
+
}),
|
|
153
|
+
),
|
|
154
|
+
).annotate({
|
|
155
|
+
identifier: "DeleteDnsPolicyRequest",
|
|
156
|
+
}) as any as S.Schema<DeleteDnsPolicyRequest>;
|
|
157
|
+
|
|
158
|
+
export interface DeleteDnsPolicyResponse {}
|
|
159
|
+
export const DeleteDnsPolicyResponse = /*@__PURE__*/ S.suspend(() =>
|
|
160
|
+
S.Struct({}),
|
|
161
|
+
).annotate({
|
|
162
|
+
identifier: "DeleteDnsPolicyResponse",
|
|
163
|
+
}) as any as S.Schema<DeleteDnsPolicyResponse>;
|
|
164
|
+
|
|
165
|
+
export interface GetDnsPolicyRequest {
|
|
166
|
+
siteId: string;
|
|
167
|
+
dnsPolicyId: string;
|
|
168
|
+
}
|
|
169
|
+
export const GetDnsPolicyRequest = /*@__PURE__*/ S.suspend(() =>
|
|
170
|
+
S.Struct({
|
|
171
|
+
siteId: S.String.pipe(T.Label()),
|
|
172
|
+
dnsPolicyId: S.String.pipe(T.Label()),
|
|
173
|
+
}).pipe(
|
|
174
|
+
T.Http({
|
|
175
|
+
method: "GET",
|
|
176
|
+
uri: "/v1/sites/{siteId}/dns/policies/{dnsPolicyId}",
|
|
177
|
+
code: 200,
|
|
178
|
+
}),
|
|
179
|
+
),
|
|
180
|
+
).annotate({
|
|
181
|
+
identifier: "GetDnsPolicyRequest",
|
|
182
|
+
}) as any as S.Schema<GetDnsPolicyRequest>;
|
|
183
|
+
|
|
184
|
+
export interface GetDnsPolicyPageRequest {
|
|
185
|
+
siteId: string;
|
|
186
|
+
offset?: number;
|
|
187
|
+
limit?: number;
|
|
188
|
+
filter?: string;
|
|
189
|
+
}
|
|
190
|
+
export const GetDnsPolicyPageRequest = /*@__PURE__*/ S.suspend(() =>
|
|
191
|
+
S.Struct({
|
|
192
|
+
siteId: S.String.pipe(T.Label()),
|
|
193
|
+
offset: S.optional(S.Number.pipe(T.Query())),
|
|
194
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
195
|
+
filter: S.optional(S.String.pipe(T.Query())),
|
|
196
|
+
}).pipe(
|
|
197
|
+
T.Http({
|
|
198
|
+
method: "GET",
|
|
199
|
+
uri: "/v1/sites/{siteId}/dns/policies",
|
|
200
|
+
code: 200,
|
|
201
|
+
}),
|
|
202
|
+
),
|
|
203
|
+
).annotate({
|
|
204
|
+
identifier: "GetDnsPolicyPageRequest",
|
|
205
|
+
}) as any as S.Schema<GetDnsPolicyPageRequest>;
|
|
206
|
+
|
|
207
|
+
export type IntegrationDnsPolicyPageDtoDataList = Array<DNSPolicy>;
|
|
208
|
+
export const IntegrationDnsPolicyPageDtoDataList = /*@__PURE__*/ S.Array(
|
|
209
|
+
DNSPolicy,
|
|
210
|
+
) as any as S.Schema<IntegrationDnsPolicyPageDtoDataList>;
|
|
211
|
+
|
|
212
|
+
export interface IntegrationDnsPolicyPageDto {
|
|
213
|
+
count: number;
|
|
214
|
+
data: IntegrationDnsPolicyPageDtoDataList;
|
|
215
|
+
limit: number;
|
|
216
|
+
offset: number;
|
|
217
|
+
totalCount: number;
|
|
218
|
+
}
|
|
219
|
+
export const IntegrationDnsPolicyPageDto = /*@__PURE__*/ S.suspend(() =>
|
|
220
|
+
S.Struct({
|
|
221
|
+
count: S.Number,
|
|
222
|
+
data: IntegrationDnsPolicyPageDtoDataList,
|
|
223
|
+
limit: S.Number,
|
|
224
|
+
offset: S.Number,
|
|
225
|
+
totalCount: S.Number,
|
|
226
|
+
}),
|
|
227
|
+
).annotate({
|
|
228
|
+
identifier: "IntegrationDnsPolicyPageDto",
|
|
229
|
+
}) as any as S.Schema<IntegrationDnsPolicyPageDto>;
|
|
230
|
+
|
|
231
|
+
export interface UpdateDnsPolicyRequest {
|
|
232
|
+
siteId: string;
|
|
233
|
+
dnsPolicyId: string;
|
|
234
|
+
enabled: boolean;
|
|
235
|
+
type: string;
|
|
236
|
+
domain?: string;
|
|
237
|
+
ipv6Address?: string;
|
|
238
|
+
/** Time to live in seconds. */
|
|
239
|
+
ttlSeconds?: number;
|
|
240
|
+
ipv4Address?: string;
|
|
241
|
+
targetDomain?: string;
|
|
242
|
+
/** IP address of the DNS Server that the DNS query is forwarded to. */
|
|
243
|
+
ipAddress?: string;
|
|
244
|
+
mailServerDomain?: string;
|
|
245
|
+
/** Priority. A lower number is preferred. */
|
|
246
|
+
priority?: number;
|
|
247
|
+
port?: number;
|
|
248
|
+
/** Protocol used by the service. */
|
|
249
|
+
protocol?: string;
|
|
250
|
+
/** Domain of the server that is running the service. */
|
|
251
|
+
serverDomain?: string;
|
|
252
|
+
/** Service associated with this SRV record. */
|
|
253
|
+
service?: string;
|
|
254
|
+
/** Weight. A relative value applicable for records with the same priority. A lower number is preferred. */
|
|
255
|
+
weight?: number;
|
|
256
|
+
/** The text value associated with this TXT DNS record. Text can contain up to four 255-character strings. Lines containing commas must be enclosed in double quotes ("). */
|
|
257
|
+
text?: string;
|
|
258
|
+
}
|
|
259
|
+
export const UpdateDnsPolicyRequest = /*@__PURE__*/ S.suspend(() =>
|
|
260
|
+
S.Struct({
|
|
261
|
+
siteId: S.String.pipe(T.Label()),
|
|
262
|
+
dnsPolicyId: S.String.pipe(T.Label()),
|
|
263
|
+
enabled: S.Boolean,
|
|
264
|
+
type: S.String,
|
|
265
|
+
domain: S.optional(S.String),
|
|
266
|
+
ipv6Address: S.optional(S.String),
|
|
267
|
+
ttlSeconds: S.optional(S.Number),
|
|
268
|
+
ipv4Address: S.optional(S.String),
|
|
269
|
+
targetDomain: S.optional(S.String),
|
|
270
|
+
ipAddress: S.optional(S.String),
|
|
271
|
+
mailServerDomain: S.optional(S.String),
|
|
272
|
+
priority: S.optional(S.Number),
|
|
273
|
+
port: S.optional(S.Number),
|
|
274
|
+
protocol: S.optional(S.String),
|
|
275
|
+
serverDomain: S.optional(S.String),
|
|
276
|
+
service: S.optional(S.String),
|
|
277
|
+
weight: S.optional(S.Number),
|
|
278
|
+
text: S.optional(S.String),
|
|
279
|
+
}).pipe(
|
|
280
|
+
T.Http({
|
|
281
|
+
method: "PUT",
|
|
282
|
+
uri: "/v1/sites/{siteId}/dns/policies/{dnsPolicyId}",
|
|
283
|
+
code: 200,
|
|
284
|
+
}),
|
|
285
|
+
),
|
|
286
|
+
).annotate({
|
|
287
|
+
identifier: "UpdateDnsPolicyRequest",
|
|
288
|
+
}) as any as S.Schema<UpdateDnsPolicyRequest>;
|
|
289
|
+
|
|
290
|
+
export type CreateDnsPolicyError = UnifiNetworkOpError;
|
|
291
|
+
/** Create DNS Policy Create a new DNS policy on a site. */
|
|
292
|
+
export const createDnsPolicy: API.OperationMethod<
|
|
293
|
+
CreateDnsPolicyRequest,
|
|
294
|
+
DNSPolicy,
|
|
295
|
+
CreateDnsPolicyError,
|
|
296
|
+
UnifiNetworkOpContext
|
|
297
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
298
|
+
input: CreateDnsPolicyRequest,
|
|
299
|
+
output: DNSPolicy,
|
|
300
|
+
errors: [UnknownUnifiNetworkError],
|
|
301
|
+
protocol: UnifiNetworkProtocol,
|
|
302
|
+
retry: Retry.Retry,
|
|
303
|
+
}));
|
|
304
|
+
|
|
305
|
+
export type DeleteDnsPolicyError = UnifiNetworkOpError;
|
|
306
|
+
/** Delete DNS Policy Delete an existing DNS policy on a site. */
|
|
307
|
+
export const deleteDnsPolicy: API.OperationMethod<
|
|
308
|
+
DeleteDnsPolicyRequest,
|
|
309
|
+
DeleteDnsPolicyResponse,
|
|
310
|
+
DeleteDnsPolicyError,
|
|
311
|
+
UnifiNetworkOpContext
|
|
312
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
313
|
+
input: DeleteDnsPolicyRequest,
|
|
314
|
+
output: DeleteDnsPolicyResponse,
|
|
315
|
+
errors: [UnknownUnifiNetworkError],
|
|
316
|
+
protocol: UnifiNetworkProtocol,
|
|
317
|
+
retry: Retry.Retry,
|
|
318
|
+
}));
|
|
319
|
+
|
|
320
|
+
export type GetDnsPolicyError = UnifiNetworkOpError;
|
|
321
|
+
/** Get DNS Policy Retrieve specific DNS policy. */
|
|
322
|
+
export const getDnsPolicy: API.OperationMethod<
|
|
323
|
+
GetDnsPolicyRequest,
|
|
324
|
+
DNSPolicy,
|
|
325
|
+
GetDnsPolicyError,
|
|
326
|
+
UnifiNetworkOpContext
|
|
327
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
328
|
+
input: GetDnsPolicyRequest,
|
|
329
|
+
output: DNSPolicy,
|
|
330
|
+
errors: [UnknownUnifiNetworkError],
|
|
331
|
+
protocol: UnifiNetworkProtocol,
|
|
332
|
+
retry: Retry.Retry,
|
|
333
|
+
}));
|
|
334
|
+
|
|
335
|
+
export type GetDnsPolicyPageError = UnifiNetworkOpError;
|
|
336
|
+
/** List DNS Policies Retrieve a paginated list of all DNS policies on a site. <details> <summary>Filterable properties (click to expand)</summary> </details> */
|
|
337
|
+
export const getDnsPolicyPage: API.OperationMethod<
|
|
338
|
+
GetDnsPolicyPageRequest,
|
|
339
|
+
IntegrationDnsPolicyPageDto,
|
|
340
|
+
GetDnsPolicyPageError,
|
|
341
|
+
UnifiNetworkOpContext
|
|
342
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
343
|
+
input: GetDnsPolicyPageRequest,
|
|
344
|
+
output: IntegrationDnsPolicyPageDto,
|
|
345
|
+
errors: [UnknownUnifiNetworkError],
|
|
346
|
+
protocol: UnifiNetworkProtocol,
|
|
347
|
+
retry: Retry.Retry,
|
|
348
|
+
}));
|
|
349
|
+
|
|
350
|
+
export type UpdateDnsPolicyError = UnifiNetworkOpError;
|
|
351
|
+
/** Update DNS Policy Update an existing DNS policy on a site. */
|
|
352
|
+
export const updateDnsPolicy: API.OperationMethod<
|
|
353
|
+
UpdateDnsPolicyRequest,
|
|
354
|
+
DNSPolicy,
|
|
355
|
+
UpdateDnsPolicyError,
|
|
356
|
+
UnifiNetworkOpContext
|
|
357
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
358
|
+
input: UpdateDnsPolicyRequest,
|
|
359
|
+
output: DNSPolicy,
|
|
360
|
+
errors: [UnknownUnifiNetworkError],
|
|
361
|
+
protocol: UnifiNetworkProtocol,
|
|
362
|
+
retry: Retry.Retry,
|
|
363
|
+
}));
|