@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.
Files changed (103) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +125 -0
  3. package/dist/credentials.d.ts +24 -0
  4. package/dist/credentials.d.ts.map +1 -0
  5. package/dist/credentials.js +78 -0
  6. package/dist/credentials.js.map +1 -0
  7. package/dist/errors.d.ts +74 -0
  8. package/dist/errors.d.ts.map +1 -0
  9. package/dist/errors.js +49 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/index.d.ts +33 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +33 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/protocol.d.ts +18 -0
  16. package/dist/protocol.d.ts.map +1 -0
  17. package/dist/protocol.js +59 -0
  18. package/dist/protocol.js.map +1 -0
  19. package/dist/retry.d.ts +57 -0
  20. package/dist/retry.d.ts.map +1 -0
  21. package/dist/retry.js +50 -0
  22. package/dist/retry.js.map +1 -0
  23. package/dist/services/access_control_acl_rules.d.ts +222 -0
  24. package/dist/services/access_control_acl_rules.d.ts.map +1 -0
  25. package/dist/services/access_control_acl_rules.js +225 -0
  26. package/dist/services/access_control_acl_rules.js.map +1 -0
  27. package/dist/services/application_info.d.ts +15 -0
  28. package/dist/services/application_info.d.ts.map +1 -0
  29. package/dist/services/application_info.js +22 -0
  30. package/dist/services/application_info.js.map +1 -0
  31. package/dist/services/clients.d.ts +108 -0
  32. package/dist/services/clients.d.ts.map +1 -0
  33. package/dist/services/clients.js +122 -0
  34. package/dist/services/clients.js.map +1 -0
  35. package/dist/services/dns_policies.d.ts +143 -0
  36. package/dist/services/dns_policies.d.ts.map +1 -0
  37. package/dist/services/dns_policies.js +171 -0
  38. package/dist/services/dns_policies.js.map +1 -0
  39. package/dist/services/firewall.d.ts +473 -0
  40. package/dist/services/firewall.d.ts.map +1 -0
  41. package/dist/services/firewall.js +521 -0
  42. package/dist/services/firewall.js.map +1 -0
  43. package/dist/services/hotspot.d.ts +107 -0
  44. package/dist/services/hotspot.d.ts.map +1 -0
  45. package/dist/services/hotspot.js +145 -0
  46. package/dist/services/hotspot.js.map +1 -0
  47. package/dist/services/index.d.ts +14 -0
  48. package/dist/services/index.d.ts.map +1 -0
  49. package/dist/services/index.js +15 -0
  50. package/dist/services/index.js.map +1 -0
  51. package/dist/services/networks.d.ts +251 -0
  52. package/dist/services/networks.d.ts.map +1 -0
  53. package/dist/services/networks.js +256 -0
  54. package/dist/services/networks.js.map +1 -0
  55. package/dist/services/sites.d.ts +31 -0
  56. package/dist/services/sites.d.ts.map +1 -0
  57. package/dist/services/sites.js +38 -0
  58. package/dist/services/sites.js.map +1 -0
  59. package/dist/services/supporting_resources.d.ts +238 -0
  60. package/dist/services/supporting_resources.d.ts.map +1 -0
  61. package/dist/services/supporting_resources.js +298 -0
  62. package/dist/services/supporting_resources.js.map +1 -0
  63. package/dist/services/switching.d.ts +168 -0
  64. package/dist/services/switching.d.ts.map +1 -0
  65. package/dist/services/switching.js +226 -0
  66. package/dist/services/switching.js.map +1 -0
  67. package/dist/services/traffic_matching_lists.d.ts +75 -0
  68. package/dist/services/traffic_matching_lists.d.ts.map +1 -0
  69. package/dist/services/traffic_matching_lists.js +126 -0
  70. package/dist/services/traffic_matching_lists.js.map +1 -0
  71. package/dist/services/unifi_devices.d.ts +280 -0
  72. package/dist/services/unifi_devices.d.ts.map +1 -0
  73. package/dist/services/unifi_devices.js +338 -0
  74. package/dist/services/unifi_devices.js.map +1 -0
  75. package/dist/services/wifi_broadcasts.d.ts +378 -0
  76. package/dist/services/wifi_broadcasts.d.ts.map +1 -0
  77. package/dist/services/wifi_broadcasts.js +396 -0
  78. package/dist/services/wifi_broadcasts.js.map +1 -0
  79. package/dist/traits.d.ts +11 -0
  80. package/dist/traits.d.ts.map +1 -0
  81. package/dist/traits.js +12 -0
  82. package/dist/traits.js.map +1 -0
  83. package/package.json +75 -0
  84. package/src/credentials.ts +112 -0
  85. package/src/errors.ts +103 -0
  86. package/src/index.ts +36 -0
  87. package/src/protocol.ts +86 -0
  88. package/src/retry.ts +83 -0
  89. package/src/services/access_control_acl_rules.ts +537 -0
  90. package/src/services/application_info.ts +44 -0
  91. package/src/services/clients.ts +272 -0
  92. package/src/services/dns_policies.ts +363 -0
  93. package/src/services/firewall.ts +1492 -0
  94. package/src/services/hotspot.ts +305 -0
  95. package/src/services/index.ts +14 -0
  96. package/src/services/networks.ts +613 -0
  97. package/src/services/sites.ts +81 -0
  98. package/src/services/supporting_resources.ts +650 -0
  99. package/src/services/switching.ts +496 -0
  100. package/src/services/traffic_matching_lists.ts +248 -0
  101. package/src/services/unifi_devices.ts +795 -0
  102. package/src/services/wifi_broadcasts.ts +992 -0
  103. package/src/traits.ts +45 -0
