@digitalculture/ochre-sdk 0.7.14 → 0.7.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,9 +1,4 @@
1
- import { Language } from "iso-639-3";
2
-
3
1
  //#region src/types/main.d.ts
4
- /**
5
- * Represents the core data structure containing item information and metadata
6
- */
7
2
  /**
8
3
  * Represents the core data structure containing item information and metadata
9
4
  */
@@ -42,7 +37,7 @@ type Metadata = {
42
37
  } | null;
43
38
  dataset: string;
44
39
  publisher: string;
45
- languages: Array<Language["iso6393"]>;
40
+ languages: Array<string>;
46
41
  identifier: string;
47
42
  description: string;
48
43
  };
@@ -177,7 +172,7 @@ type Coordinates = {
177
172
  type Observation = {
178
173
  number: number;
179
174
  date: Date | null;
180
- observers: Array<string>;
175
+ observers: Array<string> | Array<Person>;
181
176
  notes: Array<Note>;
182
177
  links: Array<Link>;
183
178
  properties: Array<Property>;
@@ -252,7 +247,6 @@ type SpatialUnit = {
252
247
  uuid: string;
253
248
  category: "spatialUnit";
254
249
  publicationDateTime: Date | null;
255
- type: string;
256
250
  number: number;
257
251
  context: Context | null;
258
252
  license: License | null;
@@ -361,11 +355,11 @@ type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "
361
355
  /**
362
356
  * Represents a property value with type information
363
357
  */
364
- type PropertyValueContent = {
365
- content: string | number | boolean | Date | null;
366
- booleanValue: boolean | null;
358
+ type PropertyValueContent<T extends PropertyValueContentType> = {
359
+ content: T extends "string" ? string : T extends "IDREF" ? string : T extends "integer" ? number : T extends "decimal" ? number : T extends "boolean" ? boolean : T extends "date" ? Date : T extends "dateTime" ? Date : T extends "time" ? Date : null;
360
+ booleanLabel: T extends "boolean" ? string | null : null;
367
361
  isUncertain: boolean;
368
- type: PropertyValueContentType;
362
+ type: T;
369
363
  category: string;
370
364
  uuid: string | null;
371
365
  publicationDateTime: Date | null;
@@ -374,10 +368,10 @@ type PropertyValueContent = {
374
368
  /**
375
369
  * Represents a property with label, values and nested properties
376
370
  */
377
- type Property = {
371
+ type Property<T extends PropertyValueContentType = PropertyValueContentType> = {
378
372
  uuid: string;
379
373
  label: string;
380
- values: Array<PropertyValueContent>;
374
+ values: Array<PropertyValueContent<T>>;
381
375
  comment: string | null;
382
376
  properties: Array<Property>;
383
377
  };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,4 @@
1
- import { Language } from "iso-639-3";
2
-
3
1
  //#region src/types/main.d.ts
4
- /**
5
- * Represents the core data structure containing item information and metadata
6
- */
7
2
  /**
8
3
  * Represents the core data structure containing item information and metadata
9
4
  */
@@ -42,7 +37,7 @@ type Metadata = {
42
37
  } | null;
43
38
  dataset: string;
44
39
  publisher: string;
45
- languages: Array<Language["iso6393"]>;
40
+ languages: Array<string>;
46
41
  identifier: string;
47
42
  description: string;
48
43
  };
@@ -177,7 +172,7 @@ type Coordinates = {
177
172
  type Observation = {
178
173
  number: number;
179
174
  date: Date | null;
180
- observers: Array<string>;
175
+ observers: Array<string> | Array<Person>;
181
176
  notes: Array<Note>;
182
177
  links: Array<Link>;
183
178
  properties: Array<Property>;
@@ -252,7 +247,6 @@ type SpatialUnit = {
252
247
  uuid: string;
253
248
  category: "spatialUnit";
254
249
  publicationDateTime: Date | null;
255
- type: string;
256
250
  number: number;
257
251
  context: Context | null;
258
252
  license: License | null;
@@ -361,11 +355,11 @@ type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "
361
355
  /**
362
356
  * Represents a property value with type information
363
357
  */
364
- type PropertyValueContent = {
365
- content: string | number | boolean | Date | null;
366
- booleanValue: boolean | null;
358
+ type PropertyValueContent<T extends PropertyValueContentType> = {
359
+ content: T extends "string" ? string : T extends "IDREF" ? string : T extends "integer" ? number : T extends "decimal" ? number : T extends "boolean" ? boolean : T extends "date" ? Date : T extends "dateTime" ? Date : T extends "time" ? Date : null;
360
+ booleanLabel: T extends "boolean" ? string | null : null;
367
361
  isUncertain: boolean;
368
- type: PropertyValueContentType;
362
+ type: T;
369
363
  category: string;
370
364
  uuid: string | null;
371
365
  publicationDateTime: Date | null;
@@ -374,10 +368,10 @@ type PropertyValueContent = {
374
368
  /**
375
369
  * Represents a property with label, values and nested properties
376
370
  */
377
- type Property = {
371
+ type Property<T extends PropertyValueContentType = PropertyValueContentType> = {
378
372
  uuid: string;
379
373
  label: string;
380
- values: Array<PropertyValueContent>;
374
+ values: Array<PropertyValueContent<T>>;
381
375
  comment: string | null;
382
376
  properties: Array<Property>;
383
377
  };