From 0ea0111bf72f855b4fa6110863672f7ce649d757 Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 12:38:19 +0300 Subject: [PATCH 01/12] fix: break import cycle that broke deep module imports `constants/export/constants.ts` imported `pickEnum` from the `utils` barrel, which pulls in `layer.utils` -> `schemas` barrel while `constants` is still initializing. Deep imports of 9 of 11 schema modules threw "Cannot access '' before initialization"; only the package entry point worked, since `src/index.ts` loads `./utils` before `./constants`. Import from `utils/helpers.utils` directly, matching what `constants/core/constants.ts` already does. All 11 schema modules now load when imported directly. --- src/constants/export/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/export/constants.ts b/src/constants/export/constants.ts index 26c58b4..bedc881 100644 --- a/src/constants/export/constants.ts +++ b/src/constants/export/constants.ts @@ -1,5 +1,5 @@ import { ArtifactRasterType } from '@map-colonies/types'; -import { pickEnum } from '../../utils'; +import { pickEnum } from '../../utils/helpers.utils'; /* eslint-disable @typescript-eslint/naming-convention */ export const ExportArtifactType = pickEnum(ArtifactRasterType, ['GPKG', 'METADATA']); From 99b4ad15c9cb6898708a8048a342839bff71c433 Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 12:39:51 +0300 Subject: [PATCH 02/12] feat: add REDIS storage provider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a `StorageProvider` discriminator covering only backends that have a matching `storageSchema` member (FS, S3, REDIS) — deliberately not spread from `SourceType`, which also contains GPKG, a source format rather than a storage backend. Split the per-provider locator fields into reusable schemas (`fsSubPathSchema`, `s3BucketSchema`, `redisPrefixSchema`) and add `redisStorageSchema` to the `storageSchema` union, keyed on a Redis key prefix. --- src/constants/core/constants.ts | 9 ++++++++ src/schemas/core/storage.schema.ts | 36 +++++++++++++++++++++++------- src/types/core/storage.type.ts | 3 ++- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/constants/core/constants.ts b/src/constants/core/constants.ts index e0296c1..5bbc3df 100644 --- a/src/constants/core/constants.ts +++ b/src/constants/core/constants.ts @@ -67,6 +67,15 @@ export const SourceType = { export type SourceType = (typeof SourceType)[keyof typeof SourceType]; +/* eslint-disable @typescript-eslint/naming-convention */ +export const StorageProvider = { + ...pickEnum(SourceType, ['FS', 'S3']), + REDIS: 'REDIS', +} as const; +/* eslint-enable @typescript-eslint/naming-convention */ + +export type StorageProvider = (typeof StorageProvider)[keyof typeof StorageProvider]; + /* eslint-disable @typescript-eslint/naming-convention */ export const InstanceType = { INGESTION: 'ingestion', diff --git a/src/schemas/core/storage.schema.ts b/src/schemas/core/storage.schema.ts index 0b45ff1..43d5796 100644 --- a/src/schemas/core/storage.schema.ts +++ b/src/schemas/core/storage.schema.ts @@ -1,14 +1,34 @@ import { z } from 'zod'; -import { SourceType } from '../../constants/core/constants'; +import { StorageProvider } from '../../constants/core/constants'; -export const fsStorageSchema = z.object({ - storageProvider: z.literal(SourceType.FS), - subPath: z.string().min(1), +export const s3BucketSchema = z.object({ + bucket: z.string().min(1), }); -export const s3StorageSchema = z.object({ - storageProvider: z.literal(SourceType.S3), - bucket: z.string().min(1), +export const redisPrefixSchema = z.object({ + prefix: z.string().min(1), // Full Redis key prefix, e.g. `myLayer-redis_WorldCRS84` }); -export const storageSchema = z.discriminatedUnion('storageProvider', [fsStorageSchema, s3StorageSchema]); +export const fsSubPathSchema = z.object({ + subPath: z.string().min(1), +}); + +export const fsStorageSchema = z + .object({ + storageProvider: z.literal(StorageProvider.FS), + }) + .merge(fsSubPathSchema); + +export const s3StorageSchema = z + .object({ + storageProvider: z.literal(StorageProvider.S3), + }) + .merge(s3BucketSchema); + +export const redisStorageSchema = z + .object({ + storageProvider: z.literal(StorageProvider.REDIS), + }) + .merge(redisPrefixSchema); + +export const storageSchema = z.discriminatedUnion('storageProvider', [fsStorageSchema, s3StorageSchema, redisStorageSchema]); diff --git a/src/types/core/storage.type.ts b/src/types/core/storage.type.ts index ebb6bb6..577b49d 100644 --- a/src/types/core/storage.type.ts +++ b/src/types/core/storage.type.ts @@ -1,6 +1,7 @@ import type { z } from 'zod'; -import type { fsStorageSchema, s3StorageSchema, storageSchema } from '../../schemas'; +import type { fsStorageSchema, redisStorageSchema, s3StorageSchema, storageSchema } from '../../schemas'; export type FsStorage = z.infer; export type S3Storage = z.infer; +export type RedisStorage = z.infer; export type Storage = z.infer; From e68ba2331af9c737f840a8e08d00f14d850f98aa Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 12:40:00 +0300 Subject: [PATCH 03/12] refactor: extract reusable tile range and pyramid schemas Replace `tilesDeletionParamsBaseSchema` and its `sourceProvider` union with two composable pieces: `tileRangesSchema` (the ranges to delete) and `tilePyramidSchema` (`tilesPath` + `fileExtension`, meaningful only for path-based tile stores). The provider-specific unions move to the deletion scope, where they can be keyed on `storageProvider` alongside the other deletion params. --- src/schemas/core/tile.schema.ts | 18 ++++++------------ src/types/core/tile.type.ts | 3 +-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/schemas/core/tile.schema.ts b/src/schemas/core/tile.schema.ts index 3e46911..71fb588 100644 --- a/src/schemas/core/tile.schema.ts +++ b/src/schemas/core/tile.schema.ts @@ -1,5 +1,5 @@ import { z } from 'zod'; -import { MAX_ZOOM_LEVEL, SourceType, TileOutputFormat } from '../../constants'; +import { MAX_ZOOM_LEVEL, TileOutputFormat } from '../../constants/core/constants'; export const tileRangeSchema = z.object({ zoom: z.number().int().min(0).max(MAX_ZOOM_LEVEL), @@ -9,18 +9,12 @@ export const tileRangeSchema = z.object({ maxY: z.number().int().min(0), }); -export const tilesDeletionParamsBaseSchema = z.object({ - tilesPath: z.string().min(1), // Base path for the tiles to be deleted +export const tileRangesSchema = z.object({ ranges: z.array(tileRangeSchema).min(1), // Array of tile ranges to be deleted - fileExtension: z.literal(TileOutputFormat.PNG.toLowerCase()).or(z.literal(TileOutputFormat.JPEG.toLowerCase())), // File extension of the tiles (e.g., 'png', 'jpeg') -}); - -export const s3TilesDeletionParamsSchema = tilesDeletionParamsBaseSchema.extend({ - sourceProvider: z.literal(SourceType.S3), }); -export const fsTilesDeletionParamsSchema = tilesDeletionParamsBaseSchema.extend({ - sourceProvider: z.literal(SourceType.FS), +/** Fields that only make sense for path-based tile stores. */ +export const tilePyramidSchema = z.object({ + tilesPath: z.string().min(1), // Base path for the tiles to be deleted + fileExtension: z.literal(TileOutputFormat.PNG.toLowerCase()).or(z.literal(TileOutputFormat.JPEG.toLowerCase())), // e.g. 'png', 'jpeg' }); - -export const tilesDeletionParamsSchema = z.discriminatedUnion('sourceProvider', [s3TilesDeletionParamsSchema, fsTilesDeletionParamsSchema]); diff --git a/src/types/core/tile.type.ts b/src/types/core/tile.type.ts index 15570f7..7c833a6 100644 --- a/src/types/core/tile.type.ts +++ b/src/types/core/tile.type.ts @@ -1,5 +1,4 @@ import z from 'zod'; -import { tileRangeSchema, tilesDeletionParamsSchema } from '../../schemas/core/tile.schema'; +import { tileRangeSchema } from '../../schemas/core/tile.schema'; -export type TilesDeletionParams = z.infer; export type TileRange = z.infer; From 1bbf32a0d79cf786a24141acb0cbd48a399b4fd4 Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 12:40:09 +0300 Subject: [PATCH 04/12] feat: add cache deletion job and task types Add `DeletionJobTypes.Cache_Deletion` and `DeletionTaskTypes.CacheDeletion` ('cache-deletion') for wiping a layer's Redis-backed tile cache. --- src/constants/deletion/constants.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/constants/deletion/constants.ts b/src/constants/deletion/constants.ts index 67b29d3..ace0c9b 100644 --- a/src/constants/deletion/constants.ts +++ b/src/constants/deletion/constants.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ export const DeletionJobTypes = { Delete_Layer: 'Delete_Layer', + Cache_Deletion: 'Cache_Deletion', } as const; export type DeletionJobTypes = (typeof DeletionJobTypes)[keyof typeof DeletionJobTypes]; @@ -9,7 +10,7 @@ export const DeletionTaskTypes = { Delete: 'delete', LayerTilesDeletion: 'tiles-deletion', ArtifactsDeletion: 'artifacts-deletion', + CacheDeletion: 'cache-deletion', } as const; export type DeletionTaskTypes = (typeof DeletionTaskTypes)[keyof typeof DeletionTaskTypes]; -/* eslint-enable @typescript-eslint/naming-convention */ From 13a09ecbb68694705d7aa59aecec597bba79453e Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 12:40:21 +0300 Subject: [PATCH 05/12] feat: add provider-aware deletion task params schemas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consolidate the deletion task params on the `storageProvider` discriminator: - `tilesDeletionParamsSchema` — S3/FS/Redis. The FS member intentionally omits `subPath`, since tile deletion locates tiles by `tilesPath`. - `deleteStoredResourcesParamsSchema` — S3/FS/Redis. The Redis member is `.strict()`, rejecting `paths` outright: for a key-value store the prefix is the locator, so `paths` is meaningless rather than merely unused. - `redisCacheDeletionParamsSchema` — params of the single `cache-deletion` task. The two shapes are told apart structurally: `ranges` present means range-based deletion, `prefix` alone means a whole-layer wipe. Both members are `.strict()`, so at most one can ever match. Both Redis members accept an optional `delaySeconds` to wait out a mapproxy reload before deleting. --- src/schemas/deletion/task.schema.ts | 70 +++++++++++++++++++++++++++-- src/types/deletion/task.type.ts | 32 ++++++++++++- 2 files changed, 97 insertions(+), 5 deletions(-) diff --git a/src/schemas/deletion/task.schema.ts b/src/schemas/deletion/task.schema.ts index 27c89dc..5a29d23 100644 --- a/src/schemas/deletion/task.schema.ts +++ b/src/schemas/deletion/task.schema.ts @@ -1,6 +1,9 @@ import { z } from 'zod'; -import { storageSchema } from '../core'; +import { StorageProvider } from '../../constants/core/constants'; +import { fsStorageSchema, redisStorageSchema, s3StorageSchema } from '../core/storage.schema'; +import { tilePyramidSchema, tileRangesSchema } from '../core/tile.schema'; +//#region DeleteTaskParams export const deleteTaskParamsSchema = z .object({ deleteFromCatalog: z.boolean().default(false), @@ -9,11 +12,70 @@ export const deleteTaskParamsSchema = z deletePolygonParts: z.boolean().default(false), }) .describe('deleteTaskParamsSchema'); +//#endregion DeleteTaskParams -export const deleteStoredResourcesParamsBaseSchema = z.object({ +//#region TilesDeletionParams +export const s3TilesDeletionParamsSchema = s3StorageSchema.merge(tilePyramidSchema).merge(tileRangesSchema); + +// Unlike the other providers this does NOT extend fsStorageSchema: tile deletion +// locates tiles by `tilesPath`, not by the layer's `subPath`. +export const fsTilesDeletionParamsSchema = z + .object({ + storageProvider: z.literal(StorageProvider.FS), + }) + .merge(tilePyramidSchema) + .merge(tileRangesSchema); + +export const redisTilesDeletionParamsSchema = redisStorageSchema + .extend({ + delaySeconds: z.number().int().nonnegative().optional(), // Seconds to wait before deleting(mapproxy reload delay) + }) + .merge(tileRangesSchema) + .strict(); // Reject path-store fields outright: a prefix store has no tilesPath + +export const tilesDeletionParamsSchema = z.discriminatedUnion('storageProvider', [ + s3TilesDeletionParamsSchema, + fsTilesDeletionParamsSchema, + redisTilesDeletionParamsSchema, +]); +//#endregion TilesDeletionParams + +//#region DeleteStoredResourcesParams +/** Paths to delete recursively. Meaningful only for path-based stores. */ +export const resourcePathsSchema = z.object({ paths: z.array(z.string().min(1)).min(1), }); -export const deleteStoredResourcesParamsSchema = deleteStoredResourcesParamsBaseSchema - .and(storageSchema) +export const s3DeleteStoredResourcesParamsSchema = s3StorageSchema.merge(resourcePathsSchema); + +export const fsDeleteStoredResourcesParamsSchema = fsStorageSchema.merge(resourcePathsSchema); + +// The prefix IS the locator for a key-value store, so `paths` is meaningless here +// and is rejected outright rather than silently stripped. +export const redisDeleteStoredResourcesParamsSchema = redisStorageSchema + .extend({ + delaySeconds: z.number().int().nonnegative().optional(), // Seconds to wait before deleting + }) + .strict(); + +export const deleteStoredResourcesParamsSchema = z + .discriminatedUnion('storageProvider', [ + s3DeleteStoredResourcesParamsSchema, + fsDeleteStoredResourcesParamsSchema, + redisDeleteStoredResourcesParamsSchema, + ]) .describe('deleteStoredResourcesParamsSchema'); +//#endregion DeleteStoredResourcesParams + +//#region CacheDeletionParams +/** + * Params of the single `cache-deletion` task. The two shapes are told apart by their + * fields rather than by the task type: `ranges` present means range-based deletion, + * `prefix` alone means a whole-layer wipe. Both members are `.strict()`, so at most + * one can ever match — `ranges` is required on the first and rejected as an unknown + * key by the second. + */ +export const redisCacheDeletionParamsSchema = z + .union([redisTilesDeletionParamsSchema, redisDeleteStoredResourcesParamsSchema]) + .describe('redisCacheDeletionParamsSchema'); +//#endregion CacheDeletionParams diff --git a/src/types/deletion/task.type.ts b/src/types/deletion/task.type.ts index 0a1e256..afae38c 100644 --- a/src/types/deletion/task.type.ts +++ b/src/types/deletion/task.type.ts @@ -1,5 +1,35 @@ import z from 'zod'; -import { deleteTaskParamsSchema, deleteStoredResourcesParamsSchema } from '../../schemas/deletion/task.schema'; +import { + deleteStoredResourcesParamsSchema, + deleteTaskParamsSchema, + fsDeleteStoredResourcesParamsSchema, + fsTilesDeletionParamsSchema, + redisCacheDeletionParamsSchema, + redisDeleteStoredResourcesParamsSchema, + redisTilesDeletionParamsSchema, + s3DeleteStoredResourcesParamsSchema, + s3TilesDeletionParamsSchema, + tilesDeletionParamsSchema, +} from '../../schemas/deletion/task.schema'; +//#region DeleteTaskParams export type DeleteTaskParams = z.infer; +//#endregion DeleteTaskParams + +//#region TilesDeletionParams +export type TilesDeletionParams = z.infer; +export type S3TilesDeletionParams = z.infer; +export type FsTilesDeletionParams = z.infer; +export type RedisTilesDeletionParams = z.infer; +//#endregion TilesDeletionParams + +//#region DeleteStoredResourcesParams export type DeleteStoredResourcesParams = z.infer; +export type S3DeleteStoredResourcesParams = z.infer; +export type FsDeleteStoredResourcesParams = z.infer; +export type RedisDeleteStoredResourcesParams = z.infer; +//#endregion DeleteStoredResourcesParams + +//#region CacheDeletionParams +export type RedisCacheDeletionParams = z.infer; +//#endregion CacheDeletionParams From c7176675bf08cecaa5c4c052d8b7b54621df267e Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 13:56:54 +0300 Subject: [PATCH 06/12] feat: consolidate Redis deletion schemas for improved clarity and reusability --- src/schemas/deletion/task.schema.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/schemas/deletion/task.schema.ts b/src/schemas/deletion/task.schema.ts index 5a29d23..5ac7486 100644 --- a/src/schemas/deletion/task.schema.ts +++ b/src/schemas/deletion/task.schema.ts @@ -3,6 +3,14 @@ import { StorageProvider } from '../../constants/core/constants'; import { fsStorageSchema, redisStorageSchema, s3StorageSchema } from '../core/storage.schema'; import { tilePyramidSchema, tileRangesSchema } from '../core/tile.schema'; +/** + * Shared by every Redis deletion shape: the key prefix that locates the entries, plus an + * optional wait for a mapproxy reload to settle before the keys are removed. + */ +const redisDeletionBaseSchema = redisStorageSchema.extend({ + delaySeconds: z.number().int().nonnegative().optional(), +}); + //#region DeleteTaskParams export const deleteTaskParamsSchema = z .object({ @@ -26,12 +34,7 @@ export const fsTilesDeletionParamsSchema = z .merge(tilePyramidSchema) .merge(tileRangesSchema); -export const redisTilesDeletionParamsSchema = redisStorageSchema - .extend({ - delaySeconds: z.number().int().nonnegative().optional(), // Seconds to wait before deleting(mapproxy reload delay) - }) - .merge(tileRangesSchema) - .strict(); // Reject path-store fields outright: a prefix store has no tilesPath +export const redisTilesDeletionParamsSchema = redisDeletionBaseSchema.merge(tileRangesSchema).strict(); // Reject path-store fields outright: a prefix store has no tilesPath export const tilesDeletionParamsSchema = z.discriminatedUnion('storageProvider', [ s3TilesDeletionParamsSchema, @@ -52,11 +55,7 @@ export const fsDeleteStoredResourcesParamsSchema = fsStorageSchema.merge(resourc // The prefix IS the locator for a key-value store, so `paths` is meaningless here // and is rejected outright rather than silently stripped. -export const redisDeleteStoredResourcesParamsSchema = redisStorageSchema - .extend({ - delaySeconds: z.number().int().nonnegative().optional(), // Seconds to wait before deleting - }) - .strict(); +export const redisDeleteStoredResourcesParamsSchema = redisDeletionBaseSchema.strict(); export const deleteStoredResourcesParamsSchema = z .discriminatedUnion('storageProvider', [ From af050a9f5bdc9b12819f732dc3125ff39e3ae870 Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 14:10:29 +0300 Subject: [PATCH 07/12] refactor: improve formatting of tilesDeletionParamsSchema for consistency --- src/schemas/deletion/task.schema.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/schemas/deletion/task.schema.ts b/src/schemas/deletion/task.schema.ts index 5ac7486..592e2c8 100644 --- a/src/schemas/deletion/task.schema.ts +++ b/src/schemas/deletion/task.schema.ts @@ -36,11 +36,9 @@ export const fsTilesDeletionParamsSchema = z export const redisTilesDeletionParamsSchema = redisDeletionBaseSchema.merge(tileRangesSchema).strict(); // Reject path-store fields outright: a prefix store has no tilesPath -export const tilesDeletionParamsSchema = z.discriminatedUnion('storageProvider', [ - s3TilesDeletionParamsSchema, - fsTilesDeletionParamsSchema, - redisTilesDeletionParamsSchema, -]); +export const tilesDeletionParamsSchema = z + .discriminatedUnion('storageProvider', [s3TilesDeletionParamsSchema, fsTilesDeletionParamsSchema, redisTilesDeletionParamsSchema]) + .describe('tilesDeletionParamsSchema'); //#endregion TilesDeletionParams //#region DeleteStoredResourcesParams From b98f7e91438d2381ea27e8994481d6d00691e416 Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 14:30:48 +0300 Subject: [PATCH 08/12] feat: rename tilesPath to tilesRelativePath for clarity in tilePyramidSchema --- src/schemas/core/tile.schema.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/schemas/core/tile.schema.ts b/src/schemas/core/tile.schema.ts index 71fb588..f912c7b 100644 --- a/src/schemas/core/tile.schema.ts +++ b/src/schemas/core/tile.schema.ts @@ -14,7 +14,9 @@ export const tileRangesSchema = z.object({ }); /** Fields that only make sense for path-based tile stores. */ -export const tilePyramidSchema = z.object({ - tilesPath: z.string().min(1), // Base path for the tiles to be deleted +export const tilesInfoSchema = z.object({ + tilesRelativePath: z.string().min(1), // Base path for the tiles to be deleted fileExtension: z.literal(TileOutputFormat.PNG.toLowerCase()).or(z.literal(TileOutputFormat.JPEG.toLowerCase())), // e.g. 'png', 'jpeg' }); + +export const tilePyramidSchema = tileRangesSchema.merge(tilesInfoSchema).describe('tilePyramidSchema'); From cb1b27ff3a34baa9cdd67d2f34d6c378810cb5fe Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 14:30:57 +0300 Subject: [PATCH 09/12] feat: simplify tiles deletion schemas by removing unnecessary merges and comments --- src/schemas/deletion/task.schema.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/schemas/deletion/task.schema.ts b/src/schemas/deletion/task.schema.ts index 592e2c8..6b2f0a9 100644 --- a/src/schemas/deletion/task.schema.ts +++ b/src/schemas/deletion/task.schema.ts @@ -1,5 +1,4 @@ import { z } from 'zod'; -import { StorageProvider } from '../../constants/core/constants'; import { fsStorageSchema, redisStorageSchema, s3StorageSchema } from '../core/storage.schema'; import { tilePyramidSchema, tileRangesSchema } from '../core/tile.schema'; @@ -23,16 +22,9 @@ export const deleteTaskParamsSchema = z //#endregion DeleteTaskParams //#region TilesDeletionParams -export const s3TilesDeletionParamsSchema = s3StorageSchema.merge(tilePyramidSchema).merge(tileRangesSchema); +export const s3TilesDeletionParamsSchema = s3StorageSchema.merge(tilePyramidSchema); -// Unlike the other providers this does NOT extend fsStorageSchema: tile deletion -// locates tiles by `tilesPath`, not by the layer's `subPath`. -export const fsTilesDeletionParamsSchema = z - .object({ - storageProvider: z.literal(StorageProvider.FS), - }) - .merge(tilePyramidSchema) - .merge(tileRangesSchema); +export const fsTilesDeletionParamsSchema = fsStorageSchema.merge(tilePyramidSchema); export const redisTilesDeletionParamsSchema = redisDeletionBaseSchema.merge(tileRangesSchema).strict(); // Reject path-store fields outright: a prefix store has no tilesPath @@ -42,7 +34,7 @@ export const tilesDeletionParamsSchema = z //#endregion TilesDeletionParams //#region DeleteStoredResourcesParams -/** Paths to delete recursively. Meaningful only for path-based stores. */ +/** Paths to delete recursively. */ export const resourcePathsSchema = z.object({ paths: z.array(z.string().min(1)).min(1), }); From f0f85150f07a4a7a0eab91a930e744d6d6220e2d Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 15:27:25 +0300 Subject: [PATCH 10/12] feat: remove redisCacheDeletionParamsSchema and related types for simplification --- src/schemas/deletion/task.schema.ts | 13 ------------- src/types/deletion/task.type.ts | 4 ---- 2 files changed, 17 deletions(-) diff --git a/src/schemas/deletion/task.schema.ts b/src/schemas/deletion/task.schema.ts index 6b2f0a9..f8bf01b 100644 --- a/src/schemas/deletion/task.schema.ts +++ b/src/schemas/deletion/task.schema.ts @@ -55,16 +55,3 @@ export const deleteStoredResourcesParamsSchema = z ]) .describe('deleteStoredResourcesParamsSchema'); //#endregion DeleteStoredResourcesParams - -//#region CacheDeletionParams -/** - * Params of the single `cache-deletion` task. The two shapes are told apart by their - * fields rather than by the task type: `ranges` present means range-based deletion, - * `prefix` alone means a whole-layer wipe. Both members are `.strict()`, so at most - * one can ever match — `ranges` is required on the first and rejected as an unknown - * key by the second. - */ -export const redisCacheDeletionParamsSchema = z - .union([redisTilesDeletionParamsSchema, redisDeleteStoredResourcesParamsSchema]) - .describe('redisCacheDeletionParamsSchema'); -//#endregion CacheDeletionParams diff --git a/src/types/deletion/task.type.ts b/src/types/deletion/task.type.ts index afae38c..5dc3506 100644 --- a/src/types/deletion/task.type.ts +++ b/src/types/deletion/task.type.ts @@ -29,7 +29,3 @@ export type S3DeleteStoredResourcesParams = z.infer; export type RedisDeleteStoredResourcesParams = z.infer; //#endregion DeleteStoredResourcesParams - -//#region CacheDeletionParams -export type RedisCacheDeletionParams = z.infer; -//#endregion CacheDeletionParams From 6ec8f778b7059db9adb93b46c97aeaa6baa7499b Mon Sep 17 00:00:00 2001 From: almog8k Date: Mon, 3 Aug 2026 15:29:49 +0300 Subject: [PATCH 11/12] feat: remove redisCacheDeletionParamsSchema for simplification --- src/types/deletion/task.type.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/types/deletion/task.type.ts b/src/types/deletion/task.type.ts index 5dc3506..a803893 100644 --- a/src/types/deletion/task.type.ts +++ b/src/types/deletion/task.type.ts @@ -4,7 +4,6 @@ import { deleteTaskParamsSchema, fsDeleteStoredResourcesParamsSchema, fsTilesDeletionParamsSchema, - redisCacheDeletionParamsSchema, redisDeleteStoredResourcesParamsSchema, redisTilesDeletionParamsSchema, s3DeleteStoredResourcesParamsSchema, From 1f5a3b8bec6a350387b0584051267f985eaf20e2 Mon Sep 17 00:00:00 2001 From: almog8k Date: Tue, 4 Aug 2026 14:32:22 +0300 Subject: [PATCH 12/12] feat: add upload_package job to pack and upload npm package to Azure storage --- .github/workflows/pull-request.yaml | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index b4c3341..d31b3a3 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -51,3 +51,40 @@ jobs: with: name: Test Reporters ${{ matrix.node }} path: ./reports/** + + upload_package: + needs: [eslint, tests] + continue-on-error: true + runs-on: ubuntu-latest + steps: + - name: Check out TS Project Git repository + uses: actions/checkout@v6 + - name: Init nodejs + uses: ./.github/actions/init-npm + + - name: Pack the package + run: npm pack + - name: get properties + id: json_properties + uses: ActionsTools/read-json-action@main + with: + file_path: 'package.json' + - uses: azure/CLI@v2 + with: + inlineScript: | + az storage blob upload --name raster-shared-${{ github.sha }}.tgz --account-name ghatmpstorage --container-name=npm-packages --file map-colonies-raster-shared-${{steps.json_properties.outputs.version}}.tgz --sas-token "${{ secrets.SAS_TOKEN }}" + - name: Comment on PR + uses: thollander/actions-comment-pull-request@v3 + with: + message: | + Hi it is me, your friendly bot helper! :wave: + I've packed this commit for you :blush: + You can install it like this: + ```json + { + "dependencies": { + "@map-colonies/raster-shared": "https://ghatmpstorage.blob.core.windows.net/npm-packages/raster-shared-${{ github.sha }}.tgz" + } + } + ``` + The link will expire in a week :hourglass: \ No newline at end of file