@takodotid/circuit 0.25.0 → 0.26.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.
Files changed (43) hide show
  1. package/README.md +7 -7
  2. package/dist/chunks/{index-wm9ypkjq.js → index-22sbskdx.js} +13 -5
  3. package/dist/chunks/{server-n2q4tzy4.js → server-1ftkqkx5.js} +1 -1
  4. package/dist/cli/index.js +2990 -264
  5. package/dist/types/adapters/devices/catalog.d.ts +14 -0
  6. package/dist/types/adapters/devices/fortios/firewall.d.ts +21 -0
  7. package/dist/types/adapters/devices/fortios/index.d.ts +55 -0
  8. package/dist/types/adapters/devices/fortios/models.d.ts +14 -0
  9. package/dist/types/adapters/devices/fortios/names.d.ts +32 -0
  10. package/dist/types/adapters/devices/fortios/plan.d.ts +26 -0
  11. package/dist/types/adapters/devices/fortios/render.d.ts +36 -0
  12. package/dist/types/adapters/devices/fortios/routing.d.ts +32 -0
  13. package/dist/types/adapters/devices/fortios/tree.d.ts +33 -0
  14. package/dist/types/schema/common.d.ts +1 -1
  15. package/dist/types/schema/device.d.ts +1 -1
  16. package/dist/types/schema/firewall.d.ts +3 -3
  17. package/dist/types/schema/interfaces.d.ts +13 -13
  18. package/dist/types/schema/policy.d.ts +3 -3
  19. package/dist/types/schema/routing.d.ts +7 -7
  20. package/dist/types/schema/system.d.ts +7 -7
  21. package/package.json +5 -2
  22. package/src/adapters/devices/catalog.ts +2 -1
  23. package/src/adapters/devices/fortios/TRAPS.md +40 -0
  24. package/src/adapters/devices/fortios/firewall.ts +352 -0
  25. package/src/adapters/devices/fortios/index.ts +800 -0
  26. package/src/adapters/devices/fortios/models.ts +7 -0
  27. package/src/adapters/devices/fortios/names.ts +78 -0
  28. package/src/adapters/devices/fortios/plan.ts +840 -0
  29. package/src/adapters/devices/fortios/render.ts +734 -0
  30. package/src/adapters/devices/fortios/routing.ts +444 -0
  31. package/src/adapters/devices/fortios/tree.ts +121 -0
  32. package/src/adapters/devices/index.ts +2 -1
  33. package/src/adapters/devices/junos/TRAPS.md +2 -2
  34. package/src/adapters/devices/raisecom-ros/TRAPS.md +2 -2
  35. package/src/adapters/devices/routeros/TRAPS.md +5 -5
  36. package/src/adapters/devices/vrp/TRAPS.md +4 -4
  37. package/src/schema/common.ts +1 -1
  38. package/src/schema/device.ts +1 -1
  39. package/src/schema/firewall.ts +3 -3
  40. package/src/schema/interfaces.ts +13 -13
  41. package/src/schema/policy.ts +3 -3
  42. package/src/schema/routing.ts +7 -7
  43. package/src/schema/system.ts +7 -7
@@ -14,10 +14,10 @@ Behaviour that looks like something else. Each one has been hit on a CE6855 runn
14
14
  - LLDP is off by default. A port setting for LLDP is refused until it is on globally.
15
15
  - A trunk forwards its native VLAN's untagged frames only when that VLAN is also allowed; the adapter adds it.
16
16
  - The name `admin` is refused for a local user.
17
- - A port joins an Eth-Trunk only while it holds no other setting, including a description.
17
+ - A port joins an Eth-Trunk only while it has no other setting, including a description.
18
18
  - An empty block such as `bfd` enters its view; the next line sent goes into it unless the view is left.
19
19
  - SNMPv3 passwords are asked for interactively, twice. `authentication-mode` must come before `privacy-mode`.
20
20
  - `abort` is not a command here. `clear configuration candidate` discards uncommitted changes.
