import {z} from 'zod' export type ObjectIDFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Includes', value: Array}; export type DateFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'GreaterThan', value: string} | {_type: 'LessThan', value: string} | {_type: 'GreaterThanOrEqual', value: string} | {_type: 'LessThanOrEqual', value: string} | {_type: 'InBetween', startValue: string, endValue: string}; export type LongTextFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Search', value: string} | {_type: 'Includes', value: Array}; export type MarkdownFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Search', value: string} | {_type: 'Includes', value: Array}; export type SlugFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Includes', value: Array}; export type EntityArrayFilter = Array | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'Includes', value: Array}; export type VeryLongTextFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Search', value: string} | {_type: 'Includes', value: Array}; export type BooleanFilter = boolean | {_type: 'EqualTo', value: boolean} | {_type: 'NotEqual', value: boolean} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: boolean}; export type JSONFilter = {_type: 'IsNull'} | {_type: 'NotNull'} | {[key: string]: string | number | boolean | {_type: 'EqualTo', value: string | number | boolean} | {_type: 'NotEqual', value: string | number | boolean} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string | number | boolean} | {_type: 'Search', value: string} | {_type: 'Includes', value: Array} | {_type: 'GreaterThan', value: string | number | boolean} | {_type: 'LessThan', value: string | number | boolean} | {_type: 'GreaterThanOrEqual', value: string | number | boolean} | {_type: 'LessThanOrEqual', value: string | number | boolean} | {_type: 'InBetween', startValue: string | number | boolean, endValue: string | number | boolean}}; export type NumberFilter = number | {_type: 'EqualTo', value: number} | {_type: 'NotEqual', value: number} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: number} | {_type: 'GreaterThan', value: number} | {_type: 'LessThan', value: number} | {_type: 'GreaterThanOrEqual', value: number} | {_type: 'LessThanOrEqual', value: number} | {_type: 'InBetween', startValue: number, endValue: number}; export type ShortTextFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Search', value: string} | {_type: 'Includes', value: Array}; export type IncidentQuerySchema = {_id?: ObjectIDFilter | undefined, createdAt?: DateFilter | undefined, updatedAt?: DateFilter | undefined, deletedAt?: DateFilter | undefined, projectId?: ObjectIDFilter | undefined, title?: LongTextFilter | undefined, description?: MarkdownFilter | undefined, declaredAt?: DateFilter | undefined, impactStartedAt?: DateFilter | undefined, firstPagedAt?: DateFilter | undefined, slug?: SlugFilter | undefined, createdByUserId?: ObjectIDFilter | undefined, monitors?: EntityArrayFilter | undefined, hosts?: EntityArrayFilter | undefined, networkDevices?: EntityArrayFilter | undefined, kubernetesClusters?: EntityArrayFilter | undefined, kubernetesResources?: EntityArrayFilter | undefined, kubernetesContainers?: EntityArrayFilter | undefined, dockerHosts?: EntityArrayFilter | undefined, podmanHosts?: EntityArrayFilter | undefined, proxmoxClusters?: EntityArrayFilter | undefined, openStackClouds?: EntityArrayFilter | undefined, vmwareVCenters?: EntityArrayFilter | undefined, iotFleets?: EntityArrayFilter | undefined, dockerSwarmClusters?: EntityArrayFilter | undefined, cephClusters?: EntityArrayFilter | undefined, storageArrays?: EntityArrayFilter | undefined, cloudResources?: EntityArrayFilter | undefined, databaseServers?: EntityArrayFilter | undefined, dockerResources?: EntityArrayFilter | undefined, podmanResources?: EntityArrayFilter | undefined, services?: EntityArrayFilter | undefined, serviceLevelObjectives?: EntityArrayFilter | undefined, onCallDutyPolicies?: EntityArrayFilter | undefined, labels?: EntityArrayFilter | undefined, currentIncidentStateId?: ObjectIDFilter | undefined, incidentSeverityId?: ObjectIDFilter | undefined, changeMonitorStatusToId?: ObjectIDFilter | undefined, subscriberNotificationStatusMessage?: VeryLongTextFilter | undefined, subscriberNotificationStatusMessageOnPostmortemPublished?: VeryLongTextFilter | undefined, shouldStatusPageSubscribersBeNotifiedOnIncidentCreated?: BooleanFilter | undefined, customFields?: JSONFilter | undefined, rootCause?: MarkdownFilter | undefined, postmortemNote?: MarkdownFilter | undefined, showPostmortemOnStatusPage?: BooleanFilter | undefined, notifySubscribersOnPostmortemPublished?: BooleanFilter | undefined, postmortemPostedAt?: DateFilter | undefined, postmortemAttachments?: EntityArrayFilter | undefined, postmortemStatusId?: ObjectIDFilter | undefined, createdStateLog?: JSONFilter | undefined, createdCriteriaId?: LongTextFilter | undefined, createdIncidentTemplateId?: LongTextFilter | undefined, seriesFingerprint?: LongTextFilter | undefined, seriesLabels?: JSONFilter | undefined, monitorSummary?: JSONFilter | undefined, createdByProbeId?: ObjectIDFilter | undefined, isCreatedAutomatically?: BooleanFilter | undefined, holdsMonitors?: BooleanFilter | undefined, postmortemDraftWaitingSince?: DateFilter | undefined, remediationNotes?: MarkdownFilter | undefined, telemetryQuery?: JSONFilter | undefined, incidentNumber?: NumberFilter | undefined, incidentNumberWithPrefix?: ShortTextFilter | undefined, isVisibleOnStatusPage?: BooleanFilter | undefined, statusPages?: EntityArrayFilter | undefined, isPrivate?: BooleanFilter | undefined, enableReminders?: BooleanFilter | undefined, nextReminderNotificationAt?: DateFilter | undefined, reminderNotificationSentCount?: NumberFilter | undefined, incidentEpisodeId?: ObjectIDFilter | undefined}; export type MonitorRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, monitorTemplateId?: boolean | undefined, autoProvisionedNetworkDeviceId?: boolean | undefined, networkAlertPolicyId?: boolean | undefined, monitorType?: boolean | undefined, currentMonitorStatusId?: boolean | undefined, monitorSteps?: boolean | undefined}; export type HostRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, hostIdentifier?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, osType?: boolean | undefined, osVersion?: boolean | undefined, hostId?: boolean | undefined, hostArch?: boolean | undefined, hostType?: boolean | undefined, hostIpAddresses?: boolean | undefined, cpuCores?: boolean | undefined, totalMemoryBytes?: boolean | undefined, processCount?: boolean | undefined, containerRuntime?: boolean | undefined, deploymentEnvironment?: boolean | undefined, runtimeName?: boolean | undefined, runtimeVersion?: boolean | undefined, cloudProvider?: boolean | undefined, cloudPlatform?: boolean | undefined, cloudRegion?: boolean | undefined, cloudAccountId?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryPercent?: boolean | undefined, latestSwapPercent?: boolean | undefined, latestDiskPercent?: boolean | undefined, latestDiskMountpoint?: boolean | undefined, latestInodesPercent?: boolean | undefined, latestInodesMountpoint?: boolean | undefined, latestLoadAverage15m?: boolean | undefined, bootedAt?: boolean | undefined, failedSystemdUnitCount?: boolean | undefined, failedSystemdUnits?: boolean | undefined, readingsUpdatedAt?: boolean | undefined}; export type NetworkDeviceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, hostname?: boolean | undefined, dnsName?: boolean | undefined, otherAddresses?: boolean | undefined, discoveredName?: boolean | undefined, discoveredNameSource?: boolean | undefined, macAddress?: boolean | undefined, isMacAddressLearned?: boolean | undefined, probeId?: boolean | undefined, siteId?: boolean | undefined, oidTemplateId?: boolean | undefined, snmpCredentialProfileId?: boolean | undefined, currentMonitorStatusId?: boolean | undefined, monitoringMethod?: boolean | undefined, deviceRole?: boolean | undefined, networkDeviceRoleId?: boolean | undefined, monitorId?: boolean | undefined, snmpVersion?: boolean | undefined, sysDescr?: boolean | undefined, sysName?: boolean | undefined, sysObjectId?: boolean | undefined, sysLocation?: boolean | undefined, vendor?: boolean | undefined, deviceModel?: boolean | undefined, lastRebootedAt?: boolean | undefined, lastSeenAt?: boolean | undefined, lastPolledAt?: boolean | undefined, isReachable?: boolean | undefined, isSnmpReachable?: boolean | undefined, lastSnmpSeenAt?: boolean | undefined}; export type KubernetesClusterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, clusterIdentifier?: boolean | undefined, provider?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, aiAccessRunnerId?: boolean | undefined}; export type KubernetesResourceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, kubernetesClusterId?: boolean | undefined, kind?: boolean | undefined, namespaceKey?: boolean | undefined, name?: boolean | undefined, uid?: boolean | undefined, phase?: boolean | undefined, isReady?: boolean | undefined, hasMemoryPressure?: boolean | undefined, hasDiskPressure?: boolean | undefined, hasPidPressure?: boolean | undefined, containerCount?: boolean | undefined, healthSeverity?: boolean | undefined, controllerDeploymentName?: boolean | undefined, controllerCronJobName?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryBytes?: boolean | undefined, latestMemoryPercent?: boolean | undefined, metricsUpdatedAt?: boolean | undefined, lastSeenAt?: boolean | undefined, resourceCreationTimestamp?: boolean | undefined}; export type KubernetesContainerRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, kubernetesClusterId?: boolean | undefined, podNamespaceKey?: boolean | undefined, podName?: boolean | undefined, name?: boolean | undefined, image?: boolean | undefined, state?: boolean | undefined, reason?: boolean | undefined, isReady?: boolean | undefined, restartCount?: boolean | undefined, memoryLimitBytes?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryBytes?: boolean | undefined, metricsUpdatedAt?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type DockerHostRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, hostIdentifier?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, osType?: boolean | undefined, osVersion?: boolean | undefined}; export type PodmanHostRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, hostIdentifier?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, osType?: boolean | undefined, osVersion?: boolean | undefined}; export type ProxmoxClusterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, pveVersion?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type OpenStackCloudRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, collectionMethod?: boolean | undefined}; export type VMwareVCenterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, collectionMethod?: boolean | undefined}; export type IoTFleetRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type DockerSwarmClusterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, dockerVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, swarmId?: boolean | undefined}; export type CephClusterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, fsid?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, cephVersion?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type StorageArrayRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, storageSystem?: boolean | undefined, reportedName?: boolean | undefined, systemId?: boolean | undefined, osName?: boolean | undefined, osVersion?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, capacityBytes?: boolean | undefined, usedBytes?: boolean | undefined}; export type CloudResourceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, resourceIdentifier?: boolean | undefined, cloudPlatform?: boolean | undefined, cloudProvider?: boolean | undefined, cloudRegion?: boolean | undefined, cloudAccountId?: boolean | undefined, cloudResourceKind?: boolean | undefined, cloudResourceType?: boolean | undefined, cloudResourceGroup?: boolean | undefined, healthSeverity?: boolean | undefined, cloudConnectionId?: boolean | undefined, runtimeName?: boolean | undefined, runtimeVersion?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type DatabaseServerRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, databaseIdentifier?: boolean | undefined, dbSystem?: boolean | undefined, serverAddress?: boolean | undefined, serverPort?: boolean | undefined, discoverySource?: boolean | undefined, otelCollectorStatus?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type DockerResourceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, dockerHostId?: boolean | undefined, kind?: boolean | undefined, name?: boolean | undefined, containerId?: boolean | undefined, imageName?: boolean | undefined, state?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryBytes?: boolean | undefined, metricsUpdatedAt?: boolean | undefined, lastSeenAt?: boolean | undefined, resourceCreationTimestamp?: boolean | undefined}; export type PodmanResourceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, podmanHostId?: boolean | undefined, kind?: boolean | undefined, name?: boolean | undefined, containerId?: boolean | undefined, imageName?: boolean | undefined, state?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryBytes?: boolean | undefined, metricsUpdatedAt?: boolean | undefined, lastSeenAt?: boolean | undefined, resourceCreationTimestamp?: boolean | undefined}; export type ServiceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, serviceColor?: boolean | undefined, serviceLanguage?: boolean | undefined, techStack?: boolean | undefined, lastSeenAt?: boolean | undefined, serviceVersion?: boolean | undefined, deploymentEnvironment?: boolean | undefined, serviceNamespace?: boolean | undefined, runtimeName?: boolean | undefined, runtimeVersion?: boolean | undefined, telemetrySdkLanguage?: boolean | undefined, cloudProvider?: boolean | undefined, cloudPlatform?: boolean | undefined, cloudRegion?: boolean | undefined, cloudAccountId?: boolean | undefined}; export type ServiceLevelObjectiveRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, sliType?: boolean | undefined, targetPercentage?: boolean | undefined}; export type OnCallDutyPolicyRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, repeatPolicyIfNoOneAcknowledgesNoOfTimes?: boolean | undefined}; export type LabelRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, name?: boolean | undefined, projectId?: boolean | undefined, color?: boolean | undefined, isArchived?: boolean | undefined}; export type FileRelationSelectSchema = {_id?: boolean | undefined, file?: boolean | undefined, name?: boolean | undefined, fileType?: boolean | undefined, slug?: boolean | undefined, isPublic?: boolean | undefined, imageAccessToken?: boolean | undefined}; export type StatusPageRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, smtpConfigId?: boolean | undefined, callSmsConfigId?: boolean | undefined, defaultBarColor?: boolean | undefined, subscriberEmailNotificationFooterText?: boolean | undefined}; export type IncidentSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, title?: boolean | undefined, description?: boolean | undefined, declaredAt?: boolean | undefined, impactStartedAt?: boolean | undefined, firstPagedAt?: boolean | undefined, slug?: boolean | undefined, createdByUserId?: boolean | undefined, monitors?: MonitorRelationSelectSchema | undefined, hosts?: HostRelationSelectSchema | undefined, networkDevices?: NetworkDeviceRelationSelectSchema | undefined, kubernetesClusters?: KubernetesClusterRelationSelectSchema | undefined, kubernetesResources?: KubernetesResourceRelationSelectSchema | undefined, kubernetesContainers?: KubernetesContainerRelationSelectSchema | undefined, dockerHosts?: DockerHostRelationSelectSchema | undefined, podmanHosts?: PodmanHostRelationSelectSchema | undefined, proxmoxClusters?: ProxmoxClusterRelationSelectSchema | undefined, openStackClouds?: OpenStackCloudRelationSelectSchema | undefined, vmwareVCenters?: VMwareVCenterRelationSelectSchema | undefined, iotFleets?: IoTFleetRelationSelectSchema | undefined, dockerSwarmClusters?: DockerSwarmClusterRelationSelectSchema | undefined, cephClusters?: CephClusterRelationSelectSchema | undefined, storageArrays?: StorageArrayRelationSelectSchema | undefined, cloudResources?: CloudResourceRelationSelectSchema | undefined, databaseServers?: DatabaseServerRelationSelectSchema | undefined, dockerResources?: DockerResourceRelationSelectSchema | undefined, podmanResources?: PodmanResourceRelationSelectSchema | undefined, services?: ServiceRelationSelectSchema | undefined, serviceLevelObjectives?: ServiceLevelObjectiveRelationSelectSchema | undefined, onCallDutyPolicies?: OnCallDutyPolicyRelationSelectSchema | undefined, labels?: LabelRelationSelectSchema | undefined, currentIncidentStateId?: boolean | undefined, incidentSeverityId?: boolean | undefined, changeMonitorStatusToId?: boolean | undefined, subscriberNotificationStatusMessage?: boolean | undefined, subscriberNotificationStatusMessageOnPostmortemPublished?: boolean | undefined, shouldStatusPageSubscribersBeNotifiedOnIncidentCreated?: boolean | undefined, customFields?: boolean | undefined, rootCause?: boolean | undefined, postmortemNote?: boolean | undefined, showPostmortemOnStatusPage?: boolean | undefined, notifySubscribersOnPostmortemPublished?: boolean | undefined, postmortemPostedAt?: boolean | undefined, postmortemAttachments?: FileRelationSelectSchema | undefined, postmortemStatusId?: boolean | undefined, createdStateLog?: boolean | undefined, createdCriteriaId?: boolean | undefined, createdIncidentTemplateId?: boolean | undefined, seriesFingerprint?: boolean | undefined, seriesLabels?: boolean | undefined, monitorSummary?: boolean | undefined, createdByProbeId?: boolean | undefined, isCreatedAutomatically?: boolean | undefined, holdsMonitors?: boolean | undefined, postmortemDraftWaitingSince?: boolean | undefined, remediationNotes?: boolean | undefined, telemetryQuery?: boolean | undefined, incidentNumber?: boolean | undefined, incidentNumberWithPrefix?: boolean | undefined, isVisibleOnStatusPage?: boolean | undefined, statusPages?: StatusPageRelationSelectSchema | undefined, isPrivate?: boolean | undefined, enableReminders?: boolean | undefined, nextReminderNotificationAt?: boolean | undefined, reminderNotificationSentCount?: boolean | undefined, incidentEpisodeId?: boolean | undefined}; export type SortOrder = 'ASC' | 'DESC'; export type IncidentSortSchema = {_id?: SortOrder | undefined, createdAt?: SortOrder | undefined, updatedAt?: SortOrder | undefined, deletedAt?: SortOrder | undefined, projectId?: SortOrder | undefined, title?: SortOrder | undefined, declaredAt?: SortOrder | undefined, impactStartedAt?: SortOrder | undefined, firstPagedAt?: SortOrder | undefined, slug?: SortOrder | undefined, createdByUserId?: SortOrder | undefined, currentIncidentStateId?: SortOrder | undefined, incidentSeverityId?: SortOrder | undefined, changeMonitorStatusToId?: SortOrder | undefined, subscriberNotificationStatusMessage?: SortOrder | undefined, subscriberNotificationStatusMessageOnPostmortemPublished?: SortOrder | undefined, shouldStatusPageSubscribersBeNotifiedOnIncidentCreated?: SortOrder | undefined, showPostmortemOnStatusPage?: SortOrder | undefined, notifySubscribersOnPostmortemPublished?: SortOrder | undefined, postmortemPostedAt?: SortOrder | undefined, postmortemStatusId?: SortOrder | undefined, createdCriteriaId?: SortOrder | undefined, createdIncidentTemplateId?: SortOrder | undefined, seriesFingerprint?: SortOrder | undefined, createdByProbeId?: SortOrder | undefined, isCreatedAutomatically?: SortOrder | undefined, holdsMonitors?: SortOrder | undefined, postmortemDraftWaitingSince?: SortOrder | undefined, incidentNumber?: SortOrder | undefined, incidentNumberWithPrefix?: SortOrder | undefined, isVisibleOnStatusPage?: SortOrder | undefined, isPrivate?: SortOrder | undefined, enableReminders?: SortOrder | undefined, nextReminderNotificationAt?: SortOrder | undefined, reminderNotificationSentCount?: SortOrder | undefined, incidentEpisodeId?: SortOrder | undefined}; export type CreateApiIncidentGetListArgs = {body: {query?: IncidentQuerySchema | undefined, select?: IncidentSelectSchema | undefined, sort?: IncidentSortSchema | undefined, limit?: number | undefined, skip?: number | undefined}}; export type CreateApiIncidentGetListOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; export const incident = z.object({_id: z.string().optional(), createdAt: z.object({}).optional(), updatedAt: z.object({}).optional(), deletedAt: z.object({}).optional(), version: z.number().optional(), projectId: z.string(), title: z.string(), description: z.string().optional(), declaredAt: z.object({}), impactStartedAt: z.object({}).optional(), firstPagedAt: z.object({}).optional(), slug: z.string(), createdByUserId: z.string().optional(), monitors: z.array(z.object({_id: z.string().optional()})).optional(), hosts: z.array(z.object({_id: z.string().optional()})).optional(), networkDevices: z.array(z.object({_id: z.string().optional()})).optional(), kubernetesClusters: z.array(z.object({_id: z.string().optional()})).optional(), kubernetesResources: z.array(z.object({_id: z.string().optional()})).optional(), kubernetesContainers: z.array(z.object({_id: z.string().optional()})).optional(), dockerHosts: z.array(z.object({_id: z.string().optional()})).optional(), podmanHosts: z.array(z.object({_id: z.string().optional()})).optional(), proxmoxClusters: z.array(z.object({_id: z.string().optional()})).optional(), openStackClouds: z.array(z.object({_id: z.string().optional()})).optional(), vmwareVCenters: z.array(z.object({_id: z.string().optional()})).optional(), iotFleets: z.array(z.object({_id: z.string().optional()})).optional(), dockerSwarmClusters: z.array(z.object({_id: z.string().optional()})).optional(), cephClusters: z.array(z.object({_id: z.string().optional()})).optional(), storageArrays: z.array(z.object({_id: z.string().optional()})).optional(), cloudResources: z.array(z.object({_id: z.string().optional()})).optional(), databaseServers: z.array(z.object({_id: z.string().optional()})).optional(), dockerResources: z.array(z.object({_id: z.string().optional()})).optional(), podmanResources: z.array(z.object({_id: z.string().optional()})).optional(), services: z.array(z.object({_id: z.string().optional()})).optional(), serviceLevelObjectives: z.array(z.object({_id: z.string().optional()})).optional(), onCallDutyPolicies: z.array(z.object({_id: z.string().optional()})).optional(), labels: z.array(z.object({_id: z.string().optional()})).optional(), currentIncidentStateId: z.string(), incidentSeverityId: z.string(), changeMonitorStatusToId: z.string().optional(), subscriberNotificationStatusOnIncidentCreated: z.enum(["Skipped", "Pending", "InProgress", "Success", "Failed"]).optional(), subscriberNotificationStatusMessage: z.string().optional(), subscriberNotificationStatusOnPostmortemPublished: z.enum(["Skipped", "Pending", "InProgress", "Success", "Failed"]).optional(), subscriberNotificationStatusMessageOnPostmortemPublished: z.string().optional(), shouldStatusPageSubscribersBeNotifiedOnIncidentCreated: z.boolean().optional(), customFields: z.object({}).optional(), isOwnerNotifiedOfResourceCreation: z.boolean(), rootCause: z.string().optional(), postmortemNote: z.string().optional(), showPostmortemOnStatusPage: z.boolean().optional(), notifySubscribersOnPostmortemPublished: z.boolean().optional(), postmortemPostedAt: z.object({}).optional(), postmortemAttachments: z.array(z.object({_id: z.string().optional()})).optional(), postmortemStatusId: z.string().optional(), createdStateLog: z.object({}).optional(), createdCriteriaId: z.string().optional(), createdIncidentTemplateId: z.string().optional(), seriesFingerprint: z.string().optional(), seriesLabels: z.object({}).optional(), monitorSummary: z.object({}).optional(), createdByProbeId: z.string().optional(), isCreatedAutomatically: z.boolean().optional(), holdsMonitors: z.boolean().optional(), postmortemDraftWaitingSince: z.object({}).optional(), remediationNotes: z.string().optional(), telemetryQuery: z.object({}).optional(), incidentNumber: z.number().optional(), incidentNumberWithPrefix: z.string().optional(), isVisibleOnStatusPage: z.boolean().optional(), statusPages: z.array(z.object({_id: z.string().optional()})).optional(), isScopedToStatusPages: z.boolean(), statusPagesNotifiedOnCreation: z.object({}).optional(), isPrivate: z.boolean().optional(), enableReminders: z.boolean().optional(), nextReminderNotificationAt: z.object({}).optional(), reminderNotificationSentCount: z.number().optional(), incidentEpisodeId: z.string().optional()}); export const createApiIncidentGetListResponse = z.object({data: z.array(incident).optional(), count: z.number().optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * List Incident * * POST /incident/get-list */ export const createApiIncidentGetList = async (args: CreateApiIncidentGetListArgs, options?: CreateApiIncidentGetListOptions) => { const {baseUrl = "https://oneuptime.com/api", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (ApiKey !== undefined) headers.set("APIKey", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/incident/get-list${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(createApiIncidentGetListResponse, await res.json()) };