UNPKG

@linode/validation

Version:

Yup validation schemas for use with the Linode APIv4

65 lines 2.24 kB
export declare const determineIPType: (ip: string) => "ipv4" | "ipv6" | undefined; /** * VPC-related IP validation that handles for single IPv4 and IPv6 addresses as well as * IPv4 ranges in CIDR format and IPv6 ranges with prefix lengths. * @param { value } - the IP address string to be validated * @param { shouldHaveIPMask } - a boolean indicating whether the value should have a mask (e.g., /32) or not * @param { mustBeIPMask } - a boolean indicating whether the value MUST be an IP mask/prefix length or not * @param { isIPv6Subnet } - a boolean indicating whether the IPv6 value is for a subnet */ export declare const vpcsValidateIP: ({ value, shouldHaveIPMask, mustBeIPMask, isIPv6Subnet, }: { value: string | undefined | null; shouldHaveIPMask: boolean; mustBeIPMask: boolean; isIPv6Subnet?: boolean; }) => boolean; export declare const updateVPCSchema: import("yup").ObjectSchema<{ label: string | undefined; description: string | undefined; }, import("yup").AnyObject, { label: undefined; description: undefined; }, "">; export declare const createSubnetSchemaIPv4: import("yup").ObjectSchema<{ label: string; ipv4: string | undefined; }, import("yup").AnyObject, { label: undefined; ipv4: undefined; }, "">; export declare const createSubnetSchemaWithIPv6: import("yup").ObjectSchema<{ label: string; ipv4: string | undefined; ipv6: { range: string; }[] | undefined; }, import("yup").AnyObject, { label: undefined; ipv4: undefined; ipv6: ""; }, "">; export declare const createVPCSchema: import("yup").ObjectSchema<{ label: string; description: string | undefined; region: string; subnets: { ipv4?: string | undefined; label: string; }[] | undefined; ipv6: { range?: string | undefined; allocation_class?: string | undefined; }[] | undefined; }, import("yup").AnyObject, { label: undefined; description: undefined; region: undefined; subnets: ""; ipv6: ""; }, "">; export declare const modifySubnetSchema: import("yup").ObjectSchema<{ label: string; }, import("yup").AnyObject, { label: undefined; }, "">; //# sourceMappingURL=vpcs.schema.d.ts.map