From 6fd425ac7137a7d96689f1440958d322b735e6bc Mon Sep 17 00:00:00 2001 From: almog8k <60139576+almog8k@users.noreply.github.com> Date: Mon, 3 Aug 2026 16:36:12 +0300 Subject: [PATCH 1/5] chore: release 8.3.0 (#219) Co-authored-by: Nitzan Morr Co-authored-by: Shimon Cohen <33935191+shimoncohen@users.noreply.github.com> Co-authored-by: Copilot Co-authored-by: RonitKissis Co-authored-by: vitaligi <54726763+vitaligi@users.noreply.github.com> Co-authored-by: mapcolonies-devops <143094402+mapcolonies-devops@users.noreply.github.com> Co-authored-by: razbroc <77406876+razbroc@users.noreply.github.com> Co-authored-by: Roi Cohen <213414225+roicohen326@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 +++++++++----- package-lock.json | 4 ++-- package.json | 2 +- src/constants/deletion/constants.ts | 15 +++++++++++++++ src/constants/deletion/index.ts | 1 + src/constants/index.ts | 1 + src/openapi/core/layerMetadata.yaml | 3 +++ src/schemas/core/index.ts | 1 + src/schemas/core/storage.schema.ts | 14 ++++++++++++++ src/schemas/deletion/index.ts | 2 ++ src/schemas/deletion/job.schema.ts | 7 +++++++ src/schemas/deletion/task.schema.ts | 19 +++++++++++++++++++ src/schemas/index.ts | 1 + src/schemas/ingestion/metadata.schema.ts | 1 + src/types/core/index.ts | 1 + src/types/core/metadata.type.ts | 1 + src/types/core/storage.type.ts | 6 ++++++ src/types/deletion/index.ts | 2 ++ src/types/deletion/job.type.ts | 4 ++++ src/types/deletion/task.type.ts | 5 +++++ src/types/index.ts | 1 + 22 files changed, 98 insertions(+), 9 deletions(-) create mode 100644 src/constants/deletion/constants.ts create mode 100644 src/constants/deletion/index.ts create mode 100644 src/schemas/core/storage.schema.ts create mode 100644 src/schemas/deletion/index.ts create mode 100644 src/schemas/deletion/job.schema.ts create mode 100644 src/schemas/deletion/task.schema.ts create mode 100644 src/types/core/storage.type.ts create mode 100644 src/types/deletion/index.ts create mode 100644 src/types/deletion/job.type.ts create mode 100644 src/types/deletion/task.type.ts diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 529b133..12950c1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "8.1.0" + ".": "8.3.0-alpha.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 61f21d0..2810f35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,17 +2,21 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. -## [8.1.0](https://github.com/MapColonies/raster-shared/compare/v7.10.2...v8.1.0) (2026-05-18) +## [8.3.0-alpha.2](https://github.com/MapColonies/raster-shared/compare/v8.3.0-alpha.1...v8.3.0-alpha.2) (2026-07-27) ### Features -* add optional errors summary to ingestion validation schema ([#180](https://github.com/MapColonies/raster-shared/issues/180)) ([5b6f644](https://github.com/MapColonies/raster-shared/commit/5b6f644d0ff2cc7fff26ee6e26f5337b0e1eeb56)) -* added raster shared types and values for lower resolution feature support ([#203](https://github.com/MapColonies/raster-shared/issues/203)) ([04090f0](https://github.com/MapColonies/raster-shared/commit/04090f012c2116b3de687ec5e84ecb5900cee4c3)) +* add subpath field to fsStorageSchema ([#216](https://github.com/MapColonies/raster-shared/issues/216)) ([c832749](https://github.com/MapColonies/raster-shared/commit/c832749354c6e4b73fc3cc22cf3584e0ee5daec3)) + +## [8.3.0-alpha.1](https://github.com/MapColonies/raster-shared/compare/v8.3.0-alpha.0...v8.3.0-alpha.1) (2026-07-07) -* release 8.1.0 ([0eb47c3](https://github.com/MapColonies/raster-shared/commit/0eb47c348d4a79d9b4234900b1548d5a9c4e2e2c)) -* update release version to 8.1.0 ([#205](https://github.com/MapColonies/raster-shared/issues/205)) ([3b60a4f](https://github.com/MapColonies/raster-shared/commit/3b60a4fa326add0b9ce70ca1af0a0e2d19f86ba8)) +### Features + +* add keywords field to base raster layer metadata schema (MAPCO-8284) ([#208](https://github.com/MapColonies/raster-shared/issues/208)) ([74cd66c](https://github.com/MapColonies/raster-shared/commit/74cd66c9ea23e6e1b57615dd70288e5cf38f79bf)) +* add layer deletion schemas, types and constants (MAPCO-7285) ([#210](https://github.com/MapColonies/raster-shared/issues/210)) ([8d50c52](https://github.com/MapColonies/raster-shared/commit/8d50c52d45a0012b00ccfaca4381e3e5bfdf51e2)) +* handle resource deletion ([#213](https://github.com/MapColonies/raster-shared/issues/213)) ([0249907](https://github.com/MapColonies/raster-shared/commit/0249907f87803ae1b1c8b274d66506d7d6fc3474)) ## [8.1.0-alpha.3](https://github.com/MapColonies/raster-shared/compare/v8.1.0-alpha.2...v8.1.0-alpha.3) (2026-05-05) diff --git a/package-lock.json b/package-lock.json index 3f6485e..9e07fee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@map-colonies/raster-shared", - "version": "8.1.0", + "version": "8.3.0-alpha.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@map-colonies/raster-shared", - "version": "8.1.0", + "version": "8.3.0-alpha.2", "license": "ISC", "dependencies": { "@map-colonies/mc-priority-queue": "^9.1.0", diff --git a/package.json b/package.json index d69032f..0b5d2a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@map-colonies/raster-shared", - "version": "8.2.0", + "version": "8.3.0-alpha.2", "description": "This is template for map colonies typescript packages", "main": "./dist/index.js", "exports": { diff --git a/src/constants/deletion/constants.ts b/src/constants/deletion/constants.ts new file mode 100644 index 0000000..67b29d3 --- /dev/null +++ b/src/constants/deletion/constants.ts @@ -0,0 +1,15 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +export const DeletionJobTypes = { + Delete_Layer: 'Delete_Layer', +} as const; + +export type DeletionJobTypes = (typeof DeletionJobTypes)[keyof typeof DeletionJobTypes]; + +export const DeletionTaskTypes = { + Delete: 'delete', + LayerTilesDeletion: 'tiles-deletion', + ArtifactsDeletion: 'artifacts-deletion', +} as const; + +export type DeletionTaskTypes = (typeof DeletionTaskTypes)[keyof typeof DeletionTaskTypes]; +/* eslint-enable @typescript-eslint/naming-convention */ diff --git a/src/constants/deletion/index.ts b/src/constants/deletion/index.ts new file mode 100644 index 0000000..c94f80f --- /dev/null +++ b/src/constants/deletion/index.ts @@ -0,0 +1 @@ +export * from './constants'; diff --git a/src/constants/index.ts b/src/constants/index.ts index 88e754e..73ddaf1 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1,3 +1,4 @@ export * from './core'; export * from './ingestion'; export * from './export'; +export * from './deletion'; diff --git a/src/openapi/core/layerMetadata.yaml b/src/openapi/core/layerMetadata.yaml index e11293b..aef8ad8 100644 --- a/src/openapi/core/layerMetadata.yaml +++ b/src/openapi/core/layerMetadata.yaml @@ -15,6 +15,9 @@ components: Description: type: string description: Layer's description + Keywords: + type: string + description: Layer's keywords Footprint: type: object oneOf: diff --git a/src/schemas/core/index.ts b/src/schemas/core/index.ts index 6438621..ee5ad72 100644 --- a/src/schemas/core/index.ts +++ b/src/schemas/core/index.ts @@ -8,3 +8,4 @@ export * from './link.schema'; export * from './file.schema'; export * from './polygonParts.schema'; export * from './tile.schema'; +export * from './storage.schema'; diff --git a/src/schemas/core/storage.schema.ts b/src/schemas/core/storage.schema.ts new file mode 100644 index 0000000..0b45ff1 --- /dev/null +++ b/src/schemas/core/storage.schema.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { SourceType } from '../../constants/core/constants'; + +export const fsStorageSchema = z.object({ + storageProvider: z.literal(SourceType.FS), + subPath: z.string().min(1), +}); + +export const s3StorageSchema = z.object({ + storageProvider: z.literal(SourceType.S3), + bucket: z.string().min(1), +}); + +export const storageSchema = z.discriminatedUnion('storageProvider', [fsStorageSchema, s3StorageSchema]); diff --git a/src/schemas/deletion/index.ts b/src/schemas/deletion/index.ts new file mode 100644 index 0000000..5e69007 --- /dev/null +++ b/src/schemas/deletion/index.ts @@ -0,0 +1,2 @@ +export * from './task.schema'; +export * from './job.schema'; diff --git a/src/schemas/deletion/job.schema.ts b/src/schemas/deletion/job.schema.ts new file mode 100644 index 0000000..59a74b8 --- /dev/null +++ b/src/schemas/deletion/job.schema.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const deleteLayerJobParamsSchema = z + .object({ + approver: z.string(), + }) + .describe('deleteLayerJobParamsSchema'); diff --git a/src/schemas/deletion/task.schema.ts b/src/schemas/deletion/task.schema.ts new file mode 100644 index 0000000..27c89dc --- /dev/null +++ b/src/schemas/deletion/task.schema.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { storageSchema } from '../core'; + +export const deleteTaskParamsSchema = z + .object({ + deleteFromCatalog: z.boolean().default(false), + deleteFromMapproxy: z.boolean().default(false), + deleteFromGeoserver: z.boolean().default(false), + deletePolygonParts: z.boolean().default(false), + }) + .describe('deleteTaskParamsSchema'); + +export const deleteStoredResourcesParamsBaseSchema = z.object({ + paths: z.array(z.string().min(1)).min(1), +}); + +export const deleteStoredResourcesParamsSchema = deleteStoredResourcesParamsBaseSchema + .and(storageSchema) + .describe('deleteStoredResourcesParamsSchema'); diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 88e754e..73ddaf1 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,3 +1,4 @@ export * from './core'; export * from './ingestion'; export * from './export'; +export * from './deletion'; diff --git a/src/schemas/ingestion/metadata.schema.ts b/src/schemas/ingestion/metadata.schema.ts index deae894..ffd92a8 100644 --- a/src/schemas/ingestion/metadata.schema.ts +++ b/src/schemas/ingestion/metadata.schema.ts @@ -9,6 +9,7 @@ export const baseRasterLayerMetadataSchema = z classification: z .string() .regex(new RegExp(INGESTION_VALIDATIONS.classification.pattern), { message: 'Classification value must be between 0 and 100' }), + keywords: z.string().optional(), }) .describe('baseRasterLayerMetadataSchema'); diff --git a/src/types/core/index.ts b/src/types/core/index.ts index b27df06..53328de 100644 --- a/src/types/core/index.ts +++ b/src/types/core/index.ts @@ -8,3 +8,4 @@ export * from './file.type'; export * from './callback.type'; export * from './polygonParts.type'; export * from './tile.type'; +export * from './storage.type'; diff --git a/src/types/core/metadata.type.ts b/src/types/core/metadata.type.ts index b7b8e64..665b775 100644 --- a/src/types/core/metadata.type.ts +++ b/src/types/core/metadata.type.ts @@ -24,6 +24,7 @@ export type RasterLayerMetadata = { minResolutionMeter: number; productSubType?: string; productBoundingBox?: string; + keywords?: string; displayPath: string; transparency: Transparency; tileMimeFormat: TilesMimeFormat; diff --git a/src/types/core/storage.type.ts b/src/types/core/storage.type.ts new file mode 100644 index 0000000..ebb6bb6 --- /dev/null +++ b/src/types/core/storage.type.ts @@ -0,0 +1,6 @@ +import type { z } from 'zod'; +import type { fsStorageSchema, s3StorageSchema, storageSchema } from '../../schemas'; + +export type FsStorage = z.infer; +export type S3Storage = z.infer; +export type Storage = z.infer; diff --git a/src/types/deletion/index.ts b/src/types/deletion/index.ts new file mode 100644 index 0000000..164369b --- /dev/null +++ b/src/types/deletion/index.ts @@ -0,0 +1,2 @@ +export * from './task.type'; +export * from './job.type'; diff --git a/src/types/deletion/job.type.ts b/src/types/deletion/job.type.ts new file mode 100644 index 0000000..e4f67e4 --- /dev/null +++ b/src/types/deletion/job.type.ts @@ -0,0 +1,4 @@ +import z from 'zod'; +import { deleteLayerJobParamsSchema } from '../../schemas/deletion/job.schema'; + +export type DeleteLayerJobParams = z.infer; diff --git a/src/types/deletion/task.type.ts b/src/types/deletion/task.type.ts new file mode 100644 index 0000000..0a1e256 --- /dev/null +++ b/src/types/deletion/task.type.ts @@ -0,0 +1,5 @@ +import z from 'zod'; +import { deleteTaskParamsSchema, deleteStoredResourcesParamsSchema } from '../../schemas/deletion/task.schema'; + +export type DeleteTaskParams = z.infer; +export type DeleteStoredResourcesParams = z.infer; diff --git a/src/types/index.ts b/src/types/index.ts index 88e754e..73ddaf1 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,3 +1,4 @@ export * from './core'; export * from './ingestion'; export * from './export'; +export * from './deletion'; From 49cfe190aedbf5db7d0e218b3cfa2ebc6bcdcad9 Mon Sep 17 00:00:00 2001 From: almog8k <60139576+almog8k@users.noreply.github.com> Date: Mon, 3 Aug 2026 16:57:38 +0300 Subject: [PATCH 2/5] chore: release 8.3.0 (#220) --- .release-please-manifest.json | 2 +- CHANGELOG.md | 10 ++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 12950c1..8d48393 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "8.3.0-alpha.2" + ".": "8.3.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2810f35..8bdb4d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [8.3.0](https://github.com/MapColonies/raster-shared/compare/v8.2.0...v8.3.0) (2026-08-03) + + +### Features + +* add keywords field to base raster layer metadata schema (MAPCO-8284) ([#208](https://github.com/MapColonies/raster-shared/issues/208)) ([74cd66c](https://github.com/MapColonies/raster-shared/commit/74cd66c9ea23e6e1b57615dd70288e5cf38f79bf)) +* add layer deletion schemas, types and constants (MAPCO-7285) ([#210](https://github.com/MapColonies/raster-shared/issues/210)) ([8d50c52](https://github.com/MapColonies/raster-shared/commit/8d50c52d45a0012b00ccfaca4381e3e5bfdf51e2)) +* add subpath field to fsStorageSchema ([#216](https://github.com/MapColonies/raster-shared/issues/216)) ([c832749](https://github.com/MapColonies/raster-shared/commit/c832749354c6e4b73fc3cc22cf3584e0ee5daec3)) +* handle resource deletion ([#213](https://github.com/MapColonies/raster-shared/issues/213)) ([0249907](https://github.com/MapColonies/raster-shared/commit/0249907f87803ae1b1c8b274d66506d7d6fc3474)) + ## [8.3.0-alpha.2](https://github.com/MapColonies/raster-shared/compare/v8.3.0-alpha.1...v8.3.0-alpha.2) (2026-07-27) diff --git a/package-lock.json b/package-lock.json index 9e07fee..56c69d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@map-colonies/raster-shared", - "version": "8.3.0-alpha.2", + "version": "8.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@map-colonies/raster-shared", - "version": "8.3.0-alpha.2", + "version": "8.3.0", "license": "ISC", "dependencies": { "@map-colonies/mc-priority-queue": "^9.1.0", diff --git a/package.json b/package.json index 0b5d2a1..0384f4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@map-colonies/raster-shared", - "version": "8.3.0-alpha.2", + "version": "8.3.0", "description": "This is template for map colonies typescript packages", "main": "./dist/index.js", "exports": { From 60a4c7c1b8367ac54b8a76f22d8138e66dcd3904 Mon Sep 17 00:00:00 2001 From: almog8k <60139576+almog8k@users.noreply.github.com> Date: Wed, 23 Sep 2026 14:45:28 +0300 Subject: [PATCH 3/5] feat!: release 9.0.0 (#228) Co-authored-by: Nitzan Morr Co-authored-by: Shimon Cohen <33935191+shimoncohen@users.noreply.github.com> Co-authored-by: Copilot Co-authored-by: RonitKissis Co-authored-by: vitaligi <54726763+vitaligi@users.noreply.github.com> Co-authored-by: mapcolonies-devops <143094402+mapcolonies-devops@users.noreply.github.com> Co-authored-by: razbroc <77406876+razbroc@users.noreply.github.com> Co-authored-by: Roi Cohen <213414225+roicohen326@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 --- .github/workflows/pull-request.yaml | 41 +++++++++++++++++++++++---- src/constants/core/constants.ts | 11 ++++++++ src/constants/deletion/constants.ts | 3 +- src/constants/export/constants.ts | 2 +- src/schemas/core/storage.schema.ts | 36 +++++++++++++++++------ src/schemas/core/tile.schema.ts | 18 +++++------- src/schemas/deletion/job.schema.ts | 9 ++++++ src/schemas/deletion/task.schema.ts | 44 ++++++++++++++++++++++++++--- src/types/core/storage.type.ts | 3 +- src/types/core/tile.type.ts | 3 +- src/types/deletion/job.type.ts | 4 ++- src/types/deletion/task.type.ts | 27 +++++++++++++++++- 12 files changed, 166 insertions(+), 35 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index b4c3341..79cafbc 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -14,12 +14,10 @@ jobs: steps: - name: Check out TS Project Git repository uses: actions/checkout@v4 - - name: Init nodejs uses: ./.github/actions/init-npm with: node-version: ${{ matrix.node }} - - name: Run TS Project linters uses: wearerequired/lint-action@v2 with: @@ -40,14 +38,47 @@ jobs: steps: - name: Check out TS Project Git repository uses: actions/checkout@v4 - - name: Init nodejs uses: ./.github/actions/init-npm - - name: Run tests run: npm run test - - uses: actions/upload-artifact@v4 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: diff --git a/src/constants/core/constants.ts b/src/constants/core/constants.ts index e0296c1..2d32804 100644 --- a/src/constants/core/constants.ts +++ b/src/constants/core/constants.ts @@ -18,6 +18,8 @@ export const RasterProductTypes = pickEnum(ProductType, [ 'RASTER_VECTOR_BEST', ]); +export const GEODETIC_GRIDS: readonly string[] = ['WorldCRS84']; + export type RasterProductTypes = (typeof RasterProductTypes)[keyof typeof RasterProductTypes]; export const RASTER_PRODUCT_TYPE_LIST = Object.values(RasterProductTypes); @@ -67,6 +69,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/constants/deletion/constants.ts b/src/constants/deletion/constants.ts index 67b29d3..23e6f1b 100644 --- a/src/constants/deletion/constants.ts +++ b/src/constants/deletion/constants.ts @@ -1,6 +1,8 @@ /* eslint-disable @typescript-eslint/naming-convention */ export const DeletionJobTypes = { Delete_Layer: 'Delete_Layer', + Swap_Delete_Cache: 'Swap_Delete_Cache', + Update_Delete_Cache: 'Update_Delete_Cache', } as const; export type DeletionJobTypes = (typeof DeletionJobTypes)[keyof typeof DeletionJobTypes]; @@ -12,4 +14,3 @@ export const DeletionTaskTypes = { } as const; export type DeletionTaskTypes = (typeof DeletionTaskTypes)[keyof typeof DeletionTaskTypes]; -/* eslint-enable @typescript-eslint/naming-convention */ 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']); 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/schemas/core/tile.schema.ts b/src/schemas/core/tile.schema.ts index 3e46911..f912c7b 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,14 @@ 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), +/** Fields that only make sense for path-based tile stores. */ +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 fsTilesDeletionParamsSchema = tilesDeletionParamsBaseSchema.extend({ - sourceProvider: z.literal(SourceType.FS), -}); - -export const tilesDeletionParamsSchema = z.discriminatedUnion('sourceProvider', [s3TilesDeletionParamsSchema, fsTilesDeletionParamsSchema]); +export const tilePyramidSchema = tileRangesSchema.merge(tilesInfoSchema).describe('tilePyramidSchema'); diff --git a/src/schemas/deletion/job.schema.ts b/src/schemas/deletion/job.schema.ts index 59a74b8..e6351e2 100644 --- a/src/schemas/deletion/job.schema.ts +++ b/src/schemas/deletion/job.schema.ts @@ -5,3 +5,12 @@ export const deleteLayerJobParamsSchema = z approver: z.string(), }) .describe('deleteLayerJobParamsSchema'); + +//#region CacheDeletionJobParams +export const cacheDeletionJobParamsSchema = z + .object({ + ingestionJobId: z.string().uuid(), + tasksCreationCompleted: z.boolean(), + }) + .describe('cacheDeletionJobParamsSchema'); +//#endregion CacheDeletionJobParams diff --git a/src/schemas/deletion/task.schema.ts b/src/schemas/deletion/task.schema.ts index 27c89dc..9fdc2d1 100644 --- a/src/schemas/deletion/task.schema.ts +++ b/src/schemas/deletion/task.schema.ts @@ -1,6 +1,16 @@ import { z } from 'zod'; -import { storageSchema } from '../core'; +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({ deleteFromCatalog: z.boolean().default(false), @@ -9,11 +19,37 @@ export const deleteTaskParamsSchema = z deletePolygonParts: z.boolean().default(false), }) .describe('deleteTaskParamsSchema'); +//#endregion DeleteTaskParams + +//#region TilesDeletionParams +export const s3TilesDeletionParamsSchema = s3StorageSchema.merge(tilePyramidSchema).strict(); + +export const fsTilesDeletionParamsSchema = fsStorageSchema.merge(tilePyramidSchema).strict(); + +export const redisTilesDeletionParamsSchema = redisDeletionBaseSchema.merge(tileRangesSchema).strict(); -export const deleteStoredResourcesParamsBaseSchema = z.object({ +export const tilesDeletionParamsSchema = z + .discriminatedUnion('storageProvider', [s3TilesDeletionParamsSchema, fsTilesDeletionParamsSchema, redisTilesDeletionParamsSchema]) + .describe('tilesDeletionParamsSchema'); +//#endregion TilesDeletionParams + +//#region DeleteStoredResourcesParams +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. +export const redisDeleteStoredResourcesParamsSchema = redisDeletionBaseSchema.strict(); + +export const deleteStoredResourcesParamsSchema = z + .discriminatedUnion('storageProvider', [ + s3DeleteStoredResourcesParamsSchema, + fsDeleteStoredResourcesParamsSchema, + redisDeleteStoredResourcesParamsSchema, + ]) .describe('deleteStoredResourcesParamsSchema'); +//#endregion DeleteStoredResourcesParams 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; 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; diff --git a/src/types/deletion/job.type.ts b/src/types/deletion/job.type.ts index e4f67e4..01572b4 100644 --- a/src/types/deletion/job.type.ts +++ b/src/types/deletion/job.type.ts @@ -1,4 +1,6 @@ import z from 'zod'; -import { deleteLayerJobParamsSchema } from '../../schemas/deletion/job.schema'; +import { cacheDeletionJobParamsSchema, deleteLayerJobParamsSchema } from '../../schemas/deletion/job.schema'; export type DeleteLayerJobParams = z.infer; + +export type CacheDeletionJobParams = z.infer; diff --git a/src/types/deletion/task.type.ts b/src/types/deletion/task.type.ts index 0a1e256..a803893 100644 --- a/src/types/deletion/task.type.ts +++ b/src/types/deletion/task.type.ts @@ -1,5 +1,30 @@ import z from 'zod'; -import { deleteTaskParamsSchema, deleteStoredResourcesParamsSchema } from '../../schemas/deletion/task.schema'; +import { + deleteStoredResourcesParamsSchema, + deleteTaskParamsSchema, + fsDeleteStoredResourcesParamsSchema, + fsTilesDeletionParamsSchema, + 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 From ec2dc7152af84abbb78b53b6c1ba344ced7468b5 Mon Sep 17 00:00:00 2001 From: almog8k <60139576+almog8k@users.noreply.github.com> Date: Wed, 23 Sep 2026 14:57:16 +0300 Subject: [PATCH 4/5] ci: add root package to release-please config (#229) --- release-please-config.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/release-please-config.json b/release-please-config.json index 1546977..7ca5450 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,6 +1,10 @@ { "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", - "release-type": "node", - "include-component-in-tag": false, - "include-v-in-tag": true + "packages": { + ".": { + "release-type": "node", + "include-component-in-tag": false, + "include-v-in-tag": true + } + } } From a59e5fc7873b21ce682fe86bc224d4c3c031a174 Mon Sep 17 00:00:00 2001 From: mapcolonies-devops <143094402+mapcolonies-devops@users.noreply.github.com> Date: Wed, 23 Sep 2026 15:22:46 +0300 Subject: [PATCH 5/5] chore(master): release 9.0.0 (#181) --- .release-please-manifest.json | 2 +- CHANGELOG.md | 11 +++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8d48393..9285669 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "8.3.0" + ".": "9.0.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bdb4d4..95eac1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [9.0.0](https://github.com/MapColonies/raster-shared/compare/v8.3.0...v9.0.0) (2026-09-23) + + +### ⚠ BREAKING CHANGES + +* release 9.0.0 ([#228](https://github.com/MapColonies/raster-shared/issues/228)) + +### Features + +* release 9.0.0 ([#228](https://github.com/MapColonies/raster-shared/issues/228)) ([60a4c7c](https://github.com/MapColonies/raster-shared/commit/60a4c7c1b8367ac54b8a76f22d8138e66dcd3904)) + ## [8.3.0](https://github.com/MapColonies/raster-shared/compare/v8.2.0...v8.3.0) (2026-08-03) diff --git a/package-lock.json b/package-lock.json index 56c69d7..a35e627 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@map-colonies/raster-shared", - "version": "8.3.0", + "version": "9.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@map-colonies/raster-shared", - "version": "8.3.0", + "version": "9.0.0", "license": "ISC", "dependencies": { "@map-colonies/mc-priority-queue": "^9.1.0", diff --git a/package.json b/package.json index 0384f4f..a7cd55d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@map-colonies/raster-shared", - "version": "8.3.0", + "version": "9.0.0", "description": "This is template for map colonies typescript packages", "main": "./dist/index.js", "exports": {