@takodotid/circuit 0.42.1 → 0.43.1
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/dist/chunks/{index-20kcjxjg.js → index-3b343xva.js} +3 -0
- package/dist/cli/index.js +109 -54
- package/dist/helpers/index.js +43 -11
- package/dist/index.js +1 -1
- package/dist/types/core/utils.d.ts +2 -0
- package/dist/types/helpers/bgp.d.ts +23 -12
- package/dist/types/helpers/index.d.ts +1 -1
- package/dist/types/helpers/upstreams.d.ts +15 -4
- package/dist/types/platforms/fortios/plan.d.ts +15 -5
- package/dist/types/schema/routing.d.ts +4 -4
- package/package.json +1 -1
- package/src/core/utils.ts +5 -0
- package/src/core/validator.ts +10 -5
- package/src/helpers/bgp.ts +50 -30
- package/src/helpers/index.ts +10 -1
- package/src/helpers/upstreams.ts +43 -4
- package/src/platforms/derive.ts +4 -3
- package/src/platforms/fortios/plan.ts +132 -44
- package/src/platforms/routeros/index.ts +11 -3
- package/src/platforms/routeros/render.ts +3 -2
- package/src/schema/routing.ts +4 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// The neutral model as a RouterOS 7 export, written in the form `/export` prints so the two compare line for line.
|
|
2
2
|
|
|
3
3
|
import { X509Certificate } from "node:crypto";
|
|
4
|
+
import { Utils } from "../../core/utils";
|
|
4
5
|
import { Address } from "../../core/address";
|
|
5
6
|
import { Secrets } from "../../core/secrets";
|
|
6
7
|
import type {
|
|
@@ -1147,7 +1148,7 @@ export class RouterOsRender {
|
|
|
1147
1148
|
distance: route.distance,
|
|
1148
1149
|
"dst-address": route.prefix,
|
|
1149
1150
|
gateway,
|
|
1150
|
-
"routing-table": route.vrf ?? route.table,
|
|
1151
|
+
"routing-table": route.vrf ?? Utils.otherTable(route.table),
|
|
1151
1152
|
});
|
|
1152
1153
|
}
|
|
1153
1154
|
}
|
|
@@ -1292,7 +1293,7 @@ export class RouterOsRender {
|
|
|
1292
1293
|
"output.network": originates ? RouterOsRender.NETWORKS[family] : undefined,
|
|
1293
1294
|
"remote.address": `${neighbor.address}/${addressFamily === "ipv4" ? 32 : 128}`,
|
|
1294
1295
|
"remote.as": settings.remote_as,
|
|
1295
|
-
"routing-table": settings.table,
|
|
1296
|
+
"routing-table": Utils.otherTable(settings.table),
|
|
1296
1297
|
"tcp-md5-key": settings.password && Secrets.marker(settings.password),
|
|
1297
1298
|
"use-bfd": settings.bfd ? "yes" : undefined,
|
|
1298
1299
|
});
|
package/src/schema/routing.ts
CHANGED
|
@@ -16,8 +16,8 @@ export type StaticRoute<I extends string, F extends string, T extends string = n
|
|
|
16
16
|
distance?: number;
|
|
17
17
|
/** The VRF the route is in. The main table when absent. */
|
|
18
18
|
vrf?: F;
|
|
19
|
-
/** The table the route is in
|
|
20
|
-
table?: T;
|
|
19
|
+
/** The table the route is in: `main`, or one of `routing.tables`. The main table when absent; write `main` to say so. A route has a `vrf` or a `table`, not both. */
|
|
20
|
+
table?: T | "main";
|
|
21
21
|
/** Why the route exists. */
|
|
22
22
|
description?: string;
|
|
23
23
|
};
|
|
@@ -57,8 +57,8 @@ export type NeighborSettings<P extends string, T extends string = never> = {
|
|
|
57
57
|
passive?: boolean;
|
|
58
58
|
/** Detect a dead link in under a second with BFD. */
|
|
59
59
|
bfd?: boolean;
|
|
60
|
-
/** The table the routes learned are installed in
|
|
61
|
-
table?: T;
|
|
60
|
+
/** The table the routes learned are installed in: `main`, or one of `routing.tables`. The main table when absent; write `main` to say so. On RouterOS the session also announces from that table, so each prefix of `networks` it announces needs a route in the table too, and a running session takes a new table only when it restarts. */
|
|
61
|
+
table?: T | "main";
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
/** One BGP session. Settings it does not set come from its group. */
|