Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b72678f
fix: package json version
nitzanmorr Apr 19, 2026
4f6ef36
feat: add resolution threshold check to thresholds schema
nitzanmorr Apr 19, 2026
e726f0d
fix: bump version
nitzanmorr Apr 19, 2026
2587722
refactor!: change polygon part validation error to new format (MAPCO-…
shimoncohen Apr 26, 2026
61e08f4
feat: update package
RonitKissis Apr 26, 2026
af9d32b
refactor: add ingestion job types schema and update polygon parts sch…
vitaligi Apr 27, 2026
908bcfd
refactor: set release-please initial version (#185)
vitaligi Apr 29, 2026
3769756
refactor: set release-please initial version (#186)
vitaligi Apr 29, 2026
19b49ff
chore(alpha): release 8.0.0-alpha.0 (#182)
mapcolonies-devops Apr 30, 2026
f92cfb6
ci: adjust publish for alpha release (#187)
vitaligi Apr 30, 2026
5ec4eb5
ci: adjust publish for alpha release (#188)
vitaligi Apr 30, 2026
b5c342d
ci: adjust publish for alpha release (#189)
vitaligi Apr 30, 2026
8ee3e0f
ci: adjust publish for alpha release (#190)
vitaligi Apr 30, 2026
c87c428
feat: add tile deletion schemas and types, refactor source type (#191)
almog8k May 4, 2026
8aee6a9
chore(alpha): release 8.1.0-alpha.0 (#192)
mapcolonies-devops May 4, 2026
440f0c5
feat: add polygon parts schema and types for intersection api (#193)
vitaligi May 5, 2026
7ea1733
ci: modify release-please (#195)
vitaligi May 5, 2026
7140755
chore(alpha): release 8.1.0-alpha.1 (#194)
mapcolonies-devops May 5, 2026
772d90b
ci: correct version reference for prerelease publishing in workflow (…
vitaligi May 5, 2026
921db4d
feat: add tile schema and type exports to core index files (#197)
almog8k May 5, 2026
25785df
chore(alpha): release 8.1.0-alpha.2 (#198)
mapcolonies-devops May 5, 2026
383ac19
fix: simplify file extension handling in tilesDeletionParamsBaseSchem…
almog8k May 5, 2026
b8901f9
chore(alpha): release 8.1.0-alpha.3 (#200)
mapcolonies-devops May 5, 2026
be9953e
fix: update productId pattern (#201)
vitaligi May 18, 2026
860c53b
chore: merge master into alpha (keep alpha version)
almog8k Jun 25, 2026
191b61e
chore: set alpha version to 8.3.0-alpha.0 for layerDeletion epic
almog8k Jun 25, 2026
8d50c52
feat: add layer deletion schemas, types and constants (MAPCO-7285) (#…
almog8k Jun 29, 2026
74cd66c
feat: add keywords field to base raster layer metadata schema (MAPCO-…
roicohen326 Jun 30, 2026
0249907
feat: handle resource deletion (#213)
vitaligi Jul 7, 2026
55a5359
chore(alpha): release 8.3.0-alpha.1 (#215)
mapcolonies-devops Jul 7, 2026
c832749
feat: add subpath field to fsStorageSchema (#216)
almog8k Jul 27, 2026
3ef1047
chore(alpha): release 8.3.0-alpha.2 (#217)
mapcolonies-devops Jul 27, 2026
c0f972a
feat!: consolidate storage schemas and add Redis provider (MAPCO-1126…
almog8k Aug 6, 2026
1a09e56
chore(alpha): release 9.0.0-alpha.0 (#221)
mapcolonies-devops Aug 6, 2026
5395ed7
feat: support cache deletion parameters for swap and update (#223)
razbroc Sep 3, 2026
ecf0ba6
chore(alpha): release 9.0.0-alpha.1 (#224)
mapcolonies-devops Sep 3, 2026
720c24f
feat: add cache-deletion job params schema (MAPCO-11779) (#225)
almog8k Sep 23, 2026
16c3d96
chore(alpha): release 9.0.0-alpha.2 (#226)
mapcolonies-devops Sep 23, 2026
4a0ecba
Merge remote-tracking branch origin/master into release/9.0.0
almog8k Sep 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 36 additions & 5 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
11 changes: 11 additions & 0 deletions src/constants/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion src/constants/deletion/constants.ts
Original file line number Diff line number Diff line change
@@ -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];
Expand All @@ -12,4 +14,3 @@ export const DeletionTaskTypes = {
} as const;

export type DeletionTaskTypes = (typeof DeletionTaskTypes)[keyof typeof DeletionTaskTypes];
/* eslint-enable @typescript-eslint/naming-convention */
2 changes: 1 addition & 1 deletion src/constants/export/constants.ts
Original file line number Diff line number Diff line change
@@ -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']);
Expand Down
36 changes: 28 additions & 8 deletions src/schemas/core/storage.schema.ts
Original file line number Diff line number Diff line change
@@ -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]);
18 changes: 7 additions & 11 deletions src/schemas/core/tile.schema.ts
Original file line number Diff line number Diff line change
@@ -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),
Expand All @@ -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');
9 changes: 9 additions & 0 deletions src/schemas/deletion/job.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
44 changes: 40 additions & 4 deletions src/schemas/deletion/task.schema.ts
Original file line number Diff line number Diff line change
@@ -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),
Expand All @@ -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
3 changes: 2 additions & 1 deletion src/types/core/storage.type.ts
Original file line number Diff line number Diff line change
@@ -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<typeof fsStorageSchema>;
export type S3Storage = z.infer<typeof s3StorageSchema>;
export type RedisStorage = z.infer<typeof redisStorageSchema>;
export type Storage = z.infer<typeof storageSchema>;
3 changes: 1 addition & 2 deletions src/types/core/tile.type.ts
Original file line number Diff line number Diff line change
@@ -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<typeof tilesDeletionParamsSchema>;
export type TileRange = z.infer<typeof tileRangeSchema>;
4 changes: 3 additions & 1 deletion src/types/deletion/job.type.ts
Original file line number Diff line number Diff line change
@@ -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<typeof deleteLayerJobParamsSchema>;

export type CacheDeletionJobParams = z.infer<typeof cacheDeletionJobParamsSchema>;
27 changes: 26 additions & 1 deletion src/types/deletion/task.type.ts
Original file line number Diff line number Diff line change
@@ -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<typeof deleteTaskParamsSchema>;
//#endregion DeleteTaskParams

//#region TilesDeletionParams
export type TilesDeletionParams = z.infer<typeof tilesDeletionParamsSchema>;
export type S3TilesDeletionParams = z.infer<typeof s3TilesDeletionParamsSchema>;
export type FsTilesDeletionParams = z.infer<typeof fsTilesDeletionParamsSchema>;
export type RedisTilesDeletionParams = z.infer<typeof redisTilesDeletionParamsSchema>;
//#endregion TilesDeletionParams

//#region DeleteStoredResourcesParams
export type DeleteStoredResourcesParams = z.infer<typeof deleteStoredResourcesParamsSchema>;
export type S3DeleteStoredResourcesParams = z.infer<typeof s3DeleteStoredResourcesParamsSchema>;
export type FsDeleteStoredResourcesParams = z.infer<typeof fsDeleteStoredResourcesParamsSchema>;
export type RedisDeleteStoredResourcesParams = z.infer<typeof redisDeleteStoredResourcesParamsSchema>;
//#endregion DeleteStoredResourcesParams
Loading