ochre-sdk 1.0.18 → 1.0.19
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/parsers/index.mjs +1 -1
- package/dist/xml/schemas.mjs +3 -3
- package/dist/xml/types.d.mts +1 -1
- package/package.json +1 -1
package/dist/parsers/index.mjs
CHANGED
|
@@ -395,7 +395,7 @@ function parseImageMapArea(area) {
|
|
|
395
395
|
const shape = area.shape === "rect" ? "rectangle" : area.shape === "circle" ? "circle" : "polygon";
|
|
396
396
|
return {
|
|
397
397
|
uuid: area.uuid,
|
|
398
|
-
publicationDateTime: area.publicationDateTime,
|
|
398
|
+
publicationDateTime: area.publicationDateTime ?? null,
|
|
399
399
|
type: area.type,
|
|
400
400
|
title: area.title,
|
|
401
401
|
slug: area.slug ?? null,
|
package/dist/xml/schemas.mjs
CHANGED
|
@@ -201,9 +201,9 @@ const XMLImage = v.object({
|
|
|
201
201
|
fileSize: XMLOptionalNumber,
|
|
202
202
|
payload: v.optional(v.string("XMLImage: payload is string and optional"))
|
|
203
203
|
}, "XMLImage: Shape error");
|
|
204
|
-
const XMLImageMapArea = v.object({
|
|
204
|
+
const XMLImageMapArea = v.pipe(v.object({
|
|
205
205
|
uuid: v.pipe(v.string("XMLImageMapArea: uuid is string and required"), v.check(isPseudoUuid, "XMLImageMapArea: uuid is not a valid pseudo-UUID")),
|
|
206
|
-
publicationDateTime: customDateTime("XMLImageMapArea: publicationDateTime is not a valid datetime"),
|
|
206
|
+
publicationDateTime: v.optional(customDateTime("XMLImageMapArea: publicationDateTime is not a valid datetime")),
|
|
207
207
|
type: v.string("XMLImageMapArea: type is string and required"),
|
|
208
208
|
title: v.string("XMLImageMapArea: title is string and required"),
|
|
209
209
|
slug: v.optional(v.string("XMLImageMapArea: slug is string and optional")),
|
|
@@ -213,7 +213,7 @@ const XMLImageMapArea = v.object({
|
|
|
213
213
|
"poly"
|
|
214
214
|
], "XMLImageMapArea: shape is rect, circle, or poly"),
|
|
215
215
|
coords: v.string("XMLImageMapArea: coords is string and required")
|
|
216
|
-
}, "XMLImageMapArea: Shape error");
|
|
216
|
+
}, "XMLImageMapArea: Shape error"), v.check((area) => area.type === "person" || area.publicationDateTime != null, "XMLImageMapArea: publicationDateTime is required unless type is person"));
|
|
217
217
|
const XMLImageMap = v.object({
|
|
218
218
|
area: v.array(XMLImageMapArea, "XMLImageMap: area is array of XMLImageMapArea"),
|
|
219
219
|
width: XMLNumber,
|
package/dist/xml/types.d.mts
CHANGED