Skip to content

Commit

Permalink
feat(api-client): add semantic_type to DatasetField
Browse files Browse the repository at this point in the history
  • Loading branch information
richterb committed Nov 6, 2024
1 parent 3ee8452 commit 6d58834
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

1 comment on commit 6d58834

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

94.71%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   index.ts100%100%100%100%
src/client
   constants.ts100%100%100%100%
   error.ts100%100%100%100%
   index.ts84.14%74.03%100%95.31%102–103, 124, 13, 146, 148, 148–149, 15, 15, 151, 162, 169, 169, 17, 17, 171, 176, 179, 182, 184, 52, 82
   types.ts100%100%100%100%
src/odsql
   clauses.ts82.61%71.43%80%90.91%14, 32, 42
   index.ts92.05%83.72%95.74%94.19%111, 146, 25, 28, 56–57, 57, 57–58, 68, 78–79

Please sign in to comment.