Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 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
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
18 changes: 13 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ jobs:
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
- name: Publish to npm
run: |
if [ "${{ github.ref_name }}" == "alpha" ]; then
npm publish --access public --tag alpha
else
npm publish --access public
fi
echo "is pre-release: ${{ github.event.release.prerelease }}"
echo "publish triggered on: ${{ github.ref_type }}"
if ([[ "${{ github.ref_type }}" == "tag" ]] &&
[[ "${{ github.event.release.prerelease }}" == "true" ]] &&
[[ "${{ github.ref_name }}" == "v${{ steps.package-info.outputs.version }}" ]]) ||
([[ "${{ github.ref_type }}" == "branch" ]] &&
[[ "${{ github.ref_name }}" == "alpha" ]]); then
echo "publishing prerelease with alpha tag from ${{ github.ref_type }}"
npm publish --access public --tag alpha
else
echo "publishing standard release"
npm publish --access public
fi
1 change: 0 additions & 1 deletion .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ jobs:
token: ${{ secrets.GH_PAT }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: node
target-branch: ${{ github.ref_name }}
config-file: ${{ steps.prerelease.outputs.prerelease_type_config }}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "7.10.2"
".": "8.1.0-alpha.3"
}
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,59 @@

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-alpha.3](https://github.com/MapColonies/raster-shared/compare/v8.1.0-alpha.2...v8.1.0-alpha.3) (2026-05-05)


### Bug Fixes

* simplify file extension handling in tilesDeletionParamsBaseSchema ([#199](https://github.com/MapColonies/raster-shared/issues/199)) ([383ac19](https://github.com/MapColonies/raster-shared/commit/383ac1988824947cd6ae3c8cb4402a881b0124c9))

## [8.1.0-alpha.2](https://github.com/MapColonies/raster-shared/compare/v8.1.0-alpha.1...v8.1.0-alpha.2) (2026-05-05)


### Features

* add tile schema and type exports to core index files ([#197](https://github.com/MapColonies/raster-shared/issues/197)) ([921db4d](https://github.com/MapColonies/raster-shared/commit/921db4dbd25f0c3dc04e08c460b6544bad562ef1))

## [8.1.0-alpha.1](https://github.com/MapColonies/raster-shared/compare/v8.1.0-alpha.0...v8.1.0-alpha.1) (2026-05-05)


### Features

* add polygon parts schema and types for intersection api ([#193](https://github.com/MapColonies/raster-shared/issues/193)) ([440f0c5](https://github.com/MapColonies/raster-shared/commit/440f0c52714a559747be55da3eadf76459dfdc3d))

## [8.1.0-alpha.0](https://github.com/MapColonies/raster-shared/compare/v8.0.0-alpha.0...v8.1.0-alpha.0) (2026-05-04)


### Features

* add tile deletion schemas and types, refactor source type ([#191](https://github.com/MapColonies/raster-shared/issues/191)) ([c87c428](https://github.com/MapColonies/raster-shared/commit/c87c428efdd98ced15972e6d487d6bb4acce95e9))

## [8.0.0-alpha.0](https://github.com/MapColonies/raster-shared/compare/v7.10.2...v8.0.0-alpha.0) (2026-04-29)


### ⚠ BREAKING CHANGES

* change polygon part validation error to new format (MAPCO-10506) ([#183](https://github.com/MapColonies/raster-shared/issues/183))

### 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))
* add resolution threshold check to thresholds schema ([4f6ef36](https://github.com/MapColonies/raster-shared/commit/4f6ef366cd25b1c4668371e7bb0f59d63148d9b6))
* update package ([61e08f4](https://github.com/MapColonies/raster-shared/commit/61e08f4785b32f66fa4fed485d9507306dcf4598))


### Bug Fixes

* bump version ([e726f0d](https://github.com/MapColonies/raster-shared/commit/e726f0dc061e058131ebda051cc11907de1f6d97))
* package json version ([b72678f](https://github.com/MapColonies/raster-shared/commit/b72678f558cef73468084e313cb654666775634b))


### Code Refactoring

* change polygon part validation error to new format (MAPCO-10506) ([#183](https://github.com/MapColonies/raster-shared/issues/183)) ([2587722](https://github.com/MapColonies/raster-shared/commit/2587722796704dce3bef9b84228835c6c852a7cd))
* set release-please initial version ([#186](https://github.com/MapColonies/raster-shared/issues/186)) ([3769756](https://github.com/MapColonies/raster-shared/commit/3769756998f8c903730c1d0dde249a45083a4b95))

## [7.10.2](https://github.com/MapColonies/raster-shared/compare/v7.10.1...v7.10.2) (2026-03-17)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@map-colonies/raster-shared",
"version": "7.10.2",
"version": "8.1.0-alpha.3",
"description": "This is template for map colonies typescript packages",
"main": "./dist/index.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion release-please-config-alpha.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"release-type": "node",
"include-component-in-tag": false,
"include-v-in-tag": true,
"initial-version": "0.0.1-alpha.1",
"initial-version": "8.0.0-alpha.0",
"prerelease": true,
"prerelease-type": "alpha",
"versioning": "prerelease"
Expand Down
3 changes: 1 addition & 2 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"$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": {}
"include-v-in-tag": true
}
12 changes: 12 additions & 0 deletions src/constants/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,15 @@ export const CORE_VALIDATIONS = {

export const HASH_ALGORITHMS = ['XXH64'] as const;
export type HashAlgorithm = (typeof HASH_ALGORITHMS)[number];

export const MAX_ZOOM_LEVEL = 22;

/* eslint-disable @typescript-eslint/naming-convention */
export const SourceType = {
S3: 'S3',
GPKG: 'GPKG',
FS: 'FS',
} as const;
/* eslint-enable @typescript-eslint/naming-convention */

export type SourceType = (typeof SourceType)[keyof typeof SourceType];
7 changes: 0 additions & 7 deletions src/constants/export/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@ export const TileFormatStrategy = {
MIXED: 'mixed',
} as const;

export const SourceType = {
S3: 'S3',
GPKG: 'GPKG',
FS: 'FS',
} as const;

export const ExportFinalizeType = {
Full_Processing: 'FullProcessing',
Error_Callback: 'ErrorCallback',
} as const;

export type TileFormatStrategy = (typeof TileFormatStrategy)[keyof typeof TileFormatStrategy];
export type SourceType = (typeof SourceType)[keyof typeof SourceType];
export type ExportFinalizeType = (typeof ExportFinalizeType)[keyof typeof ExportFinalizeType];
/* eslint-disable @typescript-eslint/naming-convention */
2 changes: 1 addition & 1 deletion src/constants/ingestion/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const INGESTION_VALIDATIONS = {
max: 4000,
},
productId: {
pattern: '^[A-Za-z]{1}[A-Za-z0-9_]{0,37}$',
pattern: '^[A-Za-z]{1}[A-Za-z0-9_]{0,36}$',
description: 'Product ID must start with a letter and contain only letters, numbers and underscores',
},
productVersion: {
Expand Down
2 changes: 2 additions & 0 deletions src/schemas/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ export * from './aggregation.schema';
export * from './callback.schema';
export * from './link.schema';
export * from './file.schema';
export * from './polygonParts.schema';
export * from './tile.schema';
90 changes: 90 additions & 0 deletions src/schemas/core/polygonParts.schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { z } from 'zod';
import { CORE_VALIDATIONS, INGESTION_VALIDATIONS } from '../../constants';
import { featureCollectionSchema, featureSchema, multiPolygonSchema, polygonSchema } from './geo.schema';

const polygonalGeometrySchema = polygonSchema.or(multiPolygonSchema).describe('polygonalGeometrySchema');

export const partSchema = z
.object({
id: z.string(),
sourceId: z.string({ message: 'Source id should be a string' }).optional(),
sourceName: z.string({ message: 'Source name should be a string' }).min(1, { message: 'Source name should have length of at least 1' }),
description: z.string({ message: 'Description should be a string' }).optional(),
imagingTimeBeginUTC: z.coerce.date({ message: 'Imaging time begin UTC should be a datetime' }),
imagingTimeEndUTC: z.coerce.date({ message: 'Imaging time end UTC should be a datetime' }),
resolutionDegree: z
.number({ message: 'Resolution degree should be a number' })
.min(CORE_VALIDATIONS.resolutionDeg.min, {
message: `Resolution degree should not be less than ${CORE_VALIDATIONS.resolutionDeg.min}`,
})
.max(CORE_VALIDATIONS.resolutionDeg.max, {
message: `Resolution degree should not be larger than ${CORE_VALIDATIONS.resolutionDeg.max}`,
}),
resolutionMeter: z
.number({ message: 'Resolution meter should be a number' })
.min(INGESTION_VALIDATIONS.resolutionMeter.min, {
message: `Resolution meter should not be less than ${INGESTION_VALIDATIONS.resolutionMeter.min}`,
})
.max(INGESTION_VALIDATIONS.resolutionMeter.max, {
message: `Resolution meter should not be larger than ${INGESTION_VALIDATIONS.resolutionMeter.max}`,
}),
sourceResolutionMeter: z
.number({ message: 'Source resolution meter should be a number' })
.min(INGESTION_VALIDATIONS.resolutionMeter.min, {
message: `Source resolution meter should not be less than ${INGESTION_VALIDATIONS.resolutionMeter.min}`,
})
.max(INGESTION_VALIDATIONS.resolutionMeter.max, {
message: `Source resolution meter should not be larger than ${INGESTION_VALIDATIONS.resolutionMeter.max}`,
}),
horizontalAccuracyCE90: z
.number({ message: 'Horizontal accuracy CE90 should be a number' })
.min(INGESTION_VALIDATIONS.horizontalAccuracyCE90.min, {
message: `Horizontal accuracy CE90 should not be less than ${INGESTION_VALIDATIONS.horizontalAccuracyCE90.min}`,
})
.max(INGESTION_VALIDATIONS.horizontalAccuracyCE90.max, {
message: `Horizontal accuracy CE90 should not be larger than ${INGESTION_VALIDATIONS.horizontalAccuracyCE90.max}`,
}),
sensors: z
.array(
z.string({ message: 'Sensors should be an array of strings' }).regex(new RegExp(INGESTION_VALIDATIONS.sensor.pattern), {
message: 'Sensors should be an array with items not starting or ending with whitespace characters',
}),
{ message: 'Sensors should be an array' }
)
.min(1, { message: 'Sensors should have an array length of at least 1' }),
countries: z
.array(z.string({ message: 'Countries should be an array of strings' }).min(1, { message: 'Countries should have length of at least 1' }), {
message: 'Countries should be an array',
})
.optional(),
cities: z
.array(z.string({ message: 'Cities should be an array of strings' }).min(1, { message: 'Cities should have length of at least 1' }), {
message: 'Cities should be an array',
})
.optional(),
})
.refine((part) => part.imagingTimeBeginUTC <= part.imagingTimeEndUTC && part.imagingTimeEndUTC <= new Date(), {
message: 'Imaging time begin UTC should be less than or equal to imaging time end UTC and both less than or equal to current timestamp',
})
.describe('partSchema');
export const partsSchema = z.array(partSchema).describe('partsSchema');

//#region intersection
export const intersectionFeaturePropertiesSchema = partSchema._def.schema
.pick({ resolutionDegree: true })
.describe('intersectionFeaturePropertiesSchema');
export const intersectionFeatureGeometrySchema = polygonalGeometrySchema.describe('intersectionFeatureGeometrySchema');
export const intersectionFeatureSchema = featureSchema(intersectionFeatureGeometrySchema, intersectionFeaturePropertiesSchema).describe(
'intersectionFeatureGeometrySchema'
);
export const intersectionFeatureCollectionSchema = featureCollectionSchema(intersectionFeatureSchema)
.and(z.object({ features: intersectionFeatureSchema.array().length(1) }))
.describe('intersectionFeatureCollectionSchema');

export const intersectedFeaturePropertiesSchema = z.object({}).strict().describe('intersectedFeaturePropertiesSchema');
export const intersectedFeatureGeometrySchema = polygonalGeometrySchema.describe('intersectedFeatureGeometrySchema');
export const intersectedFeatureSchema = featureSchema(intersectedFeatureGeometrySchema, intersectedFeaturePropertiesSchema).describe(
'intersectedFeatureSchema'
);
export const intersectedFeatureCollectionSchema = featureCollectionSchema(intersectedFeatureSchema).describe('intersectedFeatureCollectionSchema');
//#endregion
26 changes: 26 additions & 0 deletions src/schemas/core/tile.schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { z } from 'zod';
import { MAX_ZOOM_LEVEL, SourceType, TileOutputFormat } from '../../constants';

export const tileRangeSchema = z.object({
zoom: z.number().int().min(0).max(MAX_ZOOM_LEVEL),
minX: z.number().int().min(0),
maxX: z.number().int().min(0),
minY: z.number().int().min(0),
maxY: z.number().int().min(0),
});

export const tilesDeletionParamsBaseSchema = z.object({
tilesPath: z.string().min(1), // Base path for the tiles to be deleted
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),
});

export const tilesDeletionParamsSchema = z.discriminatedUnion('sourceProvider', [s3TilesDeletionParamsSchema, fsTilesDeletionParamsSchema]);
4 changes: 3 additions & 1 deletion src/schemas/ingestion/job.schema.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import z from 'zod';
import { CORE_VALIDATIONS } from '../../constants';
import { CORE_VALIDATIONS, JobTypes } from '../../constants';
import { urlsArraySchema } from '../core';
import { newAdditionalParamsSchema, swapUpdateAdditionalParamsSchema, updateAdditionalParamsSchema } from './additionalParams.schema';
import { inputFilesSchema } from './inputFiles.schema';
import { newRasterLayerMetadataSchema, updateRasterLayerMetadataSchema } from './metadata.schema';

export const ingestionJobTypeSchema = z.enum([JobTypes.Ingestion_New, JobTypes.Ingestion_Swap_Update, JobTypes.Ingestion_Update]);

export const ingestionResolutionSchema = z
.number({ message: 'Resolution degree should be a number' })
.min(CORE_VALIDATIONS.resolutionDeg.min, {
Expand Down
Loading
Loading