21
- - sFlow samples per port, `sflow sampling rate N`, N from 4096; the default is 8192 and an explicit 8192 is kept as written. A port names a collector only once the collector exists globally; until then it is refused with "collector does not exist".
22
- - `vlan batch` holds every VLAN on one line, and undoing a list that names a VLAN with an L3 interface is refused. A change sends only the VLANs added and `undo vlan batch` for the ones removed.
23
- - A VLAN name is unique across VLANs: a new VLAN cannot take a name another still holds. VLANs no longer used, and their VLAN interfaces, are removed first, in the same candidate.
21
+ - sFlow samples per port, `sflow sampling rate N`, N from 4096; the default is 8192 and an explicit 8192 is kept as written. A port can point to a collector only once the collector exists globally; until then it is refused with "collector does not exist".
22
+ - `vlan batch` has every VLAN on one line, and undoing a list that includes a VLAN with an L3 interface is refused. A change sends only the VLANs added and `undo vlan batch` for the ones removed.
23
+ - A VLAN name is unique across VLANs: a new VLAN cannot take a name another still has. VLANs no longer used, and their VLAN interfaces, are removed first, in the same candidate.
@@ -9,7 +9,7 @@ export type Secret =
9
9
  readonly secret: string;
10
10
  }
11
11
  | {
12
- /** Path of a file holding the value, relative to the config file. */
12
+ /** Path of the file with the value, relative to the config file. */
13
13
  readonly secret_file: string;
14
14
  };
15
15
 
