ochre-sdk 0.21.3 → 0.21.4

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
@@ -689,6 +689,19 @@ type QueryLeaf = {
689
689
  propertyVariable: string;
690
690
  dataType: "date" | "dateTime";
691
691
  propertyValues?: never;
692
+ value: string;
693
+ from?: never;
694
+ to?: never;
695
+ matchMode: "includes" | "exact";
696
+ isCaseSensitive: boolean;
697
+ language: string;
698
+ isNegated?: boolean;
699
+ } | {
700
+ target: "property";
701
+ propertyVariable: string;
702
+ dataType: "date" | "dateTime";
703
+ propertyValues?: never;
704
+ value?: never;
692
705
  from: string;
693
706
  to?: string;
694
707
  matchMode: "includes" | "exact";
@@ -700,6 +713,7 @@ type QueryLeaf = {
700
713
  propertyVariable: string;
701
714
  dataType: "date" | "dateTime";
702
715
  propertyValues?: never;
716
+ value?: never;
703
717
  from?: string;
704
718
  to: string;
705
719
  matchMode: "includes" | "exact";
@@ -793,9 +807,14 @@ type StylesheetItem = {
793
807
  mobile: Array<Style>;
794
808
  };
795
809
  };
796
- type WebsitePropertyQueryNode = Query extends infer QueryNode ? QueryNode extends {
810
+ type WebsitePropertyQueryNode = {
797
811
  target: "property";
798
- } ? Omit<QueryNode, "propertyValues" | "from" | "to" | "isNegated"> : never : never;
812
+ propertyVariable: string;
813
+ dataType: Exclude<PropertyValueContentType, "coordinate">;
814
+ matchMode: "includes" | "exact";
815
+ isCaseSensitive: boolean;
816
+ language: string;
817
+ };
799
818
  type WebsitePropertyQuery = WebsitePropertyQueryNode | {
800
819
  and: Array<WebsitePropertyQuery>;
801
820
  } | {
package/dist/index.mjs CHANGED
@@ -783,6 +783,19 @@ const setQueryLeafSchema = z.union([
783
783
  target: z.literal("property"),
784
784
  propertyVariable: uuidSchema,
785
785
  dataType: z.enum(["date", "dateTime"]),
786
+ value: z.string(),
787
+ from: z.never().optional(),
788
+ to: z.never().optional(),
789
+ matchMode: z.enum(["includes", "exact"]),
790
+ isCaseSensitive: z.boolean(),
791
+ language: z.string().default("eng"),
792
+ isNegated: z.boolean().optional().default(false)
793
+ }).strict(),
794
+ z.object({
795
+ target: z.literal("property"),
796
+ propertyVariable: uuidSchema,
797
+ dataType: z.enum(["date", "dateTime"]),
798
+ value: z.never().optional(),
786
799
  from: z.string(),
787
800
  to: z.string().optional(),
788
801
  matchMode: z.enum(["includes", "exact"]),
@@ -794,6 +807,7 @@ const setQueryLeafSchema = z.union([
794
807
  target: z.literal("property"),
795
808
  propertyVariable: uuidSchema,
796
809
  dataType: z.enum(["date", "dateTime"]),
810
+ value: z.never().optional(),
797
811
  from: z.string().optional(),
798
812
  to: z.string(),
799
813
  matchMode: z.enum(["includes", "exact"]),
@@ -2715,7 +2729,8 @@ function buildPropertyClause(params) {
2715
2729
  const propertyVariable = query.propertyVariable;
2716
2730
  let candidateQueryVar = null;
2717
2731
  if (propertyVariable != null) predicateParts.push(buildPropertyLabelPredicate(propertyVariable));
2718
- if (query.dataType === "date" || query.dataType === "dateTime") predicateParts.push(buildDateRangePredicate({
2732
+ if (query.dataType === "date" || query.dataType === "dateTime") if ("value" in query && query.value != null) predicateParts.push(`value/@rawValue = ${stringLiteral(query.value)}`);
2733
+ else predicateParts.push(buildDateRangePredicate({
2719
2734
  from: query.from,
2720
2735
  to: query.to
2721
2736
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "0.21.3",
3
+ "version": "0.21.4",
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",
@@ -51,7 +51,7 @@
51
51
  "bumpp": "^11.0.1",
52
52
  "eslint": "^10.1.0",
53
53
  "prettier": "^3.8.1",
54
- "tsdown": "^0.21.6",
54
+ "tsdown": "^0.21.7",
55
55
  "typescript": "^6.0.2"
56
56
  },
57
57
  "scripts": {