@homeflare/distilled-opnsense 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +95 -0
  3. package/dist/credentials.d.ts +39 -0
  4. package/dist/credentials.d.ts.map +1 -0
  5. package/dist/credentials.js +78 -0
  6. package/dist/credentials.js.map +1 -0
  7. package/dist/errors.d.ts +110 -0
  8. package/dist/errors.d.ts.map +1 -0
  9. package/dist/errors.js +63 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/index.d.ts +29 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +29 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/protocol.d.ts +13 -0
  16. package/dist/protocol.d.ts.map +1 -0
  17. package/dist/protocol.js +115 -0
  18. package/dist/protocol.js.map +1 -0
  19. package/dist/retry.d.ts +56 -0
  20. package/dist/retry.d.ts.map +1 -0
  21. package/dist/retry.js +49 -0
  22. package/dist/retry.js.map +1 -0
  23. package/dist/services/firewall_alias.d.ts +243 -0
  24. package/dist/services/firewall_alias.d.ts.map +1 -0
  25. package/dist/services/firewall_alias.js +222 -0
  26. package/dist/services/firewall_alias.js.map +1 -0
  27. package/dist/services/firewall_category.d.ts +122 -0
  28. package/dist/services/firewall_category.d.ts.map +1 -0
  29. package/dist/services/firewall_category.js +161 -0
  30. package/dist/services/firewall_category.js.map +1 -0
  31. package/dist/services/firewall_filter.d.ts +289 -0
  32. package/dist/services/firewall_filter.d.ts.map +1 -0
  33. package/dist/services/firewall_filter.js +225 -0
  34. package/dist/services/firewall_filter.js.map +1 -0
  35. package/dist/services/firewall_group.d.ts +122 -0
  36. package/dist/services/firewall_group.d.ts.map +1 -0
  37. package/dist/services/firewall_group.js +154 -0
  38. package/dist/services/firewall_group.js.map +1 -0
  39. package/dist/services/index.d.ts +9 -0
  40. package/dist/services/index.d.ts.map +1 -0
  41. package/dist/services/index.js +10 -0
  42. package/dist/services/index.js.map +1 -0
  43. package/dist/services/quagga_bgp.d.ts +1135 -0
  44. package/dist/services/quagga_bgp.d.ts.map +1 -0
  45. package/dist/services/quagga_bgp.js +1263 -0
  46. package/dist/services/quagga_bgp.js.map +1 -0
  47. package/dist/services/quagga_general.d.ts +55 -0
  48. package/dist/services/quagga_general.d.ts.map +1 -0
  49. package/dist/services/quagga_general.js +48 -0
  50. package/dist/services/quagga_general.js.map +1 -0
  51. package/dist/services/quagga_service.d.ts +60 -0
  52. package/dist/services/quagga_service.d.ts.map +1 -0
  53. package/dist/services/quagga_service.js +77 -0
  54. package/dist/services/quagga_service.js.map +1 -0
  55. package/dist/services/routing_settings.d.ts +192 -0
  56. package/dist/services/routing_settings.d.ts.map +1 -0
  57. package/dist/services/routing_settings.js +169 -0
  58. package/dist/services/routing_settings.js.map +1 -0
  59. package/dist/traits.d.ts +11 -0
  60. package/dist/traits.d.ts.map +1 -0
  61. package/dist/traits.js +11 -0
  62. package/dist/traits.js.map +1 -0
  63. package/package.json +75 -0
  64. package/src/credentials.ts +111 -0
  65. package/src/errors.ts +115 -0
  66. package/src/index.ts +32 -0
  67. package/src/protocol.ts +177 -0
  68. package/src/retry.ts +80 -0
  69. package/src/services/firewall_alias.ts +572 -0
  70. package/src/services/firewall_category.ts +359 -0
  71. package/src/services/firewall_filter.ts +671 -0
  72. package/src/services/firewall_group.ts +350 -0
  73. package/src/services/index.ts +9 -0
  74. package/src/services/quagga_bgp.ts +2955 -0
  75. package/src/services/quagga_general.ts +132 -0
  76. package/src/services/quagga_service.ts +182 -0
  77. package/src/services/routing_settings.ts +419 -0
  78. package/src/traits.ts +36 -0
