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';