@digitalculture/ochre-sdk 0.7.15 → 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.cjs +3 -578
- package/dist/index.d.cts +8 -13
- package/dist/index.d.ts +8 -13
- package/dist/index.js +3 -578
- package/package.json +5 -8
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<
|
|
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>;
|
|
@@ -360,11 +355,11 @@ type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "
|
|
|
360
355
|
/**
|
|
361
356
|
* Represents a property value with type information
|
|
362
357
|
*/
|
|
363
|
-
type PropertyValueContent = {
|
|
364
|
-
content: string
|
|
365
|
-
|
|
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;
|
|
366
361
|
isUncertain: boolean;
|
|
367
|
-
type:
|
|
362
|
+
type: T;
|
|
368
363
|
category: string;
|
|
369
364
|
uuid: string | null;
|
|
370
365
|
publicationDateTime: Date | null;
|
|
@@ -373,10 +368,10 @@ type PropertyValueContent = {
|
|
|
373
368
|
/**
|
|
374
369
|
* Represents a property with label, values and nested properties
|
|
375
370
|
*/
|
|
376
|
-
type Property = {
|
|
371
|
+
type Property<T extends PropertyValueContentType = PropertyValueContentType> = {
|
|
377
372
|
uuid: string;
|
|
378
373
|
label: string;
|
|
379
|
-
values: Array<PropertyValueContent
|
|
374
|
+
values: Array<PropertyValueContent<T>>;
|
|
380
375
|
comment: string | null;
|
|
381
376
|
properties: Array<Property>;
|
|
382
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<
|
|
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>;
|
|
@@ -360,11 +355,11 @@ type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "
|
|
|
360
355
|
/**
|
|
361
356
|
* Represents a property value with type information
|
|
362
357
|
*/
|
|
363
|
-
type PropertyValueContent = {
|
|
364
|
-
content: string
|
|
365
|
-
|
|
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;
|
|
366
361
|
isUncertain: boolean;
|
|
367
|
-
type:
|
|
362
|
+
type: T;
|
|
368
363
|
category: string;
|
|
369
364
|
uuid: string | null;
|
|
370
365
|
publicationDateTime: Date | null;
|
|
@@ -373,10 +368,10 @@ type PropertyValueContent = {
|
|
|
373
368
|
/**
|
|
374
369
|
* Represents a property with label, values and nested properties
|
|
375
370
|
*/
|
|
376
|
-
type Property = {
|
|
371
|
+
type Property<T extends PropertyValueContentType = PropertyValueContentType> = {
|
|
377
372
|
uuid: string;
|
|
378
373
|
label: string;
|
|
379
|
-
values: Array<PropertyValueContent
|
|
374
|
+
values: Array<PropertyValueContent<T>>;
|
|
380
375
|
comment: string | null;
|
|
381
376
|
properties: Array<Property>;
|
|
382
377
|
};
|