ochre-sdk 0.19.14 → 0.19.15

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.
Files changed (2) hide show
  1. package/dist/index.mjs +13 -20
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -593,24 +593,23 @@ function flattenItemProperties(item) {
593
593
  * @internal
594
594
  */
595
595
  const uuidSchema = z.string().refine(isPseudoUuid, { error: "Invalid pseudo-UUID" });
596
- const richTextStringContentSchema = z.object({
597
- content: z.union([
598
- z.string(),
599
- z.number(),
600
- z.boolean()
601
- ]).optional(),
596
+ const fakeStringSchema = z.union([
597
+ z.string(),
598
+ z.number(),
599
+ z.boolean()
600
+ ]);
601
+ const richTextStringContentSchema = z.union([fakeStringSchema, z.object({
602
+ content: fakeStringSchema.optional(),
602
603
  rend: z.string().optional(),
603
604
  whitespace: z.string().optional()
604
- });
605
+ })]);
605
606
  /**
606
607
  * Schema for validating rich text string content
607
608
  * @internal
608
609
  */
609
610
  const richTextStringSchema = z.object({
610
611
  string: z.union([
611
- z.string(),
612
- z.number(),
613
- z.boolean(),
612
+ fakeStringSchema,
614
613
  richTextStringContentSchema,
615
614
  z.array(richTextStringContentSchema)
616
615
  ]),
@@ -859,12 +858,12 @@ function parseMetadata(metadata) {
859
858
  page: metadata.project?.page ?? null
860
859
  } : null,
861
860
  collection: metadata.collection ? {
862
- uuid: metadata.collection?.uuid ?? "",
861
+ uuid: metadata.collection.uuid,
863
862
  identification: parseIdentification(metadata.collection.identification),
864
863
  page: metadata.collection.page
865
864
  } : null,
866
865
  publication: metadata.publication ? {
867
- uuid: metadata.publication?.uuid ?? "",
866
+ uuid: metadata.publication.uuid,
868
867
  identification: parseIdentification(metadata.publication.identification),
869
868
  page: metadata.publication.page
870
869
  } : null,
@@ -2187,15 +2186,9 @@ const propertyValueQueryItemSchema = z.object({
2187
2186
  uuid: z.string(),
2188
2187
  itemUuid: z.string().optional(),
2189
2188
  dataType: z.string(),
2190
- rawValue: z.union([
2191
- z.string(),
2192
- z.number(),
2193
- z.boolean()
2194
- ]).optional(),
2189
+ rawValue: fakeStringSchema.optional(),
2195
2190
  content: z.union([
2196
- z.string(),
2197
- z.number(),
2198
- z.boolean(),
2191
+ fakeStringSchema,
2199
2192
  richTextStringSchema,
2200
2193
  z.array(richTextStringSchema)
2201
2194
  ]).optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "0.19.14",
3
+ "version": "0.19.15",
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",
@@ -46,10 +46,10 @@
46
46
  "zod": "^4.3.6"
47
47
  },
48
48
  "devDependencies": {
49
- "@antfu/eslint-config": "^7.4.3",
49
+ "@antfu/eslint-config": "^7.5.0",
50
50
  "@types/node": "^24.10.13",
51
51
  "bumpp": "^10.4.1",
52
- "eslint": "^10.0.0",
52
+ "eslint": "^10.0.2",
53
53
  "prettier": "^3.8.1",
54
54
  "tsdown": "^0.20.3",
55
55
  "typescript": "^5.9.3",