@digitalculture/ochre-sdk 0.14.8 → 0.14.9
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.mts +9 -1
- package/dist/index.mjs +9 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -247,17 +247,25 @@ type Observation = {
|
|
|
247
247
|
* Represents an event with date, label and optional agent
|
|
248
248
|
*/
|
|
249
249
|
type Event = {
|
|
250
|
-
|
|
250
|
+
dateTime: Date | null;
|
|
251
|
+
date: string | null;
|
|
251
252
|
label: string;
|
|
252
253
|
agent: {
|
|
253
254
|
uuid: string;
|
|
255
|
+
publicationDateTime: Date | null;
|
|
254
256
|
content: string;
|
|
255
257
|
} | null;
|
|
256
258
|
location: {
|
|
257
259
|
uuid: string;
|
|
260
|
+
publicationDateTime: Date | null;
|
|
258
261
|
content: string;
|
|
259
262
|
} | null;
|
|
260
263
|
comment: string | null;
|
|
264
|
+
other: {
|
|
265
|
+
uuid: string | null;
|
|
266
|
+
category: string | null;
|
|
267
|
+
content: string;
|
|
268
|
+
} | null;
|
|
261
269
|
value: string | null;
|
|
262
270
|
};
|
|
263
271
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1174,17 +1174,25 @@ function parseObservations(observations) {
|
|
|
1174
1174
|
function parseEvents(events) {
|
|
1175
1175
|
const returnEvents = [];
|
|
1176
1176
|
for (const event of events) returnEvents.push({
|
|
1177
|
-
|
|
1177
|
+
dateTime: event.dateTime != null ? new Date(event.dateTime) : null,
|
|
1178
|
+
date: event.partialDates?.year != null ? `${event.partialDates.year}-01-01/${event.partialDates.endYear ?? event.partialDates.year}-12-31` : null,
|
|
1178
1179
|
label: parseStringContent(event.label),
|
|
1179
1180
|
location: event.location ? {
|
|
1180
1181
|
uuid: event.location.uuid,
|
|
1182
|
+
publicationDateTime: event.location.publicationDateTime != null ? new Date(event.location.publicationDateTime) : null,
|
|
1181
1183
|
content: parseStringContent(event.location)
|
|
1182
1184
|
} : null,
|
|
1183
1185
|
agent: event.agent ? {
|
|
1184
1186
|
uuid: event.agent.uuid,
|
|
1187
|
+
publicationDateTime: event.agent.publicationDateTime != null ? new Date(event.agent.publicationDateTime) : null,
|
|
1185
1188
|
content: parseStringContent(event.agent)
|
|
1186
1189
|
} : null,
|
|
1187
1190
|
comment: event.comment ? parseStringContent(event.comment) : null,
|
|
1191
|
+
other: event.other != null ? {
|
|
1192
|
+
uuid: event.other.uuid ?? null,
|
|
1193
|
+
category: event.other.category ?? null,
|
|
1194
|
+
content: parseStringContent(event.other)
|
|
1195
|
+
} : null,
|
|
1188
1196
|
value: event.value ? parseFakeString(event.value) : null
|
|
1189
1197
|
});
|
|
1190
1198
|
return returnEvents;
|
package/package.json
CHANGED