@digitalculture/ochre-sdk 0.6.6 → 0.7.1

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
@@ -346,20 +346,21 @@ type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "
346
346
  /**
347
347
  * Represents a property value with type information
348
348
  */
349
- type PropertyValueContent<T extends PropertyValueContentType> = {
350
- content: T extends "number" ? number : T extends "integer" ? number : T extends "decimal" ? number : T extends "dateTime" ? Date | null : string;
351
- booleanValue: T extends "boolean" ? boolean : null;
352
- type: T;
349
+ type PropertyValueContent = {
350
+ content: string | number | boolean | Date | null;
351
+ booleanValue: boolean | null;
352
+ type: PropertyValueContentType;
353
353
  category: string;
354
354
  uuid: string | null;
355
355
  publicationDateTime: Date | null;
356
+ unit: string | null;
356
357
  };
357
358
  /**
358
359
  * Represents a property with label, values and nested properties
359
360
  */
360
361
  type Property = {
361
362
  label: string;
362
- values: Array<PropertyValueContent<PropertyValueContentType>>;
363
+ values: Array<PropertyValueContent>;
363
364
  comment: string | null;
364
365
  properties: Array<Property>;
365
366
  };
@@ -927,6 +928,7 @@ type OchreSpatialUnit = {
927
928
  identification: OchreIdentification;
928
929
  image?: OchreImage;
929
930
  description?: OchreStringContent | FakeString;
931
+ coordinate?: string; // "latitude, longitude"
930
932
  coordinates?: OchreCoordinates;
931
933
  events?: { event: OchreEvent | Array<OchreEvent> };
932
934
  observations?: { observation: OchreObservation | Array<OchreObservation> };
@@ -955,9 +957,10 @@ type OchreConcept = {
955
957
  type OchrePropertyValueContent = {
956
958
  uuid?: string;
957
959
  publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
958
- type: string;
960
+ type?: string;
959
961
  category?: string;
960
962
  slug?: FakeString;
963
+ unit?: string;
961
964
  booleanValue?: boolean;
962
965
  content?: FakeString | OchreStringItem | Array<OchreStringItem>;
963
966
  };
@@ -1516,7 +1519,7 @@ declare function parseNotes(notes: Array<OchreNote>, language?: string): Array<N
1516
1519
  * @param coordinates - Raw coordinates data in OCHRE format
1517
1520
  * @returns Parsed Coordinates object
1518
1521
  */
1519
- declare function parseCoordinates(coordinates: OchreCoordinates): Coordinates;
1522
+ declare function parseCoordinates(coordinates: OchreCoordinates | string): Coordinates;
1520
1523
  /**
1521
1524
  * Parses a raw observation into a standardized Observation structure
1522
1525
  *
@@ -1538,7 +1541,7 @@ declare function parseObservations(observations: Array<OchreObservation>): Array
1538
1541
  * @returns Array of parsed Event objects
1539
1542
  */
1540
1543
  declare function parseEvents(events: Array<OchreEvent>): Array<Event>;
1541
- declare function parseProperty<T extends PropertyValueContentType>(property: OchreProperty, type: T, language?: string): Property;
1544
+ declare function parseProperty(property: OchreProperty, language?: string): Property;
1542
1545
  /**
1543
1546
  * Parses raw properties into standardized Property objects
1544
1547
  *
package/dist/index.d.ts CHANGED
@@ -346,20 +346,21 @@ type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "
346
346
  /**
347
347
  * Represents a property value with type information
348
348
  */
349
- type PropertyValueContent<T extends PropertyValueContentType> = {
350
- content: T extends "number" ? number : T extends "integer" ? number : T extends "decimal" ? number : T extends "dateTime" ? Date | null : string;
351
- booleanValue: T extends "boolean" ? boolean : null;
352
- type: T;
349
+ type PropertyValueContent = {
350
+ content: string | number | boolean | Date | null;
351
+ booleanValue: boolean | null;
352
+ type: PropertyValueContentType;
353
353
  category: string;
354
354
  uuid: string | null;
355
355
  publicationDateTime: Date | null;
356
+ unit: string | null;
356
357
  };
357
358
  /**
358
359
  * Represents a property with label, values and nested properties
359
360
  */
360
361
  type Property = {
361
362
  label: string;
362
- values: Array<PropertyValueContent<PropertyValueContentType>>;
363
+ values: Array<PropertyValueContent>;
363
364
  comment: string | null;
364
365
  properties: Array<Property>;
365
366
  };
@@ -927,6 +928,7 @@ type OchreSpatialUnit = {
927
928
  identification: OchreIdentification;
928
929
  image?: OchreImage;
929
930
  description?: OchreStringContent | FakeString;
931
+ coordinate?: string; // "latitude, longitude"
930
932
  coordinates?: OchreCoordinates;
931
933
  events?: { event: OchreEvent | Array<OchreEvent> };
932
934
  observations?: { observation: OchreObservation | Array<OchreObservation> };
@@ -955,9 +957,10 @@ type OchreConcept = {
955
957
  type OchrePropertyValueContent = {
956
958
  uuid?: string;
957
959
  publicationDateTime?: string; // YYYY-MM-DDThh:mm:ssZ
958
- type: string;
960
+ type?: string;
959
961
  category?: string;
960
962
  slug?: FakeString;
963
+ unit?: string;
961
964
  booleanValue?: boolean;
962
965
  content?: FakeString | OchreStringItem | Array<OchreStringItem>;
963
966
  };
@@ -1516,7 +1519,7 @@ declare function parseNotes(notes: Array<OchreNote>, language?: string): Array<N
1516
1519
  * @param coordinates - Raw coordinates data in OCHRE format
1517
1520
  * @returns Parsed Coordinates object
1518
1521
  */
1519
- declare function parseCoordinates(coordinates: OchreCoordinates): Coordinates;
1522
+ declare function parseCoordinates(coordinates: OchreCoordinates | string): Coordinates;
1520
1523
  /**
1521
1524
  * Parses a raw observation into a standardized Observation structure
1522
1525
  *
@@ -1538,7 +1541,7 @@ declare function parseObservations(observations: Array<OchreObservation>): Array
1538
1541
  * @returns Array of parsed Event objects
1539
1542
  */
1540
1543
  declare function parseEvents(events: Array<OchreEvent>): Array<Event>;
1541
- declare function parseProperty<T extends PropertyValueContentType>(property: OchreProperty, type: T, language?: string): Property;
1544
+ declare function parseProperty(property: OchreProperty, language?: string): Property;
1542
1545
  /**
1543
1546
  * Parses raw properties into standardized Property objects
1544
1547
  *