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.
@@ -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) {
@@ -232,6 +232,7 @@ export type DownloadOption = {
232
232
  type: "highQuality" | "iiifManifest" | "document" | "ocr" | "mets" | "alto";
233
233
  href: string;
234
234
  fileFormat: string;
235
+ fileSize: number | null;
235
236
  };
236
237
  /**
237
238
  * Area of an image map in OCHRE
@@ -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
- }, "XMLDownloadOptions: option is object with type, href, and fileFormat">, undefined>;
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
- }, "XMLDownloadOptions: option is object with type, href, and fileFormat">, undefined>;
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
- }, "XMLDownloadOptions: option is object with type, href, and fileFormat">, undefined>;
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<{
@@ -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
- }, "XMLDownloadOptions: option is object with type, href, and fileFormat")) }, "XMLDownloadOptions: Shape error");
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")),
@@ -171,6 +171,7 @@ export type XMLDownloadOptions = {
171
171
  type: "highQuality" | "iiifManifest" | "document" | "ocr" | "mets" | "alto";
172
172
  href: string;
173
173
  fileFormat: string;
174
+ fileSize?: number;
174
175
  }>;
175
176
  };
176
177
  export type XMLImageMapArea = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "1.3.21",
3
+ "version": "1.3.22",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Node.js library for working with OCHRE (Online Cultural and Historical Research Environment) data",