Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions src/constants/deletion/constants.ts
Original file line number Diff line number Diff line change
@@ -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: 'full-layer-tiles-deletion',
ArtifactsDeletion: 'artifacts-deletion',
} as const;

export type DeletionTaskTypes = (typeof DeletionTaskTypes)[keyof typeof DeletionTaskTypes];
/* eslint-enable @typescript-eslint/naming-convention */
1 change: 1 addition & 0 deletions src/constants/deletion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './constants';
1 change: 1 addition & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './core';
export * from './ingestion';
export * from './export';
export * from './deletion';
2 changes: 2 additions & 0 deletions src/schemas/deletion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './task.schema';
export * from './job.schema';
7 changes: 7 additions & 0 deletions src/schemas/deletion/job.schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { z } from 'zod';

export const deleteLayerJobParamsSchema = z
.object({
approver: z.string(),
})
.describe('deleteLayerJobParamsSchema');
26 changes: 26 additions & 0 deletions src/schemas/deletion/task.schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { z } from 'zod';
import { SourceType } from '../../constants/core/constants';

export const sourceProviderSchema = z.union([z.literal(SourceType.S3), z.literal(SourceType.FS)]);

export const deleteTaskParamsSchema = z
.object({
deleteFromCatalog: z.boolean().default(false),
deleteFromGeoserver: z.boolean().default(false),
deleteFromMapproxy: z.boolean().default(false),
})
.describe('deleteTaskParamsSchema');

export const layerTilesDeletionParamsSchema = z
.object({
catalogId: z.string().uuid(),
sourceProvider: sourceProviderSchema,
})
.describe('layerTilesDeletionParamsSchema');

export const artifactsDeletionParamsSchema = z
.object({
sourceProvider: sourceProviderSchema,
paths: z.array(z.string().min(1)).min(1), // explicit thumbnail/legend object keys (s3) or file paths (fs)
})
.describe('artifactsDeletionParamsSchema');
1 change: 1 addition & 0 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './core';
export * from './ingestion';
export * from './export';
export * from './deletion';
2 changes: 2 additions & 0 deletions src/types/deletion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './task.type';
export * from './job.type';
4 changes: 4 additions & 0 deletions src/types/deletion/job.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import z from 'zod';
import { deleteLayerJobParamsSchema } from '../../schemas/deletion/job.schema';

export type DeleteLayerJobParams = z.infer<typeof deleteLayerJobParamsSchema>;
6 changes: 6 additions & 0 deletions src/types/deletion/task.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import z from 'zod';
import { deleteTaskParamsSchema, layerTilesDeletionParamsSchema, artifactsDeletionParamsSchema } from '../../schemas/deletion/task.schema';

export type DeleteTaskParams = z.infer<typeof deleteTaskParamsSchema>;
export type LayerTilesDeletionParams = z.infer<typeof layerTilesDeletionParamsSchema>;
export type ArtifactsDeletionParams = z.infer<typeof artifactsDeletionParamsSchema>;
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './core';
export * from './ingestion';
export * from './export';
export * from './deletion';
Loading