@@ -0,0 +1,795 @@
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 AdoptDeviceRequest {
16
+ siteId: string;
17
+ ignoreDeviceLimit: boolean;
18
+ macAddress: string;
19
+ }
20
+ export const AdoptDeviceRequest = /*@__PURE__*/ S.suspend(() =>
21
+ S.Struct({
22
+ siteId: S.String.pipe(T.Label()),
23
+ ignoreDeviceLimit: S.Boolean,
24
+ macAddress: S.String,
25
+ }).pipe(
26
+ T.Http({ method: "POST", uri: "/v1/sites/{siteId}/devices", code: 200 }),
27
+ ),
28
+ ).annotate({
29
+ identifier: "AdoptDeviceRequest",
30
+ }) as any as S.Schema<AdoptDeviceRequest>;
31
+
32
+ export type UserDefinedEntityMetadataSource = "SDWAN";
33
+ export const UserDefinedEntityMetadataSource = S.String;
34
+
35
+ export interface UserDefinedEntityMetadata {
36
+ origin: string;
37
+ source?: UserDefinedEntityMetadataSource;
38
+ }
39
+ export const UserDefinedEntityMetadata = /*@__PURE__*/ S.suspend(() =>
40
+ S.Struct({
41
+ origin: S.String,
42
+ source: S.optional(UserDefinedEntityMetadataSource),
43
+ }),
44
+ ).annotate({
45
+ identifier: "UserDefinedEntityMetadata",
46
+ }) as any as S.Schema<UserDefinedEntityMetadata>;
47
+
48
+ export type IntegrationLocalLagLocalDtoPortIdxsList = Array<number>;
49
+ export const IntegrationLocalLagLocalDtoPortIdxsList = /*@__PURE__*/ S.Array(
50
+ S.Number,
51
+ ) as any as S.Schema<IntegrationLocalLagLocalDtoPortIdxsList>;
52
+
53
+ export interface IntegrationLocalLagLocalDto {
54
+ id: string;
55
+ metadata: UserDefinedEntityMetadata;
56
+ portIdxs: IntegrationLocalLagLocalDtoPortIdxsList;
57
+ }
58
+ export const IntegrationLocalLagLocalDto = /*@__PURE__*/ S.suspend(() =>
59
+ S.Struct({
60
+ id: S.String,
61
+ metadata: UserDefinedEntityMetadata,
62
+ portIdxs: IntegrationLocalLagLocalDtoPortIdxsList,
63
+ }),
64
+ ).annotate({
65
+ identifier: "IntegrationLocalLagLocalDto",
66
+ }) as any as S.Schema<IntegrationLocalLagLocalDto>;
67
+
68
+ export type SwitchingFeatureOverviewLagsList =
69
+ Array<IntegrationLocalLagLocalDto>;
70
+ export const SwitchingFeatureOverviewLagsList = /*@__PURE__*/ S.Array(
71
+ IntegrationLocalLagLocalDto,
72
+ ) as any as S.Schema<SwitchingFeatureOverviewLagsList>;
73
+
74
+ export interface SwitchingFeatureOverview {
75
+ lags: SwitchingFeatureOverviewLagsList;
76
+ }
77
+ export const SwitchingFeatureOverview = /*@__PURE__*/ S.suspend(() =>
78
+ S.Struct({
79
+ lags: SwitchingFeatureOverviewLagsList,
80
+ }),
81
+ ).annotate({
82
+ identifier: "SwitchingFeatureOverview",
83
+ }) as any as S.Schema<SwitchingFeatureOverview>;
84
+
85
+ export interface DeviceFeatures {
86
+ accessPoint?: unknown;
87
+ switching?: SwitchingFeatureOverview;
88
+ }
89
+ export const DeviceFeatures = /*@__PURE__*/ S.suspend(() =>
90
+ S.Struct({
91
+ accessPoint: S.optional(S.Unknown),
92
+ switching: S.optional(SwitchingFeatureOverview),
93
+ }),
94
+ ).annotate({ identifier: "DeviceFeatures" }) as any as S.Schema<DeviceFeatures>;
95
+
96
+ export type PortOverviewConnector =
97
+ | "RJ45"
98
+ | "SFP"
99
+ | "SFPPLUS"
100
+ | "SFP28"
101
+ | "QSFP28";
102
+ export const PortOverviewConnector = S.String;
103
+
104
+ export type PortPoEOverviewStandard = "802.3af" | "802.3at" | "802.3bt";
105
+ export const PortPoEOverviewStandard = S.String;
106
+
107
+ /** Whether the port currently supplies power to the (connected) device. */
108
+ export type PortPoEOverviewState = "UP" | "DOWN" | "LIMITED" | "UNKNOWN";
109
+ export const PortPoEOverviewState = S.String;
110
+
111
+ export type PortPoEOverviewType = "1" | "2" | "3" | "4";
112
+ export const PortPoEOverviewType = S.String;
113
+
114
+ export interface PortPoEOverview {
115
+ /** Whether the PoE feature is enabled on the port */
116
+ enabled: boolean;
117
+ standard: PortPoEOverviewStandard;
118
+ /** Whether the port currently supplies power to the (connected) device. */
119
+ state: PortPoEOverviewState;
120
+ type: PortPoEOverviewType;
121
+ }
122
+ export const PortPoEOverview = /*@__PURE__*/ S.suspend(() =>
123
+ S.Struct({
124
+ enabled: S.Boolean,
125
+ standard: PortPoEOverviewStandard,
126
+ state: PortPoEOverviewState,
127
+ type: PortPoEOverviewType,
128
+ }),
129
+ ).annotate({
130
+ identifier: "PortPoEOverview",
131
+ }) as any as S.Schema<PortPoEOverview>;
132
+
133
+ export type PortOverviewState = "UP" | "DOWN" | "UNKNOWN";
134
+ export const PortOverviewState = S.String;
135
+
136
+ export interface PortOverview {
137
+ connector: PortOverviewConnector;
138
+ idx: number;
139
+ maxSpeedMbps: number;
140
+ poe?: PortPoEOverview;
141
+ speedMbps?: number;
142
+ state: PortOverviewState;
143
+ }
144
+ export const PortOverview = /*@__PURE__*/ S.suspend(() =>
145
+ S.Struct({
146
+ connector: PortOverviewConnector,
147
+ idx: S.Number,
148
+ maxSpeedMbps: S.Number,
149
+ poe: S.optional(PortPoEOverview),
150
+ speedMbps: S.optional(S.Number),
151
+ state: PortOverviewState,
152
+ }),
153
+ ).annotate({ identifier: "PortOverview" }) as any as S.Schema<PortOverview>;
154
+
155
+ export type DevicePhysicalInterfacesPortsList = Array<PortOverview>;
156
+ export const DevicePhysicalInterfacesPortsList = /*@__PURE__*/ S.Array(
157
+ PortOverview,
158
+ ) as any as S.Schema<DevicePhysicalInterfacesPortsList>;
159
+
160
+ export type WirelessRadioOverviewFrequencyGHz = 2.4 | 5 | 6 | 60;
161
+ export const WirelessRadioOverviewFrequencyGHz = S.Number;
162
+
163
+ export type WirelessRadioOverviewWlanStandard =
164
+ | "802.11a"
165
+ | "802.11b"
166
+ | "802.11g"
167
+ | "802.11n"
168
+ | "802.11ac"
169
+ | "802.11ax"
170
+ | "802.11be";
171
+ export const WirelessRadioOverviewWlanStandard = S.String;
172
+
173
+ export interface WirelessRadioOverview {
174
+ channel?: number;
175
+ channelWidthMHz: number;
176
+ frequencyGHz: WirelessRadioOverviewFrequencyGHz;
177
+ wlanStandard: WirelessRadioOverviewWlanStandard;
178
+ }
179
+ export const WirelessRadioOverview = /*@__PURE__*/ S.suspend(() =>
180
+ S.Struct({
181
+ channel: S.optional(S.Number),
182
+ channelWidthMHz: S.Number,
183
+ frequencyGHz: WirelessRadioOverviewFrequencyGHz,
184
+ wlanStandard: WirelessRadioOverviewWlanStandard,
185
+ }),
186
+ ).annotate({
187
+ identifier: "WirelessRadioOverview",
188
+ }) as any as S.Schema<WirelessRadioOverview>;
189
+
190
+ export type DevicePhysicalInterfacesRadiosList = Array<WirelessRadioOverview>;
191
+ export const DevicePhysicalInterfacesRadiosList = /*@__PURE__*/ S.Array(
192
+ WirelessRadioOverview,
193
+ ) as any as S.Schema<DevicePhysicalInterfacesRadiosList>;
194
+
195
+ export interface DevicePhysicalInterfaces {
196
+ ports?: DevicePhysicalInterfacesPortsList;
197
+ radios?: DevicePhysicalInterfacesRadiosList;
198
+ }
199
+ export const DevicePhysicalInterfaces = /*@__PURE__*/ S.suspend(() =>
200
+ S.Struct({
201
+ ports: S.optional(DevicePhysicalInterfacesPortsList),
202
+ radios: S.optional(DevicePhysicalInterfacesRadiosList),
203
+ }),
204
+ ).annotate({
205
+ identifier: "DevicePhysicalInterfaces",
206
+ }) as any as S.Schema<DevicePhysicalInterfaces>;
207
+
208
+ export type AdoptedDeviceDetailsState =
209
+ | "ONLINE"
210
+ | "OFFLINE"
211
+ | "PENDING_ADOPTION"
212
+ | "UPDATING"
213
+ | "GETTING_READY"
214
+ | "ADOPTING"
215
+ | "DELETING"
216
+ | "CONNECTION_INTERRUPTED"
217
+ | "ISOLATED"
218
+ | "U5G_INCORRECT_TOPOLOGY";
219
+ export const AdoptedDeviceDetailsState = S.String;
220
+
221
+ /** Uplink interface is device's connection to the parent device in the network topology */
222
+ export interface DeviceUplinkInterfaceOverview {
223
+ deviceId: string;
224
+ }
225
+ export const DeviceUplinkInterfaceOverview = /*@__PURE__*/ S.suspend(() =>
226
+ S.Struct({
227
+ deviceId: S.String,
228
+ }),
229
+ ).annotate({
230
+ identifier: "DeviceUplinkInterfaceOverview",
231
+ }) as any as S.Schema<DeviceUplinkInterfaceOverview>;
232
+
233
+ export interface AdoptedDeviceDetails {
234
+ adoptedAt?: string;
235
+ configurationId: string;
236
+ features: DeviceFeatures;
237
+ firmwareUpdatable: boolean;
238
+ firmwareVersion?: string;
239
+ id: string;
240
+ interfaces: DevicePhysicalInterfaces;
241
+ ipAddress: string;
242
+ macAddress: string;
243
+ model: string;
244
+ name: string;
245
+ provisionedAt?: string;
246
+ state: AdoptedDeviceDetailsState;
247
+ supported: boolean;
248
+ uplink?: DeviceUplinkInterfaceOverview;
249
+ }
250
+ export const AdoptedDeviceDetails = /*@__PURE__*/ S.suspend(() =>
251
+ S.Struct({
252
+ adoptedAt: S.optional(S.String),
253
+ configurationId: S.String,
254
+ features: DeviceFeatures,
255
+ firmwareUpdatable: S.Boolean,
256
+ firmwareVersion: S.optional(S.String),
257
+ id: S.String,
258
+ interfaces: DevicePhysicalInterfaces,
259
+ ipAddress: S.String,
260
+ macAddress: S.String,
261
+ model: S.String,
262
+ name: S.String,
263
+ provisionedAt: S.optional(S.String),
264
+ state: AdoptedDeviceDetailsState,
265
+ supported: S.Boolean,
266
+ uplink: S.optional(DeviceUplinkInterfaceOverview),
267
+ }),
268
+ ).annotate({
269
+ identifier: "AdoptedDeviceDetails",
270
+ }) as any as S.Schema<AdoptedDeviceDetails>;
271
+
272
+ export interface ExecuteAdoptedDeviceActionRequest {
273
+ siteId: string;
274
+ deviceId: string;
275
+ action: string;
276
+ }
277
+ export const ExecuteAdoptedDeviceActionRequest = /*@__PURE__*/ S.suspend(() =>
278
+ S.Struct({
279
+ siteId: S.String.pipe(T.Label()),
280
+ deviceId: S.String.pipe(T.Label()),
281
+ action: S.String,
282
+ }).pipe(
283
+ T.Http({
284
+ method: "POST",
285
+ uri: "/v1/sites/{siteId}/devices/{deviceId}/actions",
286
+ code: 200,
287
+ }),
288
+ ),
289
+ ).annotate({
290
+ identifier: "ExecuteAdoptedDeviceActionRequest",
291
+ }) as any as S.Schema<ExecuteAdoptedDeviceActionRequest>;
292
+
293
+ export interface ExecuteAdoptedDeviceActionResponse {}
294
+ export const ExecuteAdoptedDeviceActionResponse = /*@__PURE__*/ S.suspend(() =>
295
+ S.Struct({}),
296
+ ).annotate({
297
+ identifier: "ExecuteAdoptedDeviceActionResponse",
298
+ }) as any as S.Schema<ExecuteAdoptedDeviceActionResponse>;
299
+
300
+ export interface ExecutePortActionRequest {
301
+ siteId: string;
302
+ deviceId: string;
303
+ portIdx: number;
304
+ action: string;
305
+ }
306
+ export const ExecutePortActionRequest = /*@__PURE__*/ S.suspend(() =>
307
+ S.Struct({
308
+ siteId: S.String.pipe(T.Label()),
309
+ deviceId: S.String.pipe(T.Label()),
310
+ portIdx: S.Number.pipe(T.Label()),
311
+ action: S.String,
312
+ }).pipe(
313
+ T.Http({
314
+ method: "POST",
315
+ uri: "/v1/sites/{siteId}/devices/{deviceId}/interfaces/ports/{portIdx}/actions",
316
+ code: 200,
317
+ }),
318
+ ),
319
+ ).annotate({
320
+ identifier: "ExecutePortActionRequest",
321
+ }) as any as S.Schema<ExecutePortActionRequest>;
322
+
323
+ export interface ExecutePortActionResponse {}
324
+ export const ExecutePortActionResponse = /*@__PURE__*/ S.suspend(() =>
325
+ S.Struct({}),
326
+ ).annotate({
327
+ identifier: "ExecutePortActionResponse",
328
+ }) as any as S.Schema<ExecutePortActionResponse>;
329
+
330
+ export interface GetAdoptedDeviceDetailsRequest {
331
+ siteId: string;
332
+ deviceId: string;
333
+ }
334
+ export const GetAdoptedDeviceDetailsRequest = /*@__PURE__*/ S.suspend(() =>
335
+ S.Struct({
336
+ siteId: S.String.pipe(T.Label()),
337
+ deviceId: S.String.pipe(T.Label()),
338
+ }).pipe(
339
+ T.Http({
340
+ method: "GET",
341
+ uri: "/v1/sites/{siteId}/devices/{deviceId}",
342
+ code: 200,
343
+ }),
344
+ ),
345
+ ).annotate({
346
+ identifier: "GetAdoptedDeviceDetailsRequest",
347
+ }) as any as S.Schema<GetAdoptedDeviceDetailsRequest>;
348
+
349
+ export interface GetAdoptedDeviceLatestStatisticsRequest {
350
+ siteId: string;
351
+ deviceId: string;
352
+ }
353
+ export const GetAdoptedDeviceLatestStatisticsRequest = /*@__PURE__*/ S.suspend(
354
+ () =>
355
+ S.Struct({
356
+ siteId: S.String.pipe(T.Label()),
357
+ deviceId: S.String.pipe(T.Label()),
358
+ }).pipe(
359
+ T.Http({
360
+ method: "GET",
361
+ uri: "/v1/sites/{siteId}/devices/{deviceId}/statistics/latest",
362
+ code: 200,
363
+ }),
364
+ ),
365
+ ).annotate({
366
+ identifier: "GetAdoptedDeviceLatestStatisticsRequest",
367
+ }) as any as S.Schema<GetAdoptedDeviceLatestStatisticsRequest>;
368
+
369
+ export type LatestStatisticsForWirelessRadioFrequencyGHz = 2.4 | 5 | 6 | 60;
370
+ export const LatestStatisticsForWirelessRadioFrequencyGHz = S.Number;
371
+
372
+ export interface LatestStatisticsForWirelessRadio {
373
+ frequencyGHz: LatestStatisticsForWirelessRadioFrequencyGHz;
374
+ txRetriesPct?: number;
375
+ }
376
+ export const LatestStatisticsForWirelessRadio = /*@__PURE__*/ S.suspend(() =>
377
+ S.Struct({
378
+ frequencyGHz: LatestStatisticsForWirelessRadioFrequencyGHz,
379
+ txRetriesPct: S.optional(S.Number),
380
+ }),
381
+ ).annotate({
382
+ identifier: "LatestStatisticsForWirelessRadio",
383
+ }) as any as S.Schema<LatestStatisticsForWirelessRadio>;
384
+
385
+ export type LatestStatisticsForDeviceInterfacesRadiosList =
386
+ Array<LatestStatisticsForWirelessRadio>;
387
+ export const LatestStatisticsForDeviceInterfacesRadiosList =
388
+ /*@__PURE__*/ S.Array(
389
+ LatestStatisticsForWirelessRadio,
390
+ ) as any as S.Schema<LatestStatisticsForDeviceInterfacesRadiosList>;
391
+
392
+ export interface LatestStatisticsForDeviceInterfaces {
393
+ radios?: LatestStatisticsForDeviceInterfacesRadiosList;
394
+ }
395
+ export const LatestStatisticsForDeviceInterfaces = /*@__PURE__*/ S.suspend(() =>
396
+ S.Struct({
397
+ radios: S.optional(LatestStatisticsForDeviceInterfacesRadiosList),
398
+ }),
399
+ ).annotate({
400
+ identifier: "LatestStatisticsForDeviceInterfaces",
401
+ }) as any as S.Schema<LatestStatisticsForDeviceInterfaces>;
402
+
403
+ export interface LatestStatisticsForADeviceUplinkInterface {
404
+ rxRateBps?: number;
405
+ txRateBps?: number;
406
+ }
407
+ export const LatestStatisticsForADeviceUplinkInterface =
408
+ /*@__PURE__*/ S.suspend(() =>
409
+ S.Struct({
410
+ rxRateBps: S.optional(S.Number),
411
+ txRateBps: S.optional(S.Number),
412
+ }),
413
+ ).annotate({
414
+ identifier: "LatestStatisticsForADeviceUplinkInterface",
415
+ }) as any as S.Schema<LatestStatisticsForADeviceUplinkInterface>;
416
+
417
+ export interface LatestStatisticsForADevice {
418
+ cpuUtilizationPct?: number;
419
+ interfaces: LatestStatisticsForDeviceInterfaces;
420
+ lastHeartbeatAt?: string;
421
+ loadAverage15Min?: number;
422
+ loadAverage1Min?: number;
423
+ loadAverage5Min?: number;
424
+ memoryUtilizationPct?: number;
425
+ nextHeartbeatAt?: string;
426
+ uplink?: LatestStatisticsForADeviceUplinkInterface;
427
+ uptimeSec?: number;
428
+ }
429
+ export const LatestStatisticsForADevice = /*@__PURE__*/ S.suspend(() =>
430
+ S.Struct({
431
+ cpuUtilizationPct: S.optional(S.Number),
432
+ interfaces: LatestStatisticsForDeviceInterfaces,
433
+ lastHeartbeatAt: S.optional(S.String),
434
+ loadAverage15Min: S.optional(S.Number),
435
+ loadAverage1Min: S.optional(S.Number),
436
+ loadAverage5Min: S.optional(S.Number),
437
+ memoryUtilizationPct: S.optional(S.Number),
438
+ nextHeartbeatAt: S.optional(S.String),
439
+ uplink: S.optional(LatestStatisticsForADeviceUplinkInterface),
440
+ uptimeSec: S.optional(S.Number),
441
+ }),
442
+ ).annotate({
443
+ identifier: "LatestStatisticsForADevice",
444
+ }) as any as S.Schema<LatestStatisticsForADevice>;
445
+
446
+ export interface GetAdoptedDeviceOverviewPageRequest {
447
+ siteId: string;
448
+ offset?: number;
449
+ limit?: number;
450
+ filter?: string;
451
+ }
452
+ export const GetAdoptedDeviceOverviewPageRequest = /*@__PURE__*/ S.suspend(() =>
453
+ S.Struct({
454
+ siteId: S.String.pipe(T.Label()),
455
+ offset: S.optional(S.Number.pipe(T.Query())),
456
+ limit: S.optional(S.Number.pipe(T.Query())),
457
+ filter: S.optional(S.String.pipe(T.Query())),
458
+ }).pipe(
459
+ T.Http({ method: "GET", uri: "/v1/sites/{siteId}/devices", code: 200 }),
460
+ ),
461
+ ).annotate({
462
+ identifier: "GetAdoptedDeviceOverviewPageRequest",
463
+ }) as any as S.Schema<GetAdoptedDeviceOverviewPageRequest>;
464
+
465
+ export type AdoptedDeviceOverviewFeaturesItem =
466
+ | "switching"
467
+ | "accessPoint"
468
+ | "gateway";
469
+ export const AdoptedDeviceOverviewFeaturesItem = S.String;
470
+
471
+ export type AdoptedDeviceOverviewFeaturesList =
472
+ Array<AdoptedDeviceOverviewFeaturesItem>;
473
+ export const AdoptedDeviceOverviewFeaturesList = /*@__PURE__*/ S.Array(
474
+ AdoptedDeviceOverviewFeaturesItem,
475
+ ) as any as S.Schema<AdoptedDeviceOverviewFeaturesList>;
476
+
477
+ export type AdoptedDeviceOverviewInterfacesItem = "ports" | "radios";
478
+ export const AdoptedDeviceOverviewInterfacesItem = S.String;
479
+
480
+ export type AdoptedDeviceOverviewInterfacesList =
481
+ Array<AdoptedDeviceOverviewInterfacesItem>;
482
+ export const AdoptedDeviceOverviewInterfacesList = /*@__PURE__*/ S.Array(
483
+ AdoptedDeviceOverviewInterfacesItem,
484
+ ) as any as S.Schema<AdoptedDeviceOverviewInterfacesList>;
485
+
486
+ export type AdoptedDeviceOverviewState =
487
+ | "ONLINE"
488
+ | "OFFLINE"
489
+ | "PENDING_ADOPTION"
490
+ | "UPDATING"
491
+ | "GETTING_READY"
492
+ | "ADOPTING"
493
+ | "DELETING"
494
+ | "CONNECTION_INTERRUPTED"
495
+ | "ISOLATED"
496
+ | "U5G_INCORRECT_TOPOLOGY";
497
+ export const AdoptedDeviceOverviewState = S.String;
498
+
499
+ export interface AdoptedDeviceOverview {
500
+ features: AdoptedDeviceOverviewFeaturesList;
501
+ firmwareUpdatable: boolean;
502
+ firmwareVersion?: string;
503
+ id: string;
504
+ interfaces: AdoptedDeviceOverviewInterfacesList;
505
+ ipAddress: string;
506
+ macAddress: string;
507
+ model: string;
508
+ name: string;
509
+ state: AdoptedDeviceOverviewState;
510
+ supported: boolean;
511
+ }
512
+ export const AdoptedDeviceOverview = /*@__PURE__*/ S.suspend(() =>
513
+ S.Struct({
514
+ features: AdoptedDeviceOverviewFeaturesList,
515
+ firmwareUpdatable: S.Boolean,
516
+ firmwareVersion: S.optional(S.String),
517
+ id: S.String,
518
+ interfaces: AdoptedDeviceOverviewInterfacesList,
519
+ ipAddress: S.String,
520
+ macAddress: S.String,
521
+ model: S.String,
522
+ name: S.String,
523
+ state: AdoptedDeviceOverviewState,
524
+ supported: S.Boolean,
525
+ }),
526
+ ).annotate({
527
+ identifier: "AdoptedDeviceOverview",
528
+ }) as any as S.Schema<AdoptedDeviceOverview>;
529
+
530
+ export type AdoptedDeviceOverviewPageDataList = Array<AdoptedDeviceOverview>;
531
+ export const AdoptedDeviceOverviewPageDataList = /*@__PURE__*/ S.Array(
532
+ AdoptedDeviceOverview,
533
+ ) as any as S.Schema<AdoptedDeviceOverviewPageDataList>;
534
+
535
+ export interface AdoptedDeviceOverviewPage {
536
+ count: number;
537
+ data: AdoptedDeviceOverviewPageDataList;
538
+ limit: number;
539
+ offset: number;
540
+ totalCount: number;
541
+ }
542
+ export const AdoptedDeviceOverviewPage = /*@__PURE__*/ S.suspend(() =>
543
+ S.Struct({
544
+ count: S.Number,
545
+ data: AdoptedDeviceOverviewPageDataList,
546
+ limit: S.Number,
547
+ offset: S.Number,
548
+ totalCount: S.Number,
549
+ }),
550
+ ).annotate({
551
+ identifier: "AdoptedDeviceOverviewPage",
552
+ }) as any as S.Schema<AdoptedDeviceOverviewPage>;
553
+
554
+ export interface GetPendingDevicePageRequest {
555
+ offset?: number;
556
+ limit?: number;
557
+ filter?: string;
558
+ }
559
+ export const GetPendingDevicePageRequest = /*@__PURE__*/ S.suspend(() =>
560
+ S.Struct({
561
+ offset: S.optional(S.Number.pipe(T.Query())),
562
+ limit: S.optional(S.Number.pipe(T.Query())),
563
+ filter: S.optional(S.String.pipe(T.Query())),
564
+ }).pipe(T.Http({ method: "GET", uri: "/v1/pending-devices", code: 200 })),
565
+ ).annotate({
566
+ identifier: "GetPendingDevicePageRequest",
567
+ }) as any as S.Schema<GetPendingDevicePageRequest>;
568
+
569
+ export type DevicePendingAdoptionAdoptionTargetSiteIdsList = Array<string>;
570
+ export const DevicePendingAdoptionAdoptionTargetSiteIdsList =
571
+ /*@__PURE__*/ S.Array(
572
+ S.String,
573
+ ) as any as S.Schema<DevicePendingAdoptionAdoptionTargetSiteIdsList>;
574
+
575
+ export type DevicePendingAdoptionFeaturesItem =
576
+ | "switching"
577
+ | "accessPoint"
578
+ | "gateway";
579
+ export const DevicePendingAdoptionFeaturesItem = S.String;
580
+
581
+ export type DevicePendingAdoptionFeaturesList =
582
+ Array<DevicePendingAdoptionFeaturesItem>;
583
+ export const DevicePendingAdoptionFeaturesList = /*@__PURE__*/ S.Array(
584
+ DevicePendingAdoptionFeaturesItem,
585
+ ) as any as S.Schema<DevicePendingAdoptionFeaturesList>;
586
+
587
+ export type DevicePendingAdoptionState =
588
+ | "ONLINE"
589
+ | "OFFLINE"
590
+ | "PENDING_ADOPTION"
591
+ | "UPDATING"
592
+ | "GETTING_READY"
593
+ | "ADOPTING"
594
+ | "DELETING"
595
+ | "CONNECTION_INTERRUPTED"
596
+ | "ISOLATED"
597
+ | "U5G_INCORRECT_TOPOLOGY";
598
+ export const DevicePendingAdoptionState = S.String;
599
+
600
+ export interface DevicePendingAdoption {
601
+ adoptionTargetSiteIds: DevicePendingAdoptionAdoptionTargetSiteIdsList;
602
+ features: DevicePendingAdoptionFeaturesList;
603
+ firmwareUpdatable: boolean;
604
+ firmwareVersion?: string;
605
+ ipAddress: string;
606
+ macAddress: string;
607
+ model: string;
608
+ state: DevicePendingAdoptionState;
609
+ supported: boolean;
610
+ }
611
+ export const DevicePendingAdoption = /*@__PURE__*/ S.suspend(() =>
612
+ S.Struct({
613
+ adoptionTargetSiteIds: DevicePendingAdoptionAdoptionTargetSiteIdsList,
614
+ features: DevicePendingAdoptionFeaturesList,
615
+ firmwareUpdatable: S.Boolean,
616
+ firmwareVersion: S.optional(S.String),
617
+ ipAddress: S.String,
618
+ macAddress: S.String,
619
+ model: S.String,
620
+ state: DevicePendingAdoptionState,
621
+ supported: S.Boolean,
622
+ }),
623
+ ).annotate({
624
+ identifier: "DevicePendingAdoption",
625
+ }) as any as S.Schema<DevicePendingAdoption>;
626
+
627
+ export type DevicePendingAdoptionPageDataList = Array<DevicePendingAdoption>;
628
+ export const DevicePendingAdoptionPageDataList = /*@__PURE__*/ S.Array(
629
+ DevicePendingAdoption,
630
+ ) as any as S.Schema<DevicePendingAdoptionPageDataList>;
631
+
632
+ export interface DevicePendingAdoptionPage {
633
+ count: number;
634
+ data: DevicePendingAdoptionPageDataList;
635
+ limit: number;
636
+ offset: number;
637
+ totalCount: number;
638
+ }
639
+ export const DevicePendingAdoptionPage = /*@__PURE__*/ S.suspend(() =>
640
+ S.Struct({
641
+ count: S.Number,
642
+ data: DevicePendingAdoptionPageDataList,
643
+ limit: S.Number,
644
+ offset: S.Number,
645
+ totalCount: S.Number,
646
+ }),
647
+ ).annotate({
648
+ identifier: "DevicePendingAdoptionPage",
649
+ }) as any as S.Schema<DevicePendingAdoptionPage>;
650
+
651
+ export interface RemoveDeviceRequest {
652
+ siteId: string;
653
+ deviceId: string;
654
+ }
655
+ export const RemoveDeviceRequest = /*@__PURE__*/ S.suspend(() =>
656
+ S.Struct({
657
+ siteId: S.String.pipe(T.Label()),
658
+ deviceId: S.String.pipe(T.Label()),
659
+ }).pipe(
660
+ T.Http({
661
+ method: "DELETE",
662
+ uri: "/v1/sites/{siteId}/devices/{deviceId}",
663
+ code: 200,
664
+ }),
665
+ ),
666
+ ).annotate({
667
+ identifier: "RemoveDeviceRequest",
668
+ }) as any as S.Schema<RemoveDeviceRequest>;
669
+
670
+ export interface RemoveDeviceResponse {}
671
+ export const RemoveDeviceResponse = /*@__PURE__*/ S.suspend(() =>
672
+ S.Struct({}),
673
+ ).annotate({
674
+ identifier: "RemoveDeviceResponse",
675
+ }) as any as S.Schema<RemoveDeviceResponse>;
676
+
677
+ export type AdoptDeviceError = UnifiNetworkOpError;
678
+ /** Adopt Devices Adopt a device to a site. */
679
+ export const adoptDevice: API.OperationMethod<
680
+ AdoptDeviceRequest,
681
+ AdoptedDeviceDetails,
682
+ AdoptDeviceError,
683
+ UnifiNetworkOpContext
684
+ > = /*@__PURE__*/ API.make(() => ({
685
+ input: AdoptDeviceRequest,
686
+ output: AdoptedDeviceDetails,
687
+ errors: [UnknownUnifiNetworkError],
688
+ protocol: UnifiNetworkProtocol,
689
+ retry: Retry.Retry,
690
+ }));
691
+
692
+ export type ExecuteAdoptedDeviceActionError = UnifiNetworkOpError;
693
+ /** Execute Adopted Device Action Perform an action on an specific adopted device. The request body must include the action name and any applicable input arguments. */
694
+ export const executeAdoptedDeviceAction: API.OperationMethod<
695
+ ExecuteAdoptedDeviceActionRequest,
696
+ ExecuteAdoptedDeviceActionResponse,
697
+ ExecuteAdoptedDeviceActionError,
698
+ UnifiNetworkOpContext
699
+ > = /*@__PURE__*/ API.make(() => ({
700
+ input: ExecuteAdoptedDeviceActionRequest,
701
+ output: ExecuteAdoptedDeviceActionResponse,
702
+ errors: [UnknownUnifiNetworkError],
703
+ protocol: UnifiNetworkProtocol,
704
+ retry: Retry.Retry,
705
+ }));
706
+
707
+ export type ExecutePortActionError = UnifiNetworkOpError;
708
+ /** Execute Port Action Perform an action on a specific device port. The request body must include the action name and any applicable input arguments. */
709
+ export const executePortAction: API.OperationMethod<
710
+ ExecutePortActionRequest,
711
+ ExecutePortActionResponse,
712
+ ExecutePortActionError,
713
+ UnifiNetworkOpContext
714
+ > = /*@__PURE__*/ API.make(() => ({
715
+ input: ExecutePortActionRequest,
716
+ output: ExecutePortActionResponse,
717
+ errors: [UnknownUnifiNetworkError],
718
+ protocol: UnifiNetworkProtocol,
719
+ retry: Retry.Retry,
720
+ }));
721
+
722
+ export type GetAdoptedDeviceDetailsError = UnifiNetworkOpError;
723
+ /** Get Adopted Device Details Retrieve detailed information about a specific adopted device, including firmware versioning, uplink state, details about device features and interfaces (ports, radios) and other key attributes. */
724
+ export const getAdoptedDeviceDetails: API.OperationMethod<
725
+ GetAdoptedDeviceDetailsRequest,
726
+ AdoptedDeviceDetails,
727
+ GetAdoptedDeviceDetailsError,
728
+ UnifiNetworkOpContext
729
+ > = /*@__PURE__*/ API.make(() => ({
730
+ input: GetAdoptedDeviceDetailsRequest,
731
+ output: AdoptedDeviceDetails,
732
+ errors: [UnknownUnifiNetworkError],
733
+ protocol: UnifiNetworkProtocol,
734
+ retry: Retry.Retry,
735
+ }));
736
+
737
+ export type GetAdoptedDeviceLatestStatisticsError = UnifiNetworkOpError;
738
+ /** Get Latest Adopted Device Statistics Retrieve the latest real-time statistics of a specific adopted device, such as uptime, data transmission rates, CPU and memory utilization. */
739
+ export const getAdoptedDeviceLatestStatistics: API.OperationMethod<
740
+ GetAdoptedDeviceLatestStatisticsRequest,
741
+ LatestStatisticsForADevice,
742
+ GetAdoptedDeviceLatestStatisticsError,
743
+ UnifiNetworkOpContext
744
+ > = /*@__PURE__*/ API.make(() => ({
745
+ input: GetAdoptedDeviceLatestStatisticsRequest,
746
+ output: LatestStatisticsForADevice,
747
+ errors: [UnknownUnifiNetworkError],
748
+ protocol: UnifiNetworkProtocol,
749
+ retry: Retry.Retry,
750
+ }));
751
+
752
+ export type GetAdoptedDeviceOverviewPageError = UnifiNetworkOpError;
753
+ /** List Adopted Devices Retrieve a paginated list of all adopted devices on a site, including basic device information. <details> <summary>Filterable properties (click to expand)</summary> </details> */
754
+ export const getAdoptedDeviceOverviewPage: API.OperationMethod<
755
+ GetAdoptedDeviceOverviewPageRequest,
756
+ AdoptedDeviceOverviewPage,
757
+ GetAdoptedDeviceOverviewPageError,
758
+ UnifiNetworkOpContext
759
+ > = /*@__PURE__*/ API.make(() => ({
760
+ input: GetAdoptedDeviceOverviewPageRequest,
761
+ output: AdoptedDeviceOverviewPage,
762
+ errors: [UnknownUnifiNetworkError],
763
+ protocol: UnifiNetworkProtocol,
764
+ retry: Retry.Retry,
765
+ }));
766
+
767
+ export type GetPendingDevicePageError = UnifiNetworkOpError;
768
+ /** List Devices Pending Adoption Retrieve a paginated list of devices pending adoption, including basic device information. <details> <summary>Filterable properties (click to expand)</summary> </details> */
769
+ export const getPendingDevicePage: API.OperationMethod<
770
+ GetPendingDevicePageRequest,
771
+ DevicePendingAdoptionPage,
772
+ GetPendingDevicePageError,
773
+ UnifiNetworkOpContext
774
+ > = /*@__PURE__*/ API.make(() => ({
775
+ input: GetPendingDevicePageRequest,
776
+ output: DevicePendingAdoptionPage,
777
+ errors: [UnknownUnifiNetworkError],
778
+ protocol: UnifiNetworkProtocol,
779
+ retry: Retry.Retry,
780
+ }));
781
+
782
+ export type RemoveDeviceError = UnifiNetworkOpError;
783
+ /** Remove (Unadopt) Device Removes (unadopts) an adopted device from the site. If the device is online, it will be reset to factory defaults. */
784
+ export const removeDevice: API.OperationMethod<
785
+ RemoveDeviceRequest,
786
+ RemoveDeviceResponse,
787
+ RemoveDeviceError,
788
+ UnifiNetworkOpContext
789
+ > = /*@__PURE__*/ API.make(() => ({
790
+ input: RemoveDeviceRequest,
791
+ output: RemoveDeviceResponse,
792
+ errors: [UnknownUnifiNetworkError],
793
+ protocol: UnifiNetworkProtocol,
794
+ retry: Retry.Retry,
795
+ }));