diff --git a/apps/event-worker/src/target-scan/google.ts b/apps/event-worker/src/target-scan/google.ts index b81fbe62e..7f6b4f973 100644 --- a/apps/event-worker/src/target-scan/google.ts +++ b/apps/event-worker/src/target-scan/google.ts @@ -1,4 +1,4 @@ -import type { KubernetesClusterAPIV1 } from "@ctrlplane/validators/targets"; +import type { KubernetesClusterAPIV1 } from "@ctrlplane/validators/resources"; import type { ClusterManagerClient } from "@google-cloud/container"; import type { google } from "@google-cloud/container/build/protos/protos.js"; import type { AuthClient } from "google-auth-library"; diff --git a/apps/webservice/src/app/[workspaceSlug]/(targets)/target-providers/page.tsx b/apps/webservice/src/app/[workspaceSlug]/(targets)/target-providers/page.tsx index ae56e8b42..5c4fb3e11 100644 --- a/apps/webservice/src/app/[workspaceSlug]/(targets)/target-providers/page.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/(targets)/target-providers/page.tsx @@ -1,4 +1,4 @@ -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; @@ -21,7 +21,7 @@ import { TooltipProvider, TooltipTrigger, } from "@ctrlplane/ui/tooltip"; -import { ResourceFilterType } from "@ctrlplane/validators/targets"; +import { ResourceFilterType } from "@ctrlplane/validators/resources"; import { api } from "~/trpc/server"; import { ProviderActionsDropdown } from "./ProviderActionsDropdown"; diff --git a/apps/webservice/src/app/[workspaceSlug]/(targets)/targets/TargetPageContent.tsx b/apps/webservice/src/app/[workspaceSlug]/(targets)/targets/TargetPageContent.tsx index dbfe92437..e33e87e99 100644 --- a/apps/webservice/src/app/[workspaceSlug]/(targets)/targets/TargetPageContent.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/(targets)/targets/TargetPageContent.tsx @@ -1,7 +1,7 @@ "use client"; import type * as schema from "@ctrlplane/db/schema"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import React from "react"; import { IconDots, IconFilter, IconLoader2 } from "@tabler/icons-react"; import range from "lodash/range"; @@ -12,7 +12,7 @@ import { Skeleton } from "@ctrlplane/ui/skeleton"; import { defaultCondition, isEmptyCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { NoFilterMatch } from "~/app/[workspaceSlug]/_components/filter/NoFilterMatch"; import { TargetConditionBadge } from "~/app/[workspaceSlug]/_components/target-condition/TargetConditionBadge"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/Filter.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/Filter.tsx index a442b11dd..de2b4e21f 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/Filter.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/environment-drawer/Filter.tsx @@ -1,5 +1,5 @@ import type * as SCHEMA from "@ctrlplane/db/schema"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import { useState } from "react"; import Link from "next/link"; import { useParams } from "next/navigation"; @@ -38,7 +38,7 @@ import { defaultCondition, isComparisonCondition, resourceCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { api } from "~/trpc/react"; import { TargetConditionRender } from "../target-condition/TargetConditionRender"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/job-condition/JobTargetConditionRender.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/job-condition/JobTargetConditionRender.tsx index a99ab5dbd..aa9da5307 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/job-condition/JobTargetConditionRender.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/job-condition/JobTargetConditionRender.tsx @@ -1,5 +1,5 @@ import type { JobTargetCondition } from "@ctrlplane/validators/jobs"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import { useState } from "react"; import { useParams } from "next/navigation"; import { IconLoader2, IconSelector } from "@tabler/icons-react"; @@ -23,7 +23,7 @@ import { import { ResourceFilterType, ResourceOperator, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import type { JobConditionRenderProps } from "./job-condition-props"; import { api } from "~/trpc/react"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/ComparisonConditionRender.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/ComparisonConditionRender.tsx index 553fb107f..8290bccc8 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/ComparisonConditionRender.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/ComparisonConditionRender.tsx @@ -1,7 +1,7 @@ import type { ComparisonCondition, ResourceCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { IconChevronDown, IconCopy, @@ -36,7 +36,7 @@ import { isComparisonCondition, ResourceFilterType, ResourceOperator, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import type { TargetConditionRenderProps } from "./target-condition-props"; import { TargetConditionRender } from "./TargetConditionRender"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/IdentifierConditionRender.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/IdentifierConditionRender.tsx index ad2f31bb8..affa068ab 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/IdentifierConditionRender.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/IdentifierConditionRender.tsx @@ -1,5 +1,5 @@ import type { ColumnOperatorType } from "@ctrlplane/validators/conditions"; -import type { IdentifierCondition } from "@ctrlplane/validators/targets"; +import type { IdentifierCondition } from "@ctrlplane/validators/resources"; import type { TargetConditionRenderProps } from "./target-condition-props"; import { ColumnConditionRender } from "../filter/ColumnConditionRender"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/KindConditionRender.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/KindConditionRender.tsx index 2c6faed1e..806892711 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/KindConditionRender.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/KindConditionRender.tsx @@ -1,4 +1,4 @@ -import type { KindCondition } from "@ctrlplane/validators/targets"; +import type { KindCondition } from "@ctrlplane/validators/resources"; import { useParams } from "next/navigation"; import type { TargetConditionRenderProps } from "./target-condition-props"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/NameConditionRender.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/NameConditionRender.tsx index 1825abcd5..8da79becf 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/NameConditionRender.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/NameConditionRender.tsx @@ -1,4 +1,4 @@ -import type { NameCondition } from "@ctrlplane/validators/targets"; +import type { NameCondition } from "@ctrlplane/validators/resources"; import { cn } from "@ctrlplane/ui"; import { Input } from "@ctrlplane/ui/input"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/ProviderConditionRender.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/ProviderConditionRender.tsx index 0b07b77b6..cd119caf8 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/ProviderConditionRender.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/ProviderConditionRender.tsx @@ -1,4 +1,4 @@ -import type { ProviderCondition } from "@ctrlplane/validators/targets"; +import type { ProviderCondition } from "@ctrlplane/validators/resources"; import { useParams } from "next/navigation"; import type { TargetConditionRenderProps } from "./target-condition-props"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionBadge.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionBadge.tsx index 75ad2bf36..becbccab0 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionBadge.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionBadge.tsx @@ -6,7 +6,7 @@ import type { NameCondition, ProviderCondition, ResourceCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import React from "react"; import _ from "lodash"; @@ -25,7 +25,7 @@ import { isNameCondition, isProviderCondition, ResourceOperator, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { api } from "~/trpc/react"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionDialog.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionDialog.tsx index e4f258517..19a9dc312 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionDialog.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionDialog.tsx @@ -1,5 +1,5 @@ import type * as schema from "@ctrlplane/db/schema"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import React, { useState } from "react"; import { useRouter } from "next/navigation"; @@ -18,7 +18,7 @@ import { defaultCondition, isValidTargetCondition, MAX_DEPTH_ALLOWED, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import type { TargetViewFormSchema } from "./TargetViewForm"; import { api } from "~/trpc/react"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionRender.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionRender.tsx index fd5780e57..ccad6dc2a 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionRender.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetConditionRender.tsx @@ -1,4 +1,4 @@ -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import React from "react"; import { @@ -8,7 +8,7 @@ import { isMetadataCondition, isNameCondition, isProviderCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import type { TargetConditionRenderProps } from "./target-condition-props"; import { ComparisonConditionRender } from "./ComparisonConditionRender"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetViewForm.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetViewForm.tsx index e24e2df5b..f3bf3f807 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetViewForm.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/TargetViewForm.tsx @@ -16,7 +16,7 @@ import { defaultCondition, isValidTargetCondition, resourceCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { TargetConditionRender } from "./TargetConditionRender"; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/target-condition-props.ts b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/target-condition-props.ts index e69135ba1..a5aabe5ce 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/target-condition-props.ts +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/target-condition-props.ts @@ -1,4 +1,4 @@ -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; export type TargetConditionRenderProps = { condition: T; diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/useTargetFilter.ts b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/useTargetFilter.ts index e0e907916..ea6609498 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/useTargetFilter.ts +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/useTargetFilter.ts @@ -1,5 +1,5 @@ import type * as schema from "@ctrlplane/db/schema"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import { useCallback, useMemo } from "react"; import { useRouter, useSearchParams } from "next/navigation"; import LZString from "lz-string"; diff --git a/apps/webservice/src/app/[workspaceSlug]/systems/SystemActionsDropdown.tsx b/apps/webservice/src/app/[workspaceSlug]/systems/SystemActionsDropdown.tsx index 26f93fb75..b9a146452 100644 --- a/apps/webservice/src/app/[workspaceSlug]/systems/SystemActionsDropdown.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/systems/SystemActionsDropdown.tsx @@ -1,7 +1,7 @@ "use client"; import type * as schema from "@ctrlplane/db/schema"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import React from "react"; import Link from "next/link"; import { useParams } from "next/navigation"; @@ -19,7 +19,7 @@ import { import { ResourceFilterType, ResourceOperator, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { DeleteSystemDialog } from "./[systemSlug]/_components/DeleteSystemDialog"; import { EditSystemDialog } from "./[systemSlug]/_components/EditSystemDialog"; diff --git a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/_components/variables/ConfigFields.tsx b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/_components/variables/ConfigFields.tsx index bfff7c23f..f5440fa9b 100644 --- a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/_components/variables/ConfigFields.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/_components/variables/ConfigFields.tsx @@ -1,6 +1,6 @@ "use client"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import type { BooleanVariableConfigType, ChoiceVariableConfigType, @@ -26,7 +26,7 @@ import { Textarea } from "@ctrlplane/ui/textarea"; import { defaultCondition, isEmptyCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { TargetConditionBadge } from "~/app/[workspaceSlug]/_components/target-condition/TargetConditionBadge"; import { TargetConditionDialog } from "~/app/[workspaceSlug]/_components/target-condition/TargetConditionDialog"; diff --git a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/_components/variables/VariableInputs.tsx b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/_components/variables/VariableInputs.tsx index a5415f2db..0f7cd3a64 100644 --- a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/_components/variables/VariableInputs.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/_components/variables/VariableInputs.tsx @@ -1,4 +1,4 @@ -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import type { ChoiceVariableConfigType, StringVariableConfigType, @@ -28,7 +28,7 @@ import { Textarea } from "@ctrlplane/ui/textarea"; import { ResourceFilterType, ResourceOperator, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { api } from "~/trpc/react"; diff --git a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/page.tsx b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/page.tsx index d999d4077..d16affe64 100644 --- a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/page.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/page.tsx @@ -2,7 +2,7 @@ import type { Deployment } from "@ctrlplane/db/schema"; import type { ComparisonCondition, ResourceCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import React from "react"; import { notFound } from "next/navigation"; import LZString from "lz-string"; @@ -12,7 +12,7 @@ import { Card } from "@ctrlplane/ui/card"; import { ResourceFilterType, ResourceOperator, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { api } from "~/trpc/server"; import { EditDeploymentSection } from "./EditDeploymentSection"; diff --git a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/variables/VariableValueDropdown.tsx b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/variables/VariableValueDropdown.tsx index 3c2cc35c8..2e5aa0ef9 100644 --- a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/variables/VariableValueDropdown.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/variables/VariableValueDropdown.tsx @@ -45,7 +45,7 @@ import { defaultCondition, isValidTargetCondition, resourceCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import type { VariableValue } from "./variable-data"; import { TargetConditionRender } from "~/app/[workspaceSlug]/_components/target-condition/TargetConditionRender"; diff --git a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/variables/page.tsx b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/variables/page.tsx index c2092971e..f4219fe38 100644 --- a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/variables/page.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/variables/page.tsx @@ -1,7 +1,7 @@ import type { ComparisonCondition, ResourceCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { notFound } from "next/navigation"; import LZString from "lz-string"; import { isPresent } from "ts-is-present"; @@ -9,7 +9,7 @@ import { isPresent } from "ts-is-present"; import { ResourceFilterType, ResourceOperator, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { api } from "~/trpc/server"; import { VariableTable } from "./VariableTable"; diff --git a/integrations/google-compute-scanner/src/gke.ts b/integrations/google-compute-scanner/src/gke.ts index 53d324a12..be42bcd61 100644 --- a/integrations/google-compute-scanner/src/gke.ts +++ b/integrations/google-compute-scanner/src/gke.ts @@ -1,4 +1,4 @@ -import type { KubernetesClusterAPIV1 } from "@ctrlplane/validators/targets"; +import type { KubernetesClusterAPIV1 } from "@ctrlplane/validators/resources"; import type { google } from "@google-cloud/container/build/protos/protos.js"; import type { V1Namespace } from "@kubernetes/client-node"; import Container from "@google-cloud/container"; @@ -9,7 +9,7 @@ import { SemVer } from "semver"; import { logger } from "@ctrlplane/logger"; import { ReservedMetadataKey } from "@ctrlplane/validators/conditions"; -import { kubernetesNamespaceV1 } from "@ctrlplane/validators/targets"; +import { kubernetesNamespaceV1 } from "@ctrlplane/validators/resources"; import { env } from "./config.js"; import { connectToCluster } from "./gke-connect.js"; diff --git a/packages/api/src/router/deployment-variable.ts b/packages/api/src/router/deployment-variable.ts index 1c4e4c67d..e8b62844b 100644 --- a/packages/api/src/router/deployment-variable.ts +++ b/packages/api/src/router/deployment-variable.ts @@ -1,5 +1,5 @@ import type { DeploymentVariableValue } from "@ctrlplane/db/schema"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import _ from "lodash"; import { isPresent } from "ts-is-present"; import { z } from "zod"; diff --git a/packages/api/src/router/target.ts b/packages/api/src/router/target.ts index f78bc0aa3..de0b369a6 100644 --- a/packages/api/src/router/target.ts +++ b/packages/api/src/router/target.ts @@ -27,7 +27,7 @@ import { } from "@ctrlplane/job-dispatch"; import { variablesAES256 } from "@ctrlplane/secrets"; import { Permission } from "@ctrlplane/validators/auth"; -import { resourceCondition } from "@ctrlplane/validators/targets"; +import { resourceCondition } from "@ctrlplane/validators/resources"; import { createTRPCRouter, protectedProcedure } from "../trpc"; import { resourceMetadataGroupRouter } from "./target-metadata-group"; diff --git a/packages/db/src/schema/deployment-variables.ts b/packages/db/src/schema/deployment-variables.ts index ad03f4b79..d93637912 100644 --- a/packages/db/src/schema/deployment-variables.ts +++ b/packages/db/src/schema/deployment-variables.ts @@ -1,4 +1,4 @@ -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import type { VariableConfigType } from "@ctrlplane/validators/variables"; import type { InferInsertModel, InferSelectModel } from "drizzle-orm"; import type { AnyPgColumn, ColumnsWithTable } from "drizzle-orm/pg-core"; @@ -14,7 +14,7 @@ import { import { createInsertSchema } from "drizzle-zod"; import { z } from "zod"; -import { resourceCondition } from "@ctrlplane/validators/targets"; +import { resourceCondition } from "@ctrlplane/validators/resources"; import { VariableConfig } from "@ctrlplane/validators/variables"; import { deployment } from "./deployment.js"; diff --git a/packages/db/src/schema/environment.ts b/packages/db/src/schema/environment.ts index 0d4a4a437..4bfadcd43 100644 --- a/packages/db/src/schema/environment.ts +++ b/packages/db/src/schema/environment.ts @@ -1,4 +1,4 @@ -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import type { InferSelectModel } from "drizzle-orm"; import { relations, sql } from "drizzle-orm"; import { @@ -18,7 +18,7 @@ import { z } from "zod"; import { isValidTargetCondition, resourceCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import { user } from "./auth.js"; import { deployment } from "./deployment.js"; diff --git a/packages/db/src/schema/resource.ts b/packages/db/src/schema/resource.ts index 5753bed8c..e09bb4cf2 100644 --- a/packages/db/src/schema/resource.ts +++ b/packages/db/src/schema/resource.ts @@ -2,7 +2,7 @@ import type { MetadataCondition } from "@ctrlplane/validators/conditions"; import type { IdentifierCondition, ResourceCondition, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import type { InferInsertModel, InferSelectModel, SQL } from "drizzle-orm"; import { exists, like, not, notExists, or, relations, sql } from "drizzle-orm"; import { @@ -28,7 +28,7 @@ import { import { resourceCondition, ResourceFilterType, -} from "@ctrlplane/validators/targets"; +} from "@ctrlplane/validators/resources"; import type { Tx } from "../common.js"; import { resourceProvider } from "./resource-provider.js"; diff --git a/packages/events/src/triggers/deployment-deleted.ts b/packages/events/src/triggers/deployment-deleted.ts index 11abbe524..57916403e 100644 --- a/packages/events/src/triggers/deployment-deleted.ts +++ b/packages/events/src/triggers/deployment-deleted.ts @@ -1,12 +1,12 @@ import type { HookEvent } from "@ctrlplane/validators/events"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import { isPresent } from "ts-is-present"; import { eq, isNotNull } from "@ctrlplane/db"; import { db } from "@ctrlplane/db/client"; import * as SCHEMA from "@ctrlplane/db/schema"; import { ComparisonOperator } from "@ctrlplane/validators/conditions"; -import { ResourceFilterType } from "@ctrlplane/validators/targets"; +import { ResourceFilterType } from "@ctrlplane/validators/resources"; export const getEventsForDeploymentDeleted = async ( deployment: SCHEMA.Deployment, diff --git a/packages/events/src/triggers/environment-deleted.ts b/packages/events/src/triggers/environment-deleted.ts index b76efaedd..778d9a529 100644 --- a/packages/events/src/triggers/environment-deleted.ts +++ b/packages/events/src/triggers/environment-deleted.ts @@ -1,12 +1,12 @@ import type { HookEvent } from "@ctrlplane/validators/events"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import { isPresent } from "ts-is-present"; import { and, eq, inArray, isNotNull, ne } from "@ctrlplane/db"; import { db } from "@ctrlplane/db/client"; import * as SCHEMA from "@ctrlplane/db/schema"; import { ComparisonOperator } from "@ctrlplane/validators/conditions"; -import { ResourceFilterType } from "@ctrlplane/validators/targets"; +import { ResourceFilterType } from "@ctrlplane/validators/resources"; export const getEventsForEnvironmentDeleted = async ( environment: SCHEMA.Environment, diff --git a/packages/events/src/triggers/target-deleted.ts b/packages/events/src/triggers/target-deleted.ts index 49f4cdbf9..542a3d839 100644 --- a/packages/events/src/triggers/target-deleted.ts +++ b/packages/events/src/triggers/target-deleted.ts @@ -1,12 +1,12 @@ import type { HookEvent } from "@ctrlplane/validators/events"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import { isPresent } from "ts-is-present"; import { eq, isNotNull } from "@ctrlplane/db"; import { db } from "@ctrlplane/db/client"; import * as SCHEMA from "@ctrlplane/db/schema"; import { ComparisonOperator } from "@ctrlplane/validators/conditions"; -import { ResourceFilterType } from "@ctrlplane/validators/targets"; +import { ResourceFilterType } from "@ctrlplane/validators/resources"; /** * Get events for a target that has been deleted. diff --git a/packages/job-dispatch/src/job-variables-deployment/utils.ts b/packages/job-dispatch/src/job-variables-deployment/utils.ts index b4cf8ddb6..184938265 100644 --- a/packages/job-dispatch/src/job-variables-deployment/utils.ts +++ b/packages/job-dispatch/src/job-variables-deployment/utils.ts @@ -1,5 +1,5 @@ import type { Tx } from "@ctrlplane/db"; -import type { ResourceCondition } from "@ctrlplane/validators/targets"; +import type { ResourceCondition } from "@ctrlplane/validators/resources"; import { isPresent } from "ts-is-present"; import { and, eq, takeFirstOrNull } from "@ctrlplane/db"; diff --git a/packages/validators/package.json b/packages/validators/package.json index c6ffdf242..6c6f821e9 100644 --- a/packages/validators/package.json +++ b/packages/validators/package.json @@ -8,9 +8,9 @@ "types": "./src/index.ts", "default": "./dist/index.js" }, - "./targets": { - "types": "./src/targets/index.ts", - "default": "./dist/targets/index.js" + "./resources": { + "types": "./src/resources/index.ts", + "default": "./dist/resources/index.js" }, "./releases": { "types": "./src/releases/index.ts", diff --git a/packages/validators/src/targets/conditions/comparison-condition.ts b/packages/validators/src/resources/conditions/comparison-condition.ts similarity index 100% rename from packages/validators/src/targets/conditions/comparison-condition.ts rename to packages/validators/src/resources/conditions/comparison-condition.ts diff --git a/packages/validators/src/targets/conditions/identifier-condition.ts b/packages/validators/src/resources/conditions/identifier-condition.ts similarity index 100% rename from packages/validators/src/targets/conditions/identifier-condition.ts rename to packages/validators/src/resources/conditions/identifier-condition.ts diff --git a/packages/validators/src/targets/conditions/index.ts b/packages/validators/src/resources/conditions/index.ts similarity index 83% rename from packages/validators/src/targets/conditions/index.ts rename to packages/validators/src/resources/conditions/index.ts index 17cdbb5d8..09c189c77 100644 --- a/packages/validators/src/targets/conditions/index.ts +++ b/packages/validators/src/resources/conditions/index.ts @@ -1,6 +1,6 @@ export * from "./name-condition.js"; export * from "./kind-condition.js"; export * from "./comparison-condition.js"; -export * from "./target-condition.js"; +export * from "./resource-condition.js"; export * from "./provider-condition.js"; export * from "./identifier-condition.js"; diff --git a/packages/validators/src/targets/conditions/kind-condition.ts b/packages/validators/src/resources/conditions/kind-condition.ts similarity index 100% rename from packages/validators/src/targets/conditions/kind-condition.ts rename to packages/validators/src/resources/conditions/kind-condition.ts diff --git a/packages/validators/src/targets/conditions/name-condition.ts b/packages/validators/src/resources/conditions/name-condition.ts similarity index 100% rename from packages/validators/src/targets/conditions/name-condition.ts rename to packages/validators/src/resources/conditions/name-condition.ts diff --git a/packages/validators/src/targets/conditions/provider-condition.ts b/packages/validators/src/resources/conditions/provider-condition.ts similarity index 100% rename from packages/validators/src/targets/conditions/provider-condition.ts rename to packages/validators/src/resources/conditions/provider-condition.ts diff --git a/packages/validators/src/targets/conditions/target-condition.ts b/packages/validators/src/resources/conditions/resource-condition.ts similarity index 100% rename from packages/validators/src/targets/conditions/target-condition.ts rename to packages/validators/src/resources/conditions/resource-condition.ts diff --git a/packages/validators/src/targets/index.ts b/packages/validators/src/resources/index.ts similarity index 100% rename from packages/validators/src/targets/index.ts rename to packages/validators/src/resources/index.ts diff --git a/packages/validators/src/targets/kubernetes-v1.ts b/packages/validators/src/resources/kubernetes-v1.ts similarity index 100% rename from packages/validators/src/targets/kubernetes-v1.ts rename to packages/validators/src/resources/kubernetes-v1.ts diff --git a/packages/validators/src/variables/index.ts b/packages/validators/src/variables/index.ts index 1b0ff3723..c1bff52a9 100644 --- a/packages/validators/src/variables/index.ts +++ b/packages/validators/src/variables/index.ts @@ -1,6 +1,6 @@ import { z } from "zod"; -import { resourceCondition } from "../targets/index.js"; +import { resourceCondition } from "../resources/index.js"; export const ChoiceVariableConfig = z.object({ type: z.literal("choice"),