chore: Update all imports to zod/v3

Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
This commit is contained in:
Gabriel Dugny
2026-01-11 21:55:47 +01:00
committed by Fredrik Adelöw
parent 5d8b4cddb9
commit 49171c9de4
111 changed files with 113 additions and 114 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ spec:
lifecycle: experimental
owner: team-c
definition: |
import { z } from 'zod';
import { z } from 'zod/v3';
import { publicProcedure, router } from '../trpc';
export const apiRouter = router({
@@ -20,7 +20,7 @@ import {
PassportProfile,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the Atlassian auth provider.
@@ -19,7 +19,7 @@ import {
SignInInfo,
} from '@backstage/plugin-auth-node';
import { AwsAlbResult } from './types';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the AWS ALB auth provider.
@@ -19,7 +19,7 @@ import {
SignInInfo,
} from '@backstage/plugin-auth-node';
import { AzureEasyAuthResult } from './types';
import { z } from 'zod';
import { z } from 'zod/v3';
/** @public */
export namespace azureEasyAuthSignInResolvers {
@@ -20,7 +20,7 @@ import {
PassportProfile,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the Bitbucket auth provider.
@@ -19,7 +19,7 @@ import {
PassportProfile,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the Bitbucket Server auth provider.
@@ -19,7 +19,7 @@ import {
SignInInfo,
} from '@backstage/plugin-auth-node';
import { CloudflareAccessResult } from './types';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the Cloudflare Access auth provider.
@@ -19,7 +19,7 @@ import {
SignInInfo,
} from '@backstage/plugin-auth-node';
import { GcpIapResult } from './types';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the Google auth provider.
@@ -19,7 +19,7 @@ import {
OAuthAuthenticatorResult,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
import { GithubProfile } from './authenticator';
@@ -19,7 +19,7 @@ import {
OAuthAuthenticatorResult,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
import { GitlabProfile } from './authenticator';
@@ -20,7 +20,7 @@ import {
PassportProfile,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the Google auth provider.
@@ -20,7 +20,7 @@ import {
PassportProfile,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the Microsoft auth provider.
@@ -20,7 +20,7 @@ import {
PassportProfile,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the oauth2 auth provider.
@@ -19,7 +19,7 @@ import {
SignInInfo,
} from '@backstage/plugin-auth-node';
import { OAuth2ProxyResult } from './types';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* @public
@@ -20,7 +20,7 @@ import {
PassportProfile,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the Okta auth provider.
@@ -20,7 +20,7 @@ import {
PassportProfile,
SignInInfo,
} from '@backstage/plugin-auth-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Available sign-in resolvers for the OneLogin auth provider.
@@ -22,7 +22,7 @@ import {
} from '@backstage/plugin-auth-node';
import { createHash } from 'node:crypto';
import OAuth2Strategy from 'passport-oauth2';
import { z } from 'zod';
import { z } from 'zod/v3';
/** @public */
export interface OpenShiftAuthenticatorContext {
@@ -25,7 +25,7 @@ import {
DEFAULT_NAMESPACE,
stringifyEntityRef,
} from '@backstage/catalog-model';
import { z } from 'zod';
import { z } from 'zod/v3';
export namespace openshiftSignInResolvers {
export const displayNameMatchingUserEntityName = createSignInResolverFactory({
@@ -27,7 +27,7 @@ import { UserInfoDatabase } from '../database/UserInfoDatabase';
import { OidcDatabase } from '../database/OidcDatabase';
import { OfflineAccessService } from './OfflineAccessService';
import { json } from 'express';
import { z } from 'zod';
import { z } from 'zod/v4';
import { fromZodError } from 'zod-validation-error';
import { OidcError } from './OidcError';
+2 -2
View File
@@ -16,8 +16,8 @@ import { Profile } from 'passport';
import { Request as Request_2 } from 'express';
import { Response as Response_2 } from 'express';
import { Strategy } from 'passport';
import { ZodSchema } from 'zod';
import { ZodTypeDef } from 'zod';
import { ZodSchema } from 'zod/v3';
import { ZodTypeDef } from 'zod/v3';
// @public (undocumented)
export interface AuthOwnershipResolutionExtensionPoint {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { z } from 'zod';
import { z } from 'zod/v3';
import { createSignInResolverFactory } from './createSignInResolverFactory';
import { NotAllowedError } from '@backstage/errors';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { ZodSchema, ZodTypeDef } from 'zod';
import { ZodSchema, ZodTypeDef } from 'zod/v3';
import { SignInResolver } from '../types';
import zodToJsonSchema from 'zod-to-json-schema';
import { JsonObject } from '@backstage/types';
@@ -19,7 +19,7 @@ import { Entity } from '@backstage/catalog-model';
import path from 'node:path';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import { minimatch } from 'minimatch';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Rules to apply to catalog entities.
@@ -17,7 +17,7 @@
import { catalogEntityPermissionResourceRef } from '@backstage/plugin-catalog-node/alpha';
import { createPermissionRule } from '@backstage/plugin-permission-node';
import { get } from 'lodash';
import { z } from 'zod';
import { z } from 'zod/v3';
export const createPropertyRule = (propertyType: 'metadata' | 'spec') =>
createPermissionRule({
@@ -16,7 +16,7 @@
import { catalogEntityPermissionResourceRef } from '@backstage/plugin-catalog-node/alpha';
import { createPermissionRule } from '@backstage/plugin-permission-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* A catalog {@link @backstage/plugin-permission-node#PermissionRule} which
@@ -16,7 +16,7 @@
import { catalogEntityPermissionResourceRef } from '@backstage/plugin-catalog-node/alpha';
import { createPermissionRule } from '@backstage/plugin-permission-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* A catalog {@link @backstage/plugin-permission-node#PermissionRule} which
@@ -16,7 +16,7 @@
import { catalogEntityPermissionResourceRef } from '@backstage/plugin-catalog-node/alpha';
import { createPermissionRule } from '@backstage/plugin-permission-node';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* A catalog {@link @backstage/plugin-permission-node#PermissionRule} which
@@ -16,7 +16,7 @@
import { RELATION_OWNED_BY } from '@backstage/catalog-model';
import { createPermissionRule } from '@backstage/plugin-permission-node';
import { z } from 'zod';
import { z } from 'zod/v3';
import { catalogEntityPermissionResourceRef } from '@backstage/plugin-catalog-node/alpha';
/**
@@ -41,7 +41,7 @@ import {
import express from 'express';
import { Server } from 'node:http';
import request from 'supertest';
import { z } from 'zod';
import { z } from 'zod/v3';
import { Cursor, EntitiesCatalog } from '../catalog/types';
import { applyDatabaseMigrations } from '../database/migrations';
import { DbLocationsRow } from '../database/tables';
@@ -33,7 +33,7 @@ import { InputError, serializeError } from '@backstage/errors';
import { LocationAnalyzer } from '@backstage/plugin-catalog-node';
import express from 'express';
import yn from 'yn';
import { z } from 'zod';
import { z } from 'zod/v3';
import { Cursor, EntitiesCatalog } from '../catalog/types';
import { CatalogProcessingOrchestrator } from '../processing/types';
import { validateEntityEnvelope } from '../processing/util';
@@ -22,7 +22,6 @@ import {
import { Request } from 'express';
import { z } from 'zod/v3';
import { fromZodError } from 'zod-validation-error/v3';
const filterPredicateSchema = createZodV3FilterPredicateSchema(z);
const schema = z.object({
+1 -1
View File
@@ -18,7 +18,7 @@ import { InputError, NotAllowedError } from '@backstage/errors';
import { createZodV3FilterPredicateSchema } from '@backstage/filter-predicates';
import { Request } from 'express';
import lodash from 'lodash';
import { z } from 'zod';
import { z } from 'zod/v3';
import {
Cursor,
QueryEntitiesCursorRequest,
@@ -16,7 +16,7 @@
import { CSSProperties, ReactElement, ReactNode } from 'react';
import { Layout } from 'react-grid-layout';
import { z } from 'zod';
import { z } from 'zod/v3';
import { RJSFSchema, UiSchema } from '@rjsf/utils';
const RSJFTypeSchema: z.ZodType<RJSFSchema> = z.any();
@@ -30,7 +30,7 @@ import {
createPermissionRule,
} from '@backstage/plugin-permission-node';
import { PermissionIntegrationClient } from './PermissionIntegrationClient';
import { z } from 'zod';
import { z } from 'zod/v3';
import { DiscoveryService } from '@backstage/backend-plugin-api';
describe('PermissionIntegrationClient', () => {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { z } from 'zod';
import { z } from 'zod/v3';
import {
AuthorizeResult,
ConditionalPolicyDecision,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { z } from 'zod';
import { z } from 'zod/v3';
import express, { Request, Response } from 'express';
import Router from 'express-promise-router';
import { InputError } from '@backstage/errors';
@@ -18,7 +18,7 @@ import { Config } from '@backstage/config';
import { ResponseError } from '@backstage/errors';
import fetch from 'cross-fetch';
import * as uuid from 'uuid';
import { z } from 'zod';
import { z } from 'zod/v3';
import {
AuthorizeResult,
PermissionMessageBatch,
+1 -1
View File
@@ -30,7 +30,7 @@ import { PermissionsServiceRequestOptions } from '@backstage/backend-plugin-api'
import { PolicyDecision } from '@backstage/plugin-permission-common';
import { QueryPermissionRequest } from '@backstage/plugin-permission-common';
import { ResourcePermission } from '@backstage/plugin-permission-common';
import { z } from 'zod';
import { z } from 'zod/v3';
// @public
export type ApplyConditionsRequest = {
@@ -18,7 +18,7 @@ import {
AuthorizeResult,
createPermission,
} from '@backstage/plugin-permission-common';
import { z } from 'zod';
import { z } from 'zod/v3';
import { createConditionExports } from './createConditionExports';
import { createPermissionRule } from './createPermissionRule';
import { createPermissionResourceRef } from './createPermissionResourceRef';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { z } from 'zod';
import { z } from 'zod/v3';
import { createConditionFactory } from './createConditionFactory';
import { createPermissionRule } from './createPermissionRule';
@@ -18,7 +18,7 @@ import {
PermissionCondition,
PermissionCriteria,
} from '@backstage/plugin-permission-common';
import { z } from 'zod';
import { z } from 'zod/v3';
import { createConditionTransformer } from './createConditionTransformer';
import { createPermissionRule } from './createPermissionRule';
@@ -21,7 +21,7 @@ import {
} from '@backstage/plugin-permission-common';
import express from 'express';
import request, { Response } from 'supertest';
import { z } from 'zod';
import { z } from 'zod/v3';
import {
createPermissionIntegrationRouter,
CreatePermissionIntegrationRouterResourceOptions,
@@ -16,7 +16,7 @@
import express, { Response } from 'express';
import Router from 'express-promise-router';
import { z } from 'zod';
import { z } from 'zod/v3';
import zodToJsonSchema from 'zod-to-json-schema';
import { InputError } from '@backstage/errors';
import {
@@ -19,7 +19,7 @@ import {
PermissionRuleParams,
} from '@backstage/plugin-permission-common';
import { NoInfer, PermissionRule } from '../types';
import { z } from 'zod';
import { z } from 'zod/v3';
import { PermissionResourceRef } from './createPermissionResourceRef';
/**
+1 -1
View File
@@ -18,7 +18,7 @@ import type {
PermissionCriteria,
PermissionRuleParams,
} from '@backstage/plugin-permission-common';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* Prevent use of type parameter from contributing to type inference.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { z as zod } from 'zod';
import { z as zod } from 'zod/v3';
const repoUrl = (z: typeof zod) =>
z.string({
@@ -4,12 +4,12 @@
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { objectOutputType } from 'zod';
import { objectOutputType } from 'zod/v3';
import { ScmIntegrations } from '@backstage/integration';
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
import { UrlReaderService } from '@backstage/backend-plugin-api';
import { Writable } from 'node:stream';
import { ZodTypeAny } from 'zod';
import { ZodTypeAny } from 'zod/v3';
// @public
export interface ContainerRunner {
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { z as zod } from 'zod';
import { z as zod } from 'zod/v3';
const repoUrl = (z: typeof zod) =>
z.string({
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { z as zod } from 'zod';
import { z as zod } from 'zod/v3';
const remoteUrl = (z: typeof zod) =>
z.string({
@@ -16,7 +16,7 @@
/* We want to maintain the same information as an enum, so we disable the redeclaration warning */
/* eslint-disable @typescript-eslint/no-redeclare */
import { z } from 'zod';
import { z } from 'zod/v3';
const commonGitlabConfig = z.object({
repoUrl: z.string({ description: 'Repository Location' }),
@@ -21,7 +21,7 @@ import {
ScmIntegrationRegistry,
} from '@backstage/integration';
import { Gitlab, GroupSchema, RepositoryTreeSchema } from '@gitbeaker/rest';
import { z } from 'zod';
import { z } from 'zod/v3';
import commonGitlabConfig from './commonGitlabConfig';
import { SerializedFile } from '@backstage/plugin-scaffolder-node';
@@ -17,7 +17,7 @@ import { createTemplateAction } from '@backstage/plugin-scaffolder-node';
import { resolveSafeChildPath } from '@backstage/backend-plugin-api';
import fs from 'node:fs/promises';
import path from 'node:path';
import { z as zod } from 'zod';
import { z as zod } from 'zod/v3';
import { examples } from './read.examples';
const contentSchema = (z: typeof zod) =>
@@ -85,7 +85,7 @@ import express from 'express';
import { Duration } from 'luxon';
import { pathToFileURL } from 'node:url';
import { v4 as uuid } from 'uuid';
import { z } from 'zod';
import { z } from 'zod/v3';
import {
DatabaseTaskStore,
DefaultTemplateActionRegistry,
@@ -29,7 +29,7 @@ import {
import { SerializedTask, TaskFilter } from '@backstage/plugin-scaffolder-node';
import { z } from 'zod';
import { z } from 'zod/v3';
import { JsonObject, JsonPrimitive } from '@backstage/types';
import { get } from 'lodash';
@@ -26,7 +26,7 @@ import {
} from '@backstage/plugin-scaffolder-node/alpha';
import { JsonValue } from '@backstage/types';
import { Schema } from 'jsonschema';
import { ZodType, z } from 'zod';
import { ZodType, z } from 'zod/v3';
import zodToJsonSchema from 'zod-to-json-schema';
/**
+1 -1
View File
@@ -8,7 +8,7 @@ import { JsonValue } from '@backstage/types';
import { TaskBroker } from '@backstage/plugin-scaffolder-node';
import { TemplateFilter as TemplateFilter_2 } from '@backstage/plugin-scaffolder-node';
import { TemplateGlobal as TemplateGlobal_2 } from '@backstage/plugin-scaffolder-node';
import { z } from 'zod';
import { z } from 'zod/v3';
// @alpha
export type AutocompleteHandler = (input: {
+1 -1
View File
@@ -33,7 +33,7 @@ import { UpdateTaskCheckpointOptions } from '@backstage/plugin-scaffolder-node/a
import { UrlReaderService } from '@backstage/backend-plugin-api';
import { UserEntity } from '@backstage/catalog-model';
import { Writable } from 'node:stream';
import { z } from 'zod';
import { z } from 'zod/v3';
// @public
export type ActionContext<
@@ -15,7 +15,7 @@
*/
import { ActionContext, TemplateAction } from './types';
import { z } from 'zod';
import { z } from 'zod/v3';
import { Expand, JsonObject } from '@backstage/types';
import { parseSchemas } from './util';
+1 -1
View File
@@ -20,7 +20,7 @@ import { join as joinPath, normalize as normalizePath } from 'node:path';
import { ScmIntegrationRegistry } from '@backstage/integration';
import { TemplateActionOptions } from './createTemplateAction';
import zodToJsonSchema from 'zod-to-json-schema';
import { z } from 'zod';
import { z } from 'zod/v3';
import { Schema } from 'jsonschema';
import { trim } from 'lodash';
@@ -16,7 +16,7 @@
import { ZodFunctionSchema } from '../types';
import { CreatedTemplateFilter, TemplateFilterExample } from './types';
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* This function is used to create new template filters in type-safe manner.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { z } from 'zod';
import { z } from 'zod/v3';
import { ZodFunctionSchema } from '../types';
export type { TemplateFilter } from '../../types';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { z } from 'zod';
import { z } from 'zod/v3';
import {
CreatedTemplateGlobalFunction,
CreatedTemplateGlobalValue,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonValue } from '@backstage/types';
import { z } from 'zod';
import { z } from 'zod/v3';
import { ZodFunctionSchema } from '../types';
export type { TemplateGlobal } from '../../types';
+1 -1
View File
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { z } from 'zod';
import { z } from 'zod/v3';
/**
* @alpha
+1 -1
View File
@@ -40,7 +40,7 @@ import { TemplatePresentationV1beta3 } from '@backstage/plugin-scaffolder-common
import { TranslationRef } from '@backstage/frontend-plugin-api';
import { UiSchema } from '@rjsf/utils';
import { WidgetProps } from '@rjsf/utils';
import { z } from 'zod';
import { z } from 'zod/v3';
// @alpha (undocumented)
export type BackstageOverrides = Overrides & {
+1 -1
View File
@@ -59,7 +59,7 @@ import { TemplatesType } from '@rjsf/utils';
import { UIOptionsType } from '@rjsf/utils';
import { UiSchema } from '@rjsf/utils';
import { ValidatorType } from '@rjsf/utils';
import { z } from 'zod';
import { z } from 'zod/v3';
// @public @deprecated
export type Action = Action_2;
@@ -17,7 +17,7 @@ import {
createExtensionBlueprint,
createExtensionDataRef,
} from '@backstage/frontend-plugin-api';
import { z } from 'zod';
import { z } from 'zod/v3';
import { OpaqueFormField } from '@internal/scaffolder';
import { FormFieldExtensionData } from './types';
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { z } from 'zod';
import { z } from 'zod/v3';
import {
CustomFieldValidator,
FieldExtensionComponentProps,
@@ -16,7 +16,7 @@
import { AnyApiRef } from '@backstage/core-plugin-api';
import { JsonObject, JsonValue } from '@backstage/types';
import { OpaqueFormDecorator } from '@internal/scaffolder';
import { z } from 'zod';
import { z } from 'zod/v3';
/** @alpha */
export type ScaffolderFormDecoratorContext<
+1 -1
View File
@@ -16,7 +16,7 @@
import zodToJsonSchema from 'zod-to-json-schema';
import { JSONSchema7 } from 'json-schema';
import { z } from 'zod';
import { z } from 'zod/v3';
import {
CustomFieldExtensionSchema,
FieldExtensionComponentProps,
+1 -1
View File
@@ -49,7 +49,7 @@ import { TemplateGroupFilter } from '@backstage/plugin-scaffolder-react';
import { TemplateListPageProps } from '@backstage/plugin-scaffolder/alpha';
import { TemplateParameterSchema as TemplateParameterSchema_2 } from '@backstage/plugin-scaffolder-common';
import { TemplateWizardPageProps } from '@backstage/plugin-scaffolder/alpha';
import { z } from 'zod';
import { z } from 'zod/v3';
// @public @deprecated (undocumented)
export const createScaffolderFieldExtension: typeof createScaffolderFieldExtension_2;
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { z as zod } from 'zod';
import { z as zod } from 'zod/v3';
import { makeFieldSchema } from '@backstage/plugin-scaffolder-react';
export const createEntityQueryFilterExpressionSchema = (z: typeof zod) =>
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { z as zod } from 'zod';
import { z as zod } from 'zod/v3';
import { makeFieldSchema } from '@backstage/plugin-scaffolder-react';
export const entityQueryFilterExpressionSchema = zod.record(
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JSONSchema7 } from 'json-schema';
import { z } from 'zod';
import { z } from 'zod/v3';
import zodToJsonSchema from 'zod-to-json-schema';
import { FieldSchema as FieldSchemaType } from '@backstage/plugin-scaffolder-react';
+1 -1
View File
@@ -15,7 +15,7 @@
*/
import express from 'express';
import { z } from 'zod';
import { z } from 'zod/v3';
import { InputError } from '@backstage/errors';
import { Config } from '@backstage/config';
import { JsonObject, JsonValue } from '@backstage/types';
@@ -17,7 +17,7 @@
import { InputError } from '@backstage/errors';
import express, { Request } from 'express';
import Router from 'express-promise-router';
import { z } from 'zod';
import { z } from 'zod/v3';
import { UserSettingsStore } from '../database/UserSettingsStore';
import { SignalsService } from '@backstage/plugin-signals-node';
import {