@homeflare/alchemy 0.57.0 → 0.58.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.
@@ -11,7 +11,7 @@
11
11
  "/**\n * The write SCOPE of `Unifi.Network`: the one intended consumer is a single VLAN's\n * `ipv6Configuration`, so everything else a whole-object PUT could reach is refused BEFORE any\n * request, with a typed error that carries field names only.\n *\n * ⛔ SETTABLE ALLOWLIST. A key in `patch.set` is written into the PUT body, so only\n * `ipv6Configuration` may be set: `enabled`, `internetAccessEnabled`, `ipv4Configuration`,\n * `dhcpGuarding` and every other declared key are refused with `UnifiFieldNotSettable` (a touched\n * immutable key gets `UnifiImmutableFieldChanged` first). Widening it is a kit change.\n * ⛔ REMOVABLE ALLOWLIST. A key in `patch.unset` is deleted from the PUT body, and the controller\n * reads an omitted `dhcpGuarding`/`ipv4Configuration`/`ipv6Configuration` as \"off\". Dropping a\n * declaration key therefore must not silently turn a live block off: only `ipv6Configuration`\n * (the block this write path exists for, and the revert target) may be removed. A required key\n * (`name`, `vlanId`, …) removed from a declaration would fail the SDK schema or send a body the\n * controller rejects, so it is refused here with the same error.\n * ⛔ `default: true` IS THE MANAGEMENT LAN. Writing it can cut the admin off the console.\n * ⛔ `zoneId`/`vlanId`/`management`/`deviceId` decide where the network lives and what serves it;\n * a patch (set OR unset) touching one is refused. Non-USER `metadata.origin` is deliberately NOT\n * handled yet: no rule exists for it.\n */\nimport type * as networks from '@distilled.cloud/unifi-network/networks';\nimport * as Effect from 'effect/Effect';\nimport type { NetworkProps } from './network-form.ts';\nimport {\n UnifiFieldNotRemovable,\n UnifiFieldNotSettable,\n UnifiImmutableFieldChanged,\n UnifiManagementNetworkRefused,\n} from './policy.ts';\nimport type { Patch } from './update-reconcile.ts';\n\nexport const SETTABLE_KEYS: ReadonlyArray<keyof NetworkProps> = ['ipv6Configuration'];\nexport const REMOVABLE_KEYS: ReadonlyArray<keyof NetworkProps> = ['ipv6Configuration'];\nexport const IMMUTABLE_KEYS: ReadonlyArray<keyof NetworkProps> = [\n 'zoneId',\n 'vlanId',\n 'management',\n 'deviceId',\n];\n\nexport type ScopeError =\n | UnifiFieldNotRemovable\n | UnifiFieldNotSettable\n | UnifiImmutableFieldChanged\n | UnifiManagementNetworkRefused;\n\nconst isIn = (list: ReadonlyArray<string>) => (key: string) => list.includes(key);\n\nexport const checkNetworkWriteScope = (\n live: networks.NetworkDetails,\n patch: Patch<NetworkProps>,\n props: NetworkProps,\n): Effect.Effect<void, ScopeError> => {\n const type = 'Unifi.Network';\n const identity = `sites/${props.siteId}/networks/${props.networkId}`;\n if (live.default === true) {\n return Effect.fail(new UnifiManagementNetworkRefused({ type, identity }));\n }\n const touched = [...Object.keys(patch.set), ...patch.unset.map(String)];\n const immutable = touched.filter(isIn(IMMUTABLE_KEYS as ReadonlyArray<string>));\n if (immutable.length > 0) {\n return Effect.fail(new UnifiImmutableFieldChanged({ type, identity, fields: immutable }));\n }\n const removable = isIn(REMOVABLE_KEYS as ReadonlyArray<string>);\n const notRemovable = patch.unset.map(String).filter((k) => !removable(k));\n if (notRemovable.length > 0) {\n return Effect.fail(new UnifiFieldNotRemovable({ type, identity, fields: notRemovable }));\n }\n const settable = isIn(SETTABLE_KEYS as ReadonlyArray<string>);\n const notSettable = Object.keys(patch.set).filter((k) => !settable(k));\n if (notSettable.length > 0) {\n return Effect.fail(new UnifiFieldNotSettable({ type, identity, fields: notSettable }));\n }\n return Effect.void;\n};\n",
12
12
  "/**\n * `Unifi.Network`'s one write: `updateNetwork`. THE ONLY FILE UNDER `src/unifi` ALLOWED TO NAME IT\n * (`write-op-reference.test.ts`'s `WRITE_OP_ALLOWLIST` pins that, and still refuses\n * `createNetwork`/`deleteNetwork` here).\n *\n * ⛔ THE WHOLE-OBJECT-PUT TRAP (packages/distilled-unifi-network/README.md). `PUT .../networks/{id}` disables\n * `dhcpGuarding`/`ipv4Configuration`/`ipv6Configuration` outright when the body omits them. So\n * the body is never `props`: it is the RAW live object (as `fetchLive` decoded it) minus the\n * server fields (`SERVER_FIELDS`: `id`/`default`/`metadata`), plus ONLY the patch (HIGH-2). A\n * hand edit on a field\n * the declaration never touched rides through byte-for-byte; `update-reconcile.ts` has already\n * refused any hand edit on a declared field.\n *\n * ★ WHY RAW LIVE, NOT THE ATTRIBUTES VIEW (LOW-6). `attributesOf` normalizes (sorted sets) and\n * drops keys this kit does not model. Unknown keys must survive the round trip or the PUT would\n * silently delete a setting the console added after the SDK was generated (F2). Measured by\n * reading `@distilled.cloud/core` `protocol-http.ts`: `validateResponse` returns the ORIGINAL\n * decoded value and `mapKeys` passes unknown keys through at every level, so top-level and\n * nested unknown keys both survive; `network-update.test.ts` is the alarm if that ever changes.\n *\n * ★ WHY `unset` EXISTS (HIGH-1). Reverting a declaration (dropping `ipv6Configuration`) must plan\n * and execute a real update back to the pre-image. A key in `patch.unset` is DELETED from the\n * body, which is exactly \"absent = off\" for the optional blocks above.\n *\n * ⛔ NO-OP GUARD. If the merged body equals live (ignoring the ids), the PUT would change nothing;\n * `UnifiUpdateWouldBeNoop` refuses so a normalizer gap can never become a re-PUT loop.\n *\n * ⛔ NO RETRY ON THE PUT (red team round 1, reversing the earlier Q7 decision). The SDK's default\n * policy would replay a write whose first attempt may already have landed (a dropped response\n * during a reprovision); a replay then runs against a controller state this reconcile never\n * read. One attempt, and a failure surfaces for the operator. Reads keep the default policy.\n *\n * ⛔ SCOPE FIRST (`network-scope.ts`): the management LAN, immutable fields and non-removable keys\n * are refused before the body is even built, so none of them can reach the wire.\n */\nimport * as networks from '@distilled.cloud/unifi-network/networks';\nimport * as Retry from '@distilled.cloud/unifi-network/Retry';\nimport { deepEqual } from 'alchemy/Diff';\nimport * as Effect from 'effect/Effect';\nimport { type NetworkProps } from './network-form.ts';\nimport { checkNetworkWriteScope } from './network-scope.ts';\nimport { UnifiUpdateWouldBeNoop } from './policy.ts';\nimport type { Patch } from './update-reconcile.ts';\n\nexport const SERVER_FIELDS = ['id', 'default', 'metadata'] as const;\n\n/**\n * The live object minus `SERVER_FIELDS` — ONE list drives the strip. The destructure this\n * replaced hard-coded the same three names a second time, so a key added to the export was\n * silently NOT stripped (and a removed one still was): two lists that could drift apart. Own\n * enumerable string keys only, exactly what object-rest destructure copies; a decoded JSON body\n * has no symbol keys.\n */\nconst withoutServerFields = (live: networks.NetworkDetails): Record<string, unknown> => {\n const server = new Set<string>(SERVER_FIELDS);\n const rest: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(live)) {\n if (!server.has(key)) rest[key] = value;\n }\n return rest;\n};\n\nexport const mergeForUpdate = (\n live: networks.NetworkDetails,\n patch: Patch<NetworkProps>,\n props: NetworkProps,\n): Effect.Effect<networks.UpdateNetworkRequest, UnifiUpdateWouldBeNoop> => {\n // Raw copy minus the server fields: unknown top-level keys stay in `rest` (F2).\n const rest = withoutServerFields(live);\n const body: Record<string, unknown> = { ...rest, ...patch.set };\n for (const key of patch.unset) delete body[key];\n if (deepEqual(body, rest, { stripNullish: true })) {\n return Effect.fail(\n new UnifiUpdateWouldBeNoop({\n type: 'Unifi.Network',\n identity: `sites/${props.siteId}/networks/${props.networkId}`,\n }),\n );\n }\n return Effect.succeed({\n ...body,\n siteId: props.siteId,\n networkId: live.id,\n } as networks.UpdateNetworkRequest);\n};\n\nexport const writeNetwork = (\n live: networks.NetworkDetails,\n patch: Patch<NetworkProps>,\n props: NetworkProps,\n) =>\n checkNetworkWriteScope(live, patch, props).pipe(\n Effect.andThen(mergeForUpdate(live, patch, props)),\n Effect.flatMap((body) => networks.updateNetwork(body).pipe(Retry.none)),\n );\n",
13
13
  "/**\n * One shape for every UniFi Network object — `Unifi.Network`, `Unifi.FirewallZone`, and whatever\n * import adds next. ADOPT-ONLY, except the one `update` a spec may opt into (`Unifi.Network`).\n *\n * ★ MIRRORS `../discord/resource.ts` (S7-S10, H1, H5), NOT `../netbox/resource.ts`. Both are\n * \"marker-less API\" families (S8): UniFi Network objects carry no tag or metadata field this\n * stack could stamp as ownership, so a cold read of a match is `Unowned(attrs)` exactly like\n * `Cloudflare/Snippets/Snippet.ts@v2.0.0-beta.81#read`, the reference implementation S8 and H1\n * both cite. `adopt(true)`, piped on by each resource's convenience constructor (H5), turns\n * that into a silent one-time bind instead of an `OwnedBySomeoneElse` refusal.\n *\n * ⛔ THE POSTURE (`policy.ts`, Tim 2026-09-24, lifted for TWO cases since): there is no `destroy`\n * in this spec at all, ever. `update` exists only when a spec carries an `update` block\n * (`update-reconcile.ts`'s `updateReconcile`, `Unifi.Network` only). `create` exists only when a\n * spec carries a `create` block (`update-reconcile.ts`'s `createReconcile`, `Unifi.FirewallPolicy`\n * only, and only for a row whose declared name passes `create.checkScope`). `reconcile`: an exact\n * match reports with zero writes; otherwise a family with `create` and no prior state (`olds`/\n * `output` both absent) AND an absent live read attempts the create branch; everything else\n * either refuses or runs the three-way PUT. A spec with neither block can only ever refuse or\n * report a match.\n *\n * ⚠️ RECONCILE STILL HAS TO SUCCEED ON AN EXACT-MATCH ADOPTION, NOT JUST REFUSE UNCONDITIONALLY.\n * Measured against `Plan.ts@v2.0.0-beta.81` (`forceUpdateAfterAdoption`, H6): beta.81 forces\n * ONE reconcile call after every cold adoption, whether or not the diff said noop — so a\n * resource whose `reconcile` always failed would break the ordinary \"adopt an unchanged\n * object\" deploy, not just a real write. The fix, exactly like `discordOperations.reconcile`:\n * read the live object again and return it on a match. S10's \"zero write calls when there is\n * no drift\" holds even under the forced post-adoption call.\n *\n * ⚠️ `NotFound` IS FOLDED TO \"ABSENT\" INSIDE EACH RESOURCE FILE'S OWN `fetchLive`, NOT HERE —\n * same split netbox's `resource.ts` uses and for the same reason: `Effect.catchTag`'s\n * tag-literal inference needs a concrete error union to resolve `\"NotFound\"` against, and a\n * spec's `E` is only concrete at each resource file's own call site. Every OTHER failure (a\n * real 5xx, a network error, `Forbidden`) is NOT folded anywhere — it fails the plan loudly,\n * per the task's own rule: only a genuine not-found may mean absent.\n *\n * ★ The wire guard (`wire-guard.ts`) and the three-way reconcile (`update-reconcile.ts`) live in\n * their own files; `read`/`diff`/`delete` run under `GetOnlyHttpClient`, only `reconcile` gets\n * the per-row allow entry of a spec that declares `update`.\n */\nimport { Unowned } from 'alchemy/AdoptPolicy';\nimport { isResolved } from 'alchemy/Diff';\nimport type { Input } from 'alchemy/Input';\nimport { Credentials, CredentialsFromEnv } from '@distilled.cloud/unifi-network/Credentials';\nimport type { UnifiNetworkOpContext } from '@distilled.cloud/unifi-network/Protocol';\nimport * as Effect from 'effect/Effect';\nimport type * as HttpClient from 'effect/http/HttpClient';\nimport { refuseWrite } from './policy.ts';\nimport {\n type ReconcileArgs,\n type UnifiCreate,\n type UnifiUpdate,\n createReconcile,\n updateReconcile,\n} from './update-reconcile.ts';\nimport { type AllowedWrite, guardedHttpClient } from './wire-guard.ts';\n\n/** What every handler needs from the caller's runtime once `CredentialsFromEnv` is baked in. */\nexport type UnifiRequirements = HttpClient.HttpClient;\n\n/**\n * One UniFi Network object's read. `Live` is whatever the SDK decodes (a `NetworkDetails`, a\n * `FirewallZone`, …); `E` is left to each resource file to declare (its own `fetchLive`'s error\n * union, with `NotFound` already folded away) so the precise per-operation error union flows\n * through instead of being widened by hand here. `E2` is the error union of the optional write.\n */\nexport type UnifiSpec<\n Props extends object,\n Live,\n Attributes extends object,\n E,\n E2 = never,\n E3 = never,\n> = {\n /** The vendor type string, e.g. `Unifi.Network` — for the refusal message only. */\n readonly type: string;\n /** Already folds a genuine not-found to `undefined`; nothing else is folded (see header). */\n readonly fetchLive: (props: Props) => Effect.Effect<Live | undefined, E, UnifiNetworkOpContext>;\n readonly attributes: (live: Live, props: Props) => Attributes;\n readonly matches: (attributes: Attributes, props: Props) => boolean;\n /** For the refusal message and read-back failures. */\n readonly describe: (props: Props) => string;\n /** Present only on a family allowed to write (`Unifi.Network`); see `update-reconcile.ts`. */\n readonly update?: UnifiUpdate<Props, Live, E2>;\n /** Present only on a family allowed to create (`Unifi.FirewallPolicy`, `hf:` rows only); see\n * `update-reconcile.ts`'s `createReconcile`. */\n readonly create?: UnifiCreate<Props, Live, E3>;\n};\n\nexport const unifiOperations = <Props extends object, Live, Attributes extends object, E, E2, E3>(\n spec: UnifiSpec<Props, Live, Attributes, E, E2, E3>,\n) => {\n const read = (props: Props) =>\n spec\n .fetchLive(props)\n .pipe(Effect.map((live) => (live === undefined ? undefined : spec.attributes(live, props))));\n\n return {\n read,\n\n readHandler: ({ olds, output }: { olds: Props; output: Attributes | undefined }) =>\n Effect.gen(function* () {\n const attrs = yield* read(olds);\n if (attrs === undefined) return undefined;\n // Warm read (persisted `output` says a prior apply already adopted this exact object):\n // plain attributes. Cold read (fresh store, or state lost): no ownership marker on this\n // vendor exists to tell \"ours\" from \"someone else's\" apart, so Unowned until adopt(true).\n return output !== undefined ? attrs : Unowned(attrs);\n }),\n\n diff: (news: Input<Props>, output: Attributes | undefined) =>\n Effect.gen(function* () {\n if (output === undefined || !isResolved(news)) return undefined;\n const live = yield* read(news);\n if (live === undefined) return { action: 'update' } as const;\n return spec.matches(live, news)\n ? ({ action: 'noop' } as const)\n : ({ action: 'update' } as const);\n }),\n\n /**\n * Pre-state callers (tests, adopt-only probes) pass just `news`: `olds`/`output` unset — the\n * SAME calling convention a plain cold adoption already uses (H6), so the existence GET must\n * run FIRST, for every name, exactly as it always has: a row that already exists is adopted\n * (exact match, zero writes) regardless of its name, and ONLY an absent row ever reaches\n * `create.checkScope`. \"A non-hf: create sends nothing\" therefore means no WRITE (no\n * POST/PUT/DELETE) — the same guarantee every other refusal in this engine gives, and the one\n * `wire-guard.ts`'s allow list enforces at the wire; the existence GET is not a write.\n *\n * ⛔ THE CREATE BRANCH ONLY RUNS WHEN THERE IS NO PRIOR STATE AT ALL (`olds`/`output` both\n * absent — a genuine first deploy, never a re-declare of an adopted row) AND the family\n * declares `create` AND the live read comes back absent. A row that already exists (someone\n * else's object with a colliding identity, or a retried deploy that already created it)\n * takes the ordinary `updateReconcile` path instead — exact match reports with zero writes,\n * anything else refuses (there is no `olds` to PUT a patch against, so it can never silently\n * fall through to an update of an existing row).\n */\n reconcile: (news: Props, rest: Partial<Omit<ReconcileArgs<Props>, 'news'>> = {}) => {\n const note = rest.note ?? (() => Effect.void);\n const create = spec.create;\n if (create !== undefined && rest.olds === undefined && rest.output === undefined) {\n return Effect.gen(function* () {\n const live = yield* spec.fetchLive(news);\n return live === undefined\n ? yield* createReconcile(spec, news, note)\n : yield* updateReconcile(spec, { news, olds: undefined, output: undefined, note });\n });\n }\n return updateReconcile(spec, { news, olds: rest.olds, output: rest.output, note });\n },\n\n destroy: (olds: Props) => refuseWrite(spec.type, spec.describe(olds), 'delete'),\n };\n};\n\n/**\n * The four provider handlers for a spec'd UniFi object, wired once.\n *\n * ⛔ `list` ANSWERS EMPTY. `GET /v1/sites/{siteId}/networks` answers every network on the site;\n * adoption stays explicit, the same reasoning `Proxmox.User`'s and NetBox's `list` give.\n */\nexport const unifiHandlers = <Props extends object, Live, Attributes extends object, E, E2, E3>(\n spec: UnifiSpec<Props, Live, Attributes, E, E2, E3>,\n) => {\n const ops = unifiOperations(spec);\n const withCredentials = <A, Err>(\n effect: Effect.Effect<A, Err, UnifiNetworkOpContext>,\n allow: ReadonlyArray<AllowedWrite> = [],\n ) =>\n Effect.gen(function* () {\n // ⛔ The guard anchors the allowed PUT to the CONFIGURED base URL (`wire-guard.ts`), so it is\n // read from the same credentials the SDK uses.\n const { apiBaseUrl } = yield* yield* Credentials;\n return yield* effect.pipe(Effect.provide(guardedHttpClient(allow, apiBaseUrl)));\n }).pipe(Effect.provide(CredentialsFromEnv)) as Effect.Effect<A, Err, HttpClient.HttpClient>;\n\n return {\n list: () => Effect.succeed([]),\n read: (args: { olds: Props; output: Attributes | undefined }) =>\n withCredentials(ops.readHandler(args)),\n diff: (args: { news: Input<Props>; output: Attributes | undefined }) =>\n withCredentials(ops.diff(args.news, args.output)),\n // ⛔ ONLY `reconcile` gets the per-row allow entry, and only when the spec declares `update`.\n reconcile: (args: {\n news: Props;\n olds: Props | undefined;\n output: Attributes | undefined;\n session: { note: (message: string) => Effect.Effect<void, never, never> };\n }) =>\n withCredentials(\n ops.reconcile(args.news, {\n olds: args.olds,\n output: args.output,\n note: (message) => args.session.note(message),\n }),\n // ⛔ From `news` (the ids the write will use), never `olds`; reconcile also refuses when\n // `olds` names another object (`update-reconcile.ts`). The create entry (a POST to the\n // site's fixed collection route, never a per-row path) is listed ONLY when there is no\n // prior state at all — the exact same condition `ops.reconcile` itself gates the create\n // branch on, so the wire guard never allows a POST wider than what the engine could ever\n // attempt. The hf: NAME check is NOT this list's job (`create.checkScope`'s, before the\n // POST): this only bounds METHOD and PATH.\n [\n ...(spec.update ? [spec.update.allowedWrite(args.news)] : []),\n ...(spec.create && args.olds === undefined && args.output === undefined\n ? [spec.create.allowedWrite(args.news)]\n : []),\n ],\n ),\n delete: (args: { olds: Props }) => withCredentials(ops.destroy(args.olds)),\n };\n};\n",
