Skip to content

Commit

Permalink
add ipv6 literal for maximum routes (#1159)
Browse files Browse the repository at this point in the history
* add ipv6 literal for maximum routes

* remove redundant type

* handle bgp, ipconnection and maximum routes types

* refactor maximum routes from specific numbers to just number type to future proofing

* update version of maximum routes for SNA

* add undefined type to maximum routes

* remove null type from maximum routes
  • Loading branch information
MarcoMruz authored Mar 13, 2023
1 parent bbe9d5d commit 94b7f3c
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions packages/frinx-api/src/unistore/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function decodeSiteDevicesOutput(value: unknown): SiteDevicesOutput {
const MaximumRoutesValidator = t.type({
'address-family': t.array(
t.type({
af: t.literal('ipv4'),
af: t.union([t.literal('ipv4'), t.literal('ipv6')]),
'maximum-routes': optional(t.number),
}),
),
Expand Down Expand Up @@ -278,7 +278,7 @@ const RoutingProtocolItemValidator = t.type({
}),
),
'autonomous-system': t.number,
'address-family': t.array(t.string),
'address-family': t.array(t.union([t.literal('ipv4'), t.literal('ipv6')])),
}),
),
});
Expand Down Expand Up @@ -456,7 +456,7 @@ export type CreateRoutingProtocolItem = {
}[];
};
'autonomous-system': number;
'address-family': ['ipv4'];
'address-family': ('ipv4' | 'ipv6')[];
};
};

Expand Down Expand Up @@ -504,10 +504,10 @@ export type CreateNetworkAccessInput = {
availability: {
'access-priority': number;
};
'maximum-routes': {
'maximum-routes'?: {
'address-family': {
af: 'ipv4';
'maximum-routes'?: MaximumRoutes;
af: 'ipv4' | 'ipv6';
'maximum-routes'?: number;
}[];
};
'routing-protocols': CreateRoutingProtocolsInput;
Expand Down Expand Up @@ -569,9 +569,9 @@ export type CreateVpnSiteInput = {
}[];
};
'site-network-accesses'?: CreateNetworkAccessInput;
'maximum-routes': {
'maximum-routes'?: {
'address-family': {
af: 'ipv4';
af: 'ipv4' | 'ipv6';
'maximum-routes'?: number;
}[];
};
Expand Down Expand Up @@ -825,7 +825,10 @@ export enum DefaultCVlanEnum {
}

export type AddressFamily = 'ipv4' | 'ipv6';
export type MaximumRoutes = 1000 | 2000 | 5000 | 10000 | 1000000;
export type MaximumRoutes = {
ipv4?: number | null;
ipv6?: number | null;
};

export type VpnService = {
vpnId?: string;
Expand Down Expand Up @@ -887,7 +890,7 @@ export type StaticRoutingType = {
lanTag?: LanTag;
};
export type BgpRoutingType = {
addressFamily: 'ipv4';
addressFamily: AddressFamily[];
autonomousSystem: string;
bgpProfile: string | null;
};
Expand Down Expand Up @@ -929,6 +932,14 @@ export type IPConnection = {
providerAddress?: string;
};
};
ipv6?: {
addressAllocationType?: string;
addresses?: {
customerAddress?: string;
prefixLength?: number;
providerAddress?: string;
};
};
};

export type SiteNetworkAccess = {
Expand All @@ -955,7 +966,7 @@ export type VpnSite = {
siteServiceQosProfile: string | null;
enableBgpPicFastReroute: boolean;
siteNetworkAccesses: SiteNetworkAccess[];
maximumRoutes: MaximumRoutes;
maximumRoutes: 1000 | 2000 | 5000 | 10000 | 1000000;
};

export type Status = {
Expand Down

0 comments on commit 94b7f3c

Please sign in to comment.