@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,419 @@
|
|
|
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 GatewayItemIpprotocol = "inet" | "inet6";
|
|
15
|
+
export const GatewayItemIpprotocol = S.String;
|
|
16
|
+
|
|
17
|
+
export interface GatewayItem {
|
|
18
|
+
/** Item id, assigned by OPNsense on creation. */
|
|
19
|
+
uuid?: string;
|
|
20
|
+
/** OPNsense FieldType: BooleanField */
|
|
21
|
+
disabled: string;
|
|
22
|
+
/** OPNsense FieldType: TextField; pattern /^[a-zA-Z0-9_\-]{1,32}$/ */
|
|
23
|
+
name: string;
|
|
24
|
+
/** OPNsense FieldType: DescriptionField */
|
|
25
|
+
descr?: string;
|
|
26
|
+
/** OPNsense FieldType: InterfaceField */
|
|
27
|
+
interface: string;
|
|
28
|
+
/** OPNsense FieldType: OptionField */
|
|
29
|
+
ipprotocol: GatewayItemIpprotocol | (string & {});
|
|
30
|
+
/** OPNsense FieldType: TextField */
|
|
31
|
+
gateway?: string;
|
|
32
|
+
/** OPNsense FieldType: BooleanField */
|
|
33
|
+
defaultgw?: string;
|
|
34
|
+
/** OPNsense FieldType: BooleanField */
|
|
35
|
+
fargw?: string;
|
|
36
|
+
/** OPNsense FieldType: BooleanField */
|
|
37
|
+
monitor_disable: string;
|
|
38
|
+
/** OPNsense FieldType: BooleanField */
|
|
39
|
+
monitor_noroute?: string;
|
|
40
|
+
/** OPNsense FieldType: BooleanField */
|
|
41
|
+
monitor_killstates?: string;
|
|
42
|
+
/** OPNsense FieldType: BooleanField */
|
|
43
|
+
monitor_killstates_priority?: string;
|
|
44
|
+
/** OPNsense FieldType: TextField */
|
|
45
|
+
monitor?: string;
|
|
46
|
+
/** OPNsense FieldType: BooleanField */
|
|
47
|
+
force_down?: string;
|
|
48
|
+
/** OPNsense FieldType: BooleanField */
|
|
49
|
+
nosync?: string;
|
|
50
|
+
/** OPNsense FieldType: IntegerField; range 0..255 (as text) */
|
|
51
|
+
priority: string;
|
|
52
|
+
/** OPNsense FieldType: IntegerField; range 1..10 (as text) */
|
|
53
|
+
weight: string;
|
|
54
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
55
|
+
latencylow?: string;
|
|
56
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
57
|
+
latencyhigh?: string;
|
|
58
|
+
/** OPNsense FieldType: IntegerField; range 1..99 (as text) */
|
|
59
|
+
losslow?: string;
|
|
60
|
+
/** OPNsense FieldType: IntegerField; range 1..100 (as text) */
|
|
61
|
+
losshigh?: string;
|
|
62
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
63
|
+
interval?: string;
|
|
64
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
65
|
+
time_period?: string;
|
|
66
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
67
|
+
loss_interval?: string;
|
|
68
|
+
/** OPNsense FieldType: IntegerField; range 0..+inf (as text) */
|
|
69
|
+
data_length?: string;
|
|
70
|
+
}
|
|
71
|
+
export const GatewayItem = /*@__PURE__*/ S.suspend(() =>
|
|
72
|
+
S.Struct({
|
|
73
|
+
uuid: S.optional(S.String),
|
|
74
|
+
disabled: S.String,
|
|
75
|
+
name: S.String,
|
|
76
|
+
descr: S.optional(S.String),
|
|
77
|
+
interface: S.String,
|
|
78
|
+
ipprotocol: GatewayItemIpprotocol,
|
|
79
|
+
gateway: S.optional(S.String),
|
|
80
|
+
defaultgw: S.optional(S.String),
|
|
81
|
+
fargw: S.optional(S.String),
|
|
82
|
+
monitor_disable: S.String,
|
|
83
|
+
monitor_noroute: S.optional(S.String),
|
|
84
|
+
monitor_killstates: S.optional(S.String),
|
|
85
|
+
monitor_killstates_priority: S.optional(S.String),
|
|
86
|
+
monitor: S.optional(S.String),
|
|
87
|
+
force_down: S.optional(S.String),
|
|
88
|
+
nosync: S.optional(S.String),
|
|
89
|
+
priority: S.String,
|
|
90
|
+
weight: S.String,
|
|
91
|
+
latencylow: S.optional(S.String),
|
|
92
|
+
latencyhigh: S.optional(S.String),
|
|
93
|
+
losslow: S.optional(S.String),
|
|
94
|
+
losshigh: S.optional(S.String),
|
|
95
|
+
interval: S.optional(S.String),
|
|
96
|
+
time_period: S.optional(S.String),
|
|
97
|
+
loss_interval: S.optional(S.String),
|
|
98
|
+
data_length: S.optional(S.String),
|
|
99
|
+
}),
|
|
100
|
+
).annotate({ identifier: "GatewayItem" }) as any as S.Schema<GatewayItem>;
|
|
101
|
+
|
|
102
|
+
export interface AddGatewayRequest {
|
|
103
|
+
gateway_item?: GatewayItem;
|
|
104
|
+
}
|
|
105
|
+
export const AddGatewayRequest = /*@__PURE__*/ S.suspend(() =>
|
|
106
|
+
S.Struct({
|
|
107
|
+
gateway_item: S.optional(GatewayItem),
|
|
108
|
+
}).pipe(
|
|
109
|
+
T.Http({
|
|
110
|
+
method: "POST",
|
|
111
|
+
uri: "/api/routing/settings/addGateway",
|
|
112
|
+
code: 200,
|
|
113
|
+
}),
|
|
114
|
+
),
|
|
115
|
+
).annotate({
|
|
116
|
+
identifier: "AddGatewayRequest",
|
|
117
|
+
}) as any as S.Schema<AddGatewayRequest>;
|
|
118
|
+
|
|
119
|
+
export type AddGatewayResult = "saved";
|
|
120
|
+
export const AddGatewayResult = S.String;
|
|
121
|
+
|
|
122
|
+
export interface AddGatewayResponse {
|
|
123
|
+
result?: AddGatewayResult;
|
|
124
|
+
/** The new item's uuid. */
|
|
125
|
+
uuid?: string;
|
|
126
|
+
}
|
|
127
|
+
export const AddGatewayResponse = /*@__PURE__*/ S.suspend(() =>
|
|
128
|
+
S.Struct({
|
|
129
|
+
result: S.optional(AddGatewayResult),
|
|
130
|
+
uuid: S.optional(S.String),
|
|
131
|
+
}),
|
|
132
|
+
).annotate({
|
|
133
|
+
identifier: "AddGatewayResponse",
|
|
134
|
+
}) as any as S.Schema<AddGatewayResponse>;
|
|
135
|
+
|
|
136
|
+
export interface DelGatewayRequest {
|
|
137
|
+
uuid: string;
|
|
138
|
+
}
|
|
139
|
+
export const DelGatewayRequest = /*@__PURE__*/ S.suspend(() =>
|
|
140
|
+
S.Struct({
|
|
141
|
+
uuid: S.String.pipe(T.Label()),
|
|
142
|
+
}).pipe(
|
|
143
|
+
T.Http({
|
|
144
|
+
method: "POST",
|
|
145
|
+
uri: "/api/routing/settings/delGateway/{uuid}",
|
|
146
|
+
code: 200,
|
|
147
|
+
}),
|
|
148
|
+
),
|
|
149
|
+
).annotate({
|
|
150
|
+
identifier: "DelGatewayRequest",
|
|
151
|
+
}) as any as S.Schema<DelGatewayRequest>;
|
|
152
|
+
|
|
153
|
+
export type DelGatewayResult = "deleted" | "not found";
|
|
154
|
+
export const DelGatewayResult = S.String;
|
|
155
|
+
|
|
156
|
+
export interface DelGatewayResponse {
|
|
157
|
+
result?: DelGatewayResult;
|
|
158
|
+
}
|
|
159
|
+
export const DelGatewayResponse = /*@__PURE__*/ S.suspend(() =>
|
|
160
|
+
S.Struct({
|
|
161
|
+
result: S.optional(DelGatewayResult),
|
|
162
|
+
}),
|
|
163
|
+
).annotate({
|
|
164
|
+
identifier: "DelGatewayResponse",
|
|
165
|
+
}) as any as S.Schema<DelGatewayResponse>;
|
|
166
|
+
|
|
167
|
+
export interface GetRequest {}
|
|
168
|
+
export const GetRequest = /*@__PURE__*/ S.suspend(() =>
|
|
169
|
+
S.Struct({}).pipe(
|
|
170
|
+
T.Http({ method: "GET", uri: "/api/routing/settings/get", code: 200 }),
|
|
171
|
+
),
|
|
172
|
+
).annotate({ identifier: "GetRequest" }) as any as S.Schema<GetRequest>;
|
|
173
|
+
|
|
174
|
+
export type ModelGateway_itemItemIpprotocol = "inet" | "inet6";
|
|
175
|
+
export const ModelGateway_itemItemIpprotocol = S.String;
|
|
176
|
+
|
|
177
|
+
export interface ModelGateway_itemItem {
|
|
178
|
+
/** Item id, assigned by OPNsense on creation. */
|
|
179
|
+
uuid?: string;
|
|
180
|
+
/** OPNsense FieldType: BooleanField */
|
|
181
|
+
disabled: string;
|
|
182
|
+
/** OPNsense FieldType: TextField; pattern /^[a-zA-Z0-9_\-]{1,32}$/ */
|
|
183
|
+
name: string;
|
|
184
|
+
/** OPNsense FieldType: DescriptionField */
|
|
185
|
+
descr?: string;
|
|
186
|
+
/** OPNsense FieldType: InterfaceField */
|
|
187
|
+
interface: string;
|
|
188
|
+
/** OPNsense FieldType: OptionField */
|
|
189
|
+
ipprotocol: ModelGateway_itemItemIpprotocol | (string & {});
|
|
190
|
+
/** OPNsense FieldType: TextField */
|
|
191
|
+
gateway?: string;
|
|
192
|
+
/** OPNsense FieldType: BooleanField */
|
|
193
|
+
defaultgw?: string;
|
|
194
|
+
/** OPNsense FieldType: BooleanField */
|
|
195
|
+
fargw?: string;
|
|
196
|
+
/** OPNsense FieldType: BooleanField */
|
|
197
|
+
monitor_disable: string;
|
|
198
|
+
/** OPNsense FieldType: BooleanField */
|
|
199
|
+
monitor_noroute?: string;
|
|
200
|
+
/** OPNsense FieldType: BooleanField */
|
|
201
|
+
monitor_killstates?: string;
|
|
202
|
+
/** OPNsense FieldType: BooleanField */
|
|
203
|
+
monitor_killstates_priority?: string;
|
|
204
|
+
/** OPNsense FieldType: TextField */
|
|
205
|
+
monitor?: string;
|
|
206
|
+
/** OPNsense FieldType: BooleanField */
|
|
207
|
+
force_down?: string;
|
|
208
|
+
/** OPNsense FieldType: BooleanField */
|
|
209
|
+
nosync?: string;
|
|
210
|
+
/** OPNsense FieldType: IntegerField; range 0..255 (as text) */
|
|
211
|
+
priority: string;
|
|
212
|
+
/** OPNsense FieldType: IntegerField; range 1..10 (as text) */
|
|
213
|
+
weight: string;
|
|
214
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
215
|
+
latencylow?: string;
|
|
216
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
217
|
+
latencyhigh?: string;
|
|
218
|
+
/** OPNsense FieldType: IntegerField; range 1..99 (as text) */
|
|
219
|
+
losslow?: string;
|
|
220
|
+
/** OPNsense FieldType: IntegerField; range 1..100 (as text) */
|
|
221
|
+
losshigh?: string;
|
|
222
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
223
|
+
interval?: string;
|
|
224
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
225
|
+
time_period?: string;
|
|
226
|
+
/** OPNsense FieldType: IntegerField; range 1..+inf (as text) */
|
|
227
|
+
loss_interval?: string;
|
|
228
|
+
/** OPNsense FieldType: IntegerField; range 0..+inf (as text) */
|
|
229
|
+
data_length?: string;
|
|
230
|
+
}
|
|
231
|
+
export const ModelGateway_itemItem = /*@__PURE__*/ S.suspend(() =>
|
|
232
|
+
S.Struct({
|
|
233
|
+
uuid: S.optional(S.String),
|
|
234
|
+
disabled: S.String,
|
|
235
|
+
name: S.String,
|
|
236
|
+
descr: S.optional(S.String),
|
|
237
|
+
interface: S.String,
|
|
238
|
+
ipprotocol: ModelGateway_itemItemIpprotocol,
|
|
239
|
+
gateway: S.optional(S.String),
|
|
240
|
+
defaultgw: S.optional(S.String),
|
|
241
|
+
fargw: S.optional(S.String),
|
|
242
|
+
monitor_disable: S.String,
|
|
243
|
+
monitor_noroute: S.optional(S.String),
|
|
244
|
+
monitor_killstates: S.optional(S.String),
|
|
245
|
+
monitor_killstates_priority: S.optional(S.String),
|
|
246
|
+
monitor: S.optional(S.String),
|
|
247
|
+
force_down: S.optional(S.String),
|
|
248
|
+
nosync: S.optional(S.String),
|
|
249
|
+
priority: S.String,
|
|
250
|
+
weight: S.String,
|
|
251
|
+
latencylow: S.optional(S.String),
|
|
252
|
+
latencyhigh: S.optional(S.String),
|
|
253
|
+
losslow: S.optional(S.String),
|
|
254
|
+
losshigh: S.optional(S.String),
|
|
255
|
+
interval: S.optional(S.String),
|
|
256
|
+
time_period: S.optional(S.String),
|
|
257
|
+
loss_interval: S.optional(S.String),
|
|
258
|
+
data_length: S.optional(S.String),
|
|
259
|
+
}),
|
|
260
|
+
).annotate({
|
|
261
|
+
identifier: "ModelGateway_itemItem",
|
|
262
|
+
}) as any as S.Schema<ModelGateway_itemItem>;
|
|
263
|
+
|
|
264
|
+
export type ModelGateway_itemItemMap = {
|
|
265
|
+
[key: string]: ModelGateway_itemItem | undefined;
|
|
266
|
+
};
|
|
267
|
+
export const ModelGateway_itemItemMap = /*@__PURE__*/ S.Record(
|
|
268
|
+
S.String,
|
|
269
|
+
ModelGateway_itemItem,
|
|
270
|
+
) as any as S.Schema<ModelGateway_itemItemMap>;
|
|
271
|
+
|
|
272
|
+
export interface Model {
|
|
273
|
+
gateway_item?: ModelGateway_itemItemMap;
|
|
274
|
+
}
|
|
275
|
+
export const Model = /*@__PURE__*/ S.suspend(() =>
|
|
276
|
+
S.Struct({
|
|
277
|
+
gateway_item: S.optional(ModelGateway_itemItemMap),
|
|
278
|
+
}),
|
|
279
|
+
).annotate({ identifier: "Model" }) as any as S.Schema<Model>;
|
|
280
|
+
|
|
281
|
+
export interface GetResponse {
|
|
282
|
+
gateways?: Model;
|
|
283
|
+
}
|
|
284
|
+
export const GetResponse = /*@__PURE__*/ S.suspend(() =>
|
|
285
|
+
S.Struct({
|
|
286
|
+
gateways: S.optional(Model),
|
|
287
|
+
}),
|
|
288
|
+
).annotate({ identifier: "GetResponse" }) as any as S.Schema<GetResponse>;
|
|
289
|
+
|
|
290
|
+
export interface SetRequest {
|
|
291
|
+
gateways?: Model;
|
|
292
|
+
}
|
|
293
|
+
export const SetRequest = /*@__PURE__*/ S.suspend(() =>
|
|
294
|
+
S.Struct({
|
|
295
|
+
gateways: S.optional(Model),
|
|
296
|
+
}).pipe(
|
|
297
|
+
T.Http({ method: "POST", uri: "/api/routing/settings/set", code: 200 }),
|
|
298
|
+
),
|
|
299
|
+
).annotate({ identifier: "SetRequest" }) as any as S.Schema<SetRequest>;
|
|
300
|
+
|
|
301
|
+
export type SetResult = "saved";
|
|
302
|
+
export const SetResult = S.String;
|
|
303
|
+
|
|
304
|
+
export interface SetResponse {
|
|
305
|
+
result?: SetResult;
|
|
306
|
+
}
|
|
307
|
+
export const SetResponse = /*@__PURE__*/ S.suspend(() =>
|
|
308
|
+
S.Struct({
|
|
309
|
+
result: S.optional(SetResult),
|
|
310
|
+
}),
|
|
311
|
+
).annotate({ identifier: "SetResponse" }) as any as S.Schema<SetResponse>;
|
|
312
|
+
|
|
313
|
+
export interface SetGatewayRequest {
|
|
314
|
+
uuid: string;
|
|
315
|
+
gateway_item?: GatewayItem;
|
|
316
|
+
}
|
|
317
|
+
export const SetGatewayRequest = /*@__PURE__*/ S.suspend(() =>
|
|
318
|
+
S.Struct({
|
|
319
|
+
uuid: S.String.pipe(T.Label()),
|
|
320
|
+
gateway_item: S.optional(GatewayItem),
|
|
321
|
+
}).pipe(
|
|
322
|
+
T.Http({
|
|
323
|
+
method: "POST",
|
|
324
|
+
uri: "/api/routing/settings/setGateway/{uuid}",
|
|
325
|
+
code: 200,
|
|
326
|
+
}),
|
|
327
|
+
),
|
|
328
|
+
).annotate({
|
|
329
|
+
identifier: "SetGatewayRequest",
|
|
330
|
+
}) as any as S.Schema<SetGatewayRequest>;
|
|
331
|
+
|
|
332
|
+
export type SetGatewayResult = "saved";
|
|
333
|
+
export const SetGatewayResult = S.String;
|
|
334
|
+
|
|
335
|
+
export interface SetGatewayResponse {
|
|
336
|
+
result?: SetGatewayResult;
|
|
337
|
+
}
|
|
338
|
+
export const SetGatewayResponse = /*@__PURE__*/ S.suspend(() =>
|
|
339
|
+
S.Struct({
|
|
340
|
+
result: S.optional(SetGatewayResult),
|
|
341
|
+
}),
|
|
342
|
+
).annotate({
|
|
343
|
+
identifier: "SetGatewayResponse",
|
|
344
|
+
}) as any as S.Schema<SetGatewayResponse>;
|
|
345
|
+
|
|
346
|
+
export type AddGatewayError = OpnsenseOpError;
|
|
347
|
+
/** Add a new gateway_item item. On a validation failure the call fails with ValidationFailed instead of decoding this response. */
|
|
348
|
+
export const addGateway: API.OperationMethod<
|
|
349
|
+
AddGatewayRequest,
|
|
350
|
+
AddGatewayResponse,
|
|
351
|
+
AddGatewayError,
|
|
352
|
+
OpnsenseOpContext
|
|
353
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
354
|
+
input: AddGatewayRequest,
|
|
355
|
+
output: AddGatewayResponse,
|
|
356
|
+
errors: [],
|
|
357
|
+
protocol: OpnsenseProtocol,
|
|
358
|
+
retry: Retry.Retry,
|
|
359
|
+
}));
|
|
360
|
+
|
|
361
|
+
export type DelGatewayError = OpnsenseOpError;
|
|
362
|
+
/** Delete a gateway_item item by uuid. */
|
|
363
|
+
export const delGateway: API.OperationMethod<
|
|
364
|
+
DelGatewayRequest,
|
|
365
|
+
DelGatewayResponse,
|
|
366
|
+
DelGatewayError,
|
|
367
|
+
OpnsenseOpContext
|
|
368
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
369
|
+
input: DelGatewayRequest,
|
|
370
|
+
output: DelGatewayResponse,
|
|
371
|
+
errors: [],
|
|
372
|
+
protocol: OpnsenseProtocol,
|
|
373
|
+
retry: Retry.Retry,
|
|
374
|
+
}));
|
|
375
|
+
|
|
376
|
+
export type GetError = OpnsenseOpError;
|
|
377
|
+
/** Fetch the entire model tree (every section and array collection). */
|
|
378
|
+
export const get: API.OperationMethod<
|
|
379
|
+
GetRequest,
|
|
380
|
+
GetResponse,
|
|
381
|
+
GetError,
|
|
382
|
+
OpnsenseOpContext
|
|
383
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
384
|
+
input: GetRequest,
|
|
385
|
+
output: GetResponse,
|
|
386
|
+
errors: [],
|
|
387
|
+
protocol: OpnsenseProtocol,
|
|
388
|
+
retry: Retry.Retry,
|
|
389
|
+
}));
|
|
390
|
+
|
|
391
|
+
export type SetError = OpnsenseOpError;
|
|
392
|
+
/** Replace the entire model tree in one call. On a validation failure the call fails with ValidationFailed instead of decoding this response. */
|
|
393
|
+
export const set: API.OperationMethod<
|
|
394
|
+
SetRequest,
|
|
395
|
+
SetResponse,
|
|
396
|
+
SetError,
|
|
397
|
+
OpnsenseOpContext
|
|
398
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
399
|
+
input: SetRequest,
|
|
400
|
+
output: SetResponse,
|
|
401
|
+
errors: [],
|
|
402
|
+
protocol: OpnsenseProtocol,
|
|
403
|
+
retry: Retry.Retry,
|
|
404
|
+
}));
|
|
405
|
+
|
|
406
|
+
export type SetGatewayError = OpnsenseOpError;
|
|
407
|
+
/** Update an existing gateway_item item. On a validation failure the call fails with ValidationFailed instead of decoding this response. */
|
|
408
|
+
export const setGateway: API.OperationMethod<
|
|
409
|
+
SetGatewayRequest,
|
|
410
|
+
SetGatewayResponse,
|
|
411
|
+
SetGatewayError,
|
|
412
|
+
OpnsenseOpContext
|
|
413
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
414
|
+
input: SetGatewayRequest,
|
|
415
|
+
output: SetGatewayResponse,
|
|
416
|
+
errors: [],
|
|
417
|
+
protocol: OpnsenseProtocol,
|
|
418
|
+
retry: Retry.Retry,
|
|
419
|
+
}));
|
package/src/traits.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OPNsense SDK trait surface — hand-written.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the generic protocol traits from core so generated operations
|
|
5
|
+
* import everything from one place. OPNsense's request/response shapes need
|
|
6
|
+
* nothing beyond the generic label/query/header/body bindings `protocol.ts`
|
|
7
|
+
* already builds on — no sensitive-value wrapping, no bare-array responses,
|
|
8
|
+
* no provider-specific traits.
|
|
9
|
+
*/
|
|
10
|
+
export {
|
|
11
|
+
Body,
|
|
12
|
+
Header,
|
|
13
|
+
Query,
|
|
14
|
+
Label,
|
|
15
|
+
Http,
|
|
16
|
+
ResponseCode,
|
|
17
|
+
HttpBody,
|
|
18
|
+
FormDataFile,
|
|
19
|
+
KeyDictionary,
|
|
20
|
+
UnionCases,
|
|
21
|
+
applyErrorMatchers,
|
|
22
|
+
getErrorMatchers,
|
|
23
|
+
type HttpTrait,
|
|
24
|
+
type ErrorMatcher,
|
|
25
|
+
bodySymbol,
|
|
26
|
+
headerSymbol,
|
|
27
|
+
querySymbol,
|
|
28
|
+
labelSymbol,
|
|
29
|
+
httpSymbol,
|
|
30
|
+
responseCodeSymbol,
|
|
31
|
+
httpBodySymbol,
|
|
32
|
+
formDataFileSymbol,
|
|
33
|
+
keyDictionarySymbol,
|
|
34
|
+
unionCasesSymbol,
|
|
35
|
+
errorMatchersSymbol,
|
|
36
|
+
} from "@distilled.cloud/core/trait";
|