14
- "/**\n * The three-way `reconcile` every updatable `Unifi.*` family shares (today: `Unifi.Network`).\n *\n * ⛔ THREE INPUTS, NOT TWO. `news` is the declaration now, `olds` is the declaration the LAST\n * DEPLOY wrote (Alchemy state), `live` is the raw object read right now. The PUT body is built\n * from `live` plus ONLY the fields where `news` differs from `olds` (`computePatch`) — never\n * from `news` alone. So (HIGH-2) a hand edit on a field the declaration never touched is carried\n * through unchanged instead of reverted, and a hand edit on ANY declared field is refused\n * outright (step 4) rather than overwritten.\n *\n * ★ `unset` IS WHAT MAKES A REVERT REAL (HIGH-1). Deleting an override from a declaration makes\n * `news[k]` absent while `olds[k]` is set; a patch that only carried `set` would see \"nothing\n * changed\" and the revert would never write. A key present in `olds` and null/absent in `news`\n * lands in `unset`, and the family's `write` removes it from the body.\n *\n * ⛔ FIRST DEPLOY IS ADOPT-ONLY BY CONSTRUCTION (F1, LOW-8). Without BOTH `olds` and `output` there\n * is no last-deployed baseline to patch against, so the write refuses. That also covers beta.81's\n * forced post-adoption reconcile (H6): on a match (step 2) it returns live with zero writes.\n * `olds` must also name the SAME object as `news` (`UnifiIdentityChanged`).\n *\n * ⛔ SCOPE (`update.checkScope`) runs before the note and any request: the family decides what a\n * patch may touch (`network-scope.ts`). An omitted optional block is turned OFF by a whole-object\n * PUT, so removing a key is allowed only for an explicit allowlist.\n *\n * ⚠️ NOTES AND ERRORS CARRY FIELD NAMES ONLY, NEVER VALUES.\n */\nimport { deepEqual } from 'alchemy/Diff';\nimport type { UnifiNetworkOpContext } from '@distilled.cloud/unifi-network/Protocol';\nimport * as Effect from 'effect/Effect';\nimport type { FieldDrift } from './drift.ts';\nimport {\n UnifiCreateDidNotConverge,\n UnifiIdentityChanged,\n UnifiLiveDriftedSinceDeploy,\n UnifiUpdateDidNotConverge,\n refuseWrite,\n} from './policy.ts';\nimport type { UnifiSpec } from './resource.ts';\nimport type { AllowedWrite } from './wire-guard.ts';\n\nexport type Patch<Props> = { set: Partial<Props>; unset: ReadonlyArray<keyof Props> };\n\n/** The write half of a spec: everything needed to PUT one object, and nothing to create/delete. */\nexport type UnifiUpdate<Props extends object, Live, E2> = {\n /** The one PUT the wire guard may pass for this row (path pinned to the row's own ids). */\n readonly allowedWrite: (props: Props) => AllowedWrite;\n /** Declarable keys; never the identity keys. */\n readonly patchKeys: ReadonlyArray<keyof Props>;\n readonly driftOf: (live: Live, props: Props) => ReadonlyArray<FieldDrift>;\n /** Refuses (typed, before any note or request) a patch outside this family's write scope. */\n readonly checkScope: (live: Live, patch: Patch<Props>, props: Props) => Effect.Effect<void, E2>;\n readonly write: (\n live: Live,\n patch: Patch<Props>,\n props: Props,\n ) => Effect.Effect<Live, E2, UnifiNetworkOpContext>;\n};\n\n/** Keys whose `news` value differs from `olds`: set when still declared, unset when dropped. */\nexport const computePatch = <Props extends object>(\n news: Props,\n olds: Props,\n patchKeys: ReadonlyArray<keyof Props>,\n): Patch<Props> => {\n const set: Partial<Props> = {};\n const unset: Array<keyof Props> = [];\n for (const key of patchKeys) {\n if (deepEqual(news[key], olds[key], { stripNullish: true })) continue;\n if (news[key] == null) unset.push(key);\n else set[key] = news[key];\n }\n return { set, unset };\n};\n\nexport type ReconcileArgs<Props extends object> = {\n readonly news: Props;\n readonly olds: Props | undefined;\n readonly output: unknown;\n readonly note: (message: string) => Effect.Effect<void>;\n};\n\nexport const updateReconcile = <Props extends object, Live, Attributes extends object, E, E2, E3>(\n spec: UnifiSpec<Props, Live, Attributes, E, E2, E3>,\n { news, olds, output, note }: ReconcileArgs<Props>,\n) =>\n Effect.gen(function* () {\n const identity = spec.describe(news);\n const live = yield* spec.fetchLive(news);\n if (live === undefined) return yield* refuseWrite(spec.type, identity, 'create');\n const attrs = spec.attributes(live, news);\n // Exact match: zero writes, correct for a routine deploy and the forced post-adoption call.\n if (spec.matches(attrs, news)) return attrs;\n const update = spec.update;\n if (update === undefined || olds === undefined || output === undefined) {\n return yield* refuseWrite(spec.type, identity, 'update');\n }\n // ⛔ `olds` is the baseline for THIS object only; another site or network id is no baseline.\n const previous = spec.describe(olds);\n if (previous !== identity) {\n return yield* new UnifiIdentityChanged({ type: spec.type, identity, previous });\n }\n const drifted = update.driftOf(live, olds).map((d) => d.field);\n if (drifted.length > 0) {\n return yield* new UnifiLiveDriftedSinceDeploy({\n type: spec.type,\n identity,\n fields: drifted,\n });\n }\n const patch = computePatch(news, olds, update.patchKeys);\n if (Object.keys(patch.set).length === 0 && patch.unset.length === 0) {\n return yield* refuseWrite(spec.type, identity, 'update');\n }\n yield* update.checkScope(live, patch, news);\n yield* note(\n `${spec.type} ${identity}: PUT changes [${Object.keys(patch.set).join(', ')}] ` +\n `removes [${patch.unset.map(String).join(', ')}]`,\n );\n const written = yield* update.write(live, patch, news);\n const writtenAttrs = spec.attributes(written, news);\n if (spec.matches(writtenAttrs, news)) return writtenAttrs;\n return yield* new UnifiUpdateDidNotConverge({\n type: spec.type,\n identity,\n fields: update.driftOf(written, news).map((d) => d.field),\n });\n });\n\n/**\n * The write half of a CREATE-capable family: today, only `Unifi.FirewallPolicy`, and only for an\n * `hf:`-named row (`policy.ts`'s `isHfPolicyName`). Deliberately NOT a merge-with-live update —\n * there is no live object yet — so there is no `patchKeys`/`checkScope(live, patch, …)` here: a\n * create sends exactly the fields the declaration owns, nothing echoed from elsewhere, nothing to\n * accidentally reset.\n *\n * ⛔ `checkScope` RUNS BEFORE THE POST (same ordering `update.checkScope` already has): a\n * non-`hf:` name is refused here, typed, never reaching the wire at all.\n * ★ `identify` CLOSES THE LOOP FROM THE POST'S RESPONSE TO A FRESH GET. The vendor assigns the id\n * on create; `write`'s response carries it, but a response body is not proof the object is\n * actually readable back (`createReconcile` re-fetches with the id `identify` folds in, rather\n * than trusting the POST's own echo — same reasoning `network-update.ts`'s header gives for\n * never trusting a write's own response over a real read).\n */\nexport type UnifiCreate<Props extends object, Live, E3> = {\n /** The one POST the wire guard may pass for this family (the site's fixed collection route,\n * built from `props` the same way `UnifiUpdate.allowedWrite` reads a row's ids from `props`). */\n readonly allowedWrite: (props: Props) => AllowedWrite;\n /** Refuses (typed, before any note or request) a create outside this family's write scope. */\n readonly checkScope: (props: Props) => Effect.Effect<void, E3>;\n readonly write: (props: Props) => Effect.Effect<Live, E3, UnifiNetworkOpContext>;\n /** `props` plus the vendor id the POST's response assigned, for the read-back `fetchLive`. */\n readonly identify: (props: Props, written: Live) => Props;\n readonly driftOf: (live: Live, props: Props) => ReadonlyArray<FieldDrift>;\n};\n\n/**\n * CREATE for a family whose live read came back absent AND which has no prior Alchemy state\n * (`resource.ts`'s `unifiOperations.reconcile` is the only caller, and only under that same\n * condition — see its own header). Refuses (untyped-to-typed, same `refuseWrite` every other\n * refusal uses) when the family declares no `create` at all; `create.checkScope` then refuses\n * again, more specifically, for a declared row the create scope itself does not allow.\n */\nexport const createReconcile = <Props extends object, Live, Attributes extends object, E, E2, E3>(\n spec: UnifiSpec<Props, Live, Attributes, E, E2, E3>,\n news: Props,\n note: (message: string) => Effect.Effect<void, never, never>,\n) =>\n Effect.gen(function* () {\n const identity = spec.describe(news);\n const create = spec.create;\n if (create === undefined) return yield* refuseWrite(spec.type, identity, 'create');\n yield* create.checkScope(news);\n yield* note(`${spec.type} ${identity}: POST create`);\n const written = yield* create.write(news);\n const withId = create.identify(news, written);\n // ⛔ A FRESH GET, NOT THE POST'S OWN RESPONSE (see the header): `fetchLive` is the same read\n // every adoption and every later plan uses, so the convergence check and every future read\n // of this row go through one path.\n const confirmed = yield* spec.fetchLive(withId);\n if (confirmed === undefined) {\n return yield* Effect.die(\n new Error(\n `${spec.type} ${identity}: the create POST answered, but the read-back found nothing ` +\n 'at the id it assigned. The object may or may not exist on the console; re-import ' +\n 'before trying again rather than retrying this create blindly.',\n ),\n );\n }\n const attrs = spec.attributes(confirmed, withId);\n if (spec.matches(attrs, withId)) return attrs;\n return yield* new UnifiCreateDidNotConverge({\n type: spec.type,\n identity,\n fields: create.driftOf(confirmed, withId).map((d) => d.field),\n });\n });\n",
14
+ "/**\n * The three-way `reconcile` every updatable `Unifi.*` family shares (today: `Unifi.Network`).\n *\n * ⛔ THREE INPUTS, NOT TWO. `news` is the declaration now, `olds` is the declaration the LAST\n * DEPLOY wrote (Alchemy state), `live` is the raw object read right now. The PUT body is built\n * from `live` plus ONLY the fields where `news` differs from `olds` (`computePatch`) — never\n * from `news` alone. So (HIGH-2) a hand edit on a field the declaration never touched is carried\n * through unchanged instead of reverted, and a hand edit on ANY declared field is refused\n * outright (step 4) rather than overwritten.\n *\n * ★ `unset` IS WHAT MAKES A REVERT REAL (HIGH-1). Deleting an override from a declaration makes\n * `news[k]` absent while `olds[k]` is set; a patch that only carried `set` would see \"nothing\n * changed\" and the revert would never write. A key present in `olds` and null/absent in `news`\n * lands in `unset`, and the family's `write` removes it from the body.\n *\n * ⛔ FIRST DEPLOY IS ADOPT-ONLY BY CONSTRUCTION (F1, LOW-8). Without BOTH `olds` and `output` there\n * is no last-deployed baseline to patch against, so the write refuses. That also covers beta.81's\n * forced post-adoption reconcile (H6): on a match (step 2) it returns live with zero writes.\n * `olds` must also name the SAME object as `news` (`UnifiIdentityChanged`).\n *\n * ⛔ SCOPE (`update.checkScope`) runs before the note and any request: the family decides what a\n * patch may touch (`network-scope.ts`). An omitted optional block is turned OFF by a whole-object\n * PUT, so removing a key is allowed only for an explicit allowlist.\n *\n * ⚠️ NOTES AND ERRORS CARRY FIELD NAMES ONLY, NEVER VALUES.\n */\nimport { deepEqual } from 'alchemy/Diff';\nimport type { UnifiNetworkOpContext } from '@distilled.cloud/unifi-network/Protocol';\nimport * as Effect from 'effect/Effect';\nimport type { FieldDrift } from './drift.ts';\nimport {\n UnifiCreateDidNotConverge,\n UnifiIdentityChanged,\n UnifiLiveDriftedSinceDeploy,\n UnifiUpdateDidNotConverge,\n refuseWrite,\n} from './policy.ts';\nimport type { UnifiSpec } from './resource.ts';\nimport type { AllowedWrite } from './wire-guard.ts';\n\nexport type Patch<Props> = { set: Partial<Props>; unset: ReadonlyArray<keyof Props> };\n\n/** The write half of a spec: everything needed to PUT one object, and nothing to create/delete. */\nexport type UnifiUpdate<Props extends object, Live, E2> = {\n /** The one PUT the wire guard may pass for this row (path pinned to the row's own ids). */\n readonly allowedWrite: (props: Props) => AllowedWrite;\n /** Declarable keys; never the identity keys. */\n readonly patchKeys: ReadonlyArray<keyof Props>;\n readonly driftOf: (live: Live, props: Props) => ReadonlyArray<FieldDrift>;\n /** Refuses (typed, before any note or request) a patch outside this family's write scope. */\n readonly checkScope: (live: Live, patch: Patch<Props>, props: Props) => Effect.Effect<void, E2>;\n readonly write: (\n live: Live,\n patch: Patch<Props>,\n props: Props,\n ) => Effect.Effect<Live, E2, UnifiNetworkOpContext>;\n};\n\n/** Keys whose `news` value differs from `olds`: set when still declared, unset when dropped. */\nexport const computePatch = <Props extends object>(\n news: Props,\n olds: Props,\n patchKeys: ReadonlyArray<keyof Props>,\n): Patch<Props> => {\n const set: Partial<Props> = {};\n const unset: Array<keyof Props> = [];\n for (const key of patchKeys) {\n if (deepEqual(news[key], olds[key], { stripNullish: true })) continue;\n if (news[key] == null) unset.push(key);\n else set[key] = news[key];\n }\n return { set, unset };\n};\n\n/** `olds` with each accepted field taken from `news` (which equals live there), so the patch\n * skips it. A `FieldDrift.field` names a props key; one that is not is left alone. */\nconst acceptInto = <Props extends object>(\n olds: Props,\n news: Props,\n accepted: ReadonlyArray<unknown>,\n): Props => {\n const next: Record<string, unknown> = { ...(olds as Record<string, unknown>) };\n for (const field of accepted) {\n const key = String(field);\n if (key in (news as object) || key in next) next[key] = (news as Record<string, unknown>)[key];\n }\n return next as Props;\n};\n\nexport type ReconcileArgs<Props extends object> = {\n readonly news: Props;\n readonly olds: Props | undefined;\n readonly output: unknown;\n readonly note: (message: string) => Effect.Effect<void>;\n};\n\nexport const updateReconcile = <Props extends object, Live, Attributes extends object, E, E2, E3>(\n spec: UnifiSpec<Props, Live, Attributes, E, E2, E3>,\n { news, olds, output, note }: ReconcileArgs<Props>,\n) =>\n Effect.gen(function* () {\n const identity = spec.describe(news);\n const live = yield* spec.fetchLive(news);\n if (live === undefined) return yield* refuseWrite(spec.type, identity, 'create');\n const attrs = spec.attributes(live, news);\n // Exact match: zero writes, correct for a routine deploy and the forced post-adoption call.\n if (spec.matches(attrs, news)) return attrs;\n const update = spec.update;\n if (update === undefined || olds === undefined || output === undefined) {\n return yield* refuseWrite(spec.type, identity, 'update');\n }\n // ⛔ `olds` is the baseline for THIS object only; another site or network id is no baseline.\n const previous = spec.describe(olds);\n if (previous !== identity) {\n return yield* new UnifiIdentityChanged({ type: spec.type, identity, previous });\n }\n // ★ A FIELD THAT DRIFTED SINCE THE LAST DEPLOY IS A CONFLICT ONLY IF THE DECLARATION STILL\n // DISAGREES WITH LIVE ON IT. When the declaration already equals live there (a re-import\n // recorded the console edit, the documented recovery for UnifiLiveDriftedSinceDeploy),\n // the edit is ACCEPTED: folded into the baseline, so it is neither refused nor patched. The\n // PUT is live plus the patch, so live's value survives untouched. Without this, `olds`\n // (the last deployed state) only moves on a successful deploy, so a re-import could never\n // clear the refusal (homeflare-network VLAN 16, 2026-10-19: mdnsForwardingEnabled edited on\n // the console, re-imported, and still refused on every deploy).\n // ⛔ A drifted field the declaration DISAGREES with stays a refusal: the PUT would overwrite\n // a hand edit nobody re-imported.\n const disagrees = new Set(update.driftOf(live, news).map((d) => String(d.field)));\n const drifted = update.driftOf(live, olds).map((d) => d.field);\n const conflicts = drifted.filter((field) => disagrees.has(String(field)));\n if (conflicts.length > 0) {\n return yield* new UnifiLiveDriftedSinceDeploy({\n type: spec.type,\n identity,\n fields: conflicts,\n });\n }\n const accepted = drifted.filter((field) => !disagrees.has(String(field)));\n const baseline = acceptInto(olds, news, accepted);\n if (accepted.length > 0) {\n yield* note(\n `${spec.type} ${identity}: live edits since the last deploy already match the declaration, accepted: [${accepted.map(String).join(', ')}]`,\n );\n }\n const patch = computePatch(news, baseline, update.patchKeys);\n if (Object.keys(patch.set).length === 0 && patch.unset.length === 0) {\n return yield* refuseWrite(spec.type, identity, 'update');\n }\n yield* update.checkScope(live, patch, news);\n yield* note(\n `${spec.type} ${identity}: PUT changes [${Object.keys(patch.set).join(', ')}] ` +\n `removes [${patch.unset.map(String).join(', ')}]`,\n );\n const written = yield* update.write(live, patch, news);\n const writtenAttrs = spec.attributes(written, news);\n if (spec.matches(writtenAttrs, news)) return writtenAttrs;\n return yield* new UnifiUpdateDidNotConverge({\n type: spec.type,\n identity,\n fields: update.driftOf(written, news).map((d) => d.field),\n });\n });\n\n/**\n * The write half of a CREATE-capable family: today, only `Unifi.FirewallPolicy`, and only for an\n * `hf:`-named row (`policy.ts`'s `isHfPolicyName`). Deliberately NOT a merge-with-live update —\n * there is no live object yet — so there is no `patchKeys`/`checkScope(live, patch, …)` here: a\n * create sends exactly the fields the declaration owns, nothing echoed from elsewhere, nothing to\n * accidentally reset.\n *\n * ⛔ `checkScope` RUNS BEFORE THE POST (same ordering `update.checkScope` already has): a\n * non-`hf:` name is refused here, typed, never reaching the wire at all.\n * ★ `identify` CLOSES THE LOOP FROM THE POST'S RESPONSE TO A FRESH GET. The vendor assigns the id\n * on create; `write`'s response carries it, but a response body is not proof the object is\n * actually readable back (`createReconcile` re-fetches with the id `identify` folds in, rather\n * than trusting the POST's own echo — same reasoning `network-update.ts`'s header gives for\n * never trusting a write's own response over a real read).\n */\nexport type UnifiCreate<Props extends object, Live, E3> = {\n /** The one POST the wire guard may pass for this family (the site's fixed collection route,\n * built from `props` the same way `UnifiUpdate.allowedWrite` reads a row's ids from `props`). */\n readonly allowedWrite: (props: Props) => AllowedWrite;\n /** Refuses (typed, before any note or request) a create outside this family's write scope. */\n readonly checkScope: (props: Props) => Effect.Effect<void, E3>;\n readonly write: (props: Props) => Effect.Effect<Live, E3, UnifiNetworkOpContext>;\n /** `props` plus the vendor id the POST's response assigned, for the read-back `fetchLive`. */\n readonly identify: (props: Props, written: Live) => Props;\n readonly driftOf: (live: Live, props: Props) => ReadonlyArray<FieldDrift>;\n};\n\n/**\n * CREATE for a family whose live read came back absent AND which has no prior Alchemy state\n * (`resource.ts`'s `unifiOperations.reconcile` is the only caller, and only under that same\n * condition — see its own header). Refuses (untyped-to-typed, same `refuseWrite` every other\n * refusal uses) when the family declares no `create` at all; `create.checkScope` then refuses\n * again, more specifically, for a declared row the create scope itself does not allow.\n */\nexport const createReconcile = <Props extends object, Live, Attributes extends object, E, E2, E3>(\n spec: UnifiSpec<Props, Live, Attributes, E, E2, E3>,\n news: Props,\n note: (message: string) => Effect.Effect<void, never, never>,\n) =>\n Effect.gen(function* () {\n const identity = spec.describe(news);\n const create = spec.create;\n if (create === undefined) return yield* refuseWrite(spec.type, identity, 'create');\n yield* create.checkScope(news);\n yield* note(`${spec.type} ${identity}: POST create`);\n const written = yield* create.write(news);\n const withId = create.identify(news, written);\n // ⛔ A FRESH GET, NOT THE POST'S OWN RESPONSE (see the header): `fetchLive` is the same read\n // every adoption and every later plan uses, so the convergence check and every future read\n // of this row go through one path.\n const confirmed = yield* spec.fetchLive(withId);\n if (confirmed === undefined) {\n return yield* Effect.die(\n new Error(\n `${spec.type} ${identity}: the create POST answered, but the read-back found nothing ` +\n 'at the id it assigned. The object may or may not exist on the console; re-import ' +\n 'before trying again rather than retrying this create blindly.',\n ),\n );\n }\n const attrs = spec.attributes(confirmed, withId);\n if (spec.matches(attrs, withId)) return attrs;\n return yield* new UnifiCreateDidNotConverge({\n type: spec.type,\n identity,\n fields: create.driftOf(confirmed, withId).map((d) => d.field),\n });\n });\n",
15
15
  "/**\n * `Unifi.FirewallZone` — one firewall zone on a UniFi Network site, READ-ONLY (`policy.ts`).\n *\n * ★ WHY FIREWALL ZONE IS IN THE FIRST IMPORT SET AND `Unifi.FirewallPolicy` IS NOT.\n * `getFirewallZone`/`getFirewallZones` (`firewall.ts`) is a list+get pair over genuine,\n * simply-shaped configuration: `{id, metadata, name, networkIds}`, four fields, no nested\n * discriminated filter. `FirewallPolicy` (same file) is also list+get and also configuration,\n * but its `source`/`destination`/`ipProtocolScope` fields carry several of `docs/unifi-api-notes.md`'s\n * \"converter-flattened discriminator variants\" each, and `firewall/policies/ordering` replaces\n * the whole ordered list — modelling those correctly is a bigger, separate PR (`network.ts`'s\n * header note names it explicitly) rather than something to rush alongside this one.\n */\nimport { Resource } from 'alchemy';\nimport { adopt } from 'alchemy/AdoptPolicy';\nimport * as Provider from 'alchemy/Provider';\nimport * as firewall from '@distilled.cloud/unifi-network/firewall';\nimport * as Effect from 'effect/Effect';\nimport {\n type FirewallZoneAttributes,\n type FirewallZoneProps,\n attributesOf,\n matches,\n} from './firewall-zone-form.ts';\nimport type { UnifiRequirements, UnifiSpec } from './resource.ts';\nimport { unifiHandlers } from './resource.ts';\n\nexport type { FirewallZoneAttributes, FirewallZoneProps } from './firewall-zone-form.ts';\nexport { declareFirewallZone, driftOf } from './firewall-zone-form.ts';\n\nexport interface UnifiFirewallZone extends Resource<\n 'Unifi.FirewallZone',\n FirewallZoneProps,\n FirewallZoneAttributes,\n never,\n UnifiRequirements\n> {}\n\nexport const UnifiFirewallZone = Resource<UnifiFirewallZone>('Unifi.FirewallZone', {\n defaultRemovalPolicy: 'retain',\n});\n\n/** `firewallZone('lan', props)` — `adopt(true)` piped on by default (H5); see `network.ts`. */\nexport const firewallZone = (id: string, props: FirewallZoneProps) =>\n UnifiFirewallZone(id, props).pipe(adopt(true));\n\n/** ★ EXPORTED for direct testing against a fake `Credentials` layer — see `network.ts`'s own. */\nexport const spec: UnifiSpec<\n FirewallZoneProps,\n firewall.FirewallZone,\n FirewallZoneAttributes,\n firewall.GetFirewallZoneError\n> = {\n type: 'Unifi.FirewallZone',\n describe: (props) => `sites/${props.siteId}/firewall/zones/${props.firewallZoneId}`,\n fetchLive: (props) =>\n firewall\n .getFirewallZone({ siteId: props.siteId, firewallZoneId: props.firewallZoneId })\n .pipe(Effect.catchTag('NotFound', () => Effect.succeed(undefined))),\n attributes: attributesOf,\n matches,\n};\n\nexport const handlers = unifiHandlers(spec);\n\nexport const UnifiFirewallZoneProvider = () =>\n Provider.effect(UnifiFirewallZone, Effect.succeed(UnifiFirewallZone.Provider.of(handlers)));\n",
