Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api-client): add semantic_type to DatasetField #264

Merged
merged 1 commit into from
Nov 6, 2024
Merged
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
5 changes: 5 additions & 0 deletions packages/api-client/src/client/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 4 additions & 1 deletion packages/api-client/src/client/types.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -27,6 +27,8 @@ interface DataWithLinks {

export type DatasetFieldType = ValueOf<typeof ODS_DATASET_FIELD_TYPE>;

export type DatasetFieldSemanticType = ValueOf<typeof ODS_DATASET_FIELD_SEMANTIC_TYPE>;

export interface DatasetAttachement {
id: string;
mimetype: string;
Expand All @@ -43,6 +45,7 @@ export interface DatasetField {
name: string;
label: string;
type: DatasetFieldType;
semantic_type?: DatasetFieldSemanticType;
annotations: unknown;
}

Expand Down