From 6d58834c0394d4d6f379826bfeef23c07202f8cd Mon Sep 17 00:00:00 2001 From: Benoit Richter Date: Wed, 30 Oct 2024 09:08:25 +0100 Subject: [PATCH] feat(api-client): add semantic_type to DatasetField --- packages/api-client/src/client/constants.ts | 5 +++++ packages/api-client/src/client/types.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/api-client/src/client/constants.ts b/packages/api-client/src/client/constants.ts index c4f94f3c..2a02753f 100644 --- a/packages/api-client/src/client/constants.ts +++ b/packages/api-client/src/client/constants.ts @@ -12,6 +12,11 @@ export const ODS_DATASET_FIELD_TYPE = { JSON: 'json', } as const; +export const ODS_DATASET_FIELD_SEMANTIC_TYPE = { + IP_ADDRESS: 'ip_address', + MONITORING_IP_ADDRESS: 'monitoring_ip_address', +} as const; + export const EXPORT_DATASET_FORMAT = { JSON: 'json', GEOJSON: 'geojson', diff --git a/packages/api-client/src/client/types.ts b/packages/api-client/src/client/types.ts index b0fe8798..0a7dc69d 100644 --- a/packages/api-client/src/client/types.ts +++ b/packages/api-client/src/client/types.ts @@ -1,7 +1,7 @@ // Type hints for Api response import { ValueOf } from '../utils'; -import { EXPORT_CATALOG_FORMAT, EXPORT_DATASET_FORMAT, ODS_DATASET_FIELD_TYPE } from './constants'; +import { EXPORT_CATALOG_FORMAT, EXPORT_DATASET_FORMAT, ODS_DATASET_FIELD_TYPE, ODS_DATASET_FIELD_SEMANTIC_TYPE } from './constants'; export interface Facet { name: string; @@ -27,6 +27,8 @@ interface DataWithLinks { export type DatasetFieldType = ValueOf; +export type DatasetFieldSemanticType = ValueOf; + export interface DatasetAttachement { id: string; mimetype: string; @@ -43,6 +45,7 @@ export interface DatasetField { name: string; label: string; type: DatasetFieldType; + semantic_type?: DatasetFieldSemanticType; annotations: unknown; }