@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,613 @@
|
|
|
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
|
+
/** List of trusted DHCP server IP addresses. */
|
|
16
|
+
export type NetworkDHCPGuardingTrustedDhcpServerIpAddressesList = Array<string>;
|
|
17
|
+
export const NetworkDHCPGuardingTrustedDhcpServerIpAddressesList =
|
|
18
|
+
/*@__PURE__*/ S.Array(
|
|
19
|
+
S.String,
|
|
20
|
+
) as any as S.Schema<NetworkDHCPGuardingTrustedDhcpServerIpAddressesList>;
|
|
21
|
+
|
|
22
|
+
/** Details about DHCP Guarding settings for this Network. */
|
|
23
|
+
export interface NetworkDHCPGuarding {
|
|
24
|
+
/** List of trusted DHCP server IP addresses. */
|
|
25
|
+
trustedDhcpServerIpAddresses: NetworkDHCPGuardingTrustedDhcpServerIpAddressesList;
|
|
26
|
+
}
|
|
27
|
+
export const NetworkDHCPGuarding = /*@__PURE__*/ S.suspend(() =>
|
|
28
|
+
S.Struct({
|
|
29
|
+
trustedDhcpServerIpAddresses:
|
|
30
|
+
NetworkDHCPGuardingTrustedDhcpServerIpAddressesList,
|
|
31
|
+
}),
|
|
32
|
+
).annotate({
|
|
33
|
+
identifier: "NetworkDHCPGuarding",
|
|
34
|
+
}) as any as S.Schema<NetworkDHCPGuarding>;
|
|
35
|
+
|
|
36
|
+
/** Additional host IP subnets assigned to this VLAN. */
|
|
37
|
+
export type NetworkIPv6ConfigurationAdditionalHostIpSubnetsList = Array<string>;
|
|
38
|
+
export const NetworkIPv6ConfigurationAdditionalHostIpSubnetsList =
|
|
39
|
+
/*@__PURE__*/ S.Array(
|
|
40
|
+
S.String,
|
|
41
|
+
) as any as S.Schema<NetworkIPv6ConfigurationAdditionalHostIpSubnetsList>;
|
|
42
|
+
|
|
43
|
+
export interface IntegrationIpv6AddressSuffixRangeSelectorDto {
|
|
44
|
+
/** Start suffix of the DHCPv6 address pool. */
|
|
45
|
+
start: string;
|
|
46
|
+
/** End suffix of the DHCPv6 address pool. */
|
|
47
|
+
stop: string;
|
|
48
|
+
}
|
|
49
|
+
export const IntegrationIpv6AddressSuffixRangeSelectorDto =
|
|
50
|
+
/*@__PURE__*/ S.suspend(() =>
|
|
51
|
+
S.Struct({
|
|
52
|
+
start: S.String,
|
|
53
|
+
stop: S.String,
|
|
54
|
+
}),
|
|
55
|
+
).annotate({
|
|
56
|
+
identifier: "IntegrationIpv6AddressSuffixRangeSelectorDto",
|
|
57
|
+
}) as any as S.Schema<IntegrationIpv6AddressSuffixRangeSelectorDto>;
|
|
58
|
+
|
|
59
|
+
export interface DHCPConfigurationForIPv6Network {
|
|
60
|
+
ipAddressSuffixRange: IntegrationIpv6AddressSuffixRangeSelectorDto;
|
|
61
|
+
/** The lease time in seconds for IP addresses in this range. */
|
|
62
|
+
leaseTimeSeconds: number;
|
|
63
|
+
}
|
|
64
|
+
export const DHCPConfigurationForIPv6Network = /*@__PURE__*/ S.suspend(() =>
|
|
65
|
+
S.Struct({
|
|
66
|
+
ipAddressSuffixRange: IntegrationIpv6AddressSuffixRangeSelectorDto,
|
|
67
|
+
leaseTimeSeconds: S.Number,
|
|
68
|
+
}),
|
|
69
|
+
).annotate({
|
|
70
|
+
identifier: "DHCPConfigurationForIPv6Network",
|
|
71
|
+
}) as any as S.Schema<DHCPConfigurationForIPv6Network>;
|
|
72
|
+
|
|
73
|
+
export interface IPv6ClientAddressAssignment {
|
|
74
|
+
/** IPv6 DHCP configuration for this network. At least one addressing method must be active: either enable SLAAC or provide DHCP configuration. If this field is null, SLAAC must be enabled. */
|
|
75
|
+
dhcpConfiguration?: DHCPConfigurationForIPv6Network;
|
|
76
|
+
/** Allows devices to obtain IPv6 addresses via SLAAC (Stateless Address Autoconfiguration) without DHCPv6. At least one addressing method must be active: either enable SLAAC or provide DHCP configuration. */
|
|
77
|
+
slaacEnabled: boolean;
|
|
78
|
+
}
|
|
79
|
+
export const IPv6ClientAddressAssignment = /*@__PURE__*/ S.suspend(() =>
|
|
80
|
+
S.Struct({
|
|
81
|
+
dhcpConfiguration: S.optional(DHCPConfigurationForIPv6Network),
|
|
82
|
+
slaacEnabled: S.Boolean,
|
|
83
|
+
}),
|
|
84
|
+
).annotate({
|
|
85
|
+
identifier: "IPv6ClientAddressAssignment",
|
|
86
|
+
}) as any as S.Schema<IPv6ClientAddressAssignment>;
|
|
87
|
+
|
|
88
|
+
/** The IPv6 DNS server addresses assigned to this Network. If none are specified, they will be selected automatically. */
|
|
89
|
+
export type NetworkIPv6ConfigurationDnsServerIpAddressesOverrideList =
|
|
90
|
+
Array<string>;
|
|
91
|
+
export const NetworkIPv6ConfigurationDnsServerIpAddressesOverrideList =
|
|
92
|
+
/*@__PURE__*/ S.Array(
|
|
93
|
+
S.String,
|
|
94
|
+
) as any as S.Schema<NetworkIPv6ConfigurationDnsServerIpAddressesOverrideList>;
|
|
95
|
+
|
|
96
|
+
/** Router advertisement priority. */
|
|
97
|
+
export type RouterAdvertisementConfigurationPriority =
|
|
98
|
+
| "LOW"
|
|
99
|
+
| "MEDIUM"
|
|
100
|
+
| "HIGH";
|
|
101
|
+
export const RouterAdvertisementConfigurationPriority = S.String;
|
|
102
|
+
|
|
103
|
+
export interface RouterAdvertisementConfiguration {
|
|
104
|
+
/** Router advertisement priority. */
|
|
105
|
+
priority: RouterAdvertisementConfigurationPriority | (string & {});
|
|
106
|
+
}
|
|
107
|
+
export const RouterAdvertisementConfiguration = /*@__PURE__*/ S.suspend(() =>
|
|
108
|
+
S.Struct({
|
|
109
|
+
priority: RouterAdvertisementConfigurationPriority,
|
|
110
|
+
}),
|
|
111
|
+
).annotate({
|
|
112
|
+
identifier: "RouterAdvertisementConfiguration",
|
|
113
|
+
}) as any as S.Schema<RouterAdvertisementConfiguration>;
|
|
114
|
+
|
|
115
|
+
export interface NetworkIPv6Configuration {
|
|
116
|
+
/** Additional host IP subnets assigned to this VLAN. */
|
|
117
|
+
additionalHostIpSubnets?: NetworkIPv6ConfigurationAdditionalHostIpSubnetsList;
|
|
118
|
+
/** Client Address Assignment */
|
|
119
|
+
clientAddressAssignment: IPv6ClientAddressAssignment;
|
|
120
|
+
/** The IPv6 DNS server addresses assigned to this Network. If none are specified, they will be selected automatically. */
|
|
121
|
+
dnsServerIpAddressesOverride?: NetworkIPv6ConfigurationDnsServerIpAddressesOverrideList;
|
|
122
|
+
interfaceType: string;
|
|
123
|
+
/** Router advertisement. Without it, hosts will not autoconfigure addresses and will lack a default route even with DHCPv6. */
|
|
124
|
+
routerAdvertisement?: RouterAdvertisementConfiguration;
|
|
125
|
+
/** ID of the WAN interface from which the prefix is delegated. */
|
|
126
|
+
prefixDelegationWanInterfaceId?: string;
|
|
127
|
+
/** The static IPv6 address assigned to this Network. */
|
|
128
|
+
hostIpAddress?: string;
|
|
129
|
+
prefixLength?: number;
|
|
130
|
+
}
|
|
131
|
+
export const NetworkIPv6Configuration = /*@__PURE__*/ S.suspend(() =>
|
|
132
|
+
S.Struct({
|
|
133
|
+
additionalHostIpSubnets: S.optional(
|
|
134
|
+
NetworkIPv6ConfigurationAdditionalHostIpSubnetsList,
|
|
135
|
+
),
|
|
136
|
+
clientAddressAssignment: IPv6ClientAddressAssignment,
|
|
137
|
+
dnsServerIpAddressesOverride: S.optional(
|
|
138
|
+
NetworkIPv6ConfigurationDnsServerIpAddressesOverrideList,
|
|
139
|
+
),
|
|
140
|
+
interfaceType: S.String,
|
|
141
|
+
routerAdvertisement: S.optional(RouterAdvertisementConfiguration),
|
|
142
|
+
prefixDelegationWanInterfaceId: S.optional(S.String),
|
|
143
|
+
hostIpAddress: S.optional(S.String),
|
|
144
|
+
prefixLength: S.optional(S.Number),
|
|
145
|
+
}),
|
|
146
|
+
).annotate({
|
|
147
|
+
identifier: "NetworkIPv6Configuration",
|
|
148
|
+
}) as any as S.Schema<NetworkIPv6Configuration>;
|
|
149
|
+
|
|
150
|
+
export interface CreateNetworkRequest {
|
|
151
|
+
siteId: string;
|
|
152
|
+
/** DHCP Guarding settings for this Network. If this field is omitted or null, the feature is disabled */
|
|
153
|
+
dhcpGuarding?: NetworkDHCPGuarding;
|
|
154
|
+
enabled: boolean;
|
|
155
|
+
management: string;
|
|
156
|
+
name: string;
|
|
157
|
+
/** VLAN ID. Must be 1 for the default network and >= 2 for additional networks. */
|
|
158
|
+
vlanId: number;
|
|
159
|
+
/** Whether this network is allowed to use cellular data when WAN connection(s) are down. */
|
|
160
|
+
cellularBackupEnabled?: boolean;
|
|
161
|
+
/** Whether the internet access is allowed for the device on this network. */
|
|
162
|
+
internetAccessEnabled?: boolean;
|
|
163
|
+
/** Shape varies by variant — widened by scripts/convert.ts; see README. */
|
|
164
|
+
ipv4Configuration?: unknown;
|
|
165
|
+
/** Details about IPv6 configuration for this Network. If this field is omitted or null then IPv6 is not configured on this Network. */
|
|
166
|
+
ipv6Configuration?: NetworkIPv6Configuration;
|
|
167
|
+
/** Whether this network is isolated from all other networks. */
|
|
168
|
+
isolationEnabled?: boolean;
|
|
169
|
+
/** Whether this network should participate in mDNS traffic forwarding. If null, the default from the site mDNS setting is used. */
|
|
170
|
+
mdnsForwardingEnabled?: boolean;
|
|
171
|
+
/** Firewall zone ID associated with this Network. */
|
|
172
|
+
zoneId?: string;
|
|
173
|
+
/** ID of the L3 switching capable device that manages this network. */
|
|
174
|
+
deviceId?: string;
|
|
175
|
+
}
|
|
176
|
+
export const CreateNetworkRequest = /*@__PURE__*/ S.suspend(() =>
|
|
177
|
+
S.Struct({
|
|
178
|
+
siteId: S.String.pipe(T.Label()),
|
|
179
|
+
dhcpGuarding: S.optional(NetworkDHCPGuarding),
|
|
180
|
+
enabled: S.Boolean,
|
|
181
|
+
management: S.String,
|
|
182
|
+
name: S.String,
|
|
183
|
+
vlanId: S.Number,
|
|
184
|
+
cellularBackupEnabled: S.optional(S.Boolean),
|
|
185
|
+
internetAccessEnabled: S.optional(S.Boolean),
|
|
186
|
+
ipv4Configuration: S.optional(S.Unknown),
|
|
187
|
+
ipv6Configuration: S.optional(NetworkIPv6Configuration),
|
|
188
|
+
isolationEnabled: S.optional(S.Boolean),
|
|
189
|
+
mdnsForwardingEnabled: S.optional(S.Boolean),
|
|
190
|
+
zoneId: S.optional(S.String),
|
|
191
|
+
deviceId: S.optional(S.String),
|
|
192
|
+
}).pipe(
|
|
193
|
+
T.Http({ method: "POST", uri: "/v1/sites/{siteId}/networks", code: 200 }),
|
|
194
|
+
),
|
|
195
|
+
).annotate({
|
|
196
|
+
identifier: "CreateNetworkRequest",
|
|
197
|
+
}) as any as S.Schema<CreateNetworkRequest>;
|
|
198
|
+
|
|
199
|
+
export type UserOrSystemDefinedOrOrchestratedEntityMetadataSource = "SDWAN";
|
|
200
|
+
export const UserOrSystemDefinedOrOrchestratedEntityMetadataSource = S.String;
|
|
201
|
+
|
|
202
|
+
export interface UserOrSystemDefinedOrOrchestratedEntityMetadata {
|
|
203
|
+
origin: string;
|
|
204
|
+
source?: UserOrSystemDefinedOrOrchestratedEntityMetadataSource;
|
|
205
|
+
}
|
|
206
|
+
export const UserOrSystemDefinedOrOrchestratedEntityMetadata =
|
|
207
|
+
/*@__PURE__*/ S.suspend(() =>
|
|
208
|
+
S.Struct({
|
|
209
|
+
origin: S.String,
|
|
210
|
+
source: S.optional(UserOrSystemDefinedOrOrchestratedEntityMetadataSource),
|
|
211
|
+
}),
|
|
212
|
+
).annotate({
|
|
213
|
+
identifier: "UserOrSystemDefinedOrOrchestratedEntityMetadata",
|
|
214
|
+
}) as any as S.Schema<UserOrSystemDefinedOrOrchestratedEntityMetadata>;
|
|
215
|
+
|
|
216
|
+
export interface NetworkDetails {
|
|
217
|
+
default: boolean;
|
|
218
|
+
/** DHCP Guarding settings for this Network. If this field is omitted or null, the feature is disabled */
|
|
219
|
+
dhcpGuarding?: NetworkDHCPGuarding;
|
|
220
|
+
enabled: boolean;
|
|
221
|
+
id: string;
|
|
222
|
+
management: string;
|
|
223
|
+
/** Orchestrated or System-defined configurable network support */
|
|
224
|
+
metadata: UserOrSystemDefinedOrOrchestratedEntityMetadata;
|
|
225
|
+
name: string;
|
|
226
|
+
/** VLAN ID. Must be 1 for the default network and >= 2 for additional networks. */
|
|
227
|
+
vlanId: number;
|
|
228
|
+
/** Whether this network is allowed to use cellular data when WAN connection(s) are down. */
|
|
229
|
+
cellularBackupEnabled?: boolean;
|
|
230
|
+
/** Whether the internet access is allowed for the device on this network. */
|
|
231
|
+
internetAccessEnabled?: boolean;
|
|
232
|
+
/** Shape varies by variant — widened by scripts/convert.ts; see README. */
|
|
233
|
+
ipv4Configuration?: unknown;
|
|
234
|
+
/** Details about IPv6 configuration for this Network. If this field is omitted or null then IPv6 is not configured on this Network. */
|
|
235
|
+
ipv6Configuration?: NetworkIPv6Configuration;
|
|
236
|
+
/** Whether this network is isolated from all other networks. */
|
|
237
|
+
isolationEnabled?: boolean;
|
|
238
|
+
/** Whether this network should participate in mDNS traffic forwarding. */
|
|
239
|
+
mdnsForwardingEnabled?: boolean;
|
|
240
|
+
/** Firewall zone ID associated with this Network. */
|
|
241
|
+
zoneId?: string;
|
|
242
|
+
/** ID of the L3 switching capable device that manages this network. */
|
|
243
|
+
deviceId?: string;
|
|
244
|
+
}
|
|
245
|
+
export const NetworkDetails = /*@__PURE__*/ S.suspend(() =>
|
|
246
|
+
S.Struct({
|
|
247
|
+
default: S.Boolean,
|
|
248
|
+
dhcpGuarding: S.optional(NetworkDHCPGuarding),
|
|
249
|
+
enabled: S.Boolean,
|
|
250
|
+
id: S.String,
|
|
251
|
+
management: S.String,
|
|
252
|
+
metadata: UserOrSystemDefinedOrOrchestratedEntityMetadata,
|
|
253
|
+
name: S.String,
|
|
254
|
+
vlanId: S.Number,
|
|
255
|
+
cellularBackupEnabled: S.optional(S.Boolean),
|
|
256
|
+
internetAccessEnabled: S.optional(S.Boolean),
|
|
257
|
+
ipv4Configuration: S.optional(S.Unknown),
|
|
258
|
+
ipv6Configuration: S.optional(NetworkIPv6Configuration),
|
|
259
|
+
isolationEnabled: S.optional(S.Boolean),
|
|
260
|
+
mdnsForwardingEnabled: S.optional(S.Boolean),
|
|
261
|
+
zoneId: S.optional(S.String),
|
|
262
|
+
deviceId: S.optional(S.String),
|
|
263
|
+
}),
|
|
264
|
+
).annotate({ identifier: "NetworkDetails" }) as any as S.Schema<NetworkDetails>;
|
|
265
|
+
|
|
266
|
+
export interface DeleteNetworkRequest {
|
|
267
|
+
siteId: string;
|
|
268
|
+
networkId: string;
|
|
269
|
+
force?: boolean;
|
|
270
|
+
}
|
|
271
|
+
export const DeleteNetworkRequest = /*@__PURE__*/ S.suspend(() =>
|
|
272
|
+
S.Struct({
|
|
273
|
+
siteId: S.String.pipe(T.Label()),
|
|
274
|
+
networkId: S.String.pipe(T.Label()),
|
|
275
|
+
force: S.optional(S.Boolean.pipe(T.Query())),
|
|
276
|
+
}).pipe(
|
|
277
|
+
T.Http({
|
|
278
|
+
method: "DELETE",
|
|
279
|
+
uri: "/v1/sites/{siteId}/networks/{networkId}",
|
|
280
|
+
code: 200,
|
|
281
|
+
}),
|
|
282
|
+
),
|
|
283
|
+
).annotate({
|
|
284
|
+
identifier: "DeleteNetworkRequest",
|
|
285
|
+
}) as any as S.Schema<DeleteNetworkRequest>;
|
|
286
|
+
|
|
287
|
+
export interface DeleteNetworkResponse {}
|
|
288
|
+
export const DeleteNetworkResponse = /*@__PURE__*/ S.suspend(() =>
|
|
289
|
+
S.Struct({}),
|
|
290
|
+
).annotate({
|
|
291
|
+
identifier: "DeleteNetworkResponse",
|
|
292
|
+
}) as any as S.Schema<DeleteNetworkResponse>;
|
|
293
|
+
|
|
294
|
+
export interface GetNetworkDetailsRequest {
|
|
295
|
+
siteId: string;
|
|
296
|
+
networkId: string;
|
|
297
|
+
}
|
|
298
|
+
export const GetNetworkDetailsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
299
|
+
S.Struct({
|
|
300
|
+
siteId: S.String.pipe(T.Label()),
|
|
301
|
+
networkId: S.String.pipe(T.Label()),
|
|
302
|
+
}).pipe(
|
|
303
|
+
T.Http({
|
|
304
|
+
method: "GET",
|
|
305
|
+
uri: "/v1/sites/{siteId}/networks/{networkId}",
|
|
306
|
+
code: 200,
|
|
307
|
+
}),
|
|
308
|
+
),
|
|
309
|
+
).annotate({
|
|
310
|
+
identifier: "GetNetworkDetailsRequest",
|
|
311
|
+
}) as any as S.Schema<GetNetworkDetailsRequest>;
|
|
312
|
+
|
|
313
|
+
export interface GetNetworkReferencesRequest {
|
|
314
|
+
siteId: string;
|
|
315
|
+
networkId: string;
|
|
316
|
+
}
|
|
317
|
+
export const GetNetworkReferencesRequest = /*@__PURE__*/ S.suspend(() =>
|
|
318
|
+
S.Struct({
|
|
319
|
+
siteId: S.String.pipe(T.Label()),
|
|
320
|
+
networkId: S.String.pipe(T.Label()),
|
|
321
|
+
}).pipe(
|
|
322
|
+
T.Http({
|
|
323
|
+
method: "GET",
|
|
324
|
+
uri: "/v1/sites/{siteId}/networks/{networkId}/references",
|
|
325
|
+
code: 200,
|
|
326
|
+
}),
|
|
327
|
+
),
|
|
328
|
+
).annotate({
|
|
329
|
+
identifier: "GetNetworkReferencesRequest",
|
|
330
|
+
}) as any as S.Schema<GetNetworkReferencesRequest>;
|
|
331
|
+
|
|
332
|
+
export interface NetworkReferenceDetail {
|
|
333
|
+
referenceId: string;
|
|
334
|
+
}
|
|
335
|
+
export const NetworkReferenceDetail = /*@__PURE__*/ S.suspend(() =>
|
|
336
|
+
S.Struct({
|
|
337
|
+
referenceId: S.String,
|
|
338
|
+
}),
|
|
339
|
+
).annotate({
|
|
340
|
+
identifier: "NetworkReferenceDetail",
|
|
341
|
+
}) as any as S.Schema<NetworkReferenceDetail>;
|
|
342
|
+
|
|
343
|
+
/** List of references, present only if resourceType has API model defined */
|
|
344
|
+
export type NetworkReferenceResourceReferencesList =
|
|
345
|
+
Array<NetworkReferenceDetail>;
|
|
346
|
+
export const NetworkReferenceResourceReferencesList = /*@__PURE__*/ S.Array(
|
|
347
|
+
NetworkReferenceDetail,
|
|
348
|
+
) as any as S.Schema<NetworkReferenceResourceReferencesList>;
|
|
349
|
+
|
|
350
|
+
export type NetworkReferenceResourceResourceType =
|
|
351
|
+
| "CLIENT"
|
|
352
|
+
| "DEVICE"
|
|
353
|
+
| "STATIC_ROUTE"
|
|
354
|
+
| "OSPF_ROUTE"
|
|
355
|
+
| "NEXT_AI"
|
|
356
|
+
| "WIFI"
|
|
357
|
+
| "NAT_RULE"
|
|
358
|
+
| "SD_WAN";
|
|
359
|
+
export const NetworkReferenceResourceResourceType = S.String;
|
|
360
|
+
|
|
361
|
+
export interface NetworkReferenceResource {
|
|
362
|
+
/** Number of references of this type */
|
|
363
|
+
referenceCount: number;
|
|
364
|
+
/** List of references, present only if resourceType has API model defined */
|
|
365
|
+
references?: NetworkReferenceResourceReferencesList;
|
|
366
|
+
resourceType: NetworkReferenceResourceResourceType;
|
|
367
|
+
}
|
|
368
|
+
export const NetworkReferenceResource = /*@__PURE__*/ S.suspend(() =>
|
|
369
|
+
S.Struct({
|
|
370
|
+
referenceCount: S.Number,
|
|
371
|
+
references: S.optional(NetworkReferenceResourceReferencesList),
|
|
372
|
+
resourceType: NetworkReferenceResourceResourceType,
|
|
373
|
+
}),
|
|
374
|
+
).annotate({
|
|
375
|
+
identifier: "NetworkReferenceResource",
|
|
376
|
+
}) as any as S.Schema<NetworkReferenceResource>;
|
|
377
|
+
|
|
378
|
+
/** List of network reference resources */
|
|
379
|
+
export type NetworkReferencesReferenceResourcesList =
|
|
380
|
+
Array<NetworkReferenceResource>;
|
|
381
|
+
export const NetworkReferencesReferenceResourcesList = /*@__PURE__*/ S.Array(
|
|
382
|
+
NetworkReferenceResource,
|
|
383
|
+
) as any as S.Schema<NetworkReferencesReferenceResourcesList>;
|
|
384
|
+
|
|
385
|
+
export interface NetworkReferences {
|
|
386
|
+
/** List of network reference resources */
|
|
387
|
+
referenceResources: NetworkReferencesReferenceResourcesList;
|
|
388
|
+
}
|
|
389
|
+
export const NetworkReferences = /*@__PURE__*/ S.suspend(() =>
|
|
390
|
+
S.Struct({
|
|
391
|
+
referenceResources: NetworkReferencesReferenceResourcesList,
|
|
392
|
+
}),
|
|
393
|
+
).annotate({
|
|
394
|
+
identifier: "NetworkReferences",
|
|
395
|
+
}) as any as S.Schema<NetworkReferences>;
|
|
396
|
+
|
|
397
|
+
export interface GetNetworksOverviewPageRequest {
|
|
398
|
+
siteId: string;
|
|
399
|
+
offset?: number;
|
|
400
|
+
limit?: number;
|
|
401
|
+
filter?: string;
|
|
402
|
+
}
|
|
403
|
+
export const GetNetworksOverviewPageRequest = /*@__PURE__*/ S.suspend(() =>
|
|
404
|
+
S.Struct({
|
|
405
|
+
siteId: S.String.pipe(T.Label()),
|
|
406
|
+
offset: S.optional(S.Number.pipe(T.Query())),
|
|
407
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
408
|
+
filter: S.optional(S.String.pipe(T.Query())),
|
|
409
|
+
}).pipe(
|
|
410
|
+
T.Http({ method: "GET", uri: "/v1/sites/{siteId}/networks", code: 200 }),
|
|
411
|
+
),
|
|
412
|
+
).annotate({
|
|
413
|
+
identifier: "GetNetworksOverviewPageRequest",
|
|
414
|
+
}) as any as S.Schema<GetNetworksOverviewPageRequest>;
|
|
415
|
+
|
|
416
|
+
export interface NetworkOverview {
|
|
417
|
+
default: boolean;
|
|
418
|
+
enabled: boolean;
|
|
419
|
+
id: string;
|
|
420
|
+
management: string;
|
|
421
|
+
/** Orchestrated or System-defined configurable network support */
|
|
422
|
+
metadata: UserOrSystemDefinedOrOrchestratedEntityMetadata;
|
|
423
|
+
name: string;
|
|
424
|
+
/** VLAN ID. Must be 1 for the default network and >= 2 for additional networks. */
|
|
425
|
+
vlanId: number;
|
|
426
|
+
zoneId?: string;
|
|
427
|
+
/** ID of the switch this Network is managed by. */
|
|
428
|
+
deviceId?: string;
|
|
429
|
+
}
|
|
430
|
+
export const NetworkOverview = /*@__PURE__*/ S.suspend(() =>
|
|
431
|
+
S.Struct({
|
|
432
|
+
default: S.Boolean,
|
|
433
|
+
enabled: S.Boolean,
|
|
434
|
+
id: S.String,
|
|
435
|
+
management: S.String,
|
|
436
|
+
metadata: UserOrSystemDefinedOrOrchestratedEntityMetadata,
|
|
437
|
+
name: S.String,
|
|
438
|
+
vlanId: S.Number,
|
|
439
|
+
zoneId: S.optional(S.String),
|
|
440
|
+
deviceId: S.optional(S.String),
|
|
441
|
+
}),
|
|
442
|
+
).annotate({
|
|
443
|
+
identifier: "NetworkOverview",
|
|
444
|
+
}) as any as S.Schema<NetworkOverview>;
|
|
445
|
+
|
|
446
|
+
export type NetworkOverviewPageDataList = Array<NetworkOverview>;
|
|
447
|
+
export const NetworkOverviewPageDataList = /*@__PURE__*/ S.Array(
|
|
448
|
+
NetworkOverview,
|
|
449
|
+
) as any as S.Schema<NetworkOverviewPageDataList>;
|
|
450
|
+
|
|
451
|
+
export interface NetworkOverviewPage {
|
|
452
|
+
count: number;
|
|
453
|
+
data: NetworkOverviewPageDataList;
|
|
454
|
+
limit: number;
|
|
455
|
+
offset: number;
|
|
456
|
+
totalCount: number;
|
|
457
|
+
}
|
|
458
|
+
export const NetworkOverviewPage = /*@__PURE__*/ S.suspend(() =>
|
|
459
|
+
S.Struct({
|
|
460
|
+
count: S.Number,
|
|
461
|
+
data: NetworkOverviewPageDataList,
|
|
462
|
+
limit: S.Number,
|
|
463
|
+
offset: S.Number,
|
|
464
|
+
totalCount: S.Number,
|
|
465
|
+
}),
|
|
466
|
+
).annotate({
|
|
467
|
+
identifier: "NetworkOverviewPage",
|
|
468
|
+
}) as any as S.Schema<NetworkOverviewPage>;
|
|
469
|
+
|
|
470
|
+
export interface UpdateNetworkRequest {
|
|
471
|
+
siteId: string;
|
|
472
|
+
networkId: string;
|
|
473
|
+
/** DHCP Guarding settings for this Network. If this field is omitted or null, the feature is disabled */
|
|
474
|
+
dhcpGuarding?: NetworkDHCPGuarding;
|
|
475
|
+
enabled: boolean;
|
|
476
|
+
management: string;
|
|
477
|
+
name: string;
|
|
478
|
+
/** VLAN ID. Must be 1 for the default network and >= 2 for additional networks. */
|
|
479
|
+
vlanId: number;
|
|
480
|
+
/** Whether this network is allowed to use cellular data when WAN connection(s) are down. */
|
|
481
|
+
cellularBackupEnabled?: boolean;
|
|
482
|
+
/** Whether the internet access is allowed for the device on this network. */
|
|
483
|
+
internetAccessEnabled?: boolean;
|
|
484
|
+
/** Shape varies by variant — widened by scripts/convert.ts; see README. */
|
|
485
|
+
ipv4Configuration?: unknown;
|
|
486
|
+
/** Details about IPv6 configuration for this Network. If this field is omitted or null then IPv6 is not configured on this Network. */
|
|
487
|
+
ipv6Configuration?: NetworkIPv6Configuration;
|
|
488
|
+
/** Whether this network is isolated from all other networks. */
|
|
489
|
+
isolationEnabled?: boolean;
|
|
490
|
+
/** Whether this network should participate in mDNS traffic forwarding. If null, the default from the site mDNS setting is used. */
|
|
491
|
+
mdnsForwardingEnabled?: boolean;
|
|
492
|
+
/** Firewall zone ID associated with this Network. */
|
|
493
|
+
zoneId?: string;
|
|
494
|
+
/** ID of the L3 switching capable device that manages this network. */
|
|
495
|
+
deviceId?: string;
|
|
496
|
+
}
|
|
497
|
+
export const UpdateNetworkRequest = /*@__PURE__*/ S.suspend(() =>
|
|
498
|
+
S.Struct({
|
|
499
|
+
siteId: S.String.pipe(T.Label()),
|
|
500
|
+
networkId: S.String.pipe(T.Label()),
|
|
501
|
+
dhcpGuarding: S.optional(NetworkDHCPGuarding),
|
|
502
|
+
enabled: S.Boolean,
|
|
503
|
+
management: S.String,
|
|
504
|
+
name: S.String,
|
|
505
|
+
vlanId: S.Number,
|
|
506
|
+
cellularBackupEnabled: S.optional(S.Boolean),
|
|
507
|
+
internetAccessEnabled: S.optional(S.Boolean),
|
|
508
|
+
ipv4Configuration: S.optional(S.Unknown),
|
|
509
|
+
ipv6Configuration: S.optional(NetworkIPv6Configuration),
|
|
510
|
+
isolationEnabled: S.optional(S.Boolean),
|
|
511
|
+
mdnsForwardingEnabled: S.optional(S.Boolean),
|
|
512
|
+
zoneId: S.optional(S.String),
|
|
513
|
+
deviceId: S.optional(S.String),
|
|
514
|
+
}).pipe(
|
|
515
|
+
T.Http({
|
|
516
|
+
method: "PUT",
|
|
517
|
+
uri: "/v1/sites/{siteId}/networks/{networkId}",
|
|
518
|
+
code: 200,
|
|
519
|
+
}),
|
|
520
|
+
),
|
|
521
|
+
).annotate({
|
|
522
|
+
identifier: "UpdateNetworkRequest",
|
|
523
|
+
}) as any as S.Schema<UpdateNetworkRequest>;
|
|
524
|
+
|
|
525
|
+
export type CreateNetworkError = UnifiNetworkOpError;
|
|
526
|
+
/** Create Network Create a new network on a site. */
|
|
527
|
+
export const createNetwork: API.OperationMethod<
|
|
528
|
+
CreateNetworkRequest,
|
|
529
|
+
NetworkDetails,
|
|
530
|
+
CreateNetworkError,
|
|
531
|
+
UnifiNetworkOpContext
|
|
532
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
533
|
+
input: CreateNetworkRequest,
|
|
534
|
+
output: NetworkDetails,
|
|
535
|
+
errors: [UnknownUnifiNetworkError],
|
|
536
|
+
protocol: UnifiNetworkProtocol,
|
|
537
|
+
retry: Retry.Retry,
|
|
538
|
+
}));
|
|
539
|
+
|
|
540
|
+
export type DeleteNetworkError = UnifiNetworkOpError;
|
|
541
|
+
/** Delete Network Delete an existing network on a site. */
|
|
542
|
+
export const deleteNetwork: API.OperationMethod<
|
|
543
|
+
DeleteNetworkRequest,
|
|
544
|
+
DeleteNetworkResponse,
|
|
545
|
+
DeleteNetworkError,
|
|
546
|
+
UnifiNetworkOpContext
|
|
547
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
548
|
+
input: DeleteNetworkRequest,
|
|
549
|
+
output: DeleteNetworkResponse,
|
|
550
|
+
errors: [UnknownUnifiNetworkError],
|
|
551
|
+
protocol: UnifiNetworkProtocol,
|
|
552
|
+
retry: Retry.Retry,
|
|
553
|
+
}));
|
|
554
|
+
|
|
555
|
+
export type GetNetworkDetailsError = UnifiNetworkOpError;
|
|
556
|
+
/** Get Network Details Retrieve detailed information about a specific network. */
|
|
557
|
+
export const getNetworkDetails: API.OperationMethod<
|
|
558
|
+
GetNetworkDetailsRequest,
|
|
559
|
+
NetworkDetails,
|
|
560
|
+
GetNetworkDetailsError,
|
|
561
|
+
UnifiNetworkOpContext
|
|
562
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
563
|
+
input: GetNetworkDetailsRequest,
|
|
564
|
+
output: NetworkDetails,
|
|
565
|
+
errors: [UnknownUnifiNetworkError],
|
|
566
|
+
protocol: UnifiNetworkProtocol,
|
|
567
|
+
retry: Retry.Retry,
|
|
568
|
+
}));
|
|
569
|
+
|
|
570
|
+
export type GetNetworkReferencesError = UnifiNetworkOpError;
|
|
571
|
+
/** Get Network References Retrieve references to a specific network. */
|
|
572
|
+
export const getNetworkReferences: API.OperationMethod<
|
|
573
|
+
GetNetworkReferencesRequest,
|
|
574
|
+
NetworkReferences,
|
|
575
|
+
GetNetworkReferencesError,
|
|
576
|
+
UnifiNetworkOpContext
|
|
577
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
578
|
+
input: GetNetworkReferencesRequest,
|
|
579
|
+
output: NetworkReferences,
|
|
580
|
+
errors: [UnknownUnifiNetworkError],
|
|
581
|
+
protocol: UnifiNetworkProtocol,
|
|
582
|
+
retry: Retry.Retry,
|
|
583
|
+
}));
|
|
584
|
+
|
|
585
|
+
export type GetNetworksOverviewPageError = UnifiNetworkOpError;
|
|
586
|
+
/** List Networks Retrieve a paginated list of all Networks on a site. <details> <summary>Filterable properties (click to expand)</summary> </details> */
|
|
587
|
+
export const getNetworksOverviewPage: API.OperationMethod<
|
|
588
|
+
GetNetworksOverviewPageRequest,
|
|
589
|
+
NetworkOverviewPage,
|
|
590
|
+
GetNetworksOverviewPageError,
|
|
591
|
+
UnifiNetworkOpContext
|
|
592
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
593
|
+
input: GetNetworksOverviewPageRequest,
|
|
594
|
+
output: NetworkOverviewPage,
|
|
595
|
+
errors: [UnknownUnifiNetworkError],
|
|
596
|
+
protocol: UnifiNetworkProtocol,
|
|
597
|
+
retry: Retry.Retry,
|
|
598
|
+
}));
|
|
599
|
+
|
|
600
|
+
export type UpdateNetworkError = UnifiNetworkOpError;
|
|
601
|
+
/** Update Network Update an existing network on a site. */
|
|
602
|
+
export const updateNetwork: API.OperationMethod<
|
|
603
|
+
UpdateNetworkRequest,
|
|
604
|
+
NetworkDetails,
|
|
605
|
+
UpdateNetworkError,
|
|
606
|
+
UnifiNetworkOpContext
|
|
607
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
608
|
+
input: UpdateNetworkRequest,
|
|
609
|
+
output: NetworkDetails,
|
|
610
|
+
errors: [UnknownUnifiNetworkError],
|
|
611
|
+
protocol: UnifiNetworkProtocol,
|
|
612
|
+
retry: Retry.Retry,
|
|
613
|
+
}));
|
|
@@ -0,0 +1,81 @@
|
|
|
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 GetSiteOverviewPageRequest {
|
|
16
|
+
offset?: number;
|
|
17
|
+
limit?: number;
|
|
18
|
+
filter?: string;
|
|
19
|
+
}
|
|
20
|
+
export const GetSiteOverviewPageRequest = /*@__PURE__*/ S.suspend(() =>
|
|
21
|
+
S.Struct({
|
|
22
|
+
offset: S.optional(S.Number.pipe(T.Query())),
|
|
23
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
24
|
+
filter: S.optional(S.String.pipe(T.Query())),
|
|
25
|
+
}).pipe(T.Http({ method: "GET", uri: "/v1/sites", code: 200 })),
|
|
26
|
+
).annotate({
|
|
27
|
+
identifier: "GetSiteOverviewPageRequest",
|
|
28
|
+
}) as any as S.Schema<GetSiteOverviewPageRequest>;
|
|
29
|
+
|
|
30
|
+
export interface SiteOverview {
|
|
31
|
+
id: string;
|
|
32
|
+
/** Internal unique name of the site used in older APIs */
|
|
33
|
+
internalReference: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}
|
|
36
|
+
export const SiteOverview = /*@__PURE__*/ S.suspend(() =>
|
|
37
|
+
S.Struct({
|
|
38
|
+
id: S.String,
|
|
39
|
+
internalReference: S.String,
|
|
40
|
+
name: S.String,
|
|
41
|
+
}),
|
|
42
|
+
).annotate({ identifier: "SiteOverview" }) as any as S.Schema<SiteOverview>;
|
|
43
|
+
|
|
44
|
+
export type SiteOverviewPageDataList = Array<SiteOverview>;
|
|
45
|
+
export const SiteOverviewPageDataList = /*@__PURE__*/ S.Array(
|
|
46
|
+
SiteOverview,
|
|
47
|
+
) as any as S.Schema<SiteOverviewPageDataList>;
|
|
48
|
+
|
|
49
|
+
export interface SiteOverviewPage {
|
|
50
|
+
count: number;
|
|
51
|
+
data: SiteOverviewPageDataList;
|
|
52
|
+
limit: number;
|
|
53
|
+
offset: number;
|
|
54
|
+
totalCount: number;
|
|
55
|
+
}
|
|
56
|
+
export const SiteOverviewPage = /*@__PURE__*/ S.suspend(() =>
|
|
57
|
+
S.Struct({
|
|
58
|
+
count: S.Number,
|
|
59
|
+
data: SiteOverviewPageDataList,
|
|
60
|
+
limit: S.Number,
|
|
61
|
+
offset: S.Number,
|
|
62
|
+
totalCount: S.Number,
|
|
63
|
+
}),
|
|
64
|
+
).annotate({
|
|
65
|
+
identifier: "SiteOverviewPage",
|
|
66
|
+
}) as any as S.Schema<SiteOverviewPage>;
|
|
67
|
+
|
|
68
|
+
export type GetSiteOverviewPageError = UnifiNetworkOpError;
|
|
69
|
+
/** List Local Sites Retrieve a paginated list of local sites managed by this Network application. Site ID is required for other UniFi Network API calls. <details> <summary>Filterable properties (click to expand)</summary> </details> */
|
|
70
|
+
export const getSiteOverviewPage: API.OperationMethod<
|
|
71
|
+
GetSiteOverviewPageRequest,
|
|
72
|
+
SiteOverviewPage,
|
|
73
|
+
GetSiteOverviewPageError,
|
|
74
|
+
UnifiNetworkOpContext
|
|
75
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
76
|
+
input: GetSiteOverviewPageRequest,
|
|
77
|
+
output: SiteOverviewPage,
|
|
78
|
+
errors: [UnknownUnifiNetworkError],
|
|
79
|
+
protocol: UnifiNetworkProtocol,
|
|
80
|
+
retry: Retry.Retry,
|
|
81
|
+
}));
|