diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.test.ts b/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.test.ts index 01d3976b9dd6b..294105a1621af 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.test.ts +++ b/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.test.ts @@ -292,12 +292,6 @@ describe('isValidName', () => { expect(isValidName('anotherValidName')).toBe(true); }); - it('should return false for names with numbers', () => { - expect(isValidName('invalid123')).toBe(false); - expect(isValidName('123invalid')).toBe(false); - expect(isValidName('invalid_123')).toBe(false); - }); - it('should return false for empty string', () => { expect(isValidName('')).toBe(false); }); diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.ts b/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.ts index e63e7d0648da7..959f1ef093832 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.ts +++ b/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.ts @@ -36,7 +36,7 @@ export async function buildPackage(integration: Integration): Promise { if (!isValidName(integration.name)) { throw new Error( - `Invalid integration name: ${integration.name}, Should only contain letters and underscores` + `Invalid integration name: ${integration.name}, Should only contain letters, numbers and underscores` ); } @@ -49,7 +49,7 @@ export async function buildPackage(integration: Integration): Promise { const dataStreamName = dataStream.name; if (!isValidName(dataStreamName)) { throw new Error( - `Invalid datastream name: ${dataStreamName}, Should only contain letters and underscores` + `Invalid datastream name: ${dataStreamName}, Should only contain letters, numbers and underscores` ); } const specificDataStreamDir = joinPath(dataStreamsDir, dataStreamName); @@ -77,7 +77,7 @@ export async function buildPackage(integration: Integration): Promise { return zipBuffer; } export function isValidName(input: string): boolean { - const regex = /^[a-zA-Z_]+$/; + const regex = /^[a-zA-Z0-9_]+$/; return input.length > 0 && regex.test(input); } function createDirectories(