ochre-sdk 1.3.21 → 1.3.22
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 +2 -1
- package/dist/types/index.d.mts +1 -0
- package/dist/xml/schemas.d.mts +36 -3
- package/dist/xml/schemas.mjs +3 -2
- package/dist/xml/types.d.mts +1 -0
- package/package.json +1 -1
package/dist/parsers/index.mjs
CHANGED
|
@@ -322,7 +322,8 @@ function parseDownloadOptions(rawDownloadOptions) {
|
|
|
322
322
|
return Array.from(rawDownloadOptions?.option ?? [], (option) => ({
|
|
323
323
|
type: option.type,
|
|
324
324
|
href: transformPermanentIdentificationUrl(option.href),
|
|
325
|
-
fileFormat: option.fileFormat
|
|
325
|
+
fileFormat: option.fileFormat,
|
|
326
|
+
fileSize: option.fileSize ?? null
|
|
326
327
|
}));
|
|
327
328
|
}
|
|
328
329
|
function parseHref(href) {
|
package/dist/types/index.d.mts
CHANGED
package/dist/xml/schemas.d.mts
CHANGED
|
@@ -452,7 +452,18 @@ export declare const XMLGalleryData: v.ObjectSchema<{
|
|
|
452
452
|
readonly type: v.PicklistSchema<["highQuality", "iiifManifest", "document", "ocr", "mets", "alto"], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto">;
|
|
453
453
|
readonly href: v.SchemaWithPipe<readonly [v.StringSchema<"XMLDownloadOptions: href is string and required">, v.UrlAction<string, "XMLDownloadOptions: href is not a valid URL">]>;
|
|
454
454
|
readonly fileFormat: v.StringSchema<"XMLDownloadOptions: fileFormat is string and required">;
|
|
455
|
-
|
|
455
|
+
readonly fileSize: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<"XMLNumber: string is string and required">, v.ObjectSchema<{
|
|
456
|
+
string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
|
|
457
|
+
links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
|
|
458
|
+
properties: v.OptionalSchema<v.ObjectSchema<{
|
|
459
|
+
readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
|
|
460
|
+
}, undefined>, undefined>;
|
|
461
|
+
annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
|
|
462
|
+
payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
|
|
463
|
+
rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
|
|
464
|
+
whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
|
|
465
|
+
}, "XMLString: Shape error">], undefined>, v.CheckAction<string | XMLString, "XMLNumber: string is not a number">, v.TransformAction<string | XMLString, number | undefined>]>, undefined>;
|
|
466
|
+
}, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize">, undefined>;
|
|
456
467
|
}, "XMLDownloadOptions: Shape error">, undefined>;
|
|
457
468
|
readonly document: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.ObjectSchema<{
|
|
458
469
|
readonly content: v.ArraySchema<v.ObjectSchema<{
|
|
@@ -1656,7 +1667,18 @@ export declare const XMLGalleryData: v.ObjectSchema<{
|
|
|
1656
1667
|
readonly type: v.PicklistSchema<["highQuality", "iiifManifest", "document", "ocr", "mets", "alto"], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto">;
|
|
1657
1668
|
readonly href: v.SchemaWithPipe<readonly [v.StringSchema<"XMLDownloadOptions: href is string and required">, v.UrlAction<string, "XMLDownloadOptions: href is not a valid URL">]>;
|
|
1658
1669
|
readonly fileFormat: v.StringSchema<"XMLDownloadOptions: fileFormat is string and required">;
|
|
1659
|
-
|
|
1670
|
+
readonly fileSize: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<"XMLNumber: string is string and required">, v.ObjectSchema<{
|
|
1671
|
+
string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
|
|
1672
|
+
links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
|
|
1673
|
+
properties: v.OptionalSchema<v.ObjectSchema<{
|
|
1674
|
+
readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
|
|
1675
|
+
}, undefined>, undefined>;
|
|
1676
|
+
annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
|
|
1677
|
+
payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
|
|
1678
|
+
rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
|
|
1679
|
+
whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
|
|
1680
|
+
}, "XMLString: Shape error">], undefined>, v.CheckAction<string | XMLString, "XMLNumber: string is not a number">, v.TransformAction<string | XMLString, number | undefined>]>, undefined>;
|
|
1681
|
+
}, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize">, undefined>;
|
|
1660
1682
|
}, "XMLDownloadOptions: Shape error">, undefined>;
|
|
1661
1683
|
readonly publicationInfo: v.OptionalSchema<v.ObjectSchema<{
|
|
1662
1684
|
readonly publishers: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
@@ -3000,7 +3022,18 @@ export declare const XMLGalleryData: v.ObjectSchema<{
|
|
|
3000
3022
|
readonly type: v.PicklistSchema<["highQuality", "iiifManifest", "document", "ocr", "mets", "alto"], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto">;
|
|
3001
3023
|
readonly href: v.SchemaWithPipe<readonly [v.StringSchema<"XMLDownloadOptions: href is string and required">, v.UrlAction<string, "XMLDownloadOptions: href is not a valid URL">]>;
|
|
3002
3024
|
readonly fileFormat: v.StringSchema<"XMLDownloadOptions: fileFormat is string and required">;
|
|
3003
|
-
|
|
3025
|
+
readonly fileSize: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<"XMLNumber: string is string and required">, v.ObjectSchema<{
|
|
3026
|
+
string: v.OptionalSchema<v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLString>>, "XMLString: string is array of XMLString">, undefined>;
|
|
3027
|
+
links: v.OptionalSchema<v.LazySchema<v.GenericSchema<unknown, XMLLink$1>>, undefined>;
|
|
3028
|
+
properties: v.OptionalSchema<v.ObjectSchema<{
|
|
3029
|
+
readonly property: v.ArraySchema<v.LazySchema<v.GenericSchema<unknown, XMLProperty>>, "XMLRichTextEnvelope: properties is array of XMLProperty">;
|
|
3030
|
+
}, undefined>, undefined>;
|
|
3031
|
+
annotation: v.OptionalSchema<v.StringSchema<"XMLRichTextEnvelope: annotation is string and optional">, undefined>;
|
|
3032
|
+
payload: v.OptionalSchema<v.StringSchema<"XMLString: payload is string and optional">, undefined>;
|
|
3033
|
+
rend: v.OptionalSchema<v.StringSchema<"XMLString: rend is string and optional">, undefined>;
|
|
3034
|
+
whitespace: v.OptionalSchema<v.StringSchema<"XMLString: whitespace is string and optional">, undefined>;
|
|
3035
|
+
}, "XMLString: Shape error">], undefined>, v.CheckAction<string | XMLString, "XMLNumber: string is not a number">, v.TransformAction<string | XMLString, number | undefined>]>, undefined>;
|
|
3036
|
+
}, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize">, undefined>;
|
|
3004
3037
|
}, "XMLDownloadOptions: Shape error">, undefined>;
|
|
3005
3038
|
readonly publicationInfo: v.OptionalSchema<v.ObjectSchema<{
|
|
3006
3039
|
readonly publishers: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
package/dist/xml/schemas.mjs
CHANGED
|
@@ -231,8 +231,9 @@ const XMLDownloadOptions = v.object({ option: v.array(v.object({
|
|
|
231
231
|
"alto"
|
|
232
232
|
], "XMLDownloadOptions: type is highQuality, iiifManifest, document, ocr, mets, or alto"),
|
|
233
233
|
href: v.pipe(v.string("XMLDownloadOptions: href is string and required"), v.url("XMLDownloadOptions: href is not a valid URL")),
|
|
234
|
-
fileFormat: v.string("XMLDownloadOptions: fileFormat is string and required")
|
|
235
|
-
|
|
234
|
+
fileFormat: v.string("XMLDownloadOptions: fileFormat is string and required"),
|
|
235
|
+
fileSize: XMLOptionalNumber
|
|
236
|
+
}, "XMLDownloadOptions: option is object with type, href, fileFormat, and optional fileSize")) }, "XMLDownloadOptions: Shape error");
|
|
236
237
|
const XMLImageMapArea = v.object({
|
|
237
238
|
uuid: v.pipe(v.string("XMLImageMapArea: uuid is string and required"), v.check(isPseudoUuid, "XMLImageMapArea: uuid is not a valid pseudo-UUID")),
|
|
238
239
|
publicationDateTime: v.optional(customDateTime("XMLImageMapArea: publicationDateTime is not a valid datetime")),
|
package/dist/xml/types.d.mts
CHANGED