16
16
  "/**\n * `Unifi.FirewallZone`'s wire shape — the declarable subset of `FirewallZone`, and how a live\n * read becomes both plan attributes and a rendered declaration.\n *\n * ⚠️ ONLY `name` AND `networkIds` ARE DECLARABLE. `CreateFirewallZoneRequest`\n * (`firewall.ts`) accepts exactly those two beyond `siteId`; `metadata` (origin/source) and\n * `id` are server-derived, so — same split as `network-form.ts`'s `default`/`metadata` —\n * they are attributes-only, reported but never compared or declared.\n *\n * ⛔ `networkIds` ORDER IS NOT PART OF IDENTITY. The vendor document gives no indication the\n * list is ordered (it is a set of attached networks, not a sequence like the ordering\n * endpoints' rule lists), so `matches` compares it as a set — sorted before comparing —\n * the same reasoning `proxmox/user-wire.ts`'s `groupSet` gives for PVE's `groups`.\n */\nimport type * as firewall from '@distilled.cloud/unifi-network/firewall';\nimport { makeDriftOf } from './drift.ts';\n\nexport interface FirewallZoneProps {\n siteId: string;\n firewallZoneId: string;\n /** Name of a firewall zone. */\n name: string;\n /** Network IDs attached to this zone — compared as a set, see the header. */\n networkIds: string[];\n}\n\nexport interface FirewallZoneAttributes {\n siteId: string;\n firewallZoneId: string;\n name: string;\n networkIds: string[];\n /** `origin`/`source` (e.g. `SDWAN`) — server-derived, never declared. */\n metadataOrigin: string;\n}\n\nconst sortedSet = (values: readonly string[]): string[] => [...new Set(values)].sort();\n\nexport const attributesOf = (\n live: firewall.FirewallZone,\n props: FirewallZoneProps,\n): FirewallZoneAttributes => ({\n siteId: props.siteId,\n firewallZoneId: live.id,\n name: live.name,\n networkIds: sortedSet(live.networkIds),\n metadataOrigin: live.metadata.origin,\n});\n\n/**\n * B6: `fieldDrift` (`makeDriftOf`, `drift.ts`) is now the ONLY comparison this family has — MEDIUM-4\n * (red team, 2026-09-26): a hand-written `matches` kept beside `fieldDrift` is two field lists an\n * edit to one can silently leave out of sync with the other (a mutant deleting a `fieldDrift` entry\n * left every test green, because `matches` never consulted it). `matches(attrs, props) ===\n * (driftOf(live, props).length === 0)` is now true BY CONSTRUCTION, not just by a test that happens\n * to check both. `networkIds`' custom `equal` is the set comparison the family has always used —\n * see the header — and its reported `live`/`declared` values in a `driftOf` result are the SORTED\n * arrays, not the joined strings this `equal` compares internally, so a real diff reads as a set\n * difference, not two opaque strings.\n */\nconst fieldDrift = makeDriftOf<FirewallZoneAttributes, FirewallZoneProps>([\n { field: 'name', live: (a) => a.name, declared: (p) => p.name },\n {\n field: 'networkIds',\n live: (a) => a.networkIds,\n declared: (p) => sortedSet(p.networkIds),\n equal: (live, declared) => (live as string[]).join(',') === (declared as string[]).join(','),\n },\n]);\n\nexport const matches = (attributes: FirewallZoneAttributes, props: FirewallZoneProps): boolean =>\n fieldDrift(attributes, props).length === 0;\n\n/**\n * Per-field live-vs-declared drift straight from one live read — the task's own API\n * (`driftOf(live, props)`), so `homeflare-network`'s pre-import drift check never has to derive\n * `attributesOf` itself just to call this.\n */\nexport const driftOf = (live: firewall.FirewallZone, props: FirewallZoneProps) =>\n fieldDrift(attributesOf(live, props), props);\n\n/**\n * The declaration renderer (task spec: \"given one live object, return the props a declaration\n * needs so its plan is noop\"). `matches(attributesOf(live, props), declareFirewallZone(live,\n * siteId))` is `true` by construction (`firewall-zone.test.ts` proves it).\n */\nexport const declareFirewallZone = (\n live: firewall.FirewallZone,\n siteId: string,\n): FirewallZoneProps => ({\n siteId,\n firewallZoneId: live.id,\n name: live.name,\n networkIds: sortedSet(live.networkIds),\n});\n",