package/dist/index.js ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @distilled.cloud/opnsense — OPNsense firewall API SDK for Effect.
3
+ *
4
+ * `./services` is generated by `scripts/generate.ts` from the Smithy models
5
+ * in `.generated-specs` (written by `scripts/convert.ts` from OPNsense's own
6
+ * model XML + API controller PHP, mirrored under `specs/`). Everything else
7
+ * in this folder is hand-written.
8
+ *
9
+ * One module per API controller in scope — `firewall_alias`,
10
+ * `firewall_category`, `firewall_group`, `firewall_filter`,
11
+ * `routing_settings`, `quagga_general`, `quagga_bgp`, `quagga_service` — see
12
+ * the package README for what each one covers and what was left out.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * import * as Opnsense from "@distilled.cloud/opnsense";
17
+ *
18
+ * const alias = yield* Opnsense.Services.firewall_alias.addAlias({
19
+ * alias: { name: "homeflare_edge", type: "host", content: "10.20.10.1" },
20
+ * });
21
+ * ```
22
+ */
23
+ export * from "./credentials.js";
24
+ export * from "./errors.js";
25
+ export * as T from "./traits.js";
26
+ export { OpnsenseProtocol, } from "./protocol.js";
27
+ export * as Retry from "./retry.js";
28
+ export * as Services from "./services/index.js";
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,gBAAgB,GAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import * as Layer from "effect/Layer";
2
+ import type * as HttpClient from "effect/unstable/http/HttpClient";
3
+ import type * as HttpClientError from "effect/unstable/http/HttpClientError";
4
+ import * as API from "@distilled.cloud/core/api";
5
+ import { ConfigError } from "@distilled.cloud/core/errors";
6
+ import { Credentials } from "./credentials.ts";
7
+ import { type DefaultErrors } from "./errors.ts";
8
+ /** Error channel shared by every generated OPNsense operation. */
9
+ export type OpnsenseOpError = DefaultErrors | ConfigError | HttpClientError.HttpClientError;
10
+ /** Context (requirements) shared by every generated OPNsense operation. */
11
+ export type OpnsenseOpContext = Credentials | HttpClient.HttpClient;
12
+ export declare const OpnsenseProtocol: Layer.Layer<API.Protocol>;
13
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,KAAK,eAAe,MAAM,sCAAsC,CAAC;AAE7E,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAmB,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAErB,kEAAkE;AAClE,MAAM,MAAM,eAAe,GACvB,aAAa,GACb,WAAW,GACX,eAAe,CAAC,eAAe,CAAC;AAEpC,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AA4HpE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAMtD,CAAC"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * OpnsenseProtocol — hand-written.
3
+ *
4
+ * OPNsense is a 200-with-failure vendor: `ApiMutableModelControllerBase`'s
5
+ * `set/add/del/toggleBase` (mirrored at `specs/core/models/Base/
6
+ * ApiMutableModelControllerBase.php`) answer HTTP 200 with
7
+ * `{"result":"failed", "validations"?: {...}}` on a validation error, and a
8
+ * plain `UserException`/`UserWarningException`/`UserInformationalException`
9
+ * thrown anywhere in a controller answers `{errorMessage, errorTitle?,
10
+ * errorLevel}` at 500/200/200 respectively (`src/opnsense/www/api.php`'s
11
+ * `catch` chain — see `errors.ts`'s module doc for the exact mapping this
12
+ * mirrors). `@distilled.cloud/core/protocol-rest`'s generic REST decode
13
+ * only ever branches on `response.status >= 400`, which is wrong for every
14
+ * one of those in-band failures — so, like `cloudflare` (the other
15
+ * envelope-with-embedded-failure provider in this monorepo), this package
16
+ * hand-rolls `decode` instead of calling `makeRestProtocol`. `encode` has
17
+ * no such quirk (OPNsense's request shape is plain REST) and reuses core's
18
+ * `buildRequest` directly.
19
+ */
20
+ import * as Effect from "effect/Effect";
21
+ import * as Layer from "effect/Layer";
22
+ import * as Redacted from "effect/Redacted";
23
+ import * as API from "@distilled.cloud/core/api";
24
+ import { buildRequest, mapKeys } from "@distilled.cloud/core/protocol-http";
25
+ import { ConfigError, HTTP_STATUS_MAP } from "@distilled.cloud/core/errors";
26
+ import { Credentials } from "./credentials.js";
27
+ import { ValidationFailed, OpnsenseUserError, OpnsenseUserWarning, OpnsenseUserNotice, UnknownOpnsenseError, } from "./errors.js";
28
+ const fail = (e) => Effect.fail(e);
29
+ /** `{status: 401|403|400, message}` from `ApiControllerBase::beforeExecuteRoute` — the ONE OPNsense shape with a genuine (numeric) `status` field and a non-2xx HTTP status to match it. */
30
+ const isAuthGateBody = (body) => typeof body === "object" &&
31
+ body !== null &&
32
+ typeof body.status === "number" &&
33
+ typeof body.message === "string";
34
+ /** `{errorMessage, errorTitle?, errorLevel?}` from `api.php`'s `UserException`/`DispatchException`/generic-`Exception` catch chain. */
35
+ const isVendorExceptionBody = (body) => typeof body === "object" &&
36
+ body !== null &&
37
+ typeof body.errorMessage === "string";
38
+ /** `{result:"failed", validations?}` from `ApiMutableModelControllerBase::validate/set/add/del/toggleBase`. */
39
+ const isResultFailedBody = (body) => typeof body === "object" &&
40
+ body !== null &&
41
+ body.result === "failed";
42
+ const classifyFailure = (status, body) => {
43
+ if (isAuthGateBody(body)) {
44
+ if (body.status === 401 || body.status === 403 || body.status === 400) {
45
+ const Cls = HTTP_STATUS_MAP[body.status];
46
+ return new Cls({ message: body.message });
47
+ }
48
+ }
49
+ if (isVendorExceptionBody(body)) {
50
+ const { errorMessage: message, errorTitle: title, errorLevel } = body;
51
+ if (errorLevel === "warning")
52
+ return new OpnsenseUserWarning({ title, message });
53
+ if (errorLevel === "info")
54
+ return new OpnsenseUserNotice({ title, message });
55
+ if (status === 404) {
56
+ const Cls = HTTP_STATUS_MAP[404];
57
+ return new Cls({ message });
58
+ }
59
+ if (errorLevel === "error" || title !== undefined)
60
+ return new OpnsenseUserError({ title, message });
61
+ const Cls = HTTP_STATUS_MAP[500];
62
+ return new Cls({ message, code: undefined, retryAfter: undefined });
63
+ }
64
+ if (isResultFailedBody(body)) {
65
+ const validations = (body.validations ?? {});
66
+ return new ValidationFailed({ validations });
67
+ }
68
+ const StatusCls = HTTP_STATUS_MAP[status];
69
+ if (status >= 400 && StatusCls)
70
+ return new StatusCls({ message: `HTTP ${status}` });
71
+ return new UnknownOpnsenseError({ status, body });
72
+ };
73
+ const encode = ({ input, inputAst, }) => Effect.gen(function* () {
74
+ const resolve = yield* Credentials;
75
+ const creds = yield* resolve;
76
+ return buildRequest({
77
+ input,
78
+ inputAst,
79
+ baseUrl: creds.apiBaseUrl,
80
+ headers: {
81
+ Authorization: `Basic ${Buffer.from(`${creds.apiKey}:${Redacted.value(creds.apiSecret)}`).toString("base64")}`,
82
+ Accept: "application/json",
83
+ },
84
+ });
85
+ });
86
+ const decode = ({ response, outputAst, }) => Effect.gen(function* () {
87
+ const text = (yield* response.text.pipe(Effect.orDie)) ?? "";
88
+ let json;
89
+ let nonJson = false;
90
+ if (text.trim().length > 0) {
91
+ try {
92
+ json = JSON.parse(text);
93
+ }
94
+ catch {
95
+ nonJson = true;
96
+ }
97
+ }
98
+ const status = response.status;
99
+ const body = nonJson ? text : (json ?? {});
100
+ // Success is NOT simply `status < 400` here: `{result:"failed"}` and the
101
+ // UserWarning/UserInformational vendor-exception shapes are failures at
102
+ // HTTP 200 (see module doc) — checked FIRST, before falling through to
103
+ // "this 2xx body is the payload".
104
+ if (status >= 400 ||
105
+ isResultFailedBody(body) ||
106
+ isVendorExceptionBody(body)) {
107
+ return yield* fail(classifyFailure(status, body));
108
+ }
109
+ return mapKeys(outputAst, body, "decode");
110
+ });
111
+ export const OpnsenseProtocol = Layer.succeed(API.Protocol, API.Protocol.of({
112
+ encode: (args) => encode(args),
113
+ decode,
114
+ }));
115
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAK5C,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAWrB,MAAM,IAAI,GAAG,CAAC,CAAU,EAAwB,EAAE,CAChD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAyB,CAAC;AAEzC,4LAA4L;AAC5L,MAAM,cAAc,GAAG,CACrB,IAAa,EACgC,EAAE,CAC/C,OAAO,IAAI,KAAK,QAAQ;IACxB,IAAI,KAAK,IAAI;IACb,OAAQ,IAAY,CAAC,MAAM,KAAK,QAAQ;IACxC,OAAQ,IAAY,CAAC,OAAO,KAAK,QAAQ,CAAC;AAE5C,uIAAuI;AACvI,MAAM,qBAAqB,GAAG,CAC5B,IAAa,EAC+D,EAAE,CAC9E,OAAO,IAAI,KAAK,QAAQ;IACxB,IAAI,KA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,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAuB;IACpD,MAAM;CACP,CAAC,CACH,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * OPNsense retry surface — a veneer over `@distilled.cloud/core/retry`.
3
+ *
4
+ * The `Retry` service tag is threaded into every generated operation via
5
+ * `API.make({ retry: Retry })`, so a caller-installed policy applies to all
6
+ * OPNsense calls below it and core's `makeDefault` is the fallback when none
7
+ * is provided.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import * as Opnsense from "@distilled.cloud/opnsense";
12
+ *
13
+ * myEffect.pipe(Opnsense.Retry.transient);
14
+ * ```
15
+ */
16
+ import * as Context from "effect/Context";
17
+ import * as Effect from "effect/Effect";
18
+ import * as Retries from "@distilled.cloud/core/retry";
19
+ export type Options = Retries.Options;
20
+ export type Factory = Retries.Factory;
21
+ export type Policy = Retries.Policy;
22
+ declare const Retry_base: Context.ServiceClass<Retry, "OpnsenseRetry", Retries.Policy>;
23
+ /** Context tag for configuring retry behavior of OPNsense API calls. */
24
+ export declare class Retry extends Retry_base {
25
+ }
26
+ /** Provides a custom retry policy to every OPNsense API call below it. */
27
+ export declare const policy: {
28
+ (options: Options): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
29
+ (factory: Factory): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
30
+ };
31
+ /** Disables all automatic retries. */
32
+ export declare const none: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
33
+ /**
34
+ * The default retry policy (core's): transient/throttling/retryable errors,
35
+ * capped exponential backoff with jitter, server `retryAfter` hints honored
36
+ * with precedence.
37
+ *
38
+ * OPNsense has no rate-limit surface of its own to honor a hint FROM — this
39
+ * is here purely for the transient network/5xx case (a PHP fault, a proxy
40
+ * hiccup in front of the box). A `ValidationFailed`/`OpnsenseUserError`
41
+ * business-rule denial is never retryable and this policy will not retry
42
+ * it (see `errors.ts`'s `Category.withBadRequestError` categorization).
43
+ */
44
+ export declare const makeDefault: Factory;
45
+ export declare const jittered: <Error, Env>(self: import("effect/Schedule").Schedule<unknown, unknown, Error, Env>) => import("effect/Schedule").Schedule<unknown, unknown, Error, Env>;
46
+ export declare const capped: (max: import("effect/Duration").Duration) => <Error, Env>(self: import("effect/Schedule").Schedule<unknown, unknown, Error, Env>) => import("effect/Schedule").Schedule<unknown, unknown, Error, Env>;
47
+ /** Retry options that retry all throttling errors indefinitely. */
48
+ export declare const throttlingOptions: Options;
49
+ /** Retries all throttling errors indefinitely (honoring server hints). */
50
+ export declare const throttling: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
51
+ /** Retry options that retry all transient errors indefinitely. */
52
+ export declare const transientOptions: Options;
53
+ /** Retries all transient errors indefinitely (honoring server hints). */
54
+ export declare const transient: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
55
+ export {};
56
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AAEvD,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACtC,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;;AAEpC,wEAAwE;AACxE,qBAAa,KAAM,SAAQ,UAAiD;CAAG;AAE/E,0EAA0E;AAC1E,eAAO,MAAM,MAAM,EAAE;IACnB,CACE,OAAO,EA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EhF,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,EAAE,OAAkC,CAAC;AAElE,yEAAyE;AACzE,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAoC,CAAC"}
package/dist/retry.js ADDED
@@ -0,0 +1,49 @@
1
+ /**
2
+ * OPNsense retry surface — a veneer over `@distilled.cloud/core/retry`.
3
+ *
4
+ * The `Retry` service tag is threaded into every generated operation via
5
+ * `API.make({ retry: Retry })`, so a caller-installed policy applies to all
6
+ * OPNsense calls below it and core's `makeDefault` is the fallback when none
7
+ * is provided.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import * as Opnsense from "@distilled.cloud/opnsense";
12
+ *
13
+ * myEffect.pipe(Opnsense.Retry.transient);
14
+ * ```
15
+ */
16
+ import * as Context from "effect/Context";
17
+ import * as Effect from "effect/Effect";
18
+ import * as Layer from "effect/Layer";
19
+ import * as Retries from "@distilled.cloud/core/retry";
20
+ /** Context tag for configuring retry behavior of OPNsense API calls. */
21
+ export class Retry extends Context.Service()("OpnsenseRetry") {
22
+ }
23
+ /** Provides a custom retry policy to every OPNsense API call below it. */
24
+ export const policy = (optionsOrFactory) => Effect.provide(Layer.succeed(Retry, optionsOrFactory));
25
+ /** Disables all automatic retries. */
26
+ export const none = Effect.provide(Layer.succeed(Retry, { while: () => false }));
27
+ /**
28
+ * The default retry policy (core's): transient/throttling/retryable errors,
29
+ * capped exponential backoff with jitter, server `retryAfter` hints honored
30
+ * with precedence.
31
+ *
32
+ * OPNsense has no rate-limit surface of its own to honor a hint FROM — this
33
+ * is here purely for the transient network/5xx case (a PHP fault, a proxy
34
+ * hiccup in front of the box). A `ValidationFailed`/`OpnsenseUserError`
35
+ * business-rule denial is never retryable and this policy will not retry
36
+ * it (see `errors.ts`'s `Category.withBadRequestError` categorization).
37
+ */
38
+ export const makeDefault = Retries.makeDefault;
39
+ export const jittered = Retries.jittered;
40
+ export const capped = Retries.capped;
41
+ /** Retry options that retry all throttling errors indefinitely. */
42
+ export const throttlingOptions = Retries.throttlingOptions;
43
+ /** Retries all throttling errors indefinitely (honoring server hints). */
44
+ export const throttling = policy(Retries.throttlingFactory);
45
+ /** Retry options that retry all transient errors indefinitely. */
46
+ export const transientOptions = Retries.transientOptions;
47
+ /** Retries all transient errors indefinitely (honoring server hints). */
48
+ export const transient = policy(Retries.transientFactory);
49
+ //# sourceMappingURL=retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AAMvD,wEAAwE;AACxE,MAAM,OAAO,KAAM,SAAQ,OAAO,CAAC,OAAO,EAAiB,CAAC,eAAe,CAAC;CAAG;AAE/E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,MAAM,GAWf,CAAC,gBAAmC,EAAE,EAAE,CAC1C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEzD,sCAAsC;AACtC,MAAM,CAAC,MAAM,IAAI,GAE6B,MAAM,CAAC,OAAO,CAC1D,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAC7C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GAAY,OAAO,CAAC,WAAW,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AACzC,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAErC,mEAAmE;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAAY,OAAO,CAAC,iBAAiB,CAAC;AAEpE,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAEuB,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhF,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAY,OAAO,CAAC,gBAAgB,CAAC;AAElE,yEAAyE;AACzE,MAAM,CAAC,MAAM,SAAS,GAEwB,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,243 @@
1
+ import * as S from "@distilled.cloud/core/schema";
2
+ import * as API from "@distilled.cloud/core/api";
3
+ import { type OpnsenseOpError, type OpnsenseOpContext } from "../protocol.ts";
4
+ export type { OpnsenseOpError, OpnsenseOpContext };
5
+ export type AliasItemType = "host" | "network" | "port" | "url" | "urltable" | "urljson" | "geoip" | "networkgroup" | "mac" | "asn" | "dynipv6host" | "authgroup" | "internal" | "external";
6
+ export declare const AliasItemType: any;
7
+ export type AliasItemProto = "IPv4" | "IPv6";
8
+ export declare const AliasItemProto: any;
9
+ export type AliasItemAuthtype = "Basic" | "Bearer" | "Header";
10
+ export declare const AliasItemAuthtype: any;
11
+ export interface AliasItem {
12
+ /** Item id, assigned by OPNsense on creation. */
13
+ uuid?: string;
14
+ /** OPNsense FieldType: BooleanField */
15
+ enabled: string;
16
+ /** OPNsense FieldType: .\AliasNameField */
17
+ name: string;
18
+ /** OPNsense FieldType: OptionField */
19
+ type: AliasItemType | (string & {});
20
+ /** OPNsense FieldType: TextField */
21
+ path_expression?: string;
22
+ /** OPNsense FieldType: OptionField; multi-select: wire value is a single comma-joined string, not a JSON array */
23
+ proto?: AliasItemProto | (string & {});
24
+ /** OPNsense FieldType: InterfaceField */
25
+ interface?: string;
26
+ /** OPNsense FieldType: BooleanField */
27
+ counters?: string;
28
+ /** OPNsense FieldType: NumericField */
29
+ updatefreq?: string;
30
+ /** OPNsense FieldType: .\AliasContentField */
31
+ content?: string;
32
+ /** OPNsense FieldType: TextField */
33
+ password?: string;
34
+ /** OPNsense FieldType: TextField */
35
+ username?: string;
36
+ /** OPNsense FieldType: OptionField */
37
+ authtype?: AliasItemAuthtype | (string & {});
38
+ /** OPNsense FieldType: IntegerField; range 60..999999999 (as text) */
39
+ expire?: string;
40
+ /** OPNsense FieldType: ModelRelationField; multi-select: wire value is a single comma-joined string, not a JSON array */
41
+ categories?: string;
42
+ /** OPNsense FieldType: IntegerField */
43
+ current_items?: string;
44
+ /** OPNsense FieldType: TextField */
45
+ last_updated?: string;
46
+ /** OPNsense FieldType: IntegerField */
47
+ eval_nomatch?: string;
48
+ /** OPNsense FieldType: IntegerField */
49
+ eval_match?: string;
50
+ /** OPNsense FieldType: IntegerField */
51
+ in_block_p?: string;
52
+ /** OPNsense FieldType: IntegerField */
53
+ in_block_b?: string;
54
+ /** OPNsense FieldType: IntegerField */
55
+ in_pass_p?: string;
56
+ /** OPNsense FieldType: IntegerField */
57
+ in_pass_b?: string;
58
+ /** OPNsense FieldType: IntegerField */
59
+ out_block_p?: string;
60
+ /** OPNsense FieldType: IntegerField */
61
+ out_block_b?: string;
62
+ /** OPNsense FieldType: IntegerField */
63
+ out_pass_p?: string;
64
+ /** OPNsense FieldType: IntegerField */
65
+ out_pass_b?: string;
66
+ /** OPNsense FieldType: DescriptionField */
67
+ description?: string;
68
+ }
69
+ export declare const AliasItem: S.Schema<AliasItem>;
70
+ export interface AddAliasRequest {
71
+ alias?: AliasItem;
72
+ }
73
+ export declare const AddAliasRequest: S.Schema<AddAliasRequest>;
74
+ export type AddAliasResult = "saved";
75
+ export declare const AddAliasResult: any;
76
+ export interface AddAliasResponse {
77
+ result?: AddAliasResult;
78
+ /** The new item's uuid. */
79
+ uuid?: string;
80
+ }
81
+ export declare const AddAliasResponse: S.Schema<AddAliasResponse>;
82
+ export interface DelAliasRequest {
83
+ uuids: string;
84
+ }
85
+ export declare const DelAliasRequest: S.Schema<DelAliasRequest>;
86
+ export type DelAliasResult = "deleted" | "not found";
87
+ export declare const DelAliasResult: any;
88
+ export interface DelAliasResponse {
89
+ result?: DelAliasResult;
90
+ }
91
+ export declare const DelAliasResponse: S.Schema<DelAliasResponse>;
92
+ export interface GetRequest {
93
+ }
94
+ export declare const GetRequest: S.Schema<GetRequest>;
95
+ export type ModelAliasItemType = "host" | "network" | "port" | "url" | "urltable" | "urljson" | "geoip" | "networkgroup" | "mac" | "asn" | "dynipv6host" | "authgroup" | "internal" | "external";
96
+ export declare const ModelAliasItemType: any;
97
+ export type ModelAliasItemProto = "IPv4" | "IPv6";
98
+ export declare const ModelAliasItemProto: any;
99
+ export type ModelAliasItemAuthtype = "Basic" | "Bearer" | "Header";
100
+ export declare const ModelAliasItemAuthtype: any;
101
+ export interface ModelAliasItem {
102
+ /** Item id, assigned by OPNsense on creation. */
103
+ uuid?: string;
104
+ /** OPNsense FieldType: BooleanField */
105
+ enabled: string;
106
+ /** OPNsense FieldType: .\AliasNameField */
107
+ name: string;
108
+ /** OPNsense FieldType: OptionField */
109
+ type: ModelAliasItemType | (string & {});
110
+ /** OPNsense FieldType: TextField */
111
+ path_expression?: string;
112
+ /** OPNsense FieldType: OptionField; multi-select: wire value is a single comma-joined string, not a JSON array */
113
+ proto?: ModelAliasItemProto | (string & {});
114
+ /** OPNsense FieldType: InterfaceField */
115
+ interface?: string;
116
+ /** OPNsense FieldType: BooleanField */
117
+ counters?: string;
118
+ /** OPNsense FieldType: NumericField */
119
+ updatefreq?: string;
120
+ /** OPNsense FieldType: .\AliasContentField */
121
+ content?: string;
122
+ /** OPNsense FieldType: TextField */
123
+ password?: string;
124
+ /** OPNsense FieldType: TextField */
125
+ username?: string;
126
+ /** OPNsense FieldType: OptionField */
127
+ authtype?: ModelAliasItemAuthtype | (string & {});
128
+ /** OPNsense FieldType: IntegerField; range 60..999999999 (as text) */
129
+ expire?: string;
130
+ /** OPNsense FieldType: ModelRelationField; multi-select: wire value is a single comma-joined string, not a JSON array */
131
+ categories?: string;
132
+ /** OPNsense FieldType: IntegerField */
133
+ current_items?: string;
134
+ /** OPNsense FieldType: TextField */
135
+ last_updated?: string;
136
+ /** OPNsense FieldType: IntegerField */
137
+ eval_nomatch?: string;
138
+ /** OPNsense FieldType: IntegerField */
139
+ eval_match?: string;
140
+ /** OPNsense FieldType: IntegerField */
141
+ in_block_p?: string;
142
+ /** OPNsense FieldType: IntegerField */
143
+ in_block_b?: string;
144
+ /** OPNsense FieldType: IntegerField */
145
+ in_pass_p?: string;
146
+ /** OPNsense FieldType: IntegerField */
147
+ in_pass_b?: string;
148
+ /** OPNsense FieldType: IntegerField */
149
+ out_block_p?: string;
150
+ /** OPNsense FieldType: IntegerField */
151
+ out_block_b?: string;
152
+ /** OPNsense FieldType: IntegerField */
153
+ out_pass_p?: string;
154
+ /** OPNsense FieldType: IntegerField */
155
+ out_pass_b?: string;
156
+ /** OPNsense FieldType: DescriptionField */
157
+ description?: string;
158
+ }
159
+ export declare const ModelAliasItem: S.Schema<ModelAliasItem>;
160
+ export type ModelAliasItemMap = {
161
+ [key: string]: ModelAliasItem | undefined;
162
+ };
163
+ export declare const ModelAliasItemMap: S.Schema<ModelAliasItemMap>;
164
+ export interface ModelAliases {
165
+ alias?: ModelAliasItemMap;
166
+ }
167
+ export declare const ModelAliases: S.Schema<ModelAliases>;
168
+ export interface Model {
169
+ aliases?: ModelAliases;
170
+ }
171
+ export declare const Model: S.Schema<Model>;
172
+ export interface GetResponse {
173
+ alias?: Model;
174
+ }
175
+ export declare const GetResponse: S.Schema<GetResponse>;
176
+ export interface SearchAliasRequest {
177
+ }
178
+ export declare const SearchAliasRequest: S.Schema<SearchAliasRequest>;
179
+ export type AliasList = Array<AliasItem>;
180
+ export declare const AliasList: S.Schema<AliasList>;
181
+ export interface SearchAliasResponse {
182
+ /** Total matching items before pagination. */
183
+ total?: number;
184
+ rowCount?: number;
185
+ /** Current page number. */
186
+ current?: number;
187
+ rows?: AliasList;
188
+ }
189
+ export declare const SearchAliasResponse: S.Schema<SearchAliasResponse>;
190
+ export interface SetRequest {
191
+ alias?: Model;
192
+ }
193
+ export declare const SetRequest: S.Schema<SetRequest>;
194
+ export type SetResult = "saved";
195
+ export declare const SetResult: any;
196
+ export interface SetResponse {
197
+ result?: SetResult;
198
+ }
199
+ export declare const SetResponse: S.Schema<SetResponse>;
200
+ export interface SetAliasRequest {
201
+ uuid: string;
202
+ alias?: AliasItem;
203
+ }
204
+ export declare const SetAliasRequest: S.Schema<SetAliasRequest>;
205
+ export type SetAliasResult = "saved";
206
+ export declare const SetAliasResult: any;
207
+ export interface SetAliasResponse {
208
+ result?: SetAliasResult;
209
+ }
210
+ export declare const SetAliasResponse: S.Schema<SetAliasResponse>;
211
+ export interface ToggleAliasRequest {
212
+ uuid: string;
213
+ }
214
+ export declare const ToggleAliasRequest: S.Schema<ToggleAliasRequest>;
215
+ export type ToggleAliasResult = "Enabled" | "Disabled" | "failed";
216
+ export declare const ToggleAliasResult: any;
217
+ export interface ToggleAliasResponse {
218
+ result?: ToggleAliasResult;
219
+ changed?: boolean;
220
+ }
221
+ export declare const ToggleAliasResponse: S.Schema<ToggleAliasResponse>;
222
+ export type AddAliasError = OpnsenseOpError;
223
+ /** Add a new aliases.alias item. On a validation failure the call fails with ValidationFailed instead of decoding this response. */
224
+ export declare const addAlias: API.OperationMethod<AddAliasRequest, AddAliasResponse, AddAliasError, OpnsenseOpContext>;
225
+ export type DelAliasError = OpnsenseOpError;
226
+ /** Delete a aliases.alias item by uuid. */
227
+ export declare const delAlias: API.OperationMethod<DelAliasRequest, DelAliasResponse, DelAliasError, OpnsenseOpContext>;
228
+ export type GetError = OpnsenseOpError;
229
+ /** Fetch the entire model tree (every section and array collection). */
230
+ export declare const get: API.OperationMethod<GetRequest, GetResponse, GetError, OpnsenseOpContext>;
231
+ export type SearchAliasError = OpnsenseOpError;
232
+ /** Search aliases.alias items (paginated). */
233
+ export declare const searchAlias: API.OperationMethod<SearchAliasRequest, SearchAliasResponse, SearchAliasError, OpnsenseOpContext>;
234
+ export type SetError = OpnsenseOpError;
235
+ /** Replace the entire model tree in one call. On a validation failure the call fails with ValidationFailed instead of decoding this response. */
236
+ export declare const set: API.OperationMethod<SetRequest, SetResponse, SetError, OpnsenseOpContext>;
237
+ export type SetAliasError = OpnsenseOpError;
238
+ /** Update an existing aliases.alias item. On a validation failure the call fails with ValidationFailed instead of decoding this response. */
239
+ export declare const setAlias: API.OperationMethod<SetAliasRequest, SetAliasResponse, SetAliasError, OpnsenseOpContext>;
240
+ export type ToggleAliasError = OpnsenseOpError;
241
+ /** Flip a aliases.alias item's enabled flag by uuid. */
242
+ export declare const toggleAlias: API.OperationMethod<ToggleAliasRequest, ToggleAliasResponse, ToggleAliasError, OpnsenseOpContext>;
243
+ //# sourceMappingURL=firewall_alias.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firewall_alias.d.ts","sourceRoot":"","sources":["../../src/services/firewall_alias.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAEjD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC;AAEnD,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,SAAS,GACT,MAAM,GACN,KAAK,GACL,UAAU,GACV,SAAS,GACT,OAAO,GACP,cAAc,GACd,KAAK,GACL,KAAK,GACL,aAAa,GACb,WAAW,GACX,UAAU,GACV,UAAU,CAAC;AACf,eAAO,MAAM,aAAa,KAAW,CAAC;AAEtC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,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