@homeflare/alchemy 0.39.0 → 0.41.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/README.md +10 -8
- package/dist/caddy/index.js.map +2 -2
- package/dist/ceph/auth-entity.d.ts +34 -0
- package/dist/ceph/auth-entity.d.ts.map +1 -0
- package/dist/ceph/ceph-argv-config.d.ts +10 -0
- package/dist/ceph/ceph-argv-config.d.ts.map +1 -0
- package/dist/ceph/ceph-argv.d.ts +19 -0
- package/dist/ceph/ceph-argv.d.ts.map +1 -0
- package/dist/ceph/ceph-auth-form.d.ts +54 -0
- package/dist/ceph/ceph-auth-form.d.ts.map +1 -0
- package/dist/ceph/ceph-auth-parse.d.ts +56 -0
- package/dist/ceph/ceph-auth-parse.d.ts.map +1 -0
- package/dist/ceph/ceph-auth-reconcile.d.ts +35 -0
- package/dist/ceph/ceph-auth-reconcile.d.ts.map +1 -0
- package/dist/ceph/ceph-config-options.d.ts +23 -0
- package/dist/ceph/ceph-config-options.d.ts.map +1 -0
- package/dist/ceph/ceph-key-leak-assert.d.ts +25 -0
- package/dist/ceph/ceph-key-leak-assert.d.ts.map +1 -0
- package/dist/ceph/ceph-transport.d.ts +37 -0
- package/dist/ceph/ceph-transport.d.ts.map +1 -0
- package/dist/ceph/fake-ceph-dial.d.ts +35 -0
- package/dist/ceph/fake-ceph-dial.d.ts.map +1 -0
- package/dist/ceph/index.d.ts +13 -0
- package/dist/ceph/index.d.ts.map +1 -0
- package/dist/ceph/index.js +1610 -0
- package/dist/ceph/index.js.map +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/launchd/fake-runner.d.ts.map +1 -1
- package/dist/launchd/index.d.ts +1 -1
- package/dist/launchd/index.d.ts.map +1 -1
- package/dist/launchd/index.js +7 -1
- package/dist/launchd/index.js.map +5 -5
- package/dist/launchd/local-runner.d.ts.map +1 -1
- package/dist/launchd/runner.d.ts +21 -0
- package/dist/launchd/runner.d.ts.map +1 -1
- package/dist/launchd/sudo-runner.d.ts.map +1 -1
- package/dist/linux/directory-lifecycle.d.ts.map +1 -1
- package/dist/linux/fake-linux-host.d.ts.map +1 -1
- package/dist/linux/index.d.ts +1 -1
- package/dist/linux/index.d.ts.map +1 -1
- package/dist/linux/index.js +16 -4
- package/dist/linux/index.js.map +7 -7
- package/dist/linux/ssh-runner.d.ts.map +1 -1
- package/dist/linux/sudo-runner.d.ts.map +1 -1
- package/dist/opnsense/alias-form.d.ts +14 -1
- package/dist/opnsense/alias-form.d.ts.map +1 -1
- package/dist/opnsense/alias.d.ts +1 -1
- package/dist/opnsense/alias.d.ts.map +1 -1
- package/dist/opnsense/group-form.d.ts +8 -2
- package/dist/opnsense/group-form.d.ts.map +1 -1
- package/dist/opnsense/group.d.ts +1 -1
- package/dist/opnsense/group.d.ts.map +1 -1
- package/dist/opnsense/index.js +15 -7
- package/dist/opnsense/index.js.map +7 -7
- package/dist/opnsense/wire.d.ts +42 -12
- package/dist/opnsense/wire.d.ts.map +1 -1
- package/dist/proxmox/index.js +62 -39
- package/dist/proxmox/index.js.map +8 -7
- package/dist/proxmox/qemu-volume.d.ts +12 -2
- package/dist/proxmox/qemu-volume.d.ts.map +1 -1
- package/dist/proxmox/storage-form.d.ts +28 -3
- package/dist/proxmox/storage-form.d.ts.map +1 -1
- package/dist/proxmox/storage-plugin-options.d.ts +2 -0
- package/dist/proxmox/storage-plugin-options.d.ts.map +1 -0
- package/dist/proxmox/storage-wire.d.ts +28 -1
- package/dist/proxmox/storage-wire.d.ts.map +1 -1
- package/dist/proxmox/storage.d.ts +6 -1
- package/dist/proxmox/storage.d.ts.map +1 -1
- package/dist/release/index.d.ts +1 -1
- package/dist/release/index.d.ts.map +1 -1
- package/dist/release/index.js.map +2 -2
- package/dist/talos/credentials-write.d.ts +46 -0
- package/dist/talos/credentials-write.d.ts.map +1 -0
- package/dist/talos/credentials.d.ts +51 -9
- package/dist/talos/credentials.d.ts.map +1 -1
- package/dist/talos/fake-process.d.ts +56 -0
- package/dist/talos/fake-process.d.ts.map +1 -0
- package/dist/talos/index.d.ts +19 -4
- package/dist/talos/index.d.ts.map +1 -1
- package/dist/talos/index.js +357 -173
- package/dist/talos/index.js.map +16 -10
- package/dist/talos/kubeconfig-attrs.d.ts +4 -0
- package/dist/talos/kubeconfig-attrs.d.ts.map +1 -0
- package/dist/talos/kubeconfig.d.ts +41 -23
- package/dist/talos/kubeconfig.d.ts.map +1 -1
- package/dist/talos/machine-config-fixtures.d.ts +60 -0
- package/dist/talos/machine-config-fixtures.d.ts.map +1 -0
- package/dist/talos/machine-config-poll.d.ts +43 -0
- package/dist/talos/machine-config-poll.d.ts.map +1 -0
- package/dist/talos/machine-config-read.d.ts +49 -0
- package/dist/talos/machine-config-read.d.ts.map +1 -0
- package/dist/talos/resource.d.ts +18 -0
- package/dist/talos/resource.d.ts.map +1 -1
- package/dist/talos/talos-bootstrap-etcd.d.ts +38 -0
- package/dist/talos/talos-bootstrap-etcd.d.ts.map +1 -0
- package/dist/talos/talos-bootstrap.d.ts +87 -0
- package/dist/talos/talos-bootstrap.d.ts.map +1 -1
- package/dist/talos/talos-cluster-health.d.ts +43 -1
- package/dist/talos/talos-cluster-health.d.ts.map +1 -1
- package/dist/talos/talos-errors.d.ts +68 -0
- package/dist/talos/talos-errors.d.ts.map +1 -0
- package/dist/talos/talos-machine-config.d.ts +51 -15
- package/dist/talos/talos-machine-config.d.ts.map +1 -1
- package/dist/talos/talosctl.d.ts +7 -0
- package/dist/talos/talosctl.d.ts.map +1 -1
- package/dist/talos/values.d.ts +23 -3
- package/dist/talos/values.d.ts.map +1 -1
- package/dist/unifi/acl-rule-drift.d.ts +22 -0
- package/dist/unifi/acl-rule-drift.d.ts.map +1 -0
- package/dist/unifi/acl-rule-form.d.ts +90 -0
- package/dist/unifi/acl-rule-form.d.ts.map +1 -0
- package/dist/unifi/acl-rule-ordering-form.d.ts +49 -0
- package/dist/unifi/acl-rule-ordering-form.d.ts.map +1 -0
- package/dist/unifi/acl-rule-ordering.d.ts +54 -0
- package/dist/unifi/acl-rule-ordering.d.ts.map +1 -0
- package/dist/unifi/acl-rule.d.ts +49 -0
- package/dist/unifi/acl-rule.d.ts.map +1 -0
- package/dist/unifi/dns-policy-drift.d.ts +21 -0
- package/dist/unifi/dns-policy-drift.d.ts.map +1 -0
- package/dist/unifi/dns-policy-form.d.ts +97 -0
- package/dist/unifi/dns-policy-form.d.ts.map +1 -0
- package/dist/unifi/dns-policy.d.ts +55 -0
- package/dist/unifi/dns-policy.d.ts.map +1 -0
- package/dist/unifi/firewall-policy-drift.d.ts +26 -0
- package/dist/unifi/firewall-policy-drift.d.ts.map +1 -0
- package/dist/unifi/firewall-policy-form.d.ts +102 -0
- package/dist/unifi/firewall-policy-form.d.ts.map +1 -0
- package/dist/unifi/firewall-policy-ordering-form.d.ts +66 -0
- package/dist/unifi/firewall-policy-ordering-form.d.ts.map +1 -0
- package/dist/unifi/firewall-policy-ordering.d.ts +57 -0
- package/dist/unifi/firewall-policy-ordering.d.ts.map +1 -0
- package/dist/unifi/firewall-policy.d.ts +57 -0
- package/dist/unifi/firewall-policy.d.ts.map +1 -0
- package/dist/unifi/index.d.ts +7 -0
- package/dist/unifi/index.d.ts.map +1 -1
- package/dist/unifi/index.js +588 -3
- package/dist/unifi/index.js.map +24 -4
- package/dist/unifi/paginate.d.ts +0 -12
- package/dist/unifi/paginate.d.ts.map +1 -1
- package/dist/unifi/providers.d.ts +1 -1
- package/dist/unifi/providers.d.ts.map +1 -1
- package/dist/unifi/scan-source.d.ts +11 -0
- package/dist/unifi/scan-source.d.ts.map +1 -0
- package/dist/unifi/traffic-matching-list-drift.d.ts +22 -0
- package/dist/unifi/traffic-matching-list-drift.d.ts.map +1 -0
- package/dist/unifi/traffic-matching-list-form.d.ts +56 -0
- package/dist/unifi/traffic-matching-list-form.d.ts.map +1 -0
- package/dist/unifi/traffic-matching-list.d.ts +51 -0
- package/dist/unifi/traffic-matching-list.d.ts.map +1 -0
- package/dist/unifi/wifi-broadcast-drift.d.ts +22 -0
- package/dist/unifi/wifi-broadcast-drift.d.ts.map +1 -0
- package/dist/unifi/wifi-broadcast-form.d.ts +127 -0
- package/dist/unifi/wifi-broadcast-form.d.ts.map +1 -0
- package/dist/unifi/wifi-broadcast.d.ts +73 -0
- package/dist/unifi/wifi-broadcast.d.ts.map +1 -0
- package/docs/distilled-interim.md +7 -0
- package/docs/launchd.md +5 -3
- package/docs/provider-standard.md +5 -1
- package/docs/talos-argocd-dogfood.md +160 -0
- package/docs/unifi-acl-rule.md +122 -0
- package/docs/unifi-dns-policy.md +75 -0
- package/docs/unifi-firewall-policy.md +109 -0
- package/docs/unifi-traffic-matching-list.md +82 -0
- package/docs/unifi-wifi.md +120 -0
- package/docs/unifi.md +10 -5
- package/package.json +7 -3
- package/src/ceph/auth-entity.ts +74 -0
- package/src/ceph/ceph-argv-config.ts +78 -0
- package/src/ceph/ceph-argv.test.ts +226 -0
- package/src/ceph/ceph-argv.ts +189 -0
- package/src/ceph/ceph-auth-form.test.ts +103 -0
- package/src/ceph/ceph-auth-form.ts +107 -0
- package/src/ceph/ceph-auth-parse.test.ts +155 -0
- package/src/ceph/ceph-auth-parse.ts +121 -0
- package/src/ceph/ceph-auth-reconcile-secrecy.test.ts +82 -0
- package/src/ceph/ceph-auth-reconcile.test.ts +233 -0
- package/src/ceph/ceph-auth-reconcile.ts +119 -0
- package/src/ceph/ceph-config-options.test.ts +44 -0
- package/src/ceph/ceph-config-options.ts +36 -0
- package/src/ceph/ceph-key-leak-assert.ts +35 -0
- package/src/ceph/ceph-no-output-logging.test.ts +52 -0
- package/src/ceph/ceph-transport.test.ts +125 -0
- package/src/ceph/ceph-transport.ts +117 -0
- package/src/ceph/fake-ceph-dial.ts +55 -0
- package/src/ceph/index.ts +12 -0
- package/src/index.ts +1 -0
- package/src/launchd/fake-runner.ts +2 -0
- package/src/launchd/index.ts +8 -1
- package/src/launchd/local-runner.ts +16 -1
- package/src/launchd/runner.ts +22 -0
- package/src/launchd/sudo-runner.ts +3 -0
- package/src/linux/directory-lifecycle.ts +18 -3
- package/src/linux/directory-sudo.test.ts +59 -0
- package/src/linux/directory.test.ts +34 -8
- package/src/linux/fake-linux-host.ts +2 -0
- package/src/linux/index.ts +1 -0
- package/src/linux/ssh-runner.ts +4 -0
- package/src/linux/sudo-runner.ts +3 -0
- package/src/opnsense/alias-form.test.ts +24 -12
- package/src/opnsense/alias-form.ts +20 -7
- package/src/opnsense/alias.test.ts +13 -6
- package/src/opnsense/alias.ts +16 -10
- package/src/opnsense/group-form.test.ts +12 -8
- package/src/opnsense/group-form.ts +13 -4
- package/src/opnsense/group.test.ts +18 -7
- package/src/opnsense/group.ts +10 -3
- package/src/opnsense/wire.ts +57 -12
- package/src/proxmox/qemu-volume.test.ts +153 -4
- package/src/proxmox/qemu-volume.ts +71 -14
- package/src/proxmox/storage-form.ts +48 -8
- package/src/proxmox/storage-plugin-options.ts +45 -0
- package/src/proxmox/storage-update.test.ts +183 -0
- package/src/proxmox/storage-wire.ts +54 -7
- package/src/proxmox/storage.ts +18 -6
- package/src/release/index.ts +1 -0
- package/src/talos/credentials-write.test.ts +81 -0
- package/src/talos/credentials-write.ts +95 -0
- package/src/talos/credentials.test.ts +157 -0
- package/src/talos/credentials.ts +160 -90
- package/src/talos/fake-process.ts +94 -0
- package/src/talos/index.ts +39 -4
- package/src/talos/kubeconfig-attrs.ts +55 -0
- package/src/talos/kubeconfig.test.ts +256 -0
- package/src/talos/kubeconfig.ts +170 -90
- package/src/talos/machine-config-fixtures.ts +86 -0
- package/src/talos/machine-config-poll.test.ts +57 -0
- package/src/talos/machine-config-poll.ts +82 -0
- package/src/talos/machine-config-read.ts +118 -0
- package/src/talos/resource.ts +19 -0
- package/src/talos/secrets-gate.test.ts +63 -0
- package/src/talos/talos-bootstrap-etcd.ts +71 -0
- package/src/talos/talos-bootstrap.test.ts +218 -0
- package/src/talos/talos-bootstrap.ts +151 -45
- package/src/talos/talos-cluster-health.test.ts +143 -0
- package/src/talos/talos-cluster-health.ts +91 -28
- package/src/talos/talos-errors.ts +85 -0
- package/src/talos/talos-machine-config.test.ts +189 -0
- package/src/talos/talos-machine-config.ts +102 -88
- package/src/talos/talosctl.ts +8 -0
- package/src/talos/values.test.ts +34 -6
- package/src/talos/values.ts +41 -7
- package/src/unifi/acl-rule-drift.ts +57 -0
- package/src/unifi/acl-rule-form.ts +135 -0
- package/src/unifi/acl-rule-ordering-form.ts +79 -0
- package/src/unifi/acl-rule-ordering.test.ts +141 -0
- package/src/unifi/acl-rule-ordering.ts +70 -0
- package/src/unifi/acl-rule.test.ts +183 -0
- package/src/unifi/acl-rule.ts +61 -0
- package/src/unifi/discriminated-filter-decode.test.ts +134 -0
- package/src/unifi/dns-policy-drift.ts +48 -0
- package/src/unifi/dns-policy-form.ts +142 -0
- package/src/unifi/dns-policy.test.ts +154 -0
- package/src/unifi/dns-policy.ts +67 -0
- package/src/unifi/firewall-policy-drift.test.ts +151 -0
- package/src/unifi/firewall-policy-drift.ts +55 -0
- package/src/unifi/firewall-policy-filter-roundtrip.test.ts +143 -0
- package/src/unifi/firewall-policy-form.ts +146 -0
- package/src/unifi/firewall-policy-ordering-form.ts +111 -0
- package/src/unifi/firewall-policy-ordering.test.ts +185 -0
- package/src/unifi/firewall-policy-ordering.ts +87 -0
- package/src/unifi/firewall-policy.test.ts +183 -0
- package/src/unifi/firewall-policy.ts +73 -0
- package/src/unifi/index.ts +63 -0
- package/src/unifi/paginate.test.ts +24 -0
- package/src/unifi/paginate.ts +15 -3
- package/src/unifi/providers.ts +19 -1
- package/src/unifi/scan-source.ts +64 -0
- package/src/unifi/traffic-matching-list-drift.ts +40 -0
- package/src/unifi/traffic-matching-list-form.ts +77 -0
- package/src/unifi/traffic-matching-list.test.ts +202 -0
- package/src/unifi/traffic-matching-list.ts +78 -0
- package/src/unifi/wifi-broadcast-details-call.test.ts +92 -0
- package/src/unifi/wifi-broadcast-drift.ts +69 -0
- package/src/unifi/wifi-broadcast-form.ts +211 -0
- package/src/unifi/wifi-broadcast-secrets.test.ts +145 -0
- package/src/unifi/wifi-broadcast.test.ts +155 -0
- package/src/unifi/wifi-broadcast.ts +90 -0
- package/src/unifi/write-op-reference.test.ts +8 -54
package/dist/unifi/index.js
CHANGED
|
@@ -245,26 +245,611 @@ var spec2 = {
|
|
|
245
245
|
};
|
|
246
246
|
var handlers2 = unifiHandlers(spec2);
|
|
247
247
|
var UnifiFirewallZoneProvider = () => Provider2.effect(UnifiFirewallZone, Effect4.succeed(UnifiFirewallZone.Provider.of(handlers2)));
|
|
248
|
+
// src/unifi/dns-policy.ts
|
|
249
|
+
import { Resource as Resource3 } from "alchemy";
|
|
250
|
+
import { adopt as adopt3 } from "alchemy/AdoptPolicy";
|
|
251
|
+
import * as Provider3 from "alchemy/Provider";
|
|
252
|
+
import * as dnsPolicies from "@distilled.cloud/unifi-network/dns_policies";
|
|
253
|
+
import * as Effect5 from "effect/Effect";
|
|
254
|
+
|
|
255
|
+
// src/unifi/dns-policy-form.ts
|
|
256
|
+
var attributesOf3 = (live, props) => ({
|
|
257
|
+
siteId: props.siteId,
|
|
258
|
+
dnsPolicyId: live.id,
|
|
259
|
+
enabled: live.enabled,
|
|
260
|
+
type: live.type,
|
|
261
|
+
domain: live.domain,
|
|
262
|
+
ipv6Address: live.ipv6Address,
|
|
263
|
+
ttlSeconds: live.ttlSeconds,
|
|
264
|
+
ipv4Address: live.ipv4Address,
|
|
265
|
+
targetDomain: live.targetDomain,
|
|
266
|
+
ipAddress: live.ipAddress,
|
|
267
|
+
mailServerDomain: live.mailServerDomain,
|
|
268
|
+
priority: live.priority,
|
|
269
|
+
port: live.port,
|
|
270
|
+
protocol: live.protocol,
|
|
271
|
+
serverDomain: live.serverDomain,
|
|
272
|
+
service: live.service,
|
|
273
|
+
weight: live.weight,
|
|
274
|
+
text: live.text,
|
|
275
|
+
metadataOrigin: live.metadata.origin
|
|
276
|
+
});
|
|
277
|
+
var declareDnsPolicy = (live, siteId) => ({
|
|
278
|
+
siteId,
|
|
279
|
+
dnsPolicyId: live.id,
|
|
280
|
+
enabled: live.enabled,
|
|
281
|
+
type: live.type,
|
|
282
|
+
domain: live.domain,
|
|
283
|
+
ipv6Address: live.ipv6Address,
|
|
284
|
+
ttlSeconds: live.ttlSeconds,
|
|
285
|
+
ipv4Address: live.ipv4Address,
|
|
286
|
+
targetDomain: live.targetDomain,
|
|
287
|
+
ipAddress: live.ipAddress,
|
|
288
|
+
mailServerDomain: live.mailServerDomain,
|
|
289
|
+
priority: live.priority,
|
|
290
|
+
port: live.port,
|
|
291
|
+
protocol: live.protocol,
|
|
292
|
+
serverDomain: live.serverDomain,
|
|
293
|
+
service: live.service,
|
|
294
|
+
weight: live.weight,
|
|
295
|
+
text: live.text
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// src/unifi/dns-policy-drift.ts
|
|
299
|
+
var fieldDrift3 = makeDriftOf([
|
|
300
|
+
{ field: "enabled", live: (a) => a.enabled, declared: (p) => p.enabled },
|
|
301
|
+
{ field: "type", live: (a) => a.type, declared: (p) => p.type },
|
|
302
|
+
{ field: "domain", live: (a) => a.domain, declared: (p) => p.domain },
|
|
303
|
+
{ field: "ipv6Address", live: (a) => a.ipv6Address, declared: (p) => p.ipv6Address },
|
|
304
|
+
{ field: "ttlSeconds", live: (a) => a.ttlSeconds, declared: (p) => p.ttlSeconds },
|
|
305
|
+
{ field: "ipv4Address", live: (a) => a.ipv4Address, declared: (p) => p.ipv4Address },
|
|
306
|
+
{ field: "targetDomain", live: (a) => a.targetDomain, declared: (p) => p.targetDomain },
|
|
307
|
+
{ field: "ipAddress", live: (a) => a.ipAddress, declared: (p) => p.ipAddress },
|
|
308
|
+
{
|
|
309
|
+
field: "mailServerDomain",
|
|
310
|
+
live: (a) => a.mailServerDomain,
|
|
311
|
+
declared: (p) => p.mailServerDomain
|
|
312
|
+
},
|
|
313
|
+
{ field: "priority", live: (a) => a.priority, declared: (p) => p.priority },
|
|
314
|
+
{ field: "port", live: (a) => a.port, declared: (p) => p.port },
|
|
315
|
+
{ field: "protocol", live: (a) => a.protocol, declared: (p) => p.protocol },
|
|
316
|
+
{ field: "serverDomain", live: (a) => a.serverDomain, declared: (p) => p.serverDomain },
|
|
317
|
+
{ field: "service", live: (a) => a.service, declared: (p) => p.service },
|
|
318
|
+
{ field: "weight", live: (a) => a.weight, declared: (p) => p.weight },
|
|
319
|
+
{ field: "text", live: (a) => a.text, declared: (p) => p.text }
|
|
320
|
+
]);
|
|
321
|
+
var matches3 = (attributes, props) => fieldDrift3(attributes, props).length === 0;
|
|
322
|
+
var driftOf3 = (live, props) => fieldDrift3(attributesOf3(live, props), props);
|
|
323
|
+
|
|
324
|
+
// src/unifi/dns-policy.ts
|
|
325
|
+
var UnifiDnsPolicy = Resource3("Unifi.DnsPolicy", {
|
|
326
|
+
defaultRemovalPolicy: "retain"
|
|
327
|
+
});
|
|
328
|
+
var dnsPolicy = (id, props) => UnifiDnsPolicy(id, props).pipe(adopt3(true));
|
|
329
|
+
var spec3 = {
|
|
330
|
+
type: "Unifi.DnsPolicy",
|
|
331
|
+
describe: (props) => `sites/${props.siteId}/dns/policies/${props.dnsPolicyId}`,
|
|
332
|
+
fetchLive: (props) => dnsPolicies.getDnsPolicy({ siteId: props.siteId, dnsPolicyId: props.dnsPolicyId }).pipe(Effect5.catchTag("NotFound", () => Effect5.succeed(undefined))),
|
|
333
|
+
attributes: attributesOf3,
|
|
334
|
+
matches: matches3
|
|
335
|
+
};
|
|
336
|
+
var handlers3 = unifiHandlers(spec3);
|
|
337
|
+
var UnifiDnsPolicyProvider = () => Provider3.effect(UnifiDnsPolicy, Effect5.succeed(UnifiDnsPolicy.Provider.of(handlers3)));
|
|
338
|
+
// src/unifi/acl-rule.ts
|
|
339
|
+
import { Resource as Resource4 } from "alchemy";
|
|
340
|
+
import { adopt as adopt4 } from "alchemy/AdoptPolicy";
|
|
341
|
+
import * as Provider4 from "alchemy/Provider";
|
|
342
|
+
import * as aclRules from "@distilled.cloud/unifi-network/access_control_acl_rules";
|
|
343
|
+
import * as Effect6 from "effect/Effect";
|
|
344
|
+
|
|
345
|
+
// src/unifi/acl-rule-form.ts
|
|
346
|
+
var sortedSet3 = (values) => [...new Set(values)].sort();
|
|
347
|
+
var normalizeDeviceFilter = (value) => value == null ? value : {
|
|
348
|
+
...value,
|
|
349
|
+
...value.deviceIds !== undefined ? { deviceIds: sortedSet3(value.deviceIds) } : {}
|
|
350
|
+
};
|
|
351
|
+
var normalizeProtocolFilter = (value) => value == null ? undefined : sortedSet3(value);
|
|
352
|
+
var attributesOf4 = (live, props) => ({
|
|
353
|
+
siteId: props.siteId,
|
|
354
|
+
aclRuleId: live.id,
|
|
355
|
+
action: live.action,
|
|
356
|
+
description: live.description,
|
|
357
|
+
destinationFilter: live.destinationFilter,
|
|
358
|
+
enabled: live.enabled,
|
|
359
|
+
enforcingDeviceFilter: normalizeDeviceFilter(live.enforcingDeviceFilter),
|
|
360
|
+
index: live.index,
|
|
361
|
+
name: live.name,
|
|
362
|
+
sourceFilter: live.sourceFilter,
|
|
363
|
+
type: live.type,
|
|
364
|
+
protocolFilter: normalizeProtocolFilter(live.protocolFilter),
|
|
365
|
+
networkIdFilter: live.networkIdFilter,
|
|
366
|
+
metadataOrigin: live.metadata.origin
|
|
367
|
+
});
|
|
368
|
+
var declareAclRule = (live, siteId) => ({
|
|
369
|
+
siteId,
|
|
370
|
+
aclRuleId: live.id,
|
|
371
|
+
action: live.action,
|
|
372
|
+
description: live.description,
|
|
373
|
+
destinationFilter: live.destinationFilter,
|
|
374
|
+
enabled: live.enabled,
|
|
375
|
+
enforcingDeviceFilter: normalizeDeviceFilter(live.enforcingDeviceFilter),
|
|
376
|
+
name: live.name,
|
|
377
|
+
sourceFilter: live.sourceFilter,
|
|
378
|
+
type: live.type,
|
|
379
|
+
protocolFilter: normalizeProtocolFilter(live.protocolFilter),
|
|
380
|
+
networkIdFilter: live.networkIdFilter
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// src/unifi/acl-rule-drift.ts
|
|
384
|
+
var fieldDrift4 = makeDriftOf([
|
|
385
|
+
{ field: "action", live: (a) => a.action, declared: (p) => p.action },
|
|
386
|
+
{ field: "description", live: (a) => a.description, declared: (p) => p.description },
|
|
387
|
+
{
|
|
388
|
+
field: "destinationFilter",
|
|
389
|
+
live: (a) => a.destinationFilter,
|
|
390
|
+
declared: (p) => p.destinationFilter
|
|
391
|
+
},
|
|
392
|
+
{ field: "enabled", live: (a) => a.enabled, declared: (p) => p.enabled },
|
|
393
|
+
{
|
|
394
|
+
field: "enforcingDeviceFilter",
|
|
395
|
+
live: (a) => normalizeDeviceFilter(a.enforcingDeviceFilter),
|
|
396
|
+
declared: (p) => normalizeDeviceFilter(p.enforcingDeviceFilter)
|
|
397
|
+
},
|
|
398
|
+
{ field: "name", live: (a) => a.name, declared: (p) => p.name },
|
|
399
|
+
{ field: "sourceFilter", live: (a) => a.sourceFilter, declared: (p) => p.sourceFilter },
|
|
400
|
+
{ field: "type", live: (a) => a.type, declared: (p) => p.type },
|
|
401
|
+
{
|
|
402
|
+
field: "protocolFilter",
|
|
403
|
+
live: (a) => normalizeProtocolFilter(a.protocolFilter),
|
|
404
|
+
declared: (p) => normalizeProtocolFilter(p.protocolFilter)
|
|
405
|
+
},
|
|
406
|
+
{ field: "networkIdFilter", live: (a) => a.networkIdFilter, declared: (p) => p.networkIdFilter }
|
|
407
|
+
]);
|
|
408
|
+
var matches4 = (attributes, props) => fieldDrift4(attributes, props).length === 0;
|
|
409
|
+
var driftOf4 = (live, props) => fieldDrift4(attributesOf4(live, props), props);
|
|
410
|
+
|
|
411
|
+
// src/unifi/acl-rule.ts
|
|
412
|
+
var UnifiAclRule = Resource4("Unifi.AclRule", {
|
|
413
|
+
defaultRemovalPolicy: "retain"
|
|
414
|
+
});
|
|
415
|
+
var aclRule = (id, props) => UnifiAclRule(id, props).pipe(adopt4(true));
|
|
416
|
+
var spec4 = {
|
|
417
|
+
type: "Unifi.AclRule",
|
|
418
|
+
describe: (props) => `sites/${props.siteId}/acl-rules/${props.aclRuleId}`,
|
|
419
|
+
fetchLive: (props) => aclRules.getAclRule({ siteId: props.siteId, aclRuleId: props.aclRuleId }).pipe(Effect6.catchTag("NotFound", () => Effect6.succeed(undefined))),
|
|
420
|
+
attributes: attributesOf4,
|
|
421
|
+
matches: matches4
|
|
422
|
+
};
|
|
423
|
+
var handlers4 = unifiHandlers(spec4);
|
|
424
|
+
var UnifiAclRuleProvider = () => Provider4.effect(UnifiAclRule, Effect6.succeed(UnifiAclRule.Provider.of(handlers4)));
|
|
425
|
+
// src/unifi/acl-rule-ordering.ts
|
|
426
|
+
import { Resource as Resource5 } from "alchemy";
|
|
427
|
+
import { adopt as adopt5 } from "alchemy/AdoptPolicy";
|
|
428
|
+
import * as Provider5 from "alchemy/Provider";
|
|
429
|
+
import * as aclRules2 from "@distilled.cloud/unifi-network/access_control_acl_rules";
|
|
430
|
+
import * as Effect7 from "effect/Effect";
|
|
431
|
+
|
|
432
|
+
// src/unifi/acl-rule-ordering-form.ts
|
|
433
|
+
var attributesOf5 = (live, props) => ({
|
|
434
|
+
siteId: props.siteId,
|
|
435
|
+
orderedAclRuleIds: live.orderedAclRuleIds
|
|
436
|
+
});
|
|
437
|
+
var declareAclRuleOrdering = (live, siteId) => ({
|
|
438
|
+
siteId,
|
|
439
|
+
orderedAclRuleIds: live.orderedAclRuleIds
|
|
440
|
+
});
|
|
441
|
+
var fieldDrift5 = makeDriftOf([
|
|
442
|
+
{
|
|
443
|
+
field: "orderedAclRuleIds",
|
|
444
|
+
live: (a) => a.orderedAclRuleIds,
|
|
445
|
+
declared: (p) => p.orderedAclRuleIds
|
|
446
|
+
}
|
|
447
|
+
]);
|
|
448
|
+
var matches5 = (attributes, props) => fieldDrift5(attributes, props).length === 0;
|
|
449
|
+
var driftOf5 = (live, props) => fieldDrift5(attributesOf5(live, props), props);
|
|
450
|
+
|
|
451
|
+
// src/unifi/acl-rule-ordering.ts
|
|
452
|
+
var UnifiAclRuleOrdering = Resource5("Unifi.AclRuleOrdering", {
|
|
453
|
+
defaultRemovalPolicy: "retain"
|
|
454
|
+
});
|
|
455
|
+
var aclRuleOrdering = (id, props) => UnifiAclRuleOrdering(id, props).pipe(adopt5(true));
|
|
456
|
+
var spec5 = {
|
|
457
|
+
type: "Unifi.AclRuleOrdering",
|
|
458
|
+
describe: (props) => `sites/${props.siteId}/acl-rules/ordering`,
|
|
459
|
+
fetchLive: (props) => aclRules2.getAclRuleOrdering({ siteId: props.siteId }).pipe(Effect7.catchTag("NotFound", () => Effect7.succeed(undefined))),
|
|
460
|
+
attributes: attributesOf5,
|
|
461
|
+
matches: matches5
|
|
462
|
+
};
|
|
463
|
+
var handlers5 = unifiHandlers(spec5);
|
|
464
|
+
var UnifiAclRuleOrderingProvider = () => Provider5.effect(UnifiAclRuleOrdering, Effect7.succeed(UnifiAclRuleOrdering.Provider.of(handlers5)));
|
|
465
|
+
// src/unifi/wifi-broadcast.ts
|
|
466
|
+
import { Resource as Resource6 } from "alchemy";
|
|
467
|
+
import { adopt as adopt6 } from "alchemy/AdoptPolicy";
|
|
468
|
+
import * as Provider6 from "alchemy/Provider";
|
|
469
|
+
import * as wifiBroadcasts from "@distilled.cloud/unifi-network/wifi_broadcasts";
|
|
470
|
+
import * as Effect9 from "effect/Effect";
|
|
471
|
+
|
|
472
|
+
// src/unifi/wifi-broadcast-form.ts
|
|
473
|
+
var sortedStrings = (values) => [...new Set(values)].sort();
|
|
474
|
+
var sortedFrequencies = (values) => [...new Set(values)].sort((a, b) => a - b);
|
|
475
|
+
var refKey = (ref) => `${ref.type}:${ref.networkId ?? ""}`;
|
|
476
|
+
var normalizeRef = (ref) => ref === undefined ? undefined : { type: ref.type, ...ref.networkId !== undefined ? { networkId: ref.networkId } : {} };
|
|
477
|
+
var sortedRefs = (values) => {
|
|
478
|
+
const byKey = new Map(values.map((ref) => [refKey(ref), normalizeRef(ref)]));
|
|
479
|
+
return [...byKey.values()].sort((a, b) => refKey(a).localeCompare(refKey(b)));
|
|
480
|
+
};
|
|
481
|
+
var normalizeHotspot = (value) => value === undefined ? undefined : { type: value.type };
|
|
482
|
+
var normalizeDeviceFilter2 = (value) => value == null ? value : {
|
|
483
|
+
type: value.type,
|
|
484
|
+
...value.deviceIds !== undefined ? { deviceIds: sortedStrings(value.deviceIds) } : {},
|
|
485
|
+
...value.deviceTagIds !== undefined ? { deviceTagIds: sortedStrings(value.deviceTagIds) } : {}
|
|
486
|
+
};
|
|
487
|
+
var normalizeFrequencies = (value) => value === undefined ? value : sortedFrequencies(value);
|
|
488
|
+
var normalizeSecurityConfiguration = (value) => ({
|
|
489
|
+
type: value.type,
|
|
490
|
+
...value.presharedKeyNetworkIds !== undefined ? { presharedKeyNetworkIds: sortedRefs(value.presharedKeyNetworkIds) } : {}
|
|
491
|
+
});
|
|
492
|
+
var attributesOf6 = (live, props) => ({
|
|
493
|
+
siteId: props.siteId,
|
|
494
|
+
wifiBroadcastId: live.id,
|
|
495
|
+
name: live.name,
|
|
496
|
+
enabled: live.enabled,
|
|
497
|
+
type: live.type,
|
|
498
|
+
network: normalizeRef(live.network),
|
|
499
|
+
broadcastingDeviceFilter: normalizeDeviceFilter2(live.broadcastingDeviceFilter),
|
|
500
|
+
broadcastingFrequenciesGHz: normalizeFrequencies(live.broadcastingFrequenciesGHz),
|
|
501
|
+
hotspotConfiguration: normalizeHotspot(live.hotspotConfiguration),
|
|
502
|
+
securityConfiguration: normalizeSecurityConfiguration(live.securityConfiguration),
|
|
503
|
+
metadataOrigin: live.metadata.origin
|
|
504
|
+
});
|
|
505
|
+
var declareWifiBroadcast = (live, siteId) => ({
|
|
506
|
+
siteId,
|
|
507
|
+
wifiBroadcastId: live.id,
|
|
508
|
+
name: live.name,
|
|
509
|
+
enabled: live.enabled,
|
|
510
|
+
type: live.type,
|
|
511
|
+
network: normalizeRef(live.network),
|
|
512
|
+
broadcastingDeviceFilter: normalizeDeviceFilter2(live.broadcastingDeviceFilter),
|
|
513
|
+
broadcastingFrequenciesGHz: normalizeFrequencies(live.broadcastingFrequenciesGHz),
|
|
514
|
+
hotspotConfiguration: normalizeHotspot(live.hotspotConfiguration),
|
|
515
|
+
securityConfiguration: normalizeSecurityConfiguration(live.securityConfiguration)
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
// src/unifi/wifi-broadcast-drift.ts
|
|
519
|
+
var fieldDrift6 = makeDriftOf([
|
|
520
|
+
{ field: "name", live: (a) => a.name, declared: (p) => p.name },
|
|
521
|
+
{ field: "enabled", live: (a) => a.enabled, declared: (p) => p.enabled },
|
|
522
|
+
{ field: "type", live: (a) => a.type, declared: (p) => p.type },
|
|
523
|
+
{
|
|
524
|
+
field: "network",
|
|
525
|
+
live: (a) => a.network,
|
|
526
|
+
declared: (p) => normalizeRef(p.network)
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
field: "broadcastingDeviceFilter",
|
|
530
|
+
live: (a) => a.broadcastingDeviceFilter,
|
|
531
|
+
declared: (p) => normalizeDeviceFilter2(p.broadcastingDeviceFilter)
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
field: "broadcastingFrequenciesGHz",
|
|
535
|
+
live: (a) => a.broadcastingFrequenciesGHz,
|
|
536
|
+
declared: (p) => normalizeFrequencies(p.broadcastingFrequenciesGHz)
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
field: "hotspotConfiguration",
|
|
540
|
+
live: (a) => a.hotspotConfiguration,
|
|
541
|
+
declared: (p) => normalizeHotspot(p.hotspotConfiguration)
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
field: "securityConfiguration",
|
|
545
|
+
live: (a) => a.securityConfiguration,
|
|
546
|
+
declared: (p) => normalizeSecurityConfiguration(p.securityConfiguration)
|
|
547
|
+
}
|
|
548
|
+
]);
|
|
549
|
+
var matches6 = (attributes, props) => fieldDrift6(attributes, props).length === 0;
|
|
550
|
+
var driftOf6 = (live, props) => fieldDrift6(attributesOf6(live, props), props);
|
|
551
|
+
|
|
552
|
+
// src/unifi/paginate.ts
|
|
553
|
+
import * as Data2 from "effect/Data";
|
|
554
|
+
import * as Effect8 from "effect/Effect";
|
|
555
|
+
var MAX_PAGES = 1000;
|
|
556
|
+
|
|
557
|
+
class UnifiPaginationInconsistent extends Data2.TaggedError("UnifiPaginationInconsistent") {
|
|
558
|
+
get message() {
|
|
559
|
+
return `UniFi pager: ${this.reason} -- ${this.detail}. The paged response contradicted itself (or ` + "the walk ran implausibly long); the rows collected so far cannot be trusted and are not returned.";
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
var numOrPlaceholder = (value) => typeof value === "number" && Number.isFinite(value) ? String(value) : "<non-numeric>";
|
|
563
|
+
var pageAll = (fetchPage, request) => Effect8.gen(function* () {
|
|
564
|
+
const rows = [];
|
|
565
|
+
const startOffset = request.offset ?? 0;
|
|
566
|
+
let offset = startOffset;
|
|
567
|
+
let totalCount;
|
|
568
|
+
for (let pageCount = 1;; pageCount++) {
|
|
569
|
+
if (pageCount > MAX_PAGES) {
|
|
570
|
+
return yield* new UnifiPaginationInconsistent({
|
|
571
|
+
reason: "page-ceiling",
|
|
572
|
+
detail: `stopped after ${MAX_PAGES} pages at offset ${offset} without reaching totalCount`
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
const page = yield* fetchPage({ ...request, offset });
|
|
576
|
+
if (page.offset !== offset) {
|
|
577
|
+
return yield* new UnifiPaginationInconsistent({
|
|
578
|
+
reason: "offset-mismatch",
|
|
579
|
+
detail: `requested offset ${offset}, page echoed ${numOrPlaceholder(page.offset)} -- rows may be duplicated or skipped`
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
if (totalCount !== undefined && page.totalCount !== totalCount) {
|
|
583
|
+
return yield* new UnifiPaginationInconsistent({
|
|
584
|
+
reason: "total-count-changed",
|
|
585
|
+
detail: `totalCount changed from ${numOrPlaceholder(totalCount)} to ${numOrPlaceholder(page.totalCount)} between page calls`
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
totalCount = page.totalCount;
|
|
589
|
+
rows.push(...page.data);
|
|
590
|
+
if (page.data.length === 0)
|
|
591
|
+
break;
|
|
592
|
+
offset += page.data.length;
|
|
593
|
+
if (offset >= totalCount)
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
const expected = totalCount - startOffset;
|
|
597
|
+
if (rows.length !== expected) {
|
|
598
|
+
return yield* new UnifiPaginationInconsistent({
|
|
599
|
+
reason: "row-count-mismatch",
|
|
600
|
+
detail: `collected ${rows.length} rows but totalCount(${numOrPlaceholder(totalCount)}) - startOffset(${startOffset}) = ${numOrPlaceholder(expected)}`
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
return rows;
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
// src/unifi/wifi-broadcast.ts
|
|
607
|
+
var UnifiWifiBroadcast = Resource6("Unifi.WifiBroadcast", {
|
|
608
|
+
defaultRemovalPolicy: "retain"
|
|
609
|
+
});
|
|
610
|
+
var wifiBroadcast = (id, props) => UnifiWifiBroadcast(id, props).pipe(adopt6(true));
|
|
611
|
+
var spec6 = {
|
|
612
|
+
type: "Unifi.WifiBroadcast",
|
|
613
|
+
describe: (props) => `sites/${props.siteId}/wifi/broadcasts/${props.wifiBroadcastId}`,
|
|
614
|
+
fetchLive: (props) => pageAll(wifiBroadcasts.getWifiBroadcastPage, { siteId: props.siteId }).pipe(Effect9.catchTag("NotFound", () => Effect9.succeed(undefined)), Effect9.map((rows) => rows?.find((row) => row.id === props.wifiBroadcastId))),
|
|
615
|
+
attributes: attributesOf6,
|
|
616
|
+
matches: matches6
|
|
617
|
+
};
|
|
618
|
+
var handlers6 = unifiHandlers(spec6);
|
|
619
|
+
var UnifiWifiBroadcastProvider = () => Provider6.effect(UnifiWifiBroadcast, Effect9.succeed(UnifiWifiBroadcast.Provider.of(handlers6)));
|
|
620
|
+
// src/unifi/firewall-policy.ts
|
|
621
|
+
import { Resource as Resource7 } from "alchemy";
|
|
622
|
+
import { adopt as adopt7 } from "alchemy/AdoptPolicy";
|
|
623
|
+
import * as Provider7 from "alchemy/Provider";
|
|
624
|
+
import * as firewall2 from "@distilled.cloud/unifi-network/firewall";
|
|
625
|
+
import * as Effect10 from "effect/Effect";
|
|
626
|
+
|
|
627
|
+
// src/unifi/firewall-policy-form.ts
|
|
628
|
+
var sortedSet4 = (values) => [...new Set(values)].sort();
|
|
629
|
+
var normalizeConnectionStateFilter = (value) => value == null ? undefined : sortedSet4(value);
|
|
630
|
+
var attributesOf7 = (live, props) => ({
|
|
631
|
+
siteId: props.siteId,
|
|
632
|
+
firewallPolicyId: live.id,
|
|
633
|
+
action: live.action,
|
|
634
|
+
connectionStateFilter: normalizeConnectionStateFilter(live.connectionStateFilter),
|
|
635
|
+
description: live.description,
|
|
636
|
+
destination: live.destination,
|
|
637
|
+
enabled: live.enabled,
|
|
638
|
+
index: live.index,
|
|
639
|
+
ipProtocolScope: live.ipProtocolScope,
|
|
640
|
+
ipsecFilter: live.ipsecFilter,
|
|
641
|
+
loggingEnabled: live.loggingEnabled,
|
|
642
|
+
name: live.name,
|
|
643
|
+
schedule: live.schedule,
|
|
644
|
+
source: live.source,
|
|
645
|
+
metadataOrigin: live.metadata.origin
|
|
646
|
+
});
|
|
647
|
+
var declareFirewallPolicy = (live, siteId) => ({
|
|
648
|
+
siteId,
|
|
649
|
+
firewallPolicyId: live.id,
|
|
650
|
+
action: live.action,
|
|
651
|
+
connectionStateFilter: normalizeConnectionStateFilter(live.connectionStateFilter),
|
|
652
|
+
description: live.description,
|
|
653
|
+
destination: live.destination,
|
|
654
|
+
enabled: live.enabled,
|
|
655
|
+
ipProtocolScope: live.ipProtocolScope,
|
|
656
|
+
ipsecFilter: live.ipsecFilter,
|
|
657
|
+
loggingEnabled: live.loggingEnabled,
|
|
658
|
+
name: live.name,
|
|
659
|
+
schedule: live.schedule,
|
|
660
|
+
source: live.source
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
// src/unifi/firewall-policy-drift.ts
|
|
664
|
+
var fieldDrift7 = makeDriftOf([
|
|
665
|
+
{ field: "action", live: (a) => a.action, declared: (p) => p.action },
|
|
666
|
+
{
|
|
667
|
+
field: "connectionStateFilter",
|
|
668
|
+
live: (a) => normalizeConnectionStateFilter(a.connectionStateFilter),
|
|
669
|
+
declared: (p) => normalizeConnectionStateFilter(p.connectionStateFilter)
|
|
670
|
+
},
|
|
671
|
+
{ field: "description", live: (a) => a.description, declared: (p) => p.description },
|
|
672
|
+
{ field: "destination", live: (a) => a.destination, declared: (p) => p.destination },
|
|
673
|
+
{ field: "enabled", live: (a) => a.enabled, declared: (p) => p.enabled },
|
|
674
|
+
{ field: "ipProtocolScope", live: (a) => a.ipProtocolScope, declared: (p) => p.ipProtocolScope },
|
|
675
|
+
{ field: "ipsecFilter", live: (a) => a.ipsecFilter, declared: (p) => p.ipsecFilter },
|
|
676
|
+
{ field: "loggingEnabled", live: (a) => a.loggingEnabled, declared: (p) => p.loggingEnabled },
|
|
677
|
+
{ field: "name", live: (a) => a.name, declared: (p) => p.name },
|
|
678
|
+
{ field: "schedule", live: (a) => a.schedule, declared: (p) => p.schedule },
|
|
679
|
+
{ field: "source", live: (a) => a.source, declared: (p) => p.source }
|
|
680
|
+
]);
|
|
681
|
+
var matches7 = (attributes, props) => fieldDrift7(attributes, props).length === 0;
|
|
682
|
+
var driftOf7 = (live, props) => fieldDrift7(attributesOf7(live, props), props);
|
|
683
|
+
|
|
684
|
+
// src/unifi/firewall-policy.ts
|
|
685
|
+
var UnifiFirewallPolicy = Resource7("Unifi.FirewallPolicy", {
|
|
686
|
+
defaultRemovalPolicy: "retain"
|
|
687
|
+
});
|
|
688
|
+
var firewallPolicy = (id, props) => UnifiFirewallPolicy(id, props).pipe(adopt7(true));
|
|
689
|
+
var spec7 = {
|
|
690
|
+
type: "Unifi.FirewallPolicy",
|
|
691
|
+
describe: (props) => `sites/${props.siteId}/firewall/policies/${props.firewallPolicyId}`,
|
|
692
|
+
fetchLive: (props) => firewall2.getFirewallPolicy({ siteId: props.siteId, firewallPolicyId: props.firewallPolicyId }).pipe(Effect10.catchTag("NotFound", () => Effect10.succeed(undefined))),
|
|
693
|
+
attributes: attributesOf7,
|
|
694
|
+
matches: matches7
|
|
695
|
+
};
|
|
696
|
+
var handlers7 = unifiHandlers(spec7);
|
|
697
|
+
var UnifiFirewallPolicyProvider = () => Provider7.effect(UnifiFirewallPolicy, Effect10.succeed(UnifiFirewallPolicy.Provider.of(handlers7)));
|
|
698
|
+
// src/unifi/firewall-policy-ordering.ts
|
|
699
|
+
import { Resource as Resource8 } from "alchemy";
|
|
700
|
+
import { adopt as adopt8 } from "alchemy/AdoptPolicy";
|
|
701
|
+
import * as Provider8 from "alchemy/Provider";
|
|
702
|
+
import * as firewall3 from "@distilled.cloud/unifi-network/firewall";
|
|
703
|
+
import * as Effect11 from "effect/Effect";
|
|
704
|
+
|
|
705
|
+
// src/unifi/firewall-policy-ordering-form.ts
|
|
706
|
+
var attributesOf8 = (live, props) => ({
|
|
707
|
+
siteId: props.siteId,
|
|
708
|
+
sourceFirewallZoneId: props.sourceFirewallZoneId,
|
|
709
|
+
destinationFirewallZoneId: props.destinationFirewallZoneId,
|
|
710
|
+
beforeSystemDefined: live.orderedFirewallPolicyIds.beforeSystemDefined,
|
|
711
|
+
afterSystemDefined: live.orderedFirewallPolicyIds.afterSystemDefined
|
|
712
|
+
});
|
|
713
|
+
var declareFirewallPolicyOrdering = (live, siteId, sourceFirewallZoneId, destinationFirewallZoneId) => ({
|
|
714
|
+
siteId,
|
|
715
|
+
sourceFirewallZoneId,
|
|
716
|
+
destinationFirewallZoneId,
|
|
717
|
+
beforeSystemDefined: live.orderedFirewallPolicyIds.beforeSystemDefined,
|
|
718
|
+
afterSystemDefined: live.orderedFirewallPolicyIds.afterSystemDefined
|
|
719
|
+
});
|
|
720
|
+
var fieldDrift8 = makeDriftOf([
|
|
721
|
+
{
|
|
722
|
+
field: "beforeSystemDefined",
|
|
723
|
+
live: (a) => a.beforeSystemDefined,
|
|
724
|
+
declared: (p) => p.beforeSystemDefined
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
field: "afterSystemDefined",
|
|
728
|
+
live: (a) => a.afterSystemDefined,
|
|
729
|
+
declared: (p) => p.afterSystemDefined
|
|
730
|
+
}
|
|
731
|
+
]);
|
|
732
|
+
var matches8 = (attributes, props) => fieldDrift8(attributes, props).length === 0;
|
|
733
|
+
var driftOf8 = (live, props) => fieldDrift8(attributesOf8(live, props), props);
|
|
734
|
+
|
|
735
|
+
// src/unifi/firewall-policy-ordering.ts
|
|
736
|
+
var UnifiFirewallPolicyOrdering = Resource8("Unifi.FirewallPolicyOrdering", { defaultRemovalPolicy: "retain" });
|
|
737
|
+
var firewallPolicyOrdering = (id, props) => UnifiFirewallPolicyOrdering(id, props).pipe(adopt8(true));
|
|
738
|
+
var spec8 = {
|
|
739
|
+
type: "Unifi.FirewallPolicyOrdering",
|
|
740
|
+
describe: (props) => `sites/${props.siteId}/firewall/policies/ordering` + `?sourceFirewallZoneId=${props.sourceFirewallZoneId}` + `&destinationFirewallZoneId=${props.destinationFirewallZoneId}`,
|
|
741
|
+
fetchLive: (props) => firewall3.getFirewallPolicyOrdering({
|
|
742
|
+
siteId: props.siteId,
|
|
743
|
+
sourceFirewallZoneId: props.sourceFirewallZoneId,
|
|
744
|
+
destinationFirewallZoneId: props.destinationFirewallZoneId
|
|
745
|
+
}).pipe(Effect11.catchTag("NotFound", () => Effect11.succeed(undefined))),
|
|
746
|
+
attributes: attributesOf8,
|
|
747
|
+
matches: matches8
|
|
748
|
+
};
|
|
749
|
+
var handlers8 = unifiHandlers(spec8);
|
|
750
|
+
var UnifiFirewallPolicyOrderingProvider = () => Provider8.effect(UnifiFirewallPolicyOrdering, Effect11.succeed(UnifiFirewallPolicyOrdering.Provider.of(handlers8)));
|
|
751
|
+
// src/unifi/traffic-matching-list.ts
|
|
752
|
+
import { Resource as Resource9 } from "alchemy";
|
|
753
|
+
import { adopt as adopt9 } from "alchemy/AdoptPolicy";
|
|
754
|
+
import * as Provider9 from "alchemy/Provider";
|
|
755
|
+
import * as trafficMatchingLists from "@distilled.cloud/unifi-network/traffic_matching_lists";
|
|
756
|
+
import * as Effect12 from "effect/Effect";
|
|
757
|
+
|
|
758
|
+
// src/unifi/traffic-matching-list-form.ts
|
|
759
|
+
var attributesOf9 = (live, props) => ({
|
|
760
|
+
siteId: props.siteId,
|
|
761
|
+
trafficMatchingListId: live.id,
|
|
762
|
+
name: live.name,
|
|
763
|
+
type: live.type,
|
|
764
|
+
items: live.items
|
|
765
|
+
});
|
|
766
|
+
var declareTrafficMatchingList = (live, siteId) => ({
|
|
767
|
+
siteId,
|
|
768
|
+
trafficMatchingListId: live.id,
|
|
769
|
+
name: live.name,
|
|
770
|
+
type: live.type,
|
|
771
|
+
items: live.items
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
// src/unifi/traffic-matching-list-drift.ts
|
|
775
|
+
var fieldDrift9 = makeDriftOf([
|
|
776
|
+
{ field: "name", live: (a) => a.name, declared: (p) => p.name },
|
|
777
|
+
{ field: "type", live: (a) => a.type, declared: (p) => p.type },
|
|
778
|
+
{ field: "items", live: (a) => a.items, declared: (p) => p.items }
|
|
779
|
+
]);
|
|
780
|
+
var matches9 = (attributes, props) => fieldDrift9(attributes, props).length === 0;
|
|
781
|
+
var driftOf9 = (live, props) => fieldDrift9(attributesOf9(live, props), props);
|
|
782
|
+
|
|
783
|
+
// src/unifi/traffic-matching-list.ts
|
|
784
|
+
var UnifiTrafficMatchingList = Resource9("Unifi.TrafficMatchingList", { defaultRemovalPolicy: "retain" });
|
|
785
|
+
var trafficMatchingList = (id, props) => UnifiTrafficMatchingList(id, props).pipe(adopt9(true));
|
|
786
|
+
var spec9 = {
|
|
787
|
+
type: "Unifi.TrafficMatchingList",
|
|
788
|
+
describe: (props) => `sites/${props.siteId}/traffic-matching-lists/${props.trafficMatchingListId}`,
|
|
789
|
+
fetchLive: (props) => trafficMatchingLists.getTrafficMatchingList({
|
|
790
|
+
siteId: props.siteId,
|
|
791
|
+
trafficMatchingListId: props.trafficMatchingListId
|
|
792
|
+
}).pipe(Effect12.catchTag("NotFound", () => Effect12.succeed(undefined))),
|
|
793
|
+
attributes: attributesOf9,
|
|
794
|
+
matches: matches9
|
|
795
|
+
};
|
|
796
|
+
var handlers9 = unifiHandlers(spec9);
|
|
797
|
+
var UnifiTrafficMatchingListProvider = () => Provider9.effect(UnifiTrafficMatchingList, Effect12.succeed(UnifiTrafficMatchingList.Provider.of(handlers9)));
|
|
248
798
|
// src/unifi/providers.ts
|
|
249
799
|
import * as Layer from "effect/Layer";
|
|
250
|
-
var providers = () => Layer.mergeAll(UnifiNetworkProvider(), UnifiFirewallZoneProvider());
|
|
800
|
+
var providers = () => Layer.mergeAll(UnifiNetworkProvider(), UnifiFirewallZoneProvider(), UnifiDnsPolicyProvider(), UnifiAclRuleProvider(), UnifiAclRuleOrderingProvider(), UnifiWifiBroadcastProvider(), UnifiFirewallPolicyProvider(), UnifiFirewallPolicyOrderingProvider(), UnifiTrafficMatchingListProvider());
|
|
251
801
|
export {
|
|
252
802
|
GetOnlyHttpClient,
|
|
253
803
|
UNIFI_READ_ONLY_POLICY,
|
|
804
|
+
UnifiAclRule,
|
|
805
|
+
UnifiAclRuleOrdering,
|
|
806
|
+
UnifiAclRuleOrderingProvider,
|
|
807
|
+
UnifiAclRuleProvider,
|
|
808
|
+
UnifiDnsPolicy,
|
|
809
|
+
UnifiDnsPolicyProvider,
|
|
810
|
+
UnifiFirewallPolicy,
|
|
811
|
+
UnifiFirewallPolicyOrdering,
|
|
812
|
+
UnifiFirewallPolicyOrderingProvider,
|
|
813
|
+
UnifiFirewallPolicyProvider,
|
|
254
814
|
UnifiFirewallZone,
|
|
255
815
|
UnifiFirewallZoneProvider,
|
|
256
816
|
UnifiNetwork,
|
|
257
817
|
UnifiNetworkProvider,
|
|
258
818
|
UnifiNonGetRequest,
|
|
819
|
+
UnifiTrafficMatchingList,
|
|
820
|
+
UnifiTrafficMatchingListProvider,
|
|
821
|
+
UnifiWifiBroadcast,
|
|
822
|
+
UnifiWifiBroadcastProvider,
|
|
259
823
|
UnifiWriteRefused,
|
|
824
|
+
aclRule,
|
|
825
|
+
driftOf4 as aclRuleDriftOf,
|
|
826
|
+
aclRuleOrdering,
|
|
827
|
+
driftOf5 as aclRuleOrderingDriftOf,
|
|
828
|
+
declareAclRule,
|
|
829
|
+
declareAclRuleOrdering,
|
|
830
|
+
declareDnsPolicy,
|
|
831
|
+
declareFirewallPolicy,
|
|
832
|
+
declareFirewallPolicyOrdering,
|
|
260
833
|
declareFirewallZone,
|
|
261
834
|
declareNetwork,
|
|
835
|
+
declareTrafficMatchingList,
|
|
836
|
+
declareWifiBroadcast,
|
|
837
|
+
dnsPolicy,
|
|
838
|
+
driftOf3 as dnsPolicyDriftOf,
|
|
839
|
+
firewallPolicy,
|
|
840
|
+
driftOf7 as firewallPolicyDriftOf,
|
|
841
|
+
firewallPolicyOrdering,
|
|
842
|
+
driftOf8 as firewallPolicyOrderingDriftOf,
|
|
262
843
|
firewallZone,
|
|
263
844
|
driftOf2 as firewallZoneDriftOf,
|
|
264
845
|
network,
|
|
265
846
|
driftOf as networkDriftOf,
|
|
266
|
-
providers
|
|
847
|
+
providers,
|
|
848
|
+
trafficMatchingList,
|
|
849
|
+
driftOf9 as trafficMatchingListDriftOf,
|
|
850
|
+
wifiBroadcast,
|
|
851
|
+
driftOf6 as wifiBroadcastDriftOf
|
|
267
852
|
};
|
|
268
853
|
|
|
269
|
-
//# debugId=
|
|
854
|
+
//# debugId=8F60CB2F43A8D0E164756E2164756E21
|
|
270
855
|
//# sourceMappingURL=index.js.map
|