17
17
  "/**\n * `Unifi.DnsPolicy` — one DNS policy on a UniFi Network site, READ-ONLY (`policy.ts`).\n *\n * ★ T11 GATE, CHECKED 2026-09-26, CORRECTED SAME DAY (red team, Important finding 1): `DNS\n * Policies` is 5 operations, `Access Control (ACL Rules)` (`acl-rule.ts`) is 7 — 12 total.\n * Diffed the pinned 10.4.57 spec against a 10.6.97 mirror (`beezly/unifi-apis`, diffing aid\n * only, `docs/unifi-acl-rule.md` records the sha256 + mirror commit): all 12 full operation\n * objects (parameters, request body, responses, unresolved `$ref`s included) are byte-identical\n * across versions. ⚠️ The schema closure is 46, not 17 — a `$ref`-only walk misses every schema\n * reachable only via a `discriminator.mapping` (both `DNS policy` and `ACL rule` discriminate on\n * `type`); the 46-schema closure, `$ref` + `mapping` together, shares zero names with the 14\n * schemas that DID change between the two versions (all in `Switching`, `Filtering`, or one\n * `UniFi Devices` enum — none of it DNS- or ACL-shaped). Same reachability method\n * `spec-version-provenance.md` (distilled package) used for Networks/FirewallZones, extended to\n * follow `mapping` too; full breakdown in `docs/unifi-acl-rule.md`, not repeated per family.\n */\nimport { Resource } from 'alchemy';\nimport { adopt } from 'alchemy/AdoptPolicy';\nimport * as Provider from 'alchemy/Provider';\nimport * as dnsPolicies from '@distilled.cloud/unifi-network/dns_policies';\nimport * as Effect from 'effect/Effect';\nimport { type DnsPolicyAttributes, type DnsPolicyProps, attributesOf } from './dns-policy-form.ts';\nimport { matches } from './dns-policy-drift.ts';\nimport type { UnifiRequirements, UnifiSpec } from './resource.ts';\nimport { unifiHandlers } from './resource.ts';\n\nexport type { DnsPolicyAttributes, DnsPolicyProps } from './dns-policy-form.ts';\nexport { declareDnsPolicy } from './dns-policy-form.ts';\nexport { driftOf } from './dns-policy-drift.ts';\n\nexport interface UnifiDnsPolicy extends Resource<\n 'Unifi.DnsPolicy',\n DnsPolicyProps,\n DnsPolicyAttributes,\n never,\n UnifiRequirements\n> {}\n\nexport const UnifiDnsPolicy = Resource<UnifiDnsPolicy>('Unifi.DnsPolicy', {\n defaultRemovalPolicy: 'retain',\n});\n\n/** `dnsPolicy('lan-forwarding', props)` — `adopt(true)` piped on by default (H5); see `network.ts`. */\nexport const dnsPolicy = (id: string, props: DnsPolicyProps) =>\n UnifiDnsPolicy(id, props).pipe(adopt(true));\n\n/** ★ EXPORTED for direct testing against a fake `Credentials` layer — see `network.ts`'s own. */\nexport const spec: UnifiSpec<\n DnsPolicyProps,\n dnsPolicies.DNSPolicy,\n DnsPolicyAttributes,\n dnsPolicies.GetDnsPolicyError\n> = {\n type: 'Unifi.DnsPolicy',\n describe: (props) => `sites/${props.siteId}/dns/policies/${props.dnsPolicyId}`,\n fetchLive: (props) =>\n dnsPolicies\n .getDnsPolicy({ siteId: props.siteId, dnsPolicyId: props.dnsPolicyId })\n .pipe(Effect.catchTag('NotFound', () => Effect.succeed(undefined))),\n attributes: attributesOf,\n matches,\n};\n\nexport const handlers = unifiHandlers(spec);\n\nexport const UnifiDnsPolicyProvider = () =>\n Provider.effect(UnifiDnsPolicy, Effect.succeed(UnifiDnsPolicy.Provider.of(handlers)));\n",
@@ -28,8 +28,8 @@
28
28
  "/**\n * B0b / T9: a CONSUMER-SIDE sequential offset-pager for the SDK's list operations. None of them\n * paginate on their own — `getNetworksOverviewPage`, `getFirewallZones`, `getAclRules`, … all take\n * `{ ..., offset?, limit? }` and answer `{ count, data, limit, offset, totalCount }` (the shape\n * `protocol.ts`'s own header names); there is no `smithy.api#paginated` trait in the pinned spec\n * to generate a helper from.\n *\n * ⛔ NO SDK OR `@distilled.cloud/core` CHANGE (M1 — upstream's own convention: pagination stays\n * out of the 59 packages walked down for `distilled-doctrine`). This is a plain function over\n * whatever `Effect.Effect<OffsetPage<T>, E, R>` a resource file's own `fetchPage` already is.\n * ⛔ STOPS ON `totalCount`, NEVER ON `data.length < limit` (T9's own wording). A page can come back\n * short of the requested `limit` for reasons unrelated to \"this was the last page\" (a vendor-side\n * per-call cap, a narrow filter) — `totalCount` is the one number the response commits to, so it\n * is the only thing this loop trusts to stop early. An empty page (`data.length === 0`) is the\n * other legitimate stop, and the only one checked before `totalCount` is read.\n * ⚠️ NOT SEQUENCED AGAINST A LIVE CONSOLE THAT MUTATES BETWEEN CALLS. `totalCount` is whatever the\n * MOST RECENT page reported; a page walk racing a live edit could see a row twice, miss one, or\n * just see a moving target. `homeflare-network`'s own import already treats one family's fetch\n * as one sequenced run for this reason (T27's neighboring trap) — nothing here can fix a\n * concurrent mutation, only DETECT the common ways one shows up (below) instead of returning a\n * silently wrong row set.\n *\n * ⚠️ RED TEAM (2026-09-26, IMPORTANT-3): the first version of this file trusted the vendor's\n * paged response completely — a lying or drifting `totalCount`, an ignored `offset`, or a row\n * added/removed mid-walk all produced a WRONG row set with no signal at all (silent truncation,\n * an infinite loop, or a subtly incomplete list an importer would commit as if it were correct).\n * Every list op's response already carries `offset` alongside `totalCount` (`networks.ts`'s\n * `NetworkOverviewPage`, and `protocol.ts`'s header for every OTHER list op too); the three\n * checks below are consistency proofs built entirely from fields the vendor already sends, plus\n * a hard ceiling as a backstop against a walk that can never converge. These are typed failures,\n * not `Effect.die`: an inconsistent paged response is a VENDOR-DATA condition a caller may\n * legitimately want to retry or report on (distilled-doctrine: a defect is for \"structurally\n * impossible\" code paths, not for data the wire actually sent).\n */\nimport * as Data from 'effect/Data';\nimport * as Effect from 'effect/Effect';\n\n/** The one response shape every UniFi Network list operation already has (`protocol.ts`). */\nexport interface OffsetPage<T> {\n readonly data: readonly T[];\n readonly offset: number;\n readonly totalCount: number;\n}\n\n/** The one request shape every UniFi Network list operation already accepts, plus its own fields. */\nexport type OffsetPageRequest = { readonly offset?: number; readonly limit?: number };\n\n/** Well past any family's real row count, even at a one-row page size (`docs/unifi.md`: a real\n * console's largest family is in the hundreds, not thousands) — a walk that reaches this many\n * pages is not looking at a real UniFi site, it is looking at a response that never lets `offset`\n * converge on `totalCount`. */\nconst MAX_PAGES = 1000;\n\nexport class UnifiPaginationInconsistent extends Data.TaggedError('UnifiPaginationInconsistent')<{\n readonly reason:\n | 'offset-mismatch'\n | 'total-count-changed'\n | 'row-count-mismatch'\n | 'page-ceiling';\n readonly detail: string;\n}> {\n override get message(): string {\n return (\n `UniFi pager: ${this.reason} -- ${this.detail}. The paged response contradicted itself (or ` +\n 'the walk ran implausibly long); the rows collected so far cannot be trusted and are not returned.'\n );\n }\n}\n\n/**\n * Walks every page of `fetchPage`, starting at `request.offset ?? 0`, and returns every row in\n * order. `request.limit`, if given, is kept as the page size for every call; the vendor's own\n * default applies otherwise — this loop never invents one (T18: \"pass ops only their own fields\").\n *\n * Three self-consistency checks run against fields the vendor already sends with every page —\n * detection, not a fix, for the \"live console mutates mid-walk\" case the header above accepts as\n * unfixable from the client alone: a row added AND removed in the same window can still net out to\n * a `totalCount` and final row count that agree by coincidence. What this closes is the SILENT\n * version of every case actually observed in review: an ignored `offset`, a `totalCount` that\n * drifts between calls, and an undercounted `totalCount` that truncates the walk early.\n *\n * ⛔ `numOrPlaceholder` (red team, MINOR-3, 2026-09-26): nothing in `@distilled.cloud/core` decodes\n * or validates a page response's shape (this file's own `wifi-broadcast.ts` neighbor documents\n * why), so `page.offset`/`page.totalCount` can be ANY JSON value, not just a number, if the wire\n * ever sends something malformed. Every `detail` string below prints these through\n * `numOrPlaceholder` rather than raw template interpolation, so a non-numeric value — however it\n * got there — can never inject arbitrary response text into an error message a caller might log.\n */\n/** A finite number renders as itself; anything else (a malformed wire value) renders as a fixed\n * placeholder, never as the value itself — see this file's header (MINOR-3). */\nconst numOrPlaceholder = (value: unknown): string =>\n typeof value === 'number' && Number.isFinite(value) ? String(value) : '<non-numeric>';\n\nexport const pageAll = <Req extends OffsetPageRequest, T, E, R>(\n fetchPage: (request: Req) => Effect.Effect<OffsetPage<T>, E, R>,\n request: Req,\n): Effect.Effect<T[], E | UnifiPaginationInconsistent, R> =>\n Effect.gen(function* () {\n const rows: T[] = [];\n const startOffset = request.offset ?? 0;\n let offset = startOffset;\n let totalCount: number | undefined;\n for (let pageCount = 1; ; pageCount++) {\n if (pageCount > MAX_PAGES) {\n return yield* new UnifiPaginationInconsistent({\n reason: 'page-ceiling',\n detail: `stopped after ${MAX_PAGES} pages at offset ${offset} without reaching totalCount`,\n });\n }\n // ⚠️ THE CAST IS SOUND, NOT A SHORTCUT: `Req` is a generic parameter, so TS cannot see that\n // spreading a value already typed `Req` and overriding one of `OffsetPageRequest`'s own\n // fields reconstructs a `Req` — but every field except `offset` is untouched from the\n // caller's own `request`, so it does.\n const page = yield* fetchPage({ ...request, offset } as Req);\n if (page.offset !== offset) {\n return yield* new UnifiPaginationInconsistent({\n reason: 'offset-mismatch',\n detail: `requested offset ${offset}, page echoed ${numOrPlaceholder(page.offset)} -- rows may be duplicated or skipped`,\n });\n }\n if (totalCount !== undefined && page.totalCount !== totalCount) {\n return yield* new UnifiPaginationInconsistent({\n reason: 'total-count-changed',\n detail: `totalCount changed from ${numOrPlaceholder(totalCount)} to ${numOrPlaceholder(page.totalCount)} between page calls`,\n });\n }\n totalCount = page.totalCount;\n rows.push(...page.data);\n if (page.data.length === 0) break;\n offset += page.data.length;\n if (offset >= totalCount) break;\n }\n const expected = totalCount - startOffset;\n if (rows.length !== expected) {\n return yield* new UnifiPaginationInconsistent({\n reason: 'row-count-mismatch',\n detail: `collected ${rows.length} rows but totalCount(${numOrPlaceholder(totalCount)}) - startOffset(${startOffset}) = ${numOrPlaceholder(expected)}`,\n });\n }\n return rows;\n });\n",
