ochre-sdk 0.22.18 → 0.22.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/index.d.mts CHANGED
@@ -300,6 +300,7 @@ type Event = {
300
300
  type Interpretation = {
301
301
  date: string | null;
302
302
  number: number;
303
+ notes: Array<Note>;
303
304
  links: Array<Link>;
304
305
  properties: Array<Property>;
305
306
  bibliographies: Array<Bibliography>;
package/dist/index.mjs CHANGED
@@ -1292,7 +1292,7 @@ function parseObservation(observation) {
1292
1292
  * @returns Array of parsed Observation objects
1293
1293
  */
1294
1294
  function parseObservations(observations) {
1295
- return observations.map((obs) => parseObservation(obs));
1295
+ return observations.map((observation) => parseObservation(observation));
1296
1296
  }
1297
1297
  /**
1298
1298
  * Parses an array of raw events into standardized Event objects
@@ -1435,12 +1435,13 @@ function parseProperties(properties, language = "eng") {
1435
1435
  * @returns Array of parsed Interpretation objects
1436
1436
  */
1437
1437
  function parseInterpretations(interpretations) {
1438
- return interpretations.map((interp) => ({
1439
- date: interp.date ?? null,
1440
- number: interp.interpretationNo,
1441
- links: interp.links ? parseLinks(ensureArray(interp.links)) : [],
1442
- properties: interp.properties ? parseProperties(ensureArray(interp.properties.property)) : [],
1443
- bibliographies: interp.bibliographies ? parseBibliographies(ensureArray(interp.bibliographies.bibliography)) : []
1438
+ return interpretations.map((interpretation) => ({
1439
+ date: interpretation.date ?? null,
1440
+ number: interpretation.interpretationNo,
1441
+ notes: interpretation.notes ? parseNotes(ensureArray(interpretation.notes.note)) : [],
1442
+ links: interpretation.links ? parseLinks(ensureArray(interpretation.links)) : [],
1443
+ properties: interpretation.properties ? parseProperties(ensureArray(interpretation.properties.property)) : [],
1444
+ bibliographies: interpretation.bibliographies ? parseBibliographies(ensureArray(interpretation.bibliographies.bibliography)) : []
1444
1445
  }));
1445
1446
  }
1446
1447
  /**
@@ -2275,13 +2276,8 @@ function buildRichTextPhraseQueryExpression(params) {
2275
2276
  const { value, isCaseSensitive } = params;
2276
2277
  return `cts:word-query(${stringLiteral(value)}, ${buildRichTextPhraseOptionsExpression({ isCaseSensitive })})`;
2277
2278
  }
2278
- function buildCtsNearQueryExpression(params) {
2279
- const { queryExpressions, distance, isOrdered = false } = params;
2280
- const options = isOrdered ? `, (${stringLiteral("ordered")})` : "";
2281
- return `cts:near-query((${queryExpressions.join(", ")}), ${distance}${options})`;
2282
- }
2283
2279
  function buildRichTextExactQueryExpression(params) {
2284
- const { value, isCaseSensitive, language } = params;
2280
+ const { value, isCaseSensitive } = params;
2285
2281
  const phraseQuery = buildRichTextPhraseQueryExpression({
2286
2282
  value,
2287
2283
  isCaseSensitive
@@ -2291,17 +2287,10 @@ function buildRichTextExactQueryExpression(params) {
2291
2287
  isCaseSensitive
2292
2288
  });
2293
2289
  if (terms.length <= 1) return phraseQuery;
2294
- return buildOrCtsQueryExpressionInternal([phraseQuery, buildCtsNearQueryExpression({
2295
- queryExpressions: terms.map((term) => buildCtsWordQueryExpression({
2296
- value: term,
2297
- matchMode: "exact",
2298
- isCaseSensitive,
2299
- queryFamily: "text",
2300
- language
2301
- })),
2302
- distance: 2,
2303
- isOrdered: true
2304
- })]);
2290
+ return buildOrCtsQueryExpressionInternal([phraseQuery, buildAndCtsQueryExpressionInternal(terms.map((term) => buildRichTextPhraseQueryExpression({
2291
+ value: term,
2292
+ isCaseSensitive
2293
+ })))]);
2305
2294
  }
2306
2295
  function buildCtsElementWordQueryExpression(params) {
2307
2296
  const { elementName, value, matchMode, isCaseSensitive, queryFamily, language } = params;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "0.22.18",
3
+ "version": "0.22.19",
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",