@@ -43,7 +43,7 @@ export type Device<
43
43
  > = {
44
44
  /** Hostname. */
45
45
  name: string;
46
- /** Operating system, which decides the adapter that renders and applies the device. */
46
+ /** Operating system. It decides which adapter renders and applies the device. */
47
47
  platform: Pl;
48
48
  /** Hardware model. Decides which port names exist. */
49
49
  model: M;
@@ -15,7 +15,7 @@ export type Ports = number | PortRange | readonly (number | PortRange)[];
15
15
  /** A TCP header flag. */
16
16
  export type TcpFlag = "fin" | "syn" | "rst" | "psh" | "ack" | "urg";
17
17
 
18
- /** Conditions on a packet. All must hold. A rule with addresses of one family applies to that family only. */
18
+ /** Conditions on a packet. All must be true. A rule with addresses of one family applies to that family only. */
19
19
  export type FilterMatch<I extends string, AS extends string> = {
20
20
  /** Only packets of this family. */
21
21
  family?: Family;
@@ -51,7 +51,7 @@ export type FilterRule<I extends string, AS extends string> = {
51
51
  match?: FilterMatch<I, AS>;
52
52
  /** What happens to a matching packet. `reject` answers the sender, `drop` does not. */
53
53
  action: "accept" | "drop" | "reject";
54
- /** Hand the rest of an accepted flow to the fast path, past the remaining rules. */
54
+ /** Send the rest of an accepted flow through the fast path, skipping the remaining rules. */
55
55
  offload?: true;
56
56
  };
57
57
 
@@ -126,7 +126,7 @@ export type AclRule<V extends string> = {
126
126
  src_port?: Ports;
127
127
  /** Destination port, or any of several. */
128
128
  dst_port?: Ports;
129
- /** Carried in this VLAN. */
129
+ /** In this VLAN. */
130
130
  vlan?: V;
131
131
  };
132
132
  /** What happens to a matching packet. */
@@ -1,8 +1,8 @@
1
1
  import type { Address, IP, Prefix, Secret } from "./common";
2
2
 
3
- /** A VLAN. The key it is declared under is its name. */
3
+ /** A VLAN. Its key in `vlans` is its name. */
4
4
  export type Vlan = {
5
- /** The number carried on the wire, 1 to 4094. */
5
+ /** The VLAN's number on the wire, 1 to 4094. */
6
6
  id: number;
7
7
  /** What the VLAN is for. */
8
8
  description?: string;
@@ -25,7 +25,7 @@ export type Vrrp = {
25
25
  interval?: number;
26
26
  };
27
27
 
28
- /** Layer 3 settings shared by every interface that can hold an address. */
28
+ /** Layer 3 settings shared by every interface that can have an address. */
29
29
  export type Routed<F extends string> = {
30
30
  /** Addresses with their length. Use `{ address, peer }` for a point-to-point address whose far end is outside its own prefix. */
31
31
  addresses?: readonly (Address | { address: Address; peer: IP })[];
@@ -33,7 +33,7 @@ export type Routed<F extends string> = {
33
33
  ipv6_ra?: boolean;
34
34
  /** Overrides the device's `hardware_offload` for traffic routed through this interface. Software forwarding is what makes the firewall apply. */
35
35
  hardware_offload?: boolean;
36
- /** Virtual router addresses held on this interface. */
36
+ /** Virtual router addresses on this interface. */
37
37
  vrrp?: readonly Vrrp[];
38
38
  /** The VRF this interface routes in. The default table when absent. */
39
39
  vrf?: F;
@@ -63,11 +63,11 @@ export type PortStp = {
63
63
 
64
64
  /** Layer 2 membership. A port or LAG with none of these is routed. */
65
65
  export type Switched<V extends string> = {
66
- /** Untagged member of one VLAN. */
66
+ /** The one VLAN this port or LAG is in, untagged. */
67
67
  access_vlan?: V;
68
- /** Tagged member of these VLANs. */
68
+ /** The VLANs this port or LAG carries, tagged. */
69
69
  trunk_vlans?: readonly V[];
70
- /** Untagged frames on a trunk belong to this VLAN. Only with `trunk_vlans`. */
70
+ /** Untagged frames on a trunk are in this VLAN. Only with `trunk_vlans`. */
71
71
  native_vlan?: V;
72
72
  /** Overrides the device's `stp` for this port. `false` stops it sending or acting on BPDUs. */
73
73
  stp?: boolean | PortStp;
@@ -100,7 +100,7 @@ export type Port<V extends string, A extends string, L extends string, F extends
100
100
  lldp?: boolean;
101
101
  /** Hardware ACL applied to traffic arriving on this port. */
102
102
  acl?: A;
103
- /** Member of this LAG. The LAG holds every other setting. */
103
+ /** The LAG this port is in. Every other setting goes on the LAG. */
104
104
  lag?: L;
105
105
  /** Another of our devices at the other end of the cable. */
106
106
  link?: Link;
@@ -117,20 +117,20 @@ type Base<F extends string> = Routed<F> & {
117
117
  /** A layer 3 interface on a VLAN. */
118
118
  export type VlanInterface<V extends string, F extends string> = Base<F> & {
119
119
  type: "vlan";
120
- /** The VLAN it sits on. */
120
+ /** The VLAN it is on. */
121
121
  vlan: V;
122
122
  };
123
123
 
124
- /** An interface that is always up and belongs to no link, for addresses that must not depend on one. */
124
+ /** An interface that is always up and is on no link, for addresses that must not depend on one. */
125
125
  export type Loopback<F extends string> = Base<F> & { type: "loopback" };
126
126
 
127
- /** A link aggregation. Member ports name it with `lag`. */
127
+ /** A link aggregation. Each member port points to it with `lag`. */
128
128
  export type Lag<V extends string, F extends string> = Base<F> &
129
129
  Switched<V> & {
130
130
  type: "lag";
131
- /** LACP negotiates membership with the far end; static bundles without asking. LACP when absent. */
131
+ /** LACP negotiates membership with the far end; `static` joins the ports without asking. LACP when absent. */
132
132
  mode?: "lacp" | "static";
133
- /** Number on platforms that name a LAG by number. Its position among the device's LAGs when absent. */
133
+ /** Number, on platforms where a LAG has a number instead of a name. Its position among the device's LAGs when absent. */
134
134
  id?: number;
135
135
  };
136
136
 
@@ -20,7 +20,7 @@ export type PrefixSet =
20
20
  };
21
21
  };
22
22
 
23
- /** Conditions on a route. All must hold. An empty match holds for every route. */
23
+ /** Conditions on a route. All must be true. An empty match is true for every route. */
24
24
  export type Match<S extends string> = {
25
25
  /** Only routes of this family. */
26
26
  family?: Family;
@@ -34,9 +34,9 @@ export type Match<S extends string> = {
34
34
  as_path_length?: { min?: number; max?: number };
35
35
  /** The route's origin validation state. */
36
36
  rpki?: "valid" | "invalid" | "not-found";
37
- /** Carries this standard community, `asn:value`. */
37
+ /** Has this standard community, `asn:value`. */
38
38
  community?: string;
39
- /** Carries this large community, `asn:function:parameter`. */
39
+ /** Has this large community, `asn:function:parameter`. */
40
40
  large_community?: string;
41
41
  };
42
42
 
@@ -1,6 +1,6 @@
1
1
  import type { Family, IP, Prefix, Secret } from "./common";
2
2
 
3
- /** A route the device carries without learning it. */
3
+ /** A route the device has without learning it. */
4
4
  export type StaticRoute<I extends string, F extends string> = {
5
5
  /** Destination. */
6
6
  prefix: Prefix;
@@ -12,7 +12,7 @@ export type StaticRoute<I extends string, F extends string> = {
12
12
  blackhole?: true;
13
13
  /** Preference against other routes to the same prefix. Lower wins. 1 when absent. */
14
14
  distance?: number;
15
- /** The VRF the route belongs to. The default table when absent. */
15
+ /** The VRF the route is in. The default table when absent. */
16
16
  vrf?: F;
17
17
  /** Why the route exists. */
18
18
  description?: string;
@@ -23,7 +23,7 @@ export type StaticRoute<I extends string, F extends string> = {
23
23
  */
24
24
  export type BgpRole = "provider" | "customer" | "peer" | "rs" | "rs-client";
25
25
 
26
- /** Settings a BGP neighbor can state itself or take from its group. */
26
+ /** Settings a BGP neighbor can set itself or take from its group. */
27
27
  export type NeighborSettings<P extends string> = {
28
28
  /** The neighbor's AS. Our own AS makes the session internal. */
29
29
  remote_as?: number;
@@ -35,7 +35,7 @@ export type NeighborSettings<P extends string> = {
35
35
  import?: P;
36
36
  /** Policy for routes announced. Nothing is announced when absent. */
37
37
  export?: P;
38
- /** What the neighbor is to us, such as `provider` for a transit. Both sides then reject a route leak, after RFC 9234. */
38
+ /** What the neighbor is to us, such as `provider` for a transit. Both sides then reject a route leak, as RFC 9234 describes. */
39
39
  role?: BgpRole;
40
40
  /** The neighbor is more than one hop away. */
41
41
  multihop?: boolean;
@@ -55,11 +55,11 @@ export type NeighborSettings<P extends string> = {
55
55
  bfd?: boolean;
56
56
  };
57
57
 
58
- /** One BGP session. Settings it does not state come from its group. */
58
+ /** One BGP session. Settings it does not set come from its group. */
59
59
  export type Neighbor<P extends string, G extends string> = NeighborSettings<P> & {
60
60
  /** The neighbor's address. */
61
61
  address: IP;
62
- /** Group whose settings this neighbor takes where it states none. */
62
+ /** The group this neighbor takes a setting from when it does not set that setting itself. */
63
63
  group?: NoInfer<G>;
64
64
  };
65
65
 
@@ -111,7 +111,7 @@ export type Ospf<I extends string> = {
111
111
  export type Routing<P extends string, G extends string, I extends string, F extends string> = {
112
112
  /** Identifies this router to its neighbors. */
113
113
  router_id?: IP;
114
- /** Routes the device carries without learning them. */
114
+ /** Routes the device has without learning them. */
115
115
  static?: readonly StaticRoute<I, F>[];
116
116
  /** BGP sessions and what they exchange. */
117
117
  bgp?: Bgp<P, G>;
@@ -13,7 +13,7 @@ export type System = {
13
13
  /** Answer queries from others. Off when absent. */
14
14
  serve?: boolean;
15
15
  };
16
- /** Time the device keeps. */
16
+ /** How the device keeps time. */
17
17
  ntp?: {
18
18
  /** Time sources, by address or name. */
19
19
  servers: readonly string[];
@@ -87,7 +87,7 @@ export type SnmpUser = {
87
87
 
88
88
  /** How the device is reached and managed. */
89
89
  export type Management<I extends string, C extends string> = {
90
- /** Sources allowed to every service that does not state its own. */
90
+ /** Sources allowed to every service that does not set its own. */
91
91
  allow?: readonly Prefix[];
92
92
  /** Secure shell. */
93
93
  ssh?: Service & {
@@ -141,11 +141,11 @@ export type DhcpServer<I extends string> = {
141
141
  interface: I;
142
142
  /** The network it serves. */
143
143
  network: Prefix;
144
- /** Default gateway handed out. */
144
+ /** Default gateway given to clients. */
145
145
  gateway: IP;
146
- /** Resolvers handed out. */
146
+ /** Resolvers given to clients. */
147
147
  dns?: readonly IP[];
148
- /** First and last address handed out. */
148
+ /** First and last address given to clients. */
149
149
  pool: readonly [IP, IP];
150
150
  /** Seconds a lease lasts. */
151
151
  lease_time?: number;
@@ -168,9 +168,9 @@ export type DhcpRelay<I extends string> = {
168
168
 
169
169
  /** A certificate the device presents or trusts. */
170
170
  export type Certificate = {
171
- /** The certificate, PEM. Public, so it lives in the repository. */
171
+ /** The certificate, PEM. Public, so it is kept in the repository. */
172
172
  certificate: string;
173
- /** Its private key: a PEM file through `secretFile`, or PEM base64-encoded as one line through `secret`. A certificate only trusted, such as a CA, has none. */
173
+ /** Its private key: a PEM file through `secretFile`, or PEM base64-encoded as one line through `secret`. A certificate the device only trusts, such as a CA, has none. */
174
174
  private_key?: Secret;
175
175
  };
176
176