29
29
  "/**\n * `Unifi.FirewallPolicy` — one firewall policy on a UniFi Network site. READ/ADOPT-ONLY for every\n * row (`policy.ts`), EXCEPT create for a row whose declared `name` starts `hf: `\n * (`isHfPolicyName`, Tim 2026-10-19 ~16:20Z) — `update` and `delete` stay refused even for an\n * `hf:` row. `Unifi.FirewallPolicyOrdering` (`firewall-policy-ordering.ts`) is the sibling\n * resource for policy ORDER within a zone pair (T5) — one per `(sourceFirewallZoneId,\n * destinationFirewallZoneId)`, still read-only; this lift does not touch it, so a created `hf:`\n * row lands wherever the controller places a new policy, and placing it ahead of its zone pair's\n * \"Block All Traffic\" (if the controller does not already do that) would need an ordering WRITE —\n * a second, separate lift this PR does not make (see `docs/unifi-firewall-policy.md`).\n *\n * ★ T11 GATE, CHECKED 2026-09-26: the `Firewall` tag's 13 operations (5 already covered for\n * `Unifi.FirewallZone` in `docs/unifi.md`, 8 new here for `FirewallPolicy` — `getFirewallPolicies`,\n * `createFirewallPolicy`, `getFirewallPolicyOrdering`, `updateFirewallPolicyOrdering`,\n * `deleteFirewallPolicy`, `getFirewallPolicy`, `patchFirewallPolicy`, `updateFirewallPolicy`) are\n * byte-identical between 10.4.57 and 10.6.97, full raw operation objects; the 106-schema closure\n * reachable from all 13 (`$ref` + `discriminator.mapping`) shares zero names with the 14 schemas\n * that DID change elsewhere in the document. Corroborated independently by the A3 changeset's own\n * broader 25-operation/139-schema re-check (`.changeset/unifi-network-a3-typed-discriminator-filters.md`).\n * Full breakdown: `docs/unifi-firewall-policy.md`.\n *\n * ⛔ `fetchLive` LOCATES BY `name` WHEN `firewallPolicyId` IS ABSENT (an `hf:` creatable\n * declaration never has the vendor id before its first successful create). A real site's policy\n * count is in the hundreds (T9, 424 live policies), so this walks every page with `pageAll`\n * rather than trusting any one page to hold the match — same reasoning netbox's `locateOne`\n * gives for a server-side filter that cannot be trusted alone, except here there IS no\n * server-side name filter at all, so every row is paged. More than one row sharing a name is a\n * defect, not a reason to take the first: `policy.ts`'s naming convention is exactly `hf: <desc>`\n * because a free-text description makes a collision astronomically unlikely, but if the console\n * ever has one, this engine refuses to guess which row is \"the\" declared one.\n */\nimport { Resource } from 'alchemy';\nimport { adopt } from 'alchemy/AdoptPolicy';\nimport * as Provider from 'alchemy/Provider';\nimport * as firewall from '@distilled.cloud/unifi-network/firewall';\nimport * as Effect from 'effect/Effect';\nimport {\n checkHfCreateScope,\n firewallPolicyCreateAllowedWrite,\n writeFirewallPolicyCreate,\n} from './firewall-policy-create.ts';\nimport { driftOf } from './firewall-policy-drift.ts';\nimport {\n type FirewallPolicyAttributes,\n type FirewallPolicyProps,\n attributesOf,\n} from './firewall-policy-form.ts';\nimport { matches } from './firewall-policy-drift.ts';\nimport { type UnifiPaginationInconsistent, pageAll } from './paginate.ts';\nimport type { UnifiRequirements, UnifiSpec } from './resource.ts';\nimport { unifiHandlers } from './resource.ts';\nimport type { UnifiWriteRefused } from './policy.ts';\n\nexport type { FirewallPolicyAttributes, FirewallPolicyProps } from './firewall-policy-form.ts';\nexport { declareFirewallPolicy } from './firewall-policy-form.ts';\nexport { driftOf } from './firewall-policy-drift.ts';\n\n/** `checkHfCreateScope`'s typed refusal, union'd with the real create call's own error, same\n * shape `network.ts`'s own `UpdateError` gives its write half. */\ntype CreateError = UnifiWriteRefused | firewall.CreateFirewallPolicyError;\n\nexport interface UnifiFirewallPolicy extends Resource<\n 'Unifi.FirewallPolicy',\n FirewallPolicyProps,\n FirewallPolicyAttributes,\n never,\n UnifiRequirements\n> {}\n\nexport const UnifiFirewallPolicy = Resource<UnifiFirewallPolicy>('Unifi.FirewallPolicy', {\n defaultRemovalPolicy: 'retain',\n});\n\n/** `firewallPolicy('block-iot-wan', props)` — for an IMPORTED, adopt-only row (always carries the\n * vendor's `firewallPolicyId`). `adopt(true)` piped on by default (H5); see `network.ts`. */\nexport const firewallPolicy = (id: string, props: FirewallPolicyProps) =>\n UnifiFirewallPolicy(id, props).pipe(adopt(true));\n\n/**\n * `hfFirewallPolicy('ct100-to-nas-https', props)` — for a NEW, kit-creatable row: `props` has no\n * `firewallPolicyId` (the vendor assigns one), and `name` MUST start `hf: ` or this throws\n * immediately, at declaration time, rather than waiting for `createReconcile`'s own typed refusal\n * at deploy time. That typed refusal (`checkHfCreateScope`) is still the authoritative gate — this\n * is a second, earlier check for the common case of a typo, not a replacement for it; a caller\n * that builds `FirewallPolicyProps` by hand and calls `UnifiFirewallPolicy` directly still goes\n * through `checkHfCreateScope` and is still refused the same way.\n *\n * ⛔ NO `adopt(true)` HERE. This is a create path, not an adoption: a cold read finding an\n * existing row of this exact name is `Unowned`, same as any other family, and a plan that adopts\n * one silently is not what \"create\" means for this lift.\n */\nexport const hfFirewallPolicy = (\n id: string,\n props: Omit<FirewallPolicyProps, 'firewallPolicyId'>,\n) => {\n // ⚠️ `Omit` only rejects an excess property on a FRESH object literal passed at the call site —\n // a variable typed `FirewallPolicyProps` (which still has the field) passes the parameter type\n // check silently (Opus red team, 2026-10-19, SECONDARY FINDING). Checked at runtime so this\n // constructor cannot be the route past `checkHfCreateScope`'s own identity check either.\n if (\n 'firewallPolicyId' in props &&\n (props as { firewallPolicyId?: unknown }).firewallPolicyId !== undefined\n ) {\n throw new Error(\n `hfFirewallPolicy(${id}): props already carries a firewallPolicyId -- this constructor is ` +\n 'for a row that does not exist yet. A row with a vendor id is adopted or updated, never ' +\n 'created; use firewallPolicy() instead.',\n );\n }\n if (!props.name.startsWith('hf: ')) {\n throw new Error(\n `hfFirewallPolicy(${id}): name \"${props.name}\" does not start \"hf: \" -- only hf:-named ` +\n 'policies may be created by this kit (Tim 2026-10-19); rename the declaration.',\n );\n }\n return UnifiFirewallPolicy(id, props as FirewallPolicyProps);\n};\n\n/** One page of `getFirewallPolicies`, walked end to end and narrowed to the sole row named\n * `name` — the locate path `fetchLive` uses when `firewallPolicyId` is not yet known. */\nconst locateByName = (siteId: string, name: string) =>\n pageAll(firewall.getFirewallPolicies, { siteId }).pipe(\n Effect.map((rows) => {\n const matching = rows.filter((row) => row.name === name);\n if (matching.length > 1) {\n throw new Error(\n `Unifi.FirewallPolicy: ${String(matching.length)} live policies are named \"${name}\" on ` +\n `site ${siteId}. A name this engine locates by must be unique; rename one on the console.`,\n );\n }\n return matching[0];\n }),\n );\n\n/** ★ EXPORTED for direct testing against a fake `Credentials` layer — see `network.ts`'s own. */\nexport const spec: UnifiSpec<\n FirewallPolicyProps,\n firewall.FirewallPolicy,\n FirewallPolicyAttributes,\n firewall.GetFirewallPolicyError | firewall.GetFirewallPoliciesError | UnifiPaginationInconsistent,\n never,\n CreateError\n> = {\n type: 'Unifi.FirewallPolicy',\n describe: (props) =>\n props.firewallPolicyId === undefined\n ? `sites/${props.siteId}/firewall/policies/by-name/${props.name}`\n : `sites/${props.siteId}/firewall/policies/${props.firewallPolicyId}`,\n fetchLive: (props) =>\n props.firewallPolicyId === undefined\n ? locateByName(props.siteId, props.name)\n : firewall\n .getFirewallPolicy({ siteId: props.siteId, firewallPolicyId: props.firewallPolicyId })\n .pipe(Effect.catchTag('NotFound', () => Effect.succeed(undefined))),\n attributes: attributesOf,\n matches,\n create: {\n allowedWrite: firewallPolicyCreateAllowedWrite,\n checkScope: checkHfCreateScope,\n write: writeFirewallPolicyCreate,\n identify: (props, written) => ({ ...props, firewallPolicyId: written.id }),\n driftOf,\n },\n};\n\nexport const handlers = unifiHandlers(spec);\n\nexport const UnifiFirewallPolicyProvider = () =>\n Provider.effect(UnifiFirewallPolicy, Effect.succeed(UnifiFirewallPolicy.Provider.of(handlers)));\n",
30
30
  "/**\n * `Unifi.FirewallPolicy`'s CREATE — the one write this family may make, and only for a row whose\n * declared `name` passes `policy.ts`'s `isHfPolicyName` (Tim 2026-10-19 ~16:20Z, \"Allow kit to\n * create hf: rules\"). THE ONLY FILE UNDER `src/unifi` ALLOWED TO NAME `createFirewallPolicy`\n * (`write-op-reference.test.ts`'s `WRITE_OP_ALLOWLIST` pins that, alongside `network-update.ts`'s\n * own `updateNetwork` entry).\n *\n * ⛔ A CREATE SENDS ONLY THE FIELDS THE DECLARATION OWNS — NEVER A SPREAD OF ANYTHING ELSE. Unlike\n * `network-update.ts`'s whole-object PUT (which must carry the untouched live object forward so\n * an omitted optional block is not read by the controller as \"turn it off\"), there IS no live\n * object yet: `createBody` builds `CreateFirewallPolicyRequest` field by field from `props`,\n * omitting every optional key `props` itself leaves `undefined` rather than sending it as\n * `null`/`undefined` (UniFi's \"missing = off\" rule cuts both ways — a key that is actually absent\n * from the JSON body is what \"this policy does not restrict on this axis\" means here, same as a\n * declaration that never sets `connectionStateFilter` means \"match every connection state\").\n * ⛔ `checkScope` RUNS BEFORE THE REQUEST, TYPED, NEVER A STRING COMPARISON INLINE AT THE CALL\n * SITE — one function (`policy.ts`'s `isHfPolicyName`) decides \"hf:\" everywhere this boundary is\n * checked, so a future second caller cannot drift from this one with a slightly different regex.\n *\n * 🔴 `checkScope` ALSO REFUSES A `firewallPolicyId` THAT IS ALREADY SET (Opus red team,\n * 2026-10-19, PRIMARY FINDING). `resource.ts`'s `create` branch runs for EVERY\n * `Unifi.FirewallPolicy` declaration with no prior Alchemy state, not only ones meant to\n * create — including every `firewallPolicy()` import `.pipe(adopt(true))`, and Tim's own live\n * console ALREADY names hand-made rules `hf: <desc>` (this file's sibling `policy.ts` cites\n * `hf: Vpn to MGMT (Magic WAN site-to-site)` as the existing convention). Before this check, an\n * hf:-named IMPORTED row whose `firewallPolicyId` stopped resolving (state lost, the rule\n * hand-deleted and recreated with a new id, a wrong id in a generated declaration) would GET\n * 404, fall into `createReconcile`, pass the name check, and POST A DUPLICATE — silently, with\n * a green plan, where every other family still refuses \"declared row absent\" outright\n * (`update-reconcile.ts`'s original behavior, unchanged for every family but this one). A\n * declaration carrying a vendor id is BY DEFINITION an existing row, adopted or updated, never\n * a fresh create; `firewallPolicyId !== undefined` is refused here before `isHfPolicyName` is\n * even checked, so this holds regardless of what the name says.\n */\nimport * as firewall from '@distilled.cloud/unifi-network/firewall';\nimport * as Effect from 'effect/Effect';\nimport { isHfPolicyName, refuseWrite } from './policy.ts';\nimport type { FirewallPolicyProps } from './firewall-policy-form.ts';\nimport type { AllowedWrite } from './wire-guard.ts';\n\n/** The site's fixed firewall-policies COLLECTION route — never a per-row path, since there is no\n * row id before this POST creates one. Takes `props` (not just a bare `siteId`) to match\n * `UnifiUpdate.allowedWrite`'s own shape, so `resource.ts`'s wiring treats both the same way. */\nexport const firewallPolicyCreateAllowedWrite = (props: FirewallPolicyProps): AllowedWrite => ({\n method: 'POST',\n tail: `/v1/sites/${props.siteId}/firewall/policies`,\n});\n\nconst describeByName = (props: FirewallPolicyProps) =>\n `sites/${props.siteId}/firewall/policies/by-name/${props.name}`;\n\n/** Refuses, typed, before any request: the one gate `createReconcile` calls before `write`.\n * Order matters for the message only (both refuse the same way) — the identity check runs\n * first because it is the one that must hold regardless of what the name says (see header). */\nexport const checkHfCreateScope = (props: FirewallPolicyProps) => {\n if (props.firewallPolicyId !== undefined) {\n return refuseWrite(\n 'Unifi.FirewallPolicy',\n `sites/${props.siteId}/firewall/policies/${props.firewallPolicyId}`,\n 'create',\n );\n }\n return isHfPolicyName(props.name)\n ? Effect.void\n : refuseWrite('Unifi.FirewallPolicy', describeByName(props), 'create');\n};\n\n/** Every field `CreateFirewallPolicyRequest` accepts, straight from the declaration, with an\n * absent optional field left OUT of the body entirely (never sent as `undefined`/`null`) —\n * `JSON.stringify` already drops an `undefined` value, but building the object field-by-field\n * rather than spreading `props` keeps this list the single place that enumerates exactly what a\n * create may send, so a future prop added to `FirewallPolicyProps` for some OTHER purpose cannot\n * silently become a wire field here without this file changing too. */\nexport const firewallPolicyCreateBody = (\n props: FirewallPolicyProps,\n): firewall.CreateFirewallPolicyRequest => ({\n siteId: props.siteId,\n action: props.action,\n ...(props.connectionStateFilter === undefined\n ? {}\n : { connectionStateFilter: props.connectionStateFilter }),\n ...(props.description === undefined ? {} : { description: props.description }),\n destination: props.destination,\n enabled: props.enabled,\n ipProtocolScope: props.ipProtocolScope,\n ...(props.ipsecFilter === undefined ? {} : { ipsecFilter: props.ipsecFilter }),\n loggingEnabled: props.loggingEnabled,\n name: props.name,\n ...(props.schedule === undefined ? {} : { schedule: props.schedule }),\n source: props.source,\n});\n\nexport const writeFirewallPolicyCreate = (props: FirewallPolicyProps) =>\n firewall.createFirewallPolicy(firewallPolicyCreateBody(props));\n",
