diff --git a/src/constants/ingestion/constants.ts b/src/constants/ingestion/constants.ts index 715883b..c9f3c9c 100644 --- a/src/constants/ingestion/constants.ts +++ b/src/constants/ingestion/constants.ts @@ -36,14 +36,14 @@ export const INGESTION_VALIDATIONS = { pattern: '^((\\/[\\w-]+)+)\\/([^\\/][\\wא-ת\\.-]+)\\.gpkg$', description: 'Valid gpkg file path, file name must end with .gpkg', }, - metadataShapefileFilePath: { + metadataShapefilePath: { // eslint-disable-next-line no-useless-escape - pattern: '^(\\/[\\w-]+)+\\/ShapeMetadata\\.shp$', + pattern: '^(\\/?[\\w-]+)(\\/[\\w-]+)*\\/ShapeMetadata\\.shp$', description: 'Valid metadata shapefile file path, must be end with /ShapeMetadata.shp', }, - productShapefileFilePath: { + productShapefilePath: { // eslint-disable-next-line no-useless-escape - pattern: '^(\\/[\\w-]+)+\\/Product\\.shp$', + pattern: '^(\\/?[\\w-]+)(\\/[\\w-]+)*\\/Product\\.shp$', description: 'Valid product shapefile file path, must be end with /Product.shp', }, horizontalAccuracyCE90: { diff --git a/src/schemas/ingestion/inputFiles.schema.ts b/src/schemas/ingestion/inputFiles.schema.ts index 9b555f2..82afd52 100644 --- a/src/schemas/ingestion/inputFiles.schema.ts +++ b/src/schemas/ingestion/inputFiles.schema.ts @@ -8,14 +8,14 @@ export const gpkgFileNameSchema = z export const metadataShapefilePathSchema = z .string() - .regex(new RegExp(INGESTION_VALIDATIONS.metadataShapefileFilePath.pattern), { + .regex(new RegExp(INGESTION_VALIDATIONS.metadataShapefilePath.pattern), { message: 'Metadata shape file path must be a valid shapefile path ending with "/ShapeMetadata.shp"', }) .describe('metadataShapefileSchema'); export const productShapefilePathSchema = z .string() - .regex(new RegExp(INGESTION_VALIDATIONS.productShapefileFilePath.pattern), { + .regex(new RegExp(INGESTION_VALIDATIONS.productShapefilePath.pattern), { message: 'Product file path must be a valid shapefile path ending with "/Product.shp"', }) .describe('productShapefilePathSchema');