UNPKG

@linode/validation

Version:

Yup validation schemas for use with the Linode APIv4

156 lines 5.89 kB
export declare const IP_ERROR_MESSAGE = "Must be a valid IPv4 or IPv6 address or range."; export declare const validateIP: (ipAddress?: null | string) => boolean; export declare const CreateFirewallDeviceSchema: import("yup").ObjectSchema<{ linodes: (number | undefined)[] | undefined; nodebalancers: (number | undefined)[] | undefined; }, import("yup").AnyObject, { linodes: ""; nodebalancers: ""; }, "">; export declare const ipAddress: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">; export declare let CUSTOM_PORTS_ERROR_MESSAGE: string; /** * @param ports * @returns boolean * @description Validates a comma-separated list of ports and port ranges and sets the error message */ export declare const isCustomPortsValid: (ports: string) => boolean; export declare const FirewallRuleTypeSchema: import("yup").ObjectSchema<{ action: "ACCEPT" | "DROP" | null | undefined; description: string | null | undefined; label: string | null | undefined; protocol: "ALL" | "TCP" | "UDP" | "ICMP" | "IPENCAP" | null | undefined; ports: string | null | undefined; addresses: { ipv4?: string[] | null | undefined; ipv6?: string[] | null | undefined; } | null | undefined; ruleset: number | null | undefined; }, import("yup").AnyObject, { action: undefined; description: undefined; label: undefined; protocol: undefined; ports: undefined; addresses: { ipv4: ""; ipv6: ""; }; ruleset: undefined; }, "">; export declare const FirewallRuleSchema: import("yup").ObjectSchema<{ inbound: { label?: string | null | undefined; addresses?: { ipv4?: string[] | null | undefined; ipv6?: string[] | null | undefined; } | null | undefined; description?: string | null | undefined; action?: "ACCEPT" | "DROP" | null | undefined; protocol?: "ALL" | "TCP" | "UDP" | "ICMP" | "IPENCAP" | null | undefined; ports?: string | null | undefined; ruleset?: number | null | undefined; }[] | null | undefined; outbound: { label?: string | null | undefined; addresses?: { ipv4?: string[] | null | undefined; ipv6?: string[] | null | undefined; } | null | undefined; description?: string | null | undefined; action?: "ACCEPT" | "DROP" | null | undefined; protocol?: "ALL" | "TCP" | "UDP" | "ICMP" | "IPENCAP" | null | undefined; ports?: string | null | undefined; ruleset?: number | null | undefined; }[] | null | undefined; inbound_policy: NonNullable<"ACCEPT" | "DROP" | undefined>; outbound_policy: NonNullable<"ACCEPT" | "DROP" | undefined>; }, import("yup").AnyObject, { inbound: undefined; outbound: undefined; inbound_policy: undefined; outbound_policy: undefined; }, "">; export declare const CreateFirewallSchema: import("yup").ObjectSchema<{ label: string; tags: string[] | undefined; rules: { inbound?: { label?: string | null | undefined; addresses?: { ipv4?: string[] | null | undefined; ipv6?: string[] | null | undefined; } | null | undefined; description?: string | null | undefined; action?: "ACCEPT" | "DROP" | null | undefined; protocol?: "ALL" | "TCP" | "UDP" | "ICMP" | "IPENCAP" | null | undefined; ports?: string | null | undefined; ruleset?: number | null | undefined; }[] | null | undefined; outbound?: { label?: string | null | undefined; addresses?: { ipv4?: string[] | null | undefined; ipv6?: string[] | null | undefined; } | null | undefined; description?: string | null | undefined; action?: "ACCEPT" | "DROP" | null | undefined; protocol?: "ALL" | "TCP" | "UDP" | "ICMP" | "IPENCAP" | null | undefined; ports?: string | null | undefined; ruleset?: number | null | undefined; }[] | null | undefined; inbound_policy: NonNullable<"ACCEPT" | "DROP" | undefined>; outbound_policy: NonNullable<"ACCEPT" | "DROP" | undefined>; }; devices: { linodes?: number[] | undefined; nodebalancers?: number[] | undefined; linode_interfaces?: number[] | undefined; } | null | undefined; }, import("yup").AnyObject, { label: undefined; tags: ""; rules: { inbound: undefined; outbound: undefined; inbound_policy: undefined; outbound_policy: undefined; }; devices: { linodes: ""; nodebalancers: ""; linode_interfaces: ""; }; }, "">; export declare const UpdateFirewallSchema: import("yup").ObjectSchema<{ label: string | undefined; tags: (string | undefined)[] | undefined; status: string | undefined; }, import("yup").AnyObject, { label: undefined; tags: ""; status: undefined; }, "">; export declare const FirewallDeviceSchema: import("yup").ObjectSchema<{ type: NonNullable<"linode" | "nodebalancer" | "linode_interface" | undefined>; id: number; }, import("yup").AnyObject, { type: undefined; id: undefined; }, "">; export declare const UpdateFirewallSettingsSchema: import("yup").ObjectSchema<{ default_firewall_ids: { linode?: number | null | undefined; nodebalancer?: number | null | undefined; interface_public?: number | null | undefined; interface_vpc?: number | null | undefined; }; }, import("yup").AnyObject, { default_firewall_ids: { interface_public: undefined; interface_vpc: undefined; linode: undefined; nodebalancer: undefined; }; }, "">; //# sourceMappingURL=firewalls.schema.d.ts.map