31
- "/**\n * `Unifi.FirewallPolicy`'s wire shape — the declarable subset of `FirewallPolicy` (`getFirewallPolicy`'s\n * own decode target), and how a live read becomes both plan attributes and a rendered declaration.\n * Rule ORDER is a separate resource (`firewall-policy-ordering.ts`, T5) — this file is one policy's\n * own fields only.\n *\n * ★ `source`/`destination`/`ipProtocolScope`/`action`/`schedule` STAY COMPOUND, COMPARED WHOLESALE —\n * post-A3 (`8ee11f1`, \"type FirewallPolicy/ACL/TrafficMatchingList filters per discriminator\"),\n * these decode as real per-discriminator TS unions instead of `unknown`\n * (`discriminated-filter-decode.test.ts` proves the wire path keeps every key, including one this\n * pinned spec doesn't yet declare), so this file is honest about their real shape rather than\n * casting to `unknown` the way `acl-rule-form.ts` still does for its own opaque filters. It does\n * NOT follow that up with a leaf-by-leaf declarable schema for all 12 filter variants, though:\n * that is new modelling work this PR does not attempt, so each field is compared with plain\n * `deepEqual` (`stripNullish`) as ONE value, same proportion `acl-rule-form.ts`'s\n * `enforcingDeviceFilter` gets (one level of structure, not exploded into scalars).\n *\n * ⚠️ KNOWN GAP (T15, same shape as `acl-rule-form.ts`'s own — accepted, not fixed, here either):\n * several of the vendor's filter variants nested inside `source`/`destination`/`ipProtocolScope`\n * are themselves SET-LIKE arrays with no documented order —\n * `FirewallPolicyMACAddressFilter.macAddresses`, `FirewallPolicyNetworkFilter.networkIds`,\n * `FirewallPolicyApplicationFilter.applicationIds`, `FirewallPolicyIPAddressFilter.items`,\n * `FirewallPolicyRegionFilter.regions`, `FirewallPolicyVPNServerFilter.vpnServerIds`,\n * `FirewallSchedule.repeatOnDays` — `deepEqual` compares every one of them order-sensitively, so a\n * console-side reorder with no membership change would report a spurious drift this read-only\n * family's `reconcile` then refuses forever. Not fixed here for the same reason ACL's own gap\n * isn't: normalizing 12 filter variants' own nested arrays is a bigger, separate change, not a\n * proportional extension of typing per-discriminator (A3) into set-aware comparison too.\n *\n * ⛔ `connectionStateFilter` IS THE ONE TOP-LEVEL PROPS ARRAY, AND IS A SET — \"Match on firewall\n * connection state. If null, matches all connection states\" describes membership, not a sequence\n * (unlike `firewall-policy-ordering-form.ts`'s own `beforeSystemDefined`/`afterSystemDefined`,\n * where position IS the value). Normalized with the same `sortedSet` every other family in this\n * directory uses for a set-shaped array (`firewall-zone-form.ts`'s `networkIds`,\n * `acl-rule-form.ts`'s `protocolFilter`).\n *\n * ⛔ `index` IS ATTRIBUTES-ONLY, NEVER DECLARED. `CreateFirewallPolicyRequest` has no `index`\n * field at all — the live object's current position among ALL policies on the site is reported,\n * but a policy's PRIORITY relative to its own zone pair is `firewall-policy-ordering.ts`'s concern\n * (`OrderedFirewallPolicyIDs`), same split `acl-rule-form.ts`'s own `index` documents.\n *\n * ⛔ `metadata.origin` IS ATTRIBUTES-ONLY, same split every other family here uses\n * (`firewall-zone-form.ts`'s `metadataOrigin`) — `UserOrSystemDefinedOrDerivedEntityMetadata` is\n * server-derived, no writable field accepts it.\n */\nimport type * as firewall from '@distilled.cloud/unifi-network/firewall';\n\nconst sortedSet = (values: readonly string[]): string[] => [...new Set(values)].sort();\n\n/** ★ EXPORTED so `firewall-policy-drift.ts` normalizes both live and declared sides identically —\n * see `acl-rule-form.ts`'s own header for why a normalizer applied to only one side is a bug\n * class (MEDIUM-4). */\nexport const normalizeConnectionStateFilter = (\n value: readonly string[] | undefined,\n): string[] | undefined => (value == null ? undefined : sortedSet(value));\n\n/** ⚠️ EVERY OPTIONAL FIELD SPELLS OUT `| undefined` — `exactOptionalPropertyTypes`; see\n * `network-form.ts`'s own header.\n *\n * ⛔ `firewallPolicyId` IS OPTIONAL SINCE THE 2026-10-19 hf: CREATE LIFT. An adopt-only\n * declaration (`declareFirewallPolicy`, every imported row) always carries the vendor id it was\n * read from. A fresh `hf:` creatable declaration (`declareHfFirewallPolicy` below) does not have\n * one yet — the vendor assigns it on `createFirewallPolicy`'s response — so `spec.fetchLive`\n * (`firewall-policy.ts`) locates by `name` instead of `id` whenever this is absent (netbox's\n * `locateOne` is the precedent for identity-by-natural-key over identity-by-vendor-id). */\nexport interface FirewallPolicyProps {\n siteId: string;\n firewallPolicyId?: string | undefined;\n action: firewall.FirewallPolicyAction;\n /** Connection states this policy matches — compared as a SET, see the header. */\n connectionStateFilter?: string[] | undefined;\n description?: string | undefined;\n /** Traffic destination — compound, compared wholesale; see the header's known gap. */\n destination: firewall.FirewallPolicyDestination;\n enabled: boolean;\n /** IP version + protocol scope — compound, compared wholesale; see the header's known gap. */\n ipProtocolScope: firewall.FirewallPolicyIPProtocolScope;\n ipsecFilter?: string | undefined;\n loggingEnabled: boolean;\n name: string;\n /** Schedule this policy is active on — compound, compared wholesale; see the header's known gap. */\n schedule?: firewall.FirewallSchedule | undefined;\n /** Traffic source — compound, compared wholesale; see the header's known gap. */\n source: firewall.FirewallPolicySource;\n}\n\nexport interface FirewallPolicyAttributes {\n siteId: string;\n firewallPolicyId: string;\n action: firewall.FirewallPolicyAction;\n connectionStateFilter: string[] | undefined;\n description: string | undefined;\n destination: firewall.FirewallPolicyDestination;\n enabled: boolean;\n /** Current position among ALL policies on the site — server-derived, never declared; see header. */\n index: number;\n ipProtocolScope: firewall.FirewallPolicyIPProtocolScope;\n ipsecFilter: string | undefined;\n loggingEnabled: boolean;\n name: string;\n schedule: firewall.FirewallSchedule | undefined;\n source: firewall.FirewallPolicySource;\n /** `metadata.origin` — server-derived, never declared; see `firewall-zone-form.ts`'s own. */\n metadataOrigin: string;\n}\n\nexport const attributesOf = (\n live: firewall.FirewallPolicy,\n props: FirewallPolicyProps,\n): FirewallPolicyAttributes => ({\n siteId: props.siteId,\n firewallPolicyId: live.id,\n action: live.action,\n connectionStateFilter: normalizeConnectionStateFilter(live.connectionStateFilter),\n description: live.description,\n destination: live.destination,\n enabled: live.enabled,\n index: live.index,\n ipProtocolScope: live.ipProtocolScope,\n ipsecFilter: live.ipsecFilter,\n loggingEnabled: live.loggingEnabled,\n name: live.name,\n schedule: live.schedule,\n source: live.source,\n metadataOrigin: live.metadata.origin,\n});\n\n/**\n * The declaration renderer (task spec: \"given one live object, return the props a declaration\n * needs so its plan is noop\"). A later import script feeds `getFirewallPolicy`'s own response\n * straight in and writes the result as `firewallPolicy('<id>', declareFirewallPolicy(live, siteId))`\n * — no field is invented or defaulted beyond what `attributesOf` already reports, so\n * `matches(attributesOf(live, props), declareFirewallPolicy(live, siteId))` is `true` by\n * construction (`firewall-policy.test.ts` proves it).\n */\nexport const declareFirewallPolicy = (\n live: firewall.FirewallPolicy,\n siteId: string,\n): FirewallPolicyProps => ({\n siteId,\n firewallPolicyId: live.id,\n action: live.action,\n connectionStateFilter: normalizeConnectionStateFilter(live.connectionStateFilter),\n description: live.description,\n destination: live.destination,\n enabled: live.enabled,\n ipProtocolScope: live.ipProtocolScope,\n ipsecFilter: live.ipsecFilter,\n loggingEnabled: live.loggingEnabled,\n name: live.name,\n schedule: live.schedule,\n source: live.source,\n});\n",
32
- "/**\n * `Unifi.FirewallPolicy`'s `matches` AND `driftOf` (B6) — both built on the ONE field list below,\n * the same `fieldDrift`-is-the-only-comparison shape `network-drift.ts`'s header explains (MEDIUM-4,\n * red team, 2026-09-26): `matches(attrs, props) === (driftOf(live, props).length === 0)` is true\n * BY CONSTRUCTION, never two hand-kept-in-sync comparisons.\n *\n * ⚠️ `stripNullish: true` ON EVERY FIELD BY DEFAULT (`drift.ts`'s `defaultEqual`) — same \"UniFi's\n * JSON answers `null`, a declaration omits\" tolerance every other family here relies on.\n * ⛔ `connectionStateFilter` RUNS THROUGH `firewall-policy-form.ts`'s normalizer on BOTH sides\n * before comparing — never applied to only `live` or only `declared` (the specific gap MEDIUM-4's\n * own mutant found in `network-drift.ts`; see its header, and `acl-rule-drift.ts`'s own repeat of\n * this same rule for `protocolFilter`/`enforcingDeviceFilter`).\n * ★ `action`/`destination`/`ipProtocolScope`/`schedule`/`source` compare with the plain default\n * `equal` (whole-value `deepEqual`) — see `firewall-policy-form.ts`'s header for the accepted\n * known gap this leaves in their own nested set-like arrays.\n */\nimport type * as firewall from '@distilled.cloud/unifi-network/firewall';\nimport { makeDriftOf } from './drift.ts';\nimport {\n type FirewallPolicyAttributes,\n type FirewallPolicyProps,\n attributesOf,\n normalizeConnectionStateFilter,\n} from './firewall-policy-form.ts';\n\nconst fieldDrift = makeDriftOf<FirewallPolicyAttributes, FirewallPolicyProps>([\n { field: 'action', live: (a) => a.action, declared: (p) => p.action },\n {\n field: 'connectionStateFilter',\n live: (a) => normalizeConnectionStateFilter(a.connectionStateFilter),\n declared: (p) => normalizeConnectionStateFilter(p.connectionStateFilter),\n },\n { field: 'description', live: (a) => a.description, declared: (p) => p.description },\n { field: 'destination', live: (a) => a.destination, declared: (p) => p.destination },\n { field: 'enabled', live: (a) => a.enabled, declared: (p) => p.enabled },\n { field: 'ipProtocolScope', live: (a) => a.ipProtocolScope, declared: (p) => p.ipProtocolScope },\n { field: 'ipsecFilter', live: (a) => a.ipsecFilter, declared: (p) => p.ipsecFilter },\n { field: 'loggingEnabled', live: (a) => a.loggingEnabled, declared: (p) => p.loggingEnabled },\n { field: 'name', live: (a) => a.name, declared: (p) => p.name },\n { field: 'schedule', live: (a) => a.schedule, declared: (p) => p.schedule },\n { field: 'source', live: (a) => a.source, declared: (p) => p.source },\n]);\n\nexport const matches = (\n attributes: FirewallPolicyAttributes,\n props: FirewallPolicyProps,\n): boolean => fieldDrift(attributes, props).length === 0;\n\n/**\n * Per-field live-vs-declared drift straight from one live read — the task's own API\n * (`driftOf(live, props)`), so `homeflare-network`'s pre-import drift check never has to derive\n * `attributesOf` itself just to call this.\n */\nexport const driftOf = (live: firewall.FirewallPolicy, props: FirewallPolicyProps) =>\n fieldDrift(attributesOf(live, props), props);\n",
31
+ "/**\n * `Unifi.FirewallPolicy`'s wire shape — the declarable subset of `FirewallPolicy` (`getFirewallPolicy`'s\n * own decode target), and how a live read becomes both plan attributes and a rendered declaration.\n * Rule ORDER is a separate resource (`firewall-policy-ordering.ts`, T5) — this file is one policy's\n * own fields only.\n *\n * ★ `source`/`destination`/`ipProtocolScope`/`action`/`schedule` STAY COMPOUND, COMPARED WHOLESALE —\n * post-A3 (`8ee11f1`, \"type FirewallPolicy/ACL/TrafficMatchingList filters per discriminator\"),\n * these decode as real per-discriminator TS unions instead of `unknown`\n * (`discriminated-filter-decode.test.ts` proves the wire path keeps every key, including one this\n * pinned spec doesn't yet declare), so this file is honest about their real shape rather than\n * casting to `unknown` the way `acl-rule-form.ts` still does for its own opaque filters. It does\n * NOT follow that up with a leaf-by-leaf declarable schema for all 12 filter variants, though:\n * that is new modelling work this PR does not attempt, so each field is compared with plain\n * `deepEqual` (`stripNullish`) as ONE value, same proportion `acl-rule-form.ts`'s\n * `enforcingDeviceFilter` gets (one level of structure, not exploded into scalars).\n *\n * ★ SET-LIKE NESTED ARRAYS COMPARE AS SETS (closed 2026-10-19; was T15's accepted gap). The\n * vendor's filter variants inside `source`/`destination`/`ipProtocolScope`/`schedule` carry\n * arrays with no documented order: `FirewallPolicyIPAddressFilter.items`, the port filter's\n * `items`, `FirewallPolicyMACAddressFilter.macAddresses`, `FirewallPolicyNetworkFilter.networkIds`,\n * `FirewallPolicyApplicationFilter.applicationIds`, `FirewallPolicyRegionFilter.regions`,\n * `FirewallPolicyVPNServerFilter.vpnServerIds`, `FirewallPolicyDomainFilter.domains`,\n * `applicationCategoryIds` and `FirewallSchedule.repeatOnDays`. Measured:\n * the controller (Network 11.0.83) stored a declared port list [443, 9100] as [9100, 443], so a\n * correct create failed its read-back (`UnifiCreateDidNotConverge`, homeflare-network PR 79).\n * `normalizeSetArrays` sorts every array under one of those keys (by canonical JSON) on BOTH\n * sides before `deepEqual`. Membership still has to match exactly, and duplicates are kept, so a\n * real change is never hidden.\n *\n * ⛔ `connectionStateFilter` IS THE ONE TOP-LEVEL PROPS ARRAY, AND IS A SET — \"Match on firewall\n * connection state. If null, matches all connection states\" describes membership, not a sequence\n * (unlike `firewall-policy-ordering-form.ts`'s own `beforeSystemDefined`/`afterSystemDefined`,\n * where position IS the value). Normalized with the same `sortedSet` every other family in this\n * directory uses for a set-shaped array (`firewall-zone-form.ts`'s `networkIds`,\n * `acl-rule-form.ts`'s `protocolFilter`).\n *\n * ⛔ `index` IS ATTRIBUTES-ONLY, NEVER DECLARED. `CreateFirewallPolicyRequest` has no `index`\n * field at all — the live object's current position among ALL policies on the site is reported,\n * but a policy's PRIORITY relative to its own zone pair is `firewall-policy-ordering.ts`'s concern\n * (`OrderedFirewallPolicyIDs`), same split `acl-rule-form.ts`'s own `index` documents.\n *\n * ⛔ `metadata.origin` IS ATTRIBUTES-ONLY, same split every other family here uses\n * (`firewall-zone-form.ts`'s `metadataOrigin`) — `UserOrSystemDefinedOrDerivedEntityMetadata` is\n * server-derived, no writable field accepts it.\n */\nimport type * as firewall from '@distilled.cloud/unifi-network/firewall';\n\nconst sortedSet = (values: readonly string[]): string[] => [...new Set(values)].sort();\n\n/** ★ EXPORTED so `firewall-policy-drift.ts` normalizes both live and declared sides identically —\n * see `acl-rule-form.ts`'s own header for why a normalizer applied to only one side is a bug\n * class (MEDIUM-4). */\nexport const normalizeConnectionStateFilter = (\n value: readonly string[] | undefined,\n): string[] | undefined => (value == null ? undefined : sortedSet(value));\n\n/** Keys whose array value is a set in the vendor's firewall filter schemas (header). */\nconst SET_ARRAY_KEYS: ReadonlySet<string> = new Set([\n 'items',\n 'macAddresses',\n 'networkIds',\n 'applicationIds',\n 'regions',\n 'vpnServerIds',\n 'repeatOnDays',\n 'domains',\n 'applicationCategoryIds',\n]);\n\n/** Key-order-independent JSON: a hand-written `{start, stop, type}` and a decoded `{type, start,\n * stop}` must sort to the same place (Opus red team, kit PR 466). */\nconst sortKeys = (value: unknown): unknown =>\n Array.isArray(value)\n ? value.map(sortKeys)\n : value !== null && typeof value === 'object'\n ? Object.fromEntries(\n Object.keys(value as object)\n .sort()\n .map((k) => [k, sortKeys((value as Record<string, unknown>)[k])]),\n )\n : value;\nconst canonical = (value: unknown): string => JSON.stringify(sortKeys(normalizeSetArrays(value)));\n\n/** A deep copy with every SET_ARRAY_KEYS array sorted by canonical JSON (duplicates kept). */\nexport const normalizeSetArrays = <T>(value: T): T => {\n if (Array.isArray(value)) return value.map((v) => normalizeSetArrays(v)) as T;\n if (value === null || typeof value !== 'object') return value;\n const out: Record<string, unknown> = {};\n for (const [key, inner] of Object.entries(value as Record<string, unknown>)) {\n out[key] =\n SET_ARRAY_KEYS.has(key) && Array.isArray(inner)\n ? [...inner]\n .map((v) => normalizeSetArrays(v))\n .sort((x, y) =>\n canonical(x) < canonical(y) ? -1 : canonical(x) > canonical(y) ? 1 : 0,\n )\n : normalizeSetArrays(inner);\n }\n return out as T;\n};\n\n/** ⚠️ EVERY OPTIONAL FIELD SPELLS OUT `| undefined` — `exactOptionalPropertyTypes`; see\n * `network-form.ts`'s own header.\n *\n * ⛔ `firewallPolicyId` IS OPTIONAL SINCE THE 2026-10-19 hf: CREATE LIFT. An adopt-only\n * declaration (`declareFirewallPolicy`, every imported row) always carries the vendor id it was\n * read from. A fresh `hf:` creatable declaration (`declareHfFirewallPolicy` below) does not have\n * one yet — the vendor assigns it on `createFirewallPolicy`'s response — so `spec.fetchLive`\n * (`firewall-policy.ts`) locates by `name` instead of `id` whenever this is absent (netbox's\n * `locateOne` is the precedent for identity-by-natural-key over identity-by-vendor-id). */\nexport interface FirewallPolicyProps {\n siteId: string;\n firewallPolicyId?: string | undefined;\n action: firewall.FirewallPolicyAction;\n /** Connection states this policy matches — compared as a SET, see the header. */\n connectionStateFilter?: string[] | undefined;\n description?: string | undefined;\n /** Traffic destination — compound, compared wholesale with set-like arrays normalized; see the header. */\n destination: firewall.FirewallPolicyDestination;\n enabled: boolean;\n /** IP version + protocol scope — compound, compared wholesale with set-like arrays normalized; see the header. */\n ipProtocolScope: firewall.FirewallPolicyIPProtocolScope;\n ipsecFilter?: string | undefined;\n loggingEnabled: boolean;\n name: string;\n /** Schedule this policy is active on — compound, compared wholesale with set-like arrays normalized; see the header. */\n schedule?: firewall.FirewallSchedule | undefined;\n /** Traffic source — compound, compared wholesale with set-like arrays normalized; see the header. */\n source: firewall.FirewallPolicySource;\n}\n\nexport interface FirewallPolicyAttributes {\n siteId: string;\n firewallPolicyId: string;\n action: firewall.FirewallPolicyAction;\n connectionStateFilter: string[] | undefined;\n description: string | undefined;\n destination: firewall.FirewallPolicyDestination;\n enabled: boolean;\n /** Current position among ALL policies on the site — server-derived, never declared; see header. */\n index: number;\n ipProtocolScope: firewall.FirewallPolicyIPProtocolScope;\n ipsecFilter: string | undefined;\n loggingEnabled: boolean;\n name: string;\n schedule: firewall.FirewallSchedule | undefined;\n source: firewall.FirewallPolicySource;\n /** `metadata.origin` — server-derived, never declared; see `firewall-zone-form.ts`'s own. */\n metadataOrigin: string;\n}\n\nexport const attributesOf = (\n live: firewall.FirewallPolicy,\n props: FirewallPolicyProps,\n): FirewallPolicyAttributes => ({\n siteId: props.siteId,\n firewallPolicyId: live.id,\n action: live.action,\n connectionStateFilter: normalizeConnectionStateFilter(live.connectionStateFilter),\n description: live.description,\n destination: live.destination,\n enabled: live.enabled,\n index: live.index,\n ipProtocolScope: live.ipProtocolScope,\n ipsecFilter: live.ipsecFilter,\n loggingEnabled: live.loggingEnabled,\n name: live.name,\n schedule: live.schedule,\n source: live.source,\n metadataOrigin: live.metadata.origin,\n});\n\n/**\n * The declaration renderer (task spec: \"given one live object, return the props a declaration\n * needs so its plan is noop\"). A later import script feeds `getFirewallPolicy`'s own response\n * straight in and writes the result as `firewallPolicy('<id>', declareFirewallPolicy(live, siteId))`\n * — no field is invented or defaulted beyond what `attributesOf` already reports, so\n * `matches(attributesOf(live, props), declareFirewallPolicy(live, siteId))` is `true` by\n * construction (`firewall-policy.test.ts` proves it).\n */\nexport const declareFirewallPolicy = (\n live: firewall.FirewallPolicy,\n siteId: string,\n): FirewallPolicyProps => ({\n siteId,\n firewallPolicyId: live.id,\n action: live.action,\n connectionStateFilter: normalizeConnectionStateFilter(live.connectionStateFilter),\n description: live.description,\n destination: live.destination,\n enabled: live.enabled,\n ipProtocolScope: live.ipProtocolScope,\n ipsecFilter: live.ipsecFilter,\n loggingEnabled: live.loggingEnabled,\n name: live.name,\n schedule: live.schedule,\n source: live.source,\n});\n",
32
+ "/**\n * `Unifi.FirewallPolicy`'s `matches` AND `driftOf` (B6) — both built on the ONE field list below,\n * the same `fieldDrift`-is-the-only-comparison shape `network-drift.ts`'s header explains (MEDIUM-4,\n * red team, 2026-09-26): `matches(attrs, props) === (driftOf(live, props).length === 0)` is true\n * BY CONSTRUCTION, never two hand-kept-in-sync comparisons.\n *\n * ⚠️ `stripNullish: true` ON EVERY FIELD BY DEFAULT (`drift.ts`'s `defaultEqual`) — same \"UniFi's\n * JSON answers `null`, a declaration omits\" tolerance every other family here relies on.\n * ⛔ `connectionStateFilter` RUNS THROUGH `firewall-policy-form.ts`'s normalizer on BOTH sides\n * before comparing — never applied to only `live` or only `declared` (the specific gap MEDIUM-4's\n * own mutant found in `network-drift.ts`; see its header, and `acl-rule-drift.ts`'s own repeat of\n * this same rule for `protocolFilter`/`enforcingDeviceFilter`).\n * ★ `destination`/`ipProtocolScope`/`schedule`/`source` run through `normalizeSetArrays` on BOTH\n * sides (set-like nested arrays compare as sets; `firewall-policy-form.ts`'s header), then the\n * default `deepEqual`. `action` compares wholesale.\n */\nimport type * as firewall from '@distilled.cloud/unifi-network/firewall';\nimport { makeDriftOf } from './drift.ts';\nimport {\n type FirewallPolicyAttributes,\n type FirewallPolicyProps,\n attributesOf,\n normalizeConnectionStateFilter,\n normalizeSetArrays,\n} from './firewall-policy-form.ts';\n\nconst fieldDrift = makeDriftOf<FirewallPolicyAttributes, FirewallPolicyProps>([\n { field: 'action', live: (a) => a.action, declared: (p) => p.action },\n {\n field: 'connectionStateFilter',\n live: (a) => normalizeConnectionStateFilter(a.connectionStateFilter),\n declared: (p) => normalizeConnectionStateFilter(p.connectionStateFilter),\n },\n { field: 'description', live: (a) => a.description, declared: (p) => p.description },\n {\n field: 'destination',\n live: (a) => normalizeSetArrays(a.destination),\n declared: (p) => normalizeSetArrays(p.destination),\n },\n { field: 'enabled', live: (a) => a.enabled, declared: (p) => p.enabled },\n {\n field: 'ipProtocolScope',\n live: (a) => normalizeSetArrays(a.ipProtocolScope),\n declared: (p) => normalizeSetArrays(p.ipProtocolScope),\n },\n { field: 'ipsecFilter', live: (a) => a.ipsecFilter, declared: (p) => p.ipsecFilter },\n { field: 'loggingEnabled', live: (a) => a.loggingEnabled, declared: (p) => p.loggingEnabled },\n { field: 'name', live: (a) => a.name, declared: (p) => p.name },\n {\n field: 'schedule',\n live: (a) => normalizeSetArrays(a.schedule),\n declared: (p) => normalizeSetArrays(p.schedule),\n },\n {\n field: 'source',\n live: (a) => normalizeSetArrays(a.source),\n declared: (p) => normalizeSetArrays(p.source),\n },\n]);\n\nexport const matches = (\n attributes: FirewallPolicyAttributes,\n props: FirewallPolicyProps,\n): boolean => fieldDrift(attributes, props).length === 0;\n\n/**\n * Per-field live-vs-declared drift straight from one live read — the task's own API\n * (`driftOf(live, props)`), so `homeflare-network`'s pre-import drift check never has to derive\n * `attributesOf` itself just to call this.\n */\nexport const driftOf = (live: firewall.FirewallPolicy, props: FirewallPolicyProps) =>\n fieldDrift(attributesOf(live, props), props);\n",
33
33
  "/**\n * `Unifi.FirewallPolicyOrdering` — the ordered `before`/`afterSystemDefined` policy-id lists for\n * ONE `(sourceFirewallZoneId, destinationFirewallZoneId)` zone pair (`getFirewallPolicyOrdering`,\n * `GET /v1/sites/{siteId}/firewall/policies/ordering`), READ-ONLY (`policy.ts`). T5/I4's per-family\n * variant: `docs/unifi.md`'s own header named this \"a future `Unifi.FirewallPolicyOrdering`\" as a\n * separate, bigger PR (see `acl-rule-ordering.ts`'s header for the same forward reference, now\n * resolved) — this is that resource.\n *\n * ⚠️ NOT ONE OBJECT PER SITE, UNLIKE `acl-rule-ordering.ts` — the identity is the TRIPLE\n * `(siteId, sourceFirewallZoneId, destinationFirewallZoneId)`, both zone ids passed as QUERY\n * parameters on the same path every time (`firewall.ts`'s `GetFirewallPolicyOrderingRequest`).\n * There is no \"list every zone pair with an ordering\" endpoint — a caller (a future Lane C import)\n * has to already know which pairs exist, typically by walking `firewall.getFirewallPolicies`\n * (T9's own 424-live-policy scale — B0b's `pageAll`, see `firewall-policy.test.ts`'s own decode\n * proof) and grouping by each policy's `source.zoneId`/`destination.zoneId`. Nothing here performs\n * that discovery — this resource is one already-known pair's ordering, same as\n * `firewall-policy.ts`/`acl-rule.ts` are one already-known object's own fields.\n */\nimport { Resource } from 'alchemy';\nimport { adopt } from 'alchemy/AdoptPolicy';\nimport * as Provider from 'alchemy/Provider';\nimport * as firewall from '@distilled.cloud/unifi-network/firewall';\nimport * as Effect from 'effect/Effect';\nimport {\n type FirewallPolicyOrderingAttributes,\n type FirewallPolicyOrderingProps,\n attributesOf,\n matches,\n} from './firewall-policy-ordering-form.ts';\nimport type { UnifiRequirements, UnifiSpec } from './resource.ts';\nimport { unifiHandlers } from './resource.ts';\n\nexport type {\n FirewallPolicyOrderingAttributes,\n FirewallPolicyOrderingProps,\n} from './firewall-policy-ordering-form.ts';\nexport { declareFirewallPolicyOrdering, driftOf } from './firewall-policy-ordering-form.ts';\n\nexport interface UnifiFirewallPolicyOrdering extends Resource<\n 'Unifi.FirewallPolicyOrdering',\n FirewallPolicyOrderingProps,\n FirewallPolicyOrderingAttributes,\n never,\n UnifiRequirements\n> {}\n\nexport const UnifiFirewallPolicyOrdering = Resource<UnifiFirewallPolicyOrdering>(\n 'Unifi.FirewallPolicyOrdering',\n { defaultRemovalPolicy: 'retain' },\n);\n\n/** `firewallPolicyOrdering('iot-to-external', props)` — `adopt(true)` piped on by default (H5); see\n * `network.ts`. */\nexport const firewallPolicyOrdering = (id: string, props: FirewallPolicyOrderingProps) =>\n UnifiFirewallPolicyOrdering(id, props).pipe(adopt(true));\n\n/** ★ EXPORTED for direct testing against a fake `Credentials` layer — see `network.ts`'s own. */\nexport const spec: UnifiSpec<\n FirewallPolicyOrderingProps,\n firewall.IntegrationFirewallPolicyOrderingDto,\n FirewallPolicyOrderingAttributes,\n firewall.GetFirewallPolicyOrderingError\n> = {\n type: 'Unifi.FirewallPolicyOrdering',\n describe: (props) =>\n `sites/${props.siteId}/firewall/policies/ordering` +\n `?sourceFirewallZoneId=${props.sourceFirewallZoneId}` +\n `&destinationFirewallZoneId=${props.destinationFirewallZoneId}`,\n fetchLive: (props) =>\n firewall\n .getFirewallPolicyOrdering({\n siteId: props.siteId,\n sourceFirewallZoneId: props.sourceFirewallZoneId,\n destinationFirewallZoneId: props.destinationFirewallZoneId,\n })\n .pipe(Effect.catchTag('NotFound', () => Effect.succeed(undefined))),\n attributes: attributesOf,\n matches,\n};\n\nexport const handlers = unifiHandlers(spec);\n\nexport const UnifiFirewallPolicyOrderingProvider = () =>\n Provider.effect(\n UnifiFirewallPolicyOrdering,\n Effect.succeed(UnifiFirewallPolicyOrdering.Provider.of(handlers)),\n );\n",
