UNPKG

@soft-stech/flux-cd

Version:
124 lines (123 loc) 4.65 kB
import { z } from "zod"; import { iObjectMetaSchema } from "@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema"; /** * Provider is the Schema for the providers API */ export const IProviderSchema = z.object({ /** * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion: z.literal("notification.toolkit.fluxcd.io/v1beta3"), /** * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind: z.literal("Provider"), metadata: iObjectMetaSchema.optional(), /** * ProviderSpec defines the desired state of the Provider. */ spec: z .object({ /** * Address specifies the endpoint, in a generic sense, to where alerts are sent. What kind of endpoint depends on the specific Provider type being used. For the generic Provider, for example, this is an HTTP/S address. For other Provider types this could be a project ID or a namespace. * @maxLength 2048 */ address: z.string().max(2048).optional(), /** * CertSecretRef specifies the Secret containing a PEM-encoded CA certificate (in the `ca.crt` key). * Note: Support for the `caFile` key has been deprecated. */ certSecretRef: z .object({ /** * Name of the referent. */ name: z.string() }) .optional(), /** * Channel specifies the destination channel where events should be posted. * @maxLength 2048 */ channel: z.string().max(2048).optional(), /** * Interval at which to reconcile the Provider with its Secret references. Deprecated and not used in v1beta3. * @pattern ^([0-9]+(\.[0-9]+)?(ms|s|m|h))+$ */ interval: z .string() .regex(/^([0-9]+(\.[0-9]+)?(ms|s|m|h))+$/) .optional(), /** * Proxy the HTTP/S address of the proxy server. * @maxLength 2048 * @pattern ^(http|https):\/\/.*$ */ proxy: z .string() .max(2048) .regex(/^(http|https):\/\/.*$/) .optional(), /** * SecretRef specifies the Secret containing the authentication credentials for this Provider. */ secretRef: z .object({ /** * Name of the referent. */ name: z.string() }) .optional(), /** * Suspend tells the controller to suspend subsequent events handling for this Provider. */ suspend: z.boolean().optional(), /** * Timeout for sending alerts to the Provider. * @pattern ^([0-9]+(\.[0-9]+)?(ms|s|m))+$ */ timeout: z .string() .regex(/^([0-9]+(\.[0-9]+)?(ms|s|m))+$/) .optional(), /** * Type specifies which Provider implementation to use. */ type: z.union([ z.literal("slack"), z.literal("discord"), z.literal("msteams"), z.literal("rocket"), z.literal("generic"), z.literal("generic-hmac"), z.literal("github"), z.literal("gitlab"), z.literal("gitea"), z.literal("bitbucketserver"), z.literal("bitbucket"), z.literal("azuredevops"), z.literal("googlechat"), z.literal("googlepubsub"), z.literal("webex"), z.literal("sentry"), z.literal("azureeventhub"), z.literal("telegram"), z.literal("lark"), z.literal("matrix"), z.literal("opsgenie"), z.literal("alertmanager"), z.literal("grafana"), z.literal("githubdispatch"), z.literal("pagerduty"), z.literal("datadog"), z.literal("nats") ]), /** * Username specifies the name under which events are posted. * @maxLength 2048 */ username: z.string().max(2048).optional() }) .optional() });