@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.
- package/LICENSE +201 -0
- package/README.md +95 -0
- package/dist/credentials.d.ts +39 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +78 -0
- package/dist/credentials.js.map +1 -0
- package/dist/errors.d.ts +110 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +63 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol.d.ts +13 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +115 -0
- package/dist/protocol.js.map +1 -0
- package/dist/retry.d.ts +56 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +49 -0
- package/dist/retry.js.map +1 -0
- package/dist/services/firewall_alias.d.ts +243 -0
- package/dist/services/firewall_alias.d.ts.map +1 -0
- package/dist/services/firewall_alias.js +222 -0
- package/dist/services/firewall_alias.js.map +1 -0
- package/dist/services/firewall_category.d.ts +122 -0
- package/dist/services/firewall_category.d.ts.map +1 -0
- package/dist/services/firewall_category.js +161 -0
- package/dist/services/firewall_category.js.map +1 -0
- package/dist/services/firewall_filter.d.ts +289 -0
- package/dist/services/firewall_filter.d.ts.map +1 -0
- package/dist/services/firewall_filter.js +225 -0
- package/dist/services/firewall_filter.js.map +1 -0
- package/dist/services/firewall_group.d.ts +122 -0
- package/dist/services/firewall_group.d.ts.map +1 -0
- package/dist/services/firewall_group.js +154 -0
- package/dist/services/firewall_group.js.map +1 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +10 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/quagga_bgp.d.ts +1135 -0
- package/dist/services/quagga_bgp.d.ts.map +1 -0
- package/dist/services/quagga_bgp.js +1263 -0
- package/dist/services/quagga_bgp.js.map +1 -0
- package/dist/services/quagga_general.d.ts +55 -0
- package/dist/services/quagga_general.d.ts.map +1 -0
- package/dist/services/quagga_general.js +48 -0
- package/dist/services/quagga_general.js.map +1 -0
- package/dist/services/quagga_service.d.ts +60 -0
- package/dist/services/quagga_service.d.ts.map +1 -0
- package/dist/services/quagga_service.js +77 -0
- package/dist/services/quagga_service.js.map +1 -0
- package/dist/services/routing_settings.d.ts +192 -0
- package/dist/services/routing_settings.d.ts.map +1 -0
- package/dist/services/routing_settings.js +169 -0
- package/dist/services/routing_settings.js.map +1 -0
- package/dist/traits.d.ts +11 -0
- package/dist/traits.d.ts.map +1 -0
- package/dist/traits.js +11 -0
- package/dist/traits.js.map +1 -0
- package/package.json +75 -0
- package/src/credentials.ts +111 -0
- package/src/errors.ts +115 -0
- package/src/index.ts +32 -0
- package/src/protocol.ts +177 -0
- package/src/retry.ts +80 -0
- package/src/services/firewall_alias.ts +572 -0
- package/src/services/firewall_category.ts +359 -0
- package/src/services/firewall_filter.ts +671 -0
- package/src/services/firewall_group.ts +350 -0
- package/src/services/index.ts +9 -0
- package/src/services/quagga_bgp.ts +2955 -0
- package/src/services/quagga_general.ts +132 -0
- package/src/services/quagga_service.ts +182 -0
- package/src/services/routing_settings.ts +419 -0
- package/src/traits.ts +36 -0
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-opnsense). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
OpnsenseProtocol,
|
|
7
|
+
type OpnsenseOpError,
|
|
8
|
+
type OpnsenseOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import * as Retry from "../retry.ts";
|
|
11
|
+
|
|
12
|
+
export type { OpnsenseOpError, OpnsenseOpContext };
|
|
13
|
+
|
|
14
|
+
export type AliasItemType =
|
|
15
|
+
| "host"
|
|
16
|
+
| "network"
|
|
17
|
+
| "port"
|
|
18
|
+
| "url"
|
|
19
|
+
| "urltable"
|
|
20
|
+
| "urljson"
|
|
21
|
+
| "geoip"
|
|
22
|
+
| "networkgroup"
|
|
23
|
+
| "mac"
|
|
24
|
+
| "asn"
|
|
25
|
+
| "dynipv6host"
|
|
26
|
+
| "authgroup"
|
|
27
|
+
| "internal"
|
|
28
|
+
| "external";
|
|
29
|
+
export const AliasItemType = S.String;
|
|
30
|
+
|
|
31
|
+
export type AliasItemProto = "IPv4" | "IPv6";
|
|
32
|
+
export const AliasItemProto = S.String;
|
|
33
|
+
|
|
34
|
+
export type AliasItemAuthtype = "Basic" | "Bearer" | "Header";
|
|
35
|
+
export const AliasItemAuthtype = S.String;
|
|
36
|
+
|
|
37
|
+
export interface AliasItem {
|
|
38
|
+
/** Item id, assigned by OPNsense on creation. */
|
|
39
|
+
uuid?: string;
|
|
40
|
+
/** OPNsense FieldType: BooleanField */
|
|
41
|
+
enabled: string;
|
|
42
|
+
/** OPNsense FieldType: .\AliasNameField */
|
|
43
|
+
name: string;
|
|
44
|
+
/** OPNsense FieldType: OptionField */
|
|
45
|
+
type: AliasItemType | (string & {});
|
|
46
|
+
/** OPNsense FieldType: TextField */
|
|
47
|
+
path_expression?: string;
|
|
48
|
+
/** OPNsense FieldType: OptionField; multi-select: wire value is a single comma-joined string, not a JSON array */
|
|
49
|
+
proto?: AliasItemProto | (string & {});
|
|
50
|
+
/** OPNsense FieldType: InterfaceField */
|
|
51
|
+
interface?: string;
|
|
52
|
+
/** OPNsense FieldType: BooleanField */
|
|
53
|
+
counters?: string;
|
|
54
|
+
/** OPNsense FieldType: NumericField */
|
|
55
|
+
updatefreq?: string;
|
|
56
|
+
/** OPNsense FieldType: .\AliasContentField */
|
|
57
|
+
content?: string;
|
|
58
|
+
/** OPNsense FieldType: TextField */
|
|
59
|
+
password?: string;
|
|
60
|
+
/** OPNsense FieldType: TextField */
|
|
61
|
+
username?: string;
|
|
62
|
+
/** OPNsense FieldType: OptionField */
|
|
63
|
+
authtype?: AliasItemAuthtype | (string & {});
|
|
64
|
+
/** OPNsense FieldType: IntegerField; range 60..999999999 (as text) */
|
|
65
|
+
expire?: string;
|
|
66
|
+
/** OPNsense FieldType: ModelRelationField; multi-select: wire value is a single comma-joined string, not a JSON array */
|
|
67
|
+
categories?: string;
|
|
68
|
+
/** OPNsense FieldType: IntegerField */
|
|
69
|
+
current_items?: string;
|
|
70
|
+
/** OPNsense FieldType: TextField */
|
|
71
|
+
last_updated?: string;
|
|
72
|
+
/** OPNsense FieldType: IntegerField */
|
|
73
|
+
eval_nomatch?: string;
|
|
74
|
+
/** OPNsense FieldType: IntegerField */
|
|
75
|
+
eval_match?: string;
|
|
76
|
+
/** OPNsense FieldType: IntegerField */
|
|
77
|
+
in_block_p?: string;
|
|
78
|
+
/** OPNsense FieldType: IntegerField */
|
|
79
|
+
in_block_b?: string;
|
|
80
|
+
/** OPNsense FieldType: IntegerField */
|
|
81
|
+
in_pass_p?: string;
|
|
82
|
+
/** OPNsense FieldType: IntegerField */
|
|
83
|
+
in_pass_b?: string;
|
|
84
|
+
/** OPNsense FieldType: IntegerField */
|
|
85
|
+
out_block_p?: string;
|
|
86
|
+
/** OPNsense FieldType: IntegerField */
|
|
87
|
+
out_block_b?: string;
|
|
88
|
+
/** OPNsense FieldType: IntegerField */
|
|
89
|
+
out_pass_p?: string;
|
|
90
|
+
/** OPNsense FieldType: IntegerField */
|
|
91
|
+
out_pass_b?: string;
|
|
92
|
+
/** OPNsense FieldType: DescriptionField */
|
|
93
|
+
description?: string;
|
|
94
|
+
}
|
|
95
|
+
export const AliasItem = /*@__PURE__*/ S.suspend(() =>
|
|
96
|
+
S.Struct({
|
|
97
|
+
uuid: S.optional(S.String),
|
|
98
|
+
enabled: S.String,
|
|
99
|
+
name: S.String,
|
|
100
|
+
type: AliasItemType,
|
|
101
|
+
path_expression: S.optional(S.String),
|
|
102
|
+
proto: S.optional(AliasItemProto),
|
|
103
|
+
interface: S.optional(S.String),
|
|
104
|
+
counters: S.optional(S.String),
|
|
105
|
+
updatefreq: S.optional(S.String),
|
|
106
|
+
content: S.optional(S.String),
|
|
107
|
+
password: S.optional(S.String),
|
|
108
|
+
username: S.optional(S.String),
|
|
109
|
+
authtype: S.optional(AliasItemAuthtype),
|
|
110
|
+
expire: S.optional(S.String),
|
|
111
|
+
categories: S.optional(S.String),
|
|
112
|
+
current_items: S.optional(S.String),
|
|
113
|
+
last_updated: S.optional(S.String),
|
|
114
|
+
eval_nomatch: S.optional(S.String),
|
|
115
|
+
eval_match: S.optional(S.String),
|
|
116
|
+
in_block_p: S.optional(S.String),
|
|
117
|
+
in_block_b: S.optional(S.String),
|
|
118
|
+
in_pass_p: S.optional(S.String),
|
|
119
|
+
in_pass_b: S.optional(S.String),
|
|
120
|
+
out_block_p: S.optional(S.String),
|
|
121
|
+
out_block_b: S.optional(S.String),
|
|
122
|
+
out_pass_p: S.optional(S.String),
|
|
123
|
+
out_pass_b: S.optional(S.String),
|
|
124
|
+
description: S.optional(S.String),
|
|
125
|
+
}),
|
|
126
|
+
).annotate({ identifier: "AliasItem" }) as any as S.Schema<AliasItem>;
|
|
127
|
+
|
|
128
|
+
export interface AddAliasRequest {
|
|
129
|
+
alias?: AliasItem;
|
|
130
|
+
}
|
|
131
|
+
export const AddAliasRequest = /*@__PURE__*/ S.suspend(() =>
|
|
132
|
+
S.Struct({
|
|
133
|
+
alias: S.optional(AliasItem),
|
|
134
|
+
}).pipe(
|
|
135
|
+
T.Http({ method: "POST", uri: "/api/firewall/alias/addItem", code: 200 }),
|
|
136
|
+
),
|
|
137
|
+
).annotate({
|
|
138
|
+
identifier: "AddAliasRequest",
|
|
139
|
+
}) as any as S.Schema<AddAliasRequest>;
|
|
140
|
+
|
|
141
|
+
export type AddAliasResult = "saved";
|
|
142
|
+
export const AddAliasResult = S.String;
|
|
143
|
+
|
|
144
|
+
export interface AddAliasResponse {
|
|
145
|
+
result?: AddAliasResult;
|
|
146
|
+
/** The new item's uuid. */
|
|
147
|
+
uuid?: string;
|
|
148
|
+
}
|
|
149
|
+
export const AddAliasResponse = /*@__PURE__*/ S.suspend(() =>
|
|
150
|
+
S.Struct({
|
|
151
|
+
result: S.optional(AddAliasResult),
|
|
152
|
+
uuid: S.optional(S.String),
|
|
153
|
+
}),
|
|
154
|
+
).annotate({
|
|
155
|
+
identifier: "AddAliasResponse",
|
|
156
|
+
}) as any as S.Schema<AddAliasResponse>;
|
|
157
|
+
|
|
158
|
+
export interface DelAliasRequest {
|
|
159
|
+
uuids: string;
|
|
160
|
+
}
|
|
161
|
+
export const DelAliasRequest = /*@__PURE__*/ S.suspend(() =>
|
|
162
|
+
S.Struct({
|
|
163
|
+
uuids: S.String.pipe(T.Label()),
|
|
164
|
+
}).pipe(
|
|
165
|
+
T.Http({
|
|
166
|
+
method: "POST",
|
|
167
|
+
uri: "/api/firewall/alias/delItem/{uuids}",
|
|
168
|
+
code: 200,
|
|
169
|
+
}),
|
|
170
|
+
),
|
|
171
|
+
).annotate({
|
|
172
|
+
identifier: "DelAliasRequest",
|
|
173
|
+
}) as any as S.Schema<DelAliasRequest>;
|
|
174
|
+
|
|
175
|
+
export type DelAliasResult = "deleted" | "not found";
|
|
176
|
+
export const DelAliasResult = S.String;
|
|
177
|
+
|
|
178
|
+
export interface DelAliasResponse {
|
|
179
|
+
result?: DelAliasResult;
|
|
180
|
+
}
|
|
181
|
+
export const DelAliasResponse = /*@__PURE__*/ S.suspend(() =>
|
|
182
|
+
S.Struct({
|
|
183
|
+
result: S.optional(DelAliasResult),
|
|
184
|
+
}),
|
|
185
|
+
).annotate({
|
|
186
|
+
identifier: "DelAliasResponse",
|
|
187
|
+
}) as any as S.Schema<DelAliasResponse>;
|
|
188
|
+
|
|
189
|
+
export interface GetRequest {}
|
|
190
|
+
export const GetRequest = /*@__PURE__*/ S.suspend(() =>
|
|
191
|
+
S.Struct({}).pipe(
|
|
192
|
+
T.Http({ method: "GET", uri: "/api/firewall/alias/get", code: 200 }),
|
|
193
|
+
),
|
|
194
|
+
).annotate({ identifier: "GetRequest" }) as any as S.Schema<GetRequest>;
|
|
195
|
+
|
|
196
|
+
export type ModelAliasItemType =
|
|
197
|
+
| "host"
|
|
198
|
+
| "network"
|
|
199
|
+
| "port"
|
|
200
|
+
| "url"
|
|
201
|
+
| "urltable"
|
|
202
|
+
| "urljson"
|
|
203
|
+
| "geoip"
|
|
204
|
+
| "networkgroup"
|
|
205
|
+
| "mac"
|
|
206
|
+
| "asn"
|
|
207
|
+
| "dynipv6host"
|
|
208
|
+
| "authgroup"
|
|
209
|
+
| "internal"
|
|
210
|
+
| "external";
|
|
211
|
+
export const ModelAliasItemType = S.String;
|
|
212
|
+
|
|
213
|
+
export type ModelAliasItemProto = "IPv4" | "IPv6";
|
|
214
|
+
export const ModelAliasItemProto = S.String;
|
|
215
|
+
|
|
216
|
+
export type ModelAliasItemAuthtype = "Basic" | "Bearer" | "Header";
|
|
217
|
+
export const ModelAliasItemAuthtype = S.String;
|
|
218
|
+
|
|
219
|
+
export interface ModelAliasItem {
|
|
220
|
+
/** Item id, assigned by OPNsense on creation. */
|
|
221
|
+
uuid?: string;
|
|
222
|
+
/** OPNsense FieldType: BooleanField */
|
|
223
|
+
enabled: string;
|
|
224
|
+
/** OPNsense FieldType: .\AliasNameField */
|
|
225
|
+
name: string;
|
|
226
|
+
/** OPNsense FieldType: OptionField */
|
|
227
|
+
type: ModelAliasItemType | (string & {});
|
|
228
|
+
/** OPNsense FieldType: TextField */
|
|
229
|
+
path_expression?: string;
|
|
230
|
+
/** OPNsense FieldType: OptionField; multi-select: wire value is a single comma-joined string, not a JSON array */
|
|
231
|
+
proto?: ModelAliasItemProto | (string & {});
|
|
232
|
+
/** OPNsense FieldType: InterfaceField */
|
|
233
|
+
interface?: string;
|
|
234
|
+
/** OPNsense FieldType: BooleanField */
|
|
235
|
+
counters?: string;
|
|
236
|
+
/** OPNsense FieldType: NumericField */
|
|
237
|
+
updatefreq?: string;
|
|
238
|
+
/** OPNsense FieldType: .\AliasContentField */
|
|
239
|
+
content?: string;
|
|
240
|
+
/** OPNsense FieldType: TextField */
|
|
241
|
+
password?: string;
|
|
242
|
+
/** OPNsense FieldType: TextField */
|
|
243
|
+
username?: string;
|
|
244
|
+
/** OPNsense FieldType: OptionField */
|
|
245
|
+
authtype?: ModelAliasItemAuthtype | (string & {});
|
|
246
|
+
/** OPNsense FieldType: IntegerField; range 60..999999999 (as text) */
|
|
247
|
+
expire?: string;
|
|
248
|
+
/** OPNsense FieldType: ModelRelationField; multi-select: wire value is a single comma-joined string, not a JSON array */
|
|
249
|
+
categories?: string;
|
|
250
|
+
/** OPNsense FieldType: IntegerField */
|
|
251
|
+
current_items?: string;
|
|
252
|
+
/** OPNsense FieldType: TextField */
|
|
253
|
+
last_updated?: string;
|
|
254
|
+
/** OPNsense FieldType: IntegerField */
|
|
255
|
+
eval_nomatch?: string;
|
|
256
|
+
/** OPNsense FieldType: IntegerField */
|
|
257
|
+
eval_match?: string;
|
|
258
|
+
/** OPNsense FieldType: IntegerField */
|
|
259
|
+
in_block_p?: string;
|
|
260
|
+
/** OPNsense FieldType: IntegerField */
|
|
261
|
+
in_block_b?: string;
|
|
262
|
+
/** OPNsense FieldType: IntegerField */
|
|
263
|
+
in_pass_p?: string;
|
|
264
|
+
/** OPNsense FieldType: IntegerField */
|
|
265
|
+
in_pass_b?: string;
|
|
266
|
+
/** OPNsense FieldType: IntegerField */
|
|
267
|
+
out_block_p?: string;
|
|
268
|
+
/** OPNsense FieldType: IntegerField */
|
|
269
|
+
out_block_b?: string;
|
|
270
|
+
/** OPNsense FieldType: IntegerField */
|
|
271
|
+
out_pass_p?: string;
|
|
272
|
+
/** OPNsense FieldType: IntegerField */
|
|
273
|
+
out_pass_b?: string;
|
|
274
|
+
/** OPNsense FieldType: DescriptionField */
|
|
275
|
+
description?: string;
|
|
276
|
+
}
|
|
277
|
+
export const ModelAliasItem = /*@__PURE__*/ S.suspend(() =>
|
|
278
|
+
S.Struct({
|
|
279
|
+
uuid: S.optional(S.String),
|
|
280
|
+
enabled: S.String,
|
|
281
|
+
name: S.String,
|
|
282
|
+
type: ModelAliasItemType,
|
|
283
|
+
path_expression: S.optional(S.String),
|
|
284
|
+
proto: S.optional(ModelAliasItemProto),
|
|
285
|
+
interface: S.optional(S.String),
|
|
286
|
+
counters: S.optional(S.String),
|
|
287
|
+
updatefreq: S.optional(S.String),
|
|
288
|
+
content: S.optional(S.String),
|
|
289
|
+
password: S.optional(S.String),
|
|
290
|
+
username: S.optional(S.String),
|
|
291
|
+
authtype: S.optional(ModelAliasItemAuthtype),
|
|
292
|
+
expire: S.optional(S.String),
|
|
293
|
+
categories: S.optional(S.String),
|
|
294
|
+
current_items: S.optional(S.String),
|
|
295
|
+
last_updated: S.optional(S.String),
|
|
296
|
+
eval_nomatch: S.optional(S.String),
|
|
297
|
+
eval_match: S.optional(S.String),
|
|
298
|
+
in_block_p: S.optional(S.String),
|
|
299
|
+
in_block_b: S.optional(S.String),
|
|
300
|
+
in_pass_p: S.optional(S.String),
|
|
301
|
+
in_pass_b: S.optional(S.String),
|
|
302
|
+
out_block_p: S.optional(S.String),
|
|
303
|
+
out_block_b: S.optional(S.String),
|
|
304
|
+
out_pass_p: S.optional(S.String),
|
|
305
|
+
out_pass_b: S.optional(S.String),
|
|
306
|
+
description: S.optional(S.String),
|
|
307
|
+
}),
|
|
308
|
+
).annotate({ identifier: "ModelAliasItem" }) as any as S.Schema<ModelAliasItem>;
|
|
309
|
+
|
|
310
|
+
export type ModelAliasItemMap = { [key: string]: ModelAliasItem | undefined };
|
|
311
|
+
export const ModelAliasItemMap = /*@__PURE__*/ S.Record(
|
|
312
|
+
S.String,
|
|
313
|
+
ModelAliasItem,
|
|
314
|
+
) as any as S.Schema<ModelAliasItemMap>;
|
|
315
|
+
|
|
316
|
+
export interface ModelAliases {
|
|
317
|
+
alias?: ModelAliasItemMap;
|
|
318
|
+
}
|
|
319
|
+
export const ModelAliases = /*@__PURE__*/ S.suspend(() =>
|
|
320
|
+
S.Struct({
|
|
321
|
+
alias: S.optional(ModelAliasItemMap),
|
|
322
|
+
}),
|
|
323
|
+
).annotate({ identifier: "ModelAliases" }) as any as S.Schema<ModelAliases>;
|
|
324
|
+
|
|
325
|
+
export interface Model {
|
|
326
|
+
aliases?: ModelAliases;
|
|
327
|
+
}
|
|
328
|
+
export const Model = /*@__PURE__*/ S.suspend(() =>
|
|
329
|
+
S.Struct({
|
|
330
|
+
aliases: S.optional(ModelAliases),
|
|
331
|
+
}),
|
|
332
|
+
).annotate({ identifier: "Model" }) as any as S.Schema<Model>;
|
|
333
|
+
|
|
334
|
+
export interface GetResponse {
|
|
335
|
+
alias?: Model;
|
|
336
|
+
}
|
|
337
|
+
export const GetResponse = /*@__PURE__*/ S.suspend(() =>
|
|
338
|
+
S.Struct({
|
|
339
|
+
alias: S.optional(Model),
|
|
340
|
+
}),
|
|
341
|
+
).annotate({ identifier: "GetResponse" }) as any as S.Schema<GetResponse>;
|
|
342
|
+
|
|
343
|
+
export interface SearchAliasRequest {}
|
|
344
|
+
export const SearchAliasRequest = /*@__PURE__*/ S.suspend(() =>
|
|
345
|
+
S.Struct({}).pipe(
|
|
346
|
+
T.Http({
|
|
347
|
+
method: "POST",
|
|
348
|
+
uri: "/api/firewall/alias/searchItem",
|
|
349
|
+
code: 200,
|
|
350
|
+
}),
|
|
351
|
+
),
|
|
352
|
+
).annotate({
|
|
353
|
+
identifier: "SearchAliasRequest",
|
|
354
|
+
}) as any as S.Schema<SearchAliasRequest>;
|
|
355
|
+
|
|
356
|
+
export type AliasList = Array<AliasItem>;
|
|
357
|
+
export const AliasList = /*@__PURE__*/ S.Array(
|
|
358
|
+
AliasItem,
|
|
359
|
+
) as any as S.Schema<AliasList>;
|
|
360
|
+
|
|
361
|
+
export interface SearchAliasResponse {
|
|
362
|
+
/** Total matching items before pagination. */
|
|
363
|
+
total?: number;
|
|
364
|
+
rowCount?: number;
|
|
365
|
+
/** Current page number. */
|
|
366
|
+
current?: number;
|
|
367
|
+
rows?: AliasList;
|
|
368
|
+
}
|
|
369
|
+
export const SearchAliasResponse = /*@__PURE__*/ S.suspend(() =>
|
|
370
|
+
S.Struct({
|
|
371
|
+
total: S.optional(S.Number),
|
|
372
|
+
rowCount: S.optional(S.Number),
|
|
373
|
+
current: S.optional(S.Number),
|
|
374
|
+
rows: S.optional(AliasList),
|
|
375
|
+
}),
|
|
376
|
+
).annotate({
|
|
377
|
+
identifier: "SearchAliasResponse",
|
|
378
|
+
}) as any as S.Schema<SearchAliasResponse>;
|
|
379
|
+
|
|
380
|
+
export interface SetRequest {
|
|
381
|
+
alias?: Model;
|
|
382
|
+
}
|
|
383
|
+
export const SetRequest = /*@__PURE__*/ S.suspend(() =>
|
|
384
|
+
S.Struct({
|
|
385
|
+
alias: S.optional(Model),
|
|
386
|
+
}).pipe(
|
|
387
|
+
T.Http({ method: "POST", uri: "/api/firewall/alias/set", code: 200 }),
|
|
388
|
+
),
|
|
389
|
+
).annotate({ identifier: "SetRequest" }) as any as S.Schema<SetRequest>;
|
|
390
|
+
|
|
391
|
+
export type SetResult = "saved";
|
|
392
|
+
export const SetResult = S.String;
|
|
393
|
+
|
|
394
|
+
export interface SetResponse {
|
|
395
|
+
result?: SetResult;
|
|
396
|
+
}
|
|
397
|
+
export const SetResponse = /*@__PURE__*/ S.suspend(() =>
|
|
398
|
+
S.Struct({
|
|
399
|
+
result: S.optional(SetResult),
|
|
400
|
+
}),
|
|
401
|
+
).annotate({ identifier: "SetResponse" }) as any as S.Schema<SetResponse>;
|
|
402
|
+
|
|
403
|
+
export interface SetAliasRequest {
|
|
404
|
+
uuid: string;
|
|
405
|
+
alias?: AliasItem;
|
|
406
|
+
}
|
|
407
|
+
export const SetAliasRequest = /*@__PURE__*/ S.suspend(() =>
|
|
408
|
+
S.Struct({
|
|
409
|
+
uuid: S.String.pipe(T.Label()),
|
|
410
|
+
alias: S.optional(AliasItem),
|
|
411
|
+
}).pipe(
|
|
412
|
+
T.Http({
|
|
413
|
+
method: "POST",
|
|
414
|
+
uri: "/api/firewall/alias/setItem/{uuid}",
|
|
415
|
+
code: 200,
|
|
416
|
+
}),
|
|
417
|
+
),
|
|
418
|
+
).annotate({
|
|
419
|
+
identifier: "SetAliasRequest",
|
|
420
|
+
}) as any as S.Schema<SetAliasRequest>;
|
|
421
|
+
|
|
422
|
+
export type SetAliasResult = "saved";
|
|
423
|
+
export const SetAliasResult = S.String;
|
|
424
|
+
|
|
425
|
+
export interface SetAliasResponse {
|
|
426
|
+
result?: SetAliasResult;
|
|
427
|
+
}
|
|
428
|
+
export const SetAliasResponse = /*@__PURE__*/ S.suspend(() =>
|
|
429
|
+
S.Struct({
|
|
430
|
+
result: S.optional(SetAliasResult),
|
|
431
|
+
}),
|
|
432
|
+
).annotate({
|
|
433
|
+
identifier: "SetAliasResponse",
|
|
434
|
+
}) as any as S.Schema<SetAliasResponse>;
|
|
435
|
+
|
|
436
|
+
export interface ToggleAliasRequest {
|
|
437
|
+
uuid: string;
|
|
438
|
+
}
|
|
439
|
+
export const ToggleAliasRequest = /*@__PURE__*/ S.suspend(() =>
|
|
440
|
+
S.Struct({
|
|
441
|
+
uuid: S.String.pipe(T.Label()),
|
|
442
|
+
}).pipe(
|
|
443
|
+
T.Http({
|
|
444
|
+
method: "POST",
|
|
445
|
+
uri: "/api/firewall/alias/toggleItem/{uuid}",
|
|
446
|
+
code: 200,
|
|
447
|
+
}),
|
|
448
|
+
),
|
|
449
|
+
).annotate({
|
|
450
|
+
identifier: "ToggleAliasRequest",
|
|
451
|
+
}) as any as S.Schema<ToggleAliasRequest>;
|
|
452
|
+
|
|
453
|
+
export type ToggleAliasResult = "Enabled" | "Disabled" | "failed";
|
|
454
|
+
export const ToggleAliasResult = S.String;
|
|
455
|
+
|
|
456
|
+
export interface ToggleAliasResponse {
|
|
457
|
+
result?: ToggleAliasResult;
|
|
458
|
+
changed?: boolean;
|
|
459
|
+
}
|
|
460
|
+
export const ToggleAliasResponse = /*@__PURE__*/ S.suspend(() =>
|
|
461
|
+
S.Struct({
|
|
462
|
+
result: S.optional(ToggleAliasResult),
|
|
463
|
+
changed: S.optional(S.Boolean),
|
|
464
|
+
}),
|
|
465
|
+
).annotate({
|
|
466
|
+
identifier: "ToggleAliasResponse",
|
|
467
|
+
}) as any as S.Schema<ToggleAliasResponse>;
|
|
468
|
+
|
|
469
|
+
export type AddAliasError = OpnsenseOpError;
|
|
470
|
+
/** Add a new aliases.alias item. On a validation failure the call fails with ValidationFailed instead of decoding this response. */
|
|
471
|
+
export const addAlias: API.OperationMethod<
|
|
472
|
+
AddAliasRequest,
|
|
473
|
+
AddAliasResponse,
|
|
474
|
+
AddAliasError,
|
|
475
|
+
OpnsenseOpContext
|
|
476
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
477
|
+
input: AddAliasRequest,
|
|
478
|
+
output: AddAliasResponse,
|
|
479
|
+
errors: [],
|
|
480
|
+
protocol: OpnsenseProtocol,
|
|
481
|
+
retry: Retry.Retry,
|
|
482
|
+
}));
|
|
483
|
+
|
|
484
|
+
export type DelAliasError = OpnsenseOpError;
|
|
485
|
+
/** Delete a aliases.alias item by uuid. */
|
|
486
|
+
export const delAlias: API.OperationMethod<
|
|
487
|
+
DelAliasRequest,
|
|
488
|
+
DelAliasResponse,
|
|
489
|
+
DelAliasError,
|
|
490
|
+
OpnsenseOpContext
|
|
491
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
492
|
+
input: DelAliasRequest,
|
|
493
|
+
output: DelAliasResponse,
|
|
494
|
+
errors: [],
|
|
495
|
+
protocol: OpnsenseProtocol,
|
|
496
|
+
retry: Retry.Retry,
|
|
497
|
+
}));
|
|
498
|
+
|
|
499
|
+
export type GetError = OpnsenseOpError;
|
|
500
|
+
/** Fetch the entire model tree (every section and array collection). */
|
|
501
|
+
export const get: API.OperationMethod<
|
|
502
|
+
GetRequest,
|
|
503
|
+
GetResponse,
|
|
504
|
+
GetError,
|
|
505
|
+
OpnsenseOpContext
|
|
506
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
507
|
+
input: GetRequest,
|
|
508
|
+
output: GetResponse,
|
|
509
|
+
errors: [],
|
|
510
|
+
protocol: OpnsenseProtocol,
|
|
511
|
+
retry: Retry.Retry,
|
|
512
|
+
}));
|
|
513
|
+
|
|
514
|
+
export type SearchAliasError = OpnsenseOpError;
|
|
515
|
+
/** Search aliases.alias items (paginated). */
|
|
516
|
+
export const searchAlias: API.OperationMethod<
|
|
517
|
+
SearchAliasRequest,
|
|
518
|
+
SearchAliasResponse,
|
|
519
|
+
SearchAliasError,
|
|
520
|
+
OpnsenseOpContext
|
|
521
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
522
|
+
input: SearchAliasRequest,
|
|
523
|
+
output: SearchAliasResponse,
|
|
524
|
+
errors: [],
|
|
525
|
+
protocol: OpnsenseProtocol,
|
|
526
|
+
retry: Retry.Retry,
|
|
527
|
+
}));
|
|
528
|
+
|
|
529
|
+
export type SetError = OpnsenseOpError;
|
|
530
|
+
/** Replace the entire model tree in one call. On a validation failure the call fails with ValidationFailed instead of decoding this response. */
|
|
531
|
+
export const set: API.OperationMethod<
|
|
532
|
+
SetRequest,
|
|
533
|
+
SetResponse,
|
|
534
|
+
SetError,
|
|
535
|
+
OpnsenseOpContext
|
|
536
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
537
|
+
input: SetRequest,
|
|
538
|
+
output: SetResponse,
|
|
539
|
+
errors: [],
|
|
540
|
+
protocol: OpnsenseProtocol,
|
|
541
|
+
retry: Retry.Retry,
|
|
542
|
+
}));
|
|
543
|
+
|
|
544
|
+
export type SetAliasError = OpnsenseOpError;
|
|
545
|
+
/** Update an existing aliases.alias item. On a validation failure the call fails with ValidationFailed instead of decoding this response. */
|
|
546
|
+
export const setAlias: API.OperationMethod<
|
|
547
|
+
SetAliasRequest,
|
|
548
|
+
SetAliasResponse,
|
|
549
|
+
SetAliasError,
|
|
550
|
+
OpnsenseOpContext
|
|
551
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
552
|
+
input: SetAliasRequest,
|
|
553
|
+
output: SetAliasResponse,
|
|
554
|
+
errors: [],
|
|
555
|
+
protocol: OpnsenseProtocol,
|
|
556
|
+
retry: Retry.Retry,
|
|
557
|
+
}));
|
|
558
|
+
|
|
559
|
+
export type ToggleAliasError = OpnsenseOpError;
|
|
560
|
+
/** Flip a aliases.alias item's enabled flag by uuid. */
|
|
561
|
+
export const toggleAlias: API.OperationMethod<
|
|
562
|
+
ToggleAliasRequest,
|
|
563
|
+
ToggleAliasResponse,
|
|
564
|
+
ToggleAliasError,
|
|
565
|
+
OpnsenseOpContext
|
|
566
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
567
|
+
input: ToggleAliasRequest,
|
|
568
|
+
output: ToggleAliasResponse,
|
|
569
|
+
errors: [],
|
|
570
|
+
protocol: OpnsenseProtocol,
|
|
571
|
+
retry: Retry.Retry,
|
|
572
|
+
}));
|