34
34
  "/**\n * `Unifi.FirewallPolicyOrdering`'s wire shape — ONE resource per `(sourceFirewallZoneId,\n * destinationFirewallZoneId)` ZONE PAIR (`getFirewallPolicyOrdering`'s own scope, `GET\n * /v1/sites/{siteId}/firewall/policies/ordering?sourceFirewallZoneId=…&destinationFirewallZoneId=…`),\n * not per policy and not site-wide. Compare with `acl-rule-ordering-form.ts`'s own header: ACL rule\n * order is ONE list for the whole site because ACL rules have no zone concept; firewall policies are\n * scoped to a zone pair (`firewall-zone.ts`'s own `Unifi.FirewallZone`), so the vendor keys ordering\n * the same way — a console can have as many `Unifi.FirewallPolicyOrdering` resources as it has\n * zone pairs with at least one user-defined policy between them.\n *\n * ⛔ T5 — `beforeSystemDefined`/`afterSystemDefined` ARE EACH A SEQUENCE, NEVER RUN THROUGH\n * `sortedSet`. `OrderedFirewallPolicyIDs`' own shape splits a zone pair's user-defined policies\n * into the ones ordered BEFORE the system-defined policies and the ones ordered AFTER them —\n * within each half, position is priority, the same \"lower index/earlier position wins\" reasoning\n * `acl-rule-ordering-form.ts` gives for `orderedAclRuleIds`. `drift.ts`'s `defaultEqual`\n * (`deepEqual`) already compares arrays element-by-element without sorting them, so leaving both\n * fields un-normalized is what makes the comparison order-sensitive, not an oversight.\n *\n * ★ TWO SEQUENCES, NOT ONE — the one real difference from `acl-rule-ordering-form.ts`'s single\n * `orderedAclRuleIds`. A policy ordered \"before system-defined\" and one ordered \"after\" can never\n * swap sides through this endpoint (there is no single combined list position that would let one\n * policy move from one half to the other) — `matches`/`driftOf` below compare each half\n * independently, so a policy moving from `beforeSystemDefined` to `afterSystemDefined` reports as\n * drift on BOTH fields, not a single reordering of one array.\n *\n * ★ `makeDriftOf`, NO CUSTOM `equal` — same framework every other family's `matches`/`driftOf`\n * share (MEDIUM-4). Its default `deepEqual` is already order-sensitive for arrays, so the absence\n * of a custom `equal` here is itself the \"never sortedSet\" rule in force, exactly as\n * `acl-rule-ordering-form.ts`'s own header explains for its one field.\n */\nimport type * as firewall from '@distilled.cloud/unifi-network/firewall';\nimport { makeDriftOf } from './drift.ts';\n\nexport interface FirewallPolicyOrderingProps {\n siteId: string;\n sourceFirewallZoneId: string;\n destinationFirewallZoneId: string;\n /** Policy IDs ordered before the zone pair's system-defined policies, highest priority first —\n * never compared as a set (see header). */\n beforeSystemDefined: string[];\n /** Policy IDs ordered after the zone pair's system-defined policies, highest priority first —\n * never compared as a set (see header). */\n afterSystemDefined: string[];\n}\n\nexport interface FirewallPolicyOrderingAttributes {\n siteId: string;\n sourceFirewallZoneId: string;\n destinationFirewallZoneId: string;\n beforeSystemDefined: string[];\n afterSystemDefined: string[];\n}\n\nexport const attributesOf = (\n live: firewall.IntegrationFirewallPolicyOrderingDto,\n props: FirewallPolicyOrderingProps,\n): FirewallPolicyOrderingAttributes => ({\n siteId: props.siteId,\n sourceFirewallZoneId: props.sourceFirewallZoneId,\n destinationFirewallZoneId: props.destinationFirewallZoneId,\n beforeSystemDefined: live.orderedFirewallPolicyIds.beforeSystemDefined,\n afterSystemDefined: live.orderedFirewallPolicyIds.afterSystemDefined,\n});\n\n/**\n * The declaration renderer (task spec: \"given one live object, return the props a declaration\n * needs so its plan is noop\"). A later import script feeds `getFirewallPolicyOrdering`'s own\n * response straight in and writes the result as `firewallPolicyOrdering('<id>',\n * declareFirewallPolicyOrdering(live, siteId, sourceZoneId, destZoneId))` —\n * `matches(attributesOf(live, props), declareFirewallPolicyOrdering(live, …))` is `true` by\n * construction (`firewall-policy-ordering.test.ts` proves it).\n */\nexport const declareFirewallPolicyOrdering = (\n live: firewall.IntegrationFirewallPolicyOrderingDto,\n siteId: string,\n sourceFirewallZoneId: string,\n destinationFirewallZoneId: string,\n): FirewallPolicyOrderingProps => ({\n siteId,\n sourceFirewallZoneId,\n destinationFirewallZoneId,\n beforeSystemDefined: live.orderedFirewallPolicyIds.beforeSystemDefined,\n afterSystemDefined: live.orderedFirewallPolicyIds.afterSystemDefined,\n});\n\nconst fieldDrift = makeDriftOf<FirewallPolicyOrderingAttributes, FirewallPolicyOrderingProps>([\n {\n field: 'beforeSystemDefined',\n live: (a) => a.beforeSystemDefined,\n declared: (p) => p.beforeSystemDefined,\n },\n {\n field: 'afterSystemDefined',\n live: (a) => a.afterSystemDefined,\n declared: (p) => p.afterSystemDefined,\n },\n]);\n\nexport const matches = (\n attributes: FirewallPolicyOrderingAttributes,\n props: FirewallPolicyOrderingProps,\n): boolean => fieldDrift(attributes, props).length === 0;\n\n/**\n * Per-field live-vs-declared drift straight from one live read — the task's own API\n * (`driftOf(live, props)`).\n */\nexport const driftOf = (\n live: firewall.IntegrationFirewallPolicyOrderingDto,\n props: FirewallPolicyOrderingProps,\n) => fieldDrift(attributesOf(live, props), props);\n",
