@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,537 @@
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
+ /** ACL rule action */
16
+ export type CreateAclRuleRequestAction = "ALLOW" | "BLOCK";
17
+ export const CreateAclRuleRequestAction = S.String;
18
+
19
+ /** List of Switch capable device IDs to which the ACL rule will be provisioned. */
20
+ export type ACLRuleDeviceFilterDeviceIdsList = Array<string>;
21
+ export const ACLRuleDeviceFilterDeviceIdsList = /*@__PURE__*/ S.Array(
22
+ S.String,
23
+ ) as any as S.Schema<ACLRuleDeviceFilterDeviceIdsList>;
24
+
25
+ export interface ACLRuleDeviceFilter {
26
+ type: string;
27
+ /** List of Switch capable device IDs to which the ACL rule will be provisioned. */
28
+ deviceIds?: ACLRuleDeviceFilterDeviceIdsList;
29
+ }
30
+ export const ACLRuleDeviceFilter = /*@__PURE__*/ S.suspend(() =>
31
+ S.Struct({
32
+ type: S.String,
33
+ deviceIds: S.optional(ACLRuleDeviceFilterDeviceIdsList),
34
+ }),
35
+ ).annotate({
36
+ identifier: "ACLRuleDeviceFilter",
37
+ }) as any as S.Schema<ACLRuleDeviceFilter>;
38
+
39
+ export type CreateAclRuleRequestProtocolFilterItem = "TCP" | "UDP";
40
+ export const CreateAclRuleRequestProtocolFilterItem = S.String;
41
+
42
+ /** Protocols this ACL rule will be applied to. When null, the rule will be applied to all protocols. */
43
+ export type CreateAclRuleRequestProtocolFilterList = Array<
44
+ CreateAclRuleRequestProtocolFilterItem | (string & {})
45
+ >;
46
+ export const CreateAclRuleRequestProtocolFilterList = /*@__PURE__*/ S.Array(
47
+ CreateAclRuleRequestProtocolFilterItem,
48
+ ) as any as S.Schema<CreateAclRuleRequestProtocolFilterList>;
49
+
50
+ export interface CreateAclRuleRequest {
51
+ siteId: string;
52
+ /** ACL rule action */
53
+ action: CreateAclRuleRequestAction | (string & {});
54
+ /** ACL rule description */
55
+ description?: string;
56
+ /** Shape varies by variant — widened by scripts/convert.ts; see README. */
57
+ destinationFilter?: unknown;
58
+ enabled: boolean;
59
+ /** IDs of the Switch-capable devices used to enforce the ACL rule. When null, the rule will be provisioned to all switches on the site. */
60
+ enforcingDeviceFilter?: ACLRuleDeviceFilter;
61
+ /** ACL rule index. This property is deprecated and has no effect. Use the dedicated ACL rule reordering endpoint. */
62
+ index?: number;
63
+ /** ACL rule name */
64
+ name: string;
65
+ /** Shape varies by variant — widened by scripts/convert.ts; see README. */
66
+ sourceFilter?: unknown;
67
+ type: string;
68
+ /** Protocols this ACL rule will be applied to. When null, the rule will be applied to all protocols. */
69
+ protocolFilter?: CreateAclRuleRequestProtocolFilterList;
70
+ /** Network ID to which this ACL rule applies */
71
+ networkIdFilter?: string;
72
+ }
73
+ export const CreateAclRuleRequest = /*@__PURE__*/ S.suspend(() =>
74
+ S.Struct({
75
+ siteId: S.String.pipe(T.Label()),
76
+ action: CreateAclRuleRequestAction,
77
+ description: S.optional(S.String),
78
+ destinationFilter: S.optional(S.Unknown),
79
+ enabled: S.Boolean,
80
+ enforcingDeviceFilter: S.optional(ACLRuleDeviceFilter),
81
+ index: S.optional(S.Number),
82
+ name: S.String,
83
+ sourceFilter: S.optional(S.Unknown),
84
+ type: S.String,
85
+ protocolFilter: S.optional(CreateAclRuleRequestProtocolFilterList),
86
+ networkIdFilter: S.optional(S.String),
87
+ }).pipe(
88
+ T.Http({ method: "POST", uri: "/v1/sites/{siteId}/acl-rules", code: 200 }),
89
+ ),
90
+ ).annotate({
91
+ identifier: "CreateAclRuleRequest",
92
+ }) as any as S.Schema<CreateAclRuleRequest>;
93
+
94
+ /** ACL rule action */
95
+ export type ACLRuleAction = "ALLOW" | "BLOCK";
96
+ export const ACLRuleAction = S.String;
97
+
98
+ export type UserDefinedOrDerivedEntityMetadataSource = "SDWAN";
99
+ export const UserDefinedOrDerivedEntityMetadataSource = S.String;
100
+
101
+ export interface UserDefinedOrDerivedEntityMetadata {
102
+ origin: string;
103
+ source?: UserDefinedOrDerivedEntityMetadataSource;
104
+ }
105
+ export const UserDefinedOrDerivedEntityMetadata = /*@__PURE__*/ S.suspend(() =>
106
+ S.Struct({
107
+ origin: S.String,
108
+ source: S.optional(UserDefinedOrDerivedEntityMetadataSource),
109
+ }),
110
+ ).annotate({
111
+ identifier: "UserDefinedOrDerivedEntityMetadata",
112
+ }) as any as S.Schema<UserDefinedOrDerivedEntityMetadata>;
113
+
114
+ export type ACLRuleProtocolFilterItem = "TCP" | "UDP";
115
+ export const ACLRuleProtocolFilterItem = S.String;
116
+
117
+ /** Protocols this ACL rule will be applied to. When null, the rule will be applied to all protocols. */
118
+ export type ACLRuleProtocolFilterList = Array<ACLRuleProtocolFilterItem>;
119
+ export const ACLRuleProtocolFilterList = /*@__PURE__*/ S.Array(
120
+ ACLRuleProtocolFilterItem,
121
+ ) as any as S.Schema<ACLRuleProtocolFilterList>;
122
+
123
+ export interface ACLRule {
124
+ /** ACL rule action */
125
+ action: ACLRuleAction;
126
+ /** ACL rule description */
127
+ description?: string;
128
+ /** Traffic destination filter */
129
+ destinationFilter?: unknown;
130
+ enabled: boolean;
131
+ /** IDs of the Switch-capable devices used to enforce the ACL rule. When null, the rule will be provisioned to all switches on the site. */
132
+ enforcingDeviceFilter?: ACLRuleDeviceFilter;
133
+ id: string;
134
+ /** ACL rule index. Lower index has higher priority */
135
+ index: number;
136
+ /** Only user-defined rules can be deleted or modified */
137
+ metadata: UserDefinedOrDerivedEntityMetadata;
138
+ /** ACL rule name */
139
+ name: string;
140
+ /** Traffic source filter */
141
+ sourceFilter?: unknown;
142
+ type: string;
143
+ /** Protocols this ACL rule will be applied to. When null, the rule will be applied to all protocols. */
144
+ protocolFilter?: ACLRuleProtocolFilterList;
145
+ /** Network ID to which this ACL rule applies */
146
+ networkIdFilter?: string;
147
+ }
148
+ export const ACLRule = /*@__PURE__*/ S.suspend(() =>
149
+ S.Struct({
150
+ action: ACLRuleAction,
151
+ description: S.optional(S.String),
152
+ destinationFilter: S.optional(S.Unknown),
153
+ enabled: S.Boolean,
154
+ enforcingDeviceFilter: S.optional(ACLRuleDeviceFilter),
155
+ id: S.String,
156
+ index: S.Number,
157
+ metadata: UserDefinedOrDerivedEntityMetadata,
158
+ name: S.String,
159
+ sourceFilter: S.optional(S.Unknown),
160
+ type: S.String,
161
+ protocolFilter: S.optional(ACLRuleProtocolFilterList),
162
+ networkIdFilter: S.optional(S.String),
163
+ }),
164
+ ).annotate({ identifier: "ACLRule" }) as any as S.Schema<ACLRule>;
165
+
166
+ export interface DeleteAclRuleRequest {
167
+ siteId: string;
168
+ aclRuleId: string;
169
+ }
170
+ export const DeleteAclRuleRequest = /*@__PURE__*/ S.suspend(() =>
171
+ S.Struct({
172
+ siteId: S.String.pipe(T.Label()),
173
+ aclRuleId: S.String.pipe(T.Label()),
174
+ }).pipe(
175
+ T.Http({
176
+ method: "DELETE",
177
+ uri: "/v1/sites/{siteId}/acl-rules/{aclRuleId}",
178
+ code: 200,
179
+ }),
180
+ ),
181
+ ).annotate({
182
+ identifier: "DeleteAclRuleRequest",
183
+ }) as any as S.Schema<DeleteAclRuleRequest>;
184
+
185
+ export interface DeleteAclRuleResponse {}
186
+ export const DeleteAclRuleResponse = /*@__PURE__*/ S.suspend(() =>
187
+ S.Struct({}),
188
+ ).annotate({
189
+ identifier: "DeleteAclRuleResponse",
190
+ }) as any as S.Schema<DeleteAclRuleResponse>;
191
+
192
+ export interface GetAclRuleRequest {
193
+ siteId: string;
194
+ aclRuleId: string;
195
+ }
196
+ export const GetAclRuleRequest = /*@__PURE__*/ S.suspend(() =>
197
+ S.Struct({
198
+ siteId: S.String.pipe(T.Label()),
199
+ aclRuleId: S.String.pipe(T.Label()),
200
+ }).pipe(
201
+ T.Http({
202
+ method: "GET",
203
+ uri: "/v1/sites/{siteId}/acl-rules/{aclRuleId}",
204
+ code: 200,
205
+ }),
206
+ ),
207
+ ).annotate({
208
+ identifier: "GetAclRuleRequest",
209
+ }) as any as S.Schema<GetAclRuleRequest>;
210
+
211
+ export interface GetAclRuleOrderingRequest {
212
+ siteId: string;
213
+ }
214
+ export const GetAclRuleOrderingRequest = /*@__PURE__*/ S.suspend(() =>
215
+ S.Struct({
216
+ siteId: S.String.pipe(T.Label()),
217
+ }).pipe(
218
+ T.Http({
219
+ method: "GET",
220
+ uri: "/v1/sites/{siteId}/acl-rules/ordering",
221
+ code: 200,
222
+ }),
223
+ ),
224
+ ).annotate({
225
+ identifier: "GetAclRuleOrderingRequest",
226
+ }) as any as S.Schema<GetAclRuleOrderingRequest>;
227
+
228
+ export type ACLRuleOrderingOrderedAclRuleIdsList = Array<string>;
229
+ export const ACLRuleOrderingOrderedAclRuleIdsList = /*@__PURE__*/ S.Array(
230
+ S.String,
231
+ ) as any as S.Schema<ACLRuleOrderingOrderedAclRuleIdsList>;
232
+
233
+ export interface ACLRuleOrdering {
234
+ orderedAclRuleIds: ACLRuleOrderingOrderedAclRuleIdsList;
235
+ }
236
+ export const ACLRuleOrdering = /*@__PURE__*/ S.suspend(() =>
237
+ S.Struct({
238
+ orderedAclRuleIds: ACLRuleOrderingOrderedAclRuleIdsList,
239
+ }),
240
+ ).annotate({
241
+ identifier: "ACLRuleOrdering",
242
+ }) as any as S.Schema<ACLRuleOrdering>;
243
+
244
+ export interface GetAclRulePageRequest {
245
+ siteId: string;
246
+ offset?: number;
247
+ limit?: number;
248
+ filter?: string;
249
+ }
250
+ export const GetAclRulePageRequest = /*@__PURE__*/ S.suspend(() =>
251
+ S.Struct({
252
+ siteId: S.String.pipe(T.Label()),
253
+ offset: S.optional(S.Number.pipe(T.Query())),
254
+ limit: S.optional(S.Number.pipe(T.Query())),
255
+ filter: S.optional(S.String.pipe(T.Query())),
256
+ }).pipe(
257
+ T.Http({ method: "GET", uri: "/v1/sites/{siteId}/acl-rules", code: 200 }),
258
+ ),
259
+ ).annotate({
260
+ identifier: "GetAclRulePageRequest",
261
+ }) as any as S.Schema<GetAclRulePageRequest>;
262
+
263
+ /** ACL rule action */
264
+ export type ACLRuleObjectAction = "ALLOW" | "BLOCK";
265
+ export const ACLRuleObjectAction = S.String;
266
+
267
+ export type ACLRuleObjectProtocolFilterItem = "TCP" | "UDP";
268
+ export const ACLRuleObjectProtocolFilterItem = S.String;
269
+
270
+ /** Protocols this ACL rule will be applied to. When null, the rule will be applied to all protocols. */
271
+ export type ACLRuleObjectProtocolFilterList =
272
+ Array<ACLRuleObjectProtocolFilterItem>;
273
+ export const ACLRuleObjectProtocolFilterList = /*@__PURE__*/ S.Array(
274
+ ACLRuleObjectProtocolFilterItem,
275
+ ) as any as S.Schema<ACLRuleObjectProtocolFilterList>;
276
+
277
+ export interface ACLRuleObject {
278
+ /** ACL rule action */
279
+ action: ACLRuleObjectAction;
280
+ /** ACL rule description */
281
+ description?: string;
282
+ /** Traffic destination filter */
283
+ destinationFilter?: unknown;
284
+ enabled: boolean;
285
+ /** IDs of the Switch-capable devices used to enforce the ACL rule. When null, the rule will be provisioned to all switches on the site. */
286
+ enforcingDeviceFilter?: ACLRuleDeviceFilter;
287
+ id: string;
288
+ /** ACL rule index. Lower index has higher priority */
289
+ index: number;
290
+ /** Only user-defined rules can be deleted or modified */
291
+ metadata: UserDefinedOrDerivedEntityMetadata;
292
+ /** ACL rule name */
293
+ name: string;
294
+ /** Traffic source filter */
295
+ sourceFilter?: unknown;
296
+ type: string;
297
+ /** Protocols this ACL rule will be applied to. When null, the rule will be applied to all protocols. */
298
+ protocolFilter?: ACLRuleObjectProtocolFilterList;
299
+ /** Network ID to which this ACL rule applies */
300
+ networkIdFilter?: string;
301
+ }
302
+ export const ACLRuleObject = /*@__PURE__*/ S.suspend(() =>
303
+ S.Struct({
304
+ action: ACLRuleObjectAction,
305
+ description: S.optional(S.String),
306
+ destinationFilter: S.optional(S.Unknown),
307
+ enabled: S.Boolean,
308
+ enforcingDeviceFilter: S.optional(ACLRuleDeviceFilter),
309
+ id: S.String,
310
+ index: S.Number,
311
+ metadata: UserDefinedOrDerivedEntityMetadata,
312
+ name: S.String,
313
+ sourceFilter: S.optional(S.Unknown),
314
+ type: S.String,
315
+ protocolFilter: S.optional(ACLRuleObjectProtocolFilterList),
316
+ networkIdFilter: S.optional(S.String),
317
+ }),
318
+ ).annotate({ identifier: "ACLRuleObject" }) as any as S.Schema<ACLRuleObject>;
319
+
320
+ export type IntegrationAclRulePageDtoDataList = Array<ACLRuleObject>;
321
+ export const IntegrationAclRulePageDtoDataList = /*@__PURE__*/ S.Array(
322
+ ACLRuleObject,
323
+ ) as any as S.Schema<IntegrationAclRulePageDtoDataList>;
324
+
325
+ export interface IntegrationAclRulePageDto {
326
+ count: number;
327
+ data: IntegrationAclRulePageDtoDataList;
328
+ limit: number;
329
+ offset: number;
330
+ totalCount: number;
331
+ }
332
+ export const IntegrationAclRulePageDto = /*@__PURE__*/ S.suspend(() =>
333
+ S.Struct({
334
+ count: S.Number,
335
+ data: IntegrationAclRulePageDtoDataList,
336
+ limit: S.Number,
337
+ offset: S.Number,
338
+ totalCount: S.Number,
339
+ }),
340
+ ).annotate({
341
+ identifier: "IntegrationAclRulePageDto",
342
+ }) as any as S.Schema<IntegrationAclRulePageDto>;
343
+
344
+ /** ACL rule action */
345
+ export type UpdateAclRuleRequestAction = "ALLOW" | "BLOCK";
346
+ export const UpdateAclRuleRequestAction = S.String;
347
+
348
+ export type UpdateAclRuleRequestProtocolFilterItem = "TCP" | "UDP";
349
+ export const UpdateAclRuleRequestProtocolFilterItem = S.String;
350
+
351
+ /** Protocols this ACL rule will be applied to. When null, the rule will be applied to all protocols. */
352
+ export type UpdateAclRuleRequestProtocolFilterList = Array<
353
+ UpdateAclRuleRequestProtocolFilterItem | (string & {})
354
+ >;
355
+ export const UpdateAclRuleRequestProtocolFilterList = /*@__PURE__*/ S.Array(
356
+ UpdateAclRuleRequestProtocolFilterItem,
357
+ ) as any as S.Schema<UpdateAclRuleRequestProtocolFilterList>;
358
+
359
+ export interface UpdateAclRuleRequest {
360
+ siteId: string;
361
+ aclRuleId: string;
362
+ /** ACL rule action */
363
+ action: UpdateAclRuleRequestAction | (string & {});
364
+ /** ACL rule description */
365
+ description?: string;
366
+ /** Shape varies by variant — widened by scripts/convert.ts; see README. */
367
+ destinationFilter?: unknown;
368
+ enabled: boolean;
369
+ /** IDs of the Switch-capable devices used to enforce the ACL rule. When null, the rule will be provisioned to all switches on the site. */
370
+ enforcingDeviceFilter?: ACLRuleDeviceFilter;
371
+ /** ACL rule index. This property is deprecated and has no effect. Use the dedicated ACL rule reordering endpoint. */
372
+ index?: number;
373
+ /** ACL rule name */
374
+ name: string;
375
+ /** Shape varies by variant — widened by scripts/convert.ts; see README. */
376
+ sourceFilter?: unknown;
377
+ type: string;
378
+ /** Protocols this ACL rule will be applied to. When null, the rule will be applied to all protocols. */
379
+ protocolFilter?: UpdateAclRuleRequestProtocolFilterList;
380
+ /** Network ID to which this ACL rule applies */
381
+ networkIdFilter?: string;
382
+ }
383
+ export const UpdateAclRuleRequest = /*@__PURE__*/ S.suspend(() =>
384
+ S.Struct({
385
+ siteId: S.String.pipe(T.Label()),
386
+ aclRuleId: S.String.pipe(T.Label()),
387
+ action: UpdateAclRuleRequestAction,
388
+ description: S.optional(S.String),
389
+ destinationFilter: S.optional(S.Unknown),
390
+ enabled: S.Boolean,
391
+ enforcingDeviceFilter: S.optional(ACLRuleDeviceFilter),
392
+ index: S.optional(S.Number),
393
+ name: S.String,
394
+ sourceFilter: S.optional(S.Unknown),
395
+ type: S.String,
396
+ protocolFilter: S.optional(UpdateAclRuleRequestProtocolFilterList),
397
+ networkIdFilter: S.optional(S.String),
398
+ }).pipe(
399
+ T.Http({
400
+ method: "PUT",
401
+ uri: "/v1/sites/{siteId}/acl-rules/{aclRuleId}",
402
+ code: 200,
403
+ }),
404
+ ),
405
+ ).annotate({
406
+ identifier: "UpdateAclRuleRequest",
407
+ }) as any as S.Schema<UpdateAclRuleRequest>;
408
+
409
+ export type UpdateAclRuleOrderingRequestOrderedAclRuleIdsList = Array<string>;
410
+ export const UpdateAclRuleOrderingRequestOrderedAclRuleIdsList =
411
+ /*@__PURE__*/ S.Array(
412
+ S.String,
413
+ ) as any as S.Schema<UpdateAclRuleOrderingRequestOrderedAclRuleIdsList>;
414
+
415
+ export interface UpdateAclRuleOrderingRequest {
416
+ siteId: string;
417
+ orderedAclRuleIds: UpdateAclRuleOrderingRequestOrderedAclRuleIdsList;
418
+ }
419
+ export const UpdateAclRuleOrderingRequest = /*@__PURE__*/ S.suspend(() =>
420
+ S.Struct({
421
+ siteId: S.String.pipe(T.Label()),
422
+ orderedAclRuleIds: UpdateAclRuleOrderingRequestOrderedAclRuleIdsList,
423
+ }).pipe(
424
+ T.Http({
425
+ method: "PUT",
426
+ uri: "/v1/sites/{siteId}/acl-rules/ordering",
427
+ code: 200,
428
+ }),
429
+ ),
430
+ ).annotate({
431
+ identifier: "UpdateAclRuleOrderingRequest",
432
+ }) as any as S.Schema<UpdateAclRuleOrderingRequest>;
433
+
434
+ export type CreateAclRuleError = UnifiNetworkOpError;
435
+ /** Create ACL Rule Create a new user defined ACL rule on a site. */
436
+ export const createAclRule: API.OperationMethod<
437
+ CreateAclRuleRequest,
438
+ ACLRule,
439
+ CreateAclRuleError,
440
+ UnifiNetworkOpContext
441
+ > = /*@__PURE__*/ API.make(() => ({
442
+ input: CreateAclRuleRequest,
443
+ output: ACLRule,
444
+ errors: [UnknownUnifiNetworkError],
445
+ protocol: UnifiNetworkProtocol,
446
+ retry: Retry.Retry,
447
+ }));
448
+
449
+ export type DeleteAclRuleError = UnifiNetworkOpError;
450
+ /** Delete ACL Rule Delete an existing user defined ACL rule on a site. */
451
+ export const deleteAclRule: API.OperationMethod<
452
+ DeleteAclRuleRequest,
453
+ DeleteAclRuleResponse,
454
+ DeleteAclRuleError,
455
+ UnifiNetworkOpContext
456
+ > = /*@__PURE__*/ API.make(() => ({
457
+ input: DeleteAclRuleRequest,
458
+ output: DeleteAclRuleResponse,
459
+ errors: [UnknownUnifiNetworkError],
460
+ protocol: UnifiNetworkProtocol,
461
+ retry: Retry.Retry,
462
+ }));
463
+
464
+ export type GetAclRuleError = UnifiNetworkOpError;
465
+ /** Get ACL Rule */
466
+ export const getAclRule: API.OperationMethod<
467
+ GetAclRuleRequest,
468
+ ACLRule,
469
+ GetAclRuleError,
470
+ UnifiNetworkOpContext
471
+ > = /*@__PURE__*/ API.make(() => ({
472
+ input: GetAclRuleRequest,
473
+ output: ACLRule,
474
+ errors: [UnknownUnifiNetworkError],
475
+ protocol: UnifiNetworkProtocol,
476
+ retry: Retry.Retry,
477
+ }));
478
+
479
+ export type GetAclRuleOrderingError = UnifiNetworkOpError;
480
+ /** Get User-Defined ACL Rule Ordering Retrieve user-defined ACL rule ordering on a site. */
481
+ export const getAclRuleOrdering: API.OperationMethod<
482
+ GetAclRuleOrderingRequest,
483
+ ACLRuleOrdering,
484
+ GetAclRuleOrderingError,
485
+ UnifiNetworkOpContext
486
+ > = /*@__PURE__*/ API.make(() => ({
487
+ input: GetAclRuleOrderingRequest,
488
+ output: ACLRuleOrdering,
489
+ errors: [UnknownUnifiNetworkError],
490
+ protocol: UnifiNetworkProtocol,
491
+ retry: Retry.Retry,
492
+ }));
493
+
494
+ export type GetAclRulePageError = UnifiNetworkOpError;
495
+ /** List ACL Rules Retrieve a paginated list of all ACL rules on a site. <details> <summary>Filterable properties (click to expand)</summary> </details> */
496
+ export const getAclRulePage: API.OperationMethod<
497
+ GetAclRulePageRequest,
498
+ IntegrationAclRulePageDto,
499
+ GetAclRulePageError,
500
+ UnifiNetworkOpContext
501
+ > = /*@__PURE__*/ API.make(() => ({
502
+ input: GetAclRulePageRequest,
503
+ output: IntegrationAclRulePageDto,
504
+ errors: [UnknownUnifiNetworkError],
505
+ protocol: UnifiNetworkProtocol,
506
+ retry: Retry.Retry,
507
+ }));
508
+
509
+ export type UpdateAclRuleError = UnifiNetworkOpError;
510
+ /** Update ACL Rule Update an existing user defined ACL rule on a site. */
511
+ export const updateAclRule: API.OperationMethod<
512
+ UpdateAclRuleRequest,
513
+ ACLRule,
514
+ UpdateAclRuleError,
515
+ UnifiNetworkOpContext
516
+ > = /*@__PURE__*/ API.make(() => ({
517
+ input: UpdateAclRuleRequest,
518
+ output: ACLRule,
519
+ errors: [UnknownUnifiNetworkError],
520
+ protocol: UnifiNetworkProtocol,
521
+ retry: Retry.Retry,
522
+ }));
523
+
524
+ export type UpdateAclRuleOrderingError = UnifiNetworkOpError;
525
+ /** Reorder User-Defined ACL Rules Reorder user-defined ACL rules on a site. */
526
+ export const updateAclRuleOrdering: API.OperationMethod<
527
+ UpdateAclRuleOrderingRequest,
528
+ ACLRuleOrdering,
529
+ UpdateAclRuleOrderingError,
530
+ UnifiNetworkOpContext
531
+ > = /*@__PURE__*/ API.make(() => ({
532
+ input: UpdateAclRuleOrderingRequest,
533
+ output: ACLRuleOrdering,
534
+ errors: [UnknownUnifiNetworkError],
535
+ protocol: UnifiNetworkProtocol,
536
+ retry: Retry.Retry,
537
+ }));
@@ -0,0 +1,44 @@
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 GetInfoRequest {}
16
+ export const GetInfoRequest = /*@__PURE__*/ S.suspend(() =>
17
+ S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/info", code: 200 })),
18
+ ).annotate({ identifier: "GetInfoRequest" }) as any as S.Schema<GetInfoRequest>;
19
+
20
+ export interface ApplicationInfo {
21
+ applicationVersion: string;
22
+ }
23
+ export const ApplicationInfo = /*@__PURE__*/ S.suspend(() =>
24
+ S.Struct({
25
+ applicationVersion: S.String,
26
+ }),
27
+ ).annotate({
28
+ identifier: "ApplicationInfo",
29
+ }) as any as S.Schema<ApplicationInfo>;
30
+
31
+ export type GetInfoError = UnifiNetworkOpError;
32
+ /** Get Application Info Retrieve general information about the UniFi Network application. */
33
+ export const getInfo: API.OperationMethod<
34
+ GetInfoRequest,
35
+ ApplicationInfo,
36
+ GetInfoError,
37
+ UnifiNetworkOpContext
38
+ > = /*@__PURE__*/ API.make(() => ({
39
+ input: GetInfoRequest,
40
+ output: ApplicationInfo,
41
+ errors: [UnknownUnifiNetworkError],
42
+ protocol: UnifiNetworkProtocol,
43
+ retry: Retry.Retry,
44
+ }));