35
35
  "/**\n * `Unifi.TrafficMatchingList` — one traffic matching list (IPv4/IPv6/port match entries) on a UniFi\n * Network site, READ-ONLY (`policy.ts`).\n *\n * ★ T11 GATE, CHECKED 2026-09-26: `Traffic Matching Lists`' 5 operations are byte-identical between\n * 10.4.57 and 10.6.97, full raw operation objects; the 19-schema closure reachable from all 5\n * (`$ref` + `discriminator.mapping`) shares zero names with the 14 schemas that DID change\n * elsewhere in the document. Corroborated independently by the A3 changeset's own broader\n * 25-operation/139-schema re-check (`.changeset/unifi-network-a3-typed-discriminator-filters.md`).\n * Full breakdown: `docs/unifi-traffic-matching-list.md`.\n */\nimport { Resource } from 'alchemy';\nimport { adopt } from 'alchemy/AdoptPolicy';\nimport * as Provider from 'alchemy/Provider';\nimport * as trafficMatchingLists from '@distilled.cloud/unifi-network/traffic_matching_lists';\nimport * as Effect from 'effect/Effect';\nimport {\n type TrafficMatchingListAttributes,\n type TrafficMatchingListProps,\n attributesOf,\n} from './traffic-matching-list-form.ts';\nimport { matches } from './traffic-matching-list-drift.ts';\nimport type { UnifiRequirements, UnifiSpec } from './resource.ts';\nimport { unifiHandlers } from './resource.ts';\n\nexport type {\n TrafficMatchingListAttributes,\n TrafficMatchingListProps,\n} from './traffic-matching-list-form.ts';\nexport { declareTrafficMatchingList } from './traffic-matching-list-form.ts';\nexport { driftOf } from './traffic-matching-list-drift.ts';\n\nexport interface UnifiTrafficMatchingList extends Resource<\n 'Unifi.TrafficMatchingList',\n TrafficMatchingListProps,\n TrafficMatchingListAttributes,\n never,\n UnifiRequirements\n> {}\n\nexport const UnifiTrafficMatchingList = Resource<UnifiTrafficMatchingList>(\n 'Unifi.TrafficMatchingList',\n { defaultRemovalPolicy: 'retain' },\n);\n\n/** `trafficMatchingList('office-subnets', props)` — `adopt(true)` piped on by default (H5); see\n * `network.ts`. */\nexport const trafficMatchingList = (id: string, props: TrafficMatchingListProps) =>\n UnifiTrafficMatchingList(id, props).pipe(adopt(true));\n\n/** ★ EXPORTED for direct testing against a fake `Credentials` layer — see `network.ts`'s own. */\nexport const spec: UnifiSpec<\n TrafficMatchingListProps,\n trafficMatchingLists.TrafficMatchingList,\n TrafficMatchingListAttributes,\n trafficMatchingLists.GetTrafficMatchingListError\n> = {\n type: 'Unifi.TrafficMatchingList',\n describe: (props) =>\n `sites/${props.siteId}/traffic-matching-lists/${props.trafficMatchingListId}`,\n fetchLive: (props) =>\n trafficMatchingLists\n .getTrafficMatchingList({\n siteId: props.siteId,\n trafficMatchingListId: props.trafficMatchingListId,\n })\n .pipe(Effect.catchTag('NotFound', () => Effect.succeed(undefined))),\n attributes: attributesOf,\n matches,\n};\n\nexport const handlers = unifiHandlers(spec);\n\nexport const UnifiTrafficMatchingListProvider = () =>\n Provider.effect(\n UnifiTrafficMatchingList,\n Effect.succeed(UnifiTrafficMatchingList.Provider.of(handlers)),\n );\n",
@@ -37,7 +37,7 @@
37
37
  "/**\n * `Unifi.TrafficMatchingList`'s `matches` AND `driftOf` (B6) — both built on the ONE field list\n * below, the same `fieldDrift`-is-the-only-comparison shape `network-drift.ts`'s header explains\n * (MEDIUM-4, red team, 2026-09-26): `matches(attrs, props) === (driftOf(live, props).length === 0)`\n * is true BY CONSTRUCTION, never two hand-kept-in-sync comparisons.\n *\n * ⚠️ `stripNullish: true` ON EVERY FIELD BY DEFAULT (`drift.ts`'s `defaultEqual`) — same \"UniFi's\n * JSON answers `null`, a declaration omits\" tolerance every other family here relies on.\n * ★ `items` compares with the plain default `equal` (whole-value `deepEqual`) — see\n * `traffic-matching-list-form.ts`'s header for the accepted known gap this leaves for a\n * membership-preserving reorder.\n */\nimport type * as trafficMatchingLists from '@distilled.cloud/unifi-network/traffic_matching_lists';\nimport { makeDriftOf } from './drift.ts';\nimport {\n type TrafficMatchingListAttributes,\n type TrafficMatchingListProps,\n attributesOf,\n} from './traffic-matching-list-form.ts';\n\nconst fieldDrift = makeDriftOf<TrafficMatchingListAttributes, TrafficMatchingListProps>([\n { field: 'name', live: (a) => a.name, declared: (p) => p.name },\n { field: 'type', live: (a) => a.type, declared: (p) => p.type },\n { field: 'items', live: (a) => a.items, declared: (p) => p.items },\n]);\n\nexport const matches = (\n attributes: TrafficMatchingListAttributes,\n props: TrafficMatchingListProps,\n): boolean => fieldDrift(attributes, props).length === 0;\n\n/**\n * Per-field live-vs-declared drift straight from one live read — the task's own API\n * (`driftOf(live, props)`), so `homeflare-network`'s pre-import drift check never has to derive\n * `attributesOf` itself just to call this.\n */\nexport const driftOf = (\n live: trafficMatchingLists.TrafficMatchingList,\n props: TrafficMatchingListProps,\n) => fieldDrift(attributesOf(live, props), props);\n",
38
38
  "/**\n * Every `Unifi.*` provider as one layer for a stack.\n *\n * Layer.mergeAll(unifiProviders(), …the stack's other providers)\n * .pipe(Layer.provide(FetchHttpClient.layer))\n *\n * S16: a subpath's `providers()` plays the role upstream's own `Providers.ts` does — one minimal\n * insertion per family. `FetchHttpClient.layer` is the stack's own responsibility to provide,\n * mirroring `../discord/providers.ts`.\n */\nimport * as Layer from 'effect/Layer';\nimport { UnifiAclRuleProvider } from './acl-rule.ts';\nimport { UnifiAclRuleOrderingProvider } from './acl-rule-ordering.ts';\nimport { UnifiDnsPolicyProvider } from './dns-policy.ts';\nimport { UnifiFirewallPolicyProvider } from './firewall-policy.ts';\nimport { UnifiFirewallPolicyOrderingProvider } from './firewall-policy-ordering.ts';\nimport { UnifiFirewallZoneProvider } from './firewall-zone.ts';\nimport { UnifiNetworkProvider } from './network.ts';\nimport { UnifiTrafficMatchingListProvider } from './traffic-matching-list.ts';\nimport { UnifiWifiBroadcastProvider } from './wifi-broadcast.ts';\n\nexport const providers = () =>\n Layer.mergeAll(\n UnifiNetworkProvider(),\n UnifiFirewallZoneProvider(),\n UnifiDnsPolicyProvider(),\n UnifiAclRuleProvider(),\n UnifiAclRuleOrderingProvider(),\n UnifiWifiBroadcastProvider(),\n UnifiFirewallPolicyProvider(),\n UnifiFirewallPolicyOrderingProvider(),\n UnifiTrafficMatchingListProvider(),\n );\n"
39
39
  ],
40
- "mappings": ";AAkBA;AACA;AAEO,IAAM,qBACX,mGACA,kGACA,qGACA,+FACA,mGACA,gGACA;AASK,IAAM,iBAAiB,CAAC,SAA0B,KAAK,WAAW,MAAM;AAGxE,IAAM,yBAAyB;AAAA;AAK/B,MAAM,0BAA+B,iBAAY,mBAA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AACF;AAEO,IAAM,YAAW,cAAc,KAAI;AAEnC,IAAM,mCAAmC,MACrC,iBACP,0BACO,iBAAQ,yBAAyB,SAAS,GAAG,SAAQ,CAAC,CAC/D;;AGnEF;AAWO,IAAM,YAAY,MACjB,eACJ,qBAAqB,GACrB,0BAA0B,GAC1B,uBAAuB,GACvB,qBAAqB,GACrB,6BAA6B,GAC7B,2BAA2B,GAC3B,4BAA4B,GAC5B,oCAAoC,GACpC,iCAAiC,CACnC;",
41
+ "debugId": "D14D4404F58A5F1264756E2164756E21",
42
42
  "names": []
43
43
  }
@@ -0,0 +1,53 @@
1
+ import { type NetworkProps } from './network.ts';
2
+ export declare const PATH = "/proxy/network/integration/v1/sites/site-1/networks/net-1";
3
+ export declare const IPV6: {
4
+ interfaceType: string;
5
+ prefixLength: number;
6
+ hostIpAddress: string;
7
+ clientAddressAssignment: {
8
+ slaacEnabled: boolean;
9
+ };
10
+ routerAdvertisement: {
11
+ priority: string;
12
+ };
13
+ };
14
+ export declare const BASE: NetworkProps;
15
+ export declare const WITH_V6: NetworkProps;
16
+ /** Raw live object, with a key the SDK schema has never heard of. */
17
+ export declare const live: (extra?: Record<string, unknown>) => {
18
+ name: string;
19
+ enabled: boolean;
20
+ management: string;
21
+ vlanId: number;
22
+ dhcpGuarding?: import("@distilled.cloud/unifi-network/networks").NetworkDHCPGuarding | undefined;
23
+ cellularBackupEnabled?: boolean | undefined;
24
+ internetAccessEnabled?: boolean | undefined;
25
+ ipv4Configuration?: unknown;
26
+ ipv6Configuration?: import("@distilled.cloud/unifi-network/networks").NetworkIPv6Configuration | undefined;
27
+ isolationEnabled?: boolean | undefined;
28
+ mdnsForwardingEnabled?: boolean | undefined;
29
+ zoneId?: string | undefined;
30
+ deviceId?: string | undefined;
31
+ id: string;
32
+ default: boolean;
33
+ metadata: {
34
+ origin: string;
35
+ };
36
+ futureTopLevelKey: string;
37
+ siteId: undefined;
38
+ networkId: undefined;
39
+ };
40
+ export declare const reconcile: (route: (method: string, url: URL) => Response, news: NetworkProps, olds: NetworkProps | undefined, outputArg?: object | null) => {
41
+ fake: {
42
+ fetch: typeof fetch;
43
+ seen: import("./fake-unifi.ts").Seen[];
44
+ };
45
+ notes: string[];
46
+ exit: Promise<import("effect/Exit").Exit<import("./network-form.ts").NetworkAttributes, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/caddy").BadRequest | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").Conflict | import("@distilled.cloud/caddy").Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/caddy").NotFound | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("./policy.ts").UnifiCreateDidNotConverge | import("./policy.ts").UnifiFieldNotRemovable | import("./policy.ts").UnifiFieldNotSettable | import("./policy.ts").UnifiIdentityChanged | import("./policy.ts").UnifiImmutableFieldChanged | import("./policy.ts").UnifiLiveDriftedSinceDeploy | import("./policy.ts").UnifiManagementNetworkRefused | import("@distilled.cloud/unifi-network/Errors").UnifiNetworkParseError | import("./policy.ts").UnifiUpdateDidNotConverge | import("./policy.ts").UnifiUpdateWouldBeNoop | import("./policy.ts").UnifiWriteRefused | import("@distilled.cloud/unifi-network/Errors").UnknownUnifiNetworkError | import("@distilled.cloud/caddy").UnprocessableEntity>>;
47
+ };
48
+ export declare const answering: (liveBody: object, put?: () => Response) => (method: string, url: URL) => Response;
49
+ export declare const putBody: (seen: ReadonlyArray<{
50
+ method: string;
51
+ body?: unknown;
52
+ }>) => Record<string, unknown>[];
53
+ //# sourceMappingURL=network-update.fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-update.fixtures.d.ts","sourceRoot":"","sources":["../../src/unifi/network-update.fixtures.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAQ,MAAM,cAAc,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AAI,EAAE,EAAE,IAAI;IACxD;sGACkG;IAClG,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,YAAY,CAAC;IACtD,8FAA8F;IAC9F,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC/D,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAC;IACjF,8FAA8F;IAC9F,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,KAAK,KAAK,CAAC;IAC1D,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,KAAK,aAAa,CAAC,UAAU,CAAC,CAAC;CAC3E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,SAAS,MAAM,EAAE,IAAI,EAAE,UAAU,SAAS,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,QACxF,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,QAC7C,KAAK,QACL,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,mIA8B1D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homeflare/alchemy",
3
- "version": "0.57.0",
3
+ "version": "0.58.0",
4
4
  "description": "Custom Alchemy providers for Cloudflare, Proxmox, OpenBao, Forgejo, Talos, launchd and Caddy, and a verifier that proves adoptions are no-ops.",
5
5
  "homepage": "https://github.com/taslabs-net/homeflare-kit/tree/main/packages/alchemy#readme",
6
6
  "bugs": "https://github.com/taslabs-net/homeflare-kit/issues",