@fibery/query-utils 1.1.1 → 1.1.2

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.
@@ -1,4 +1,4 @@
1
- import { Expression, FiberyObject, OrderBy } from "@fibery/expression-utils/src/types";
1
+ import { Expression, FieldExpression, FiberyObject, OrderBy } from "@fibery/expression-utils/src/types";
2
2
  import { FieldObject, TypeObject } from "@fibery/schema";
3
3
  import { $TSFixMe } from "./tsfixme";
4
4
  export declare const extractReferenceField: (expression: Expression) => string;
@@ -9,7 +9,7 @@ export declare function extractFieldObjectFromExpression({ expression, typeObjec
9
9
  typeObject: TypeObject;
10
10
  }): FieldObject | null;
11
11
  export declare const warnAboutNonProcessedKeys: (location: string, rest: Record<string, unknown>) => void;
12
- export declare const getValueByFieldExpression: (object: $TSFixMe, path: Expression) => any;
12
+ export declare const getValueByFieldExpression: (object: $TSFixMe, path: FieldExpression) => any;
13
13
  export declare const parseMultiFieldValue: ({ multiFieldValue, multiFieldObject, }: {
14
14
  multiFieldValue?: Record<string, unknown> | null;
15
15
  multiFieldObject: FieldObject;
@@ -33,10 +33,10 @@ export declare const calculateSortObjectsFn: ({ typeObject }: {
33
33
  <T>(value: T): T;
34
34
  (): undefined;
35
35
  } | ((objects: $TSFixMe) => any[]);
36
- export declare const extractSingleField: (expression: Expression) => string;
36
+ export declare const extractSingleField: (expression: FieldExpression) => string;
37
37
  export declare const getQuerySelectForExpression: ({ typeObject, expression, selectsByTypeLookup, }: {
38
38
  typeObject: TypeObject;
39
- expression: Expression;
39
+ expression: FieldExpression;
40
40
  selectsByTypeLookup?: Record<string, $TSFixMe>;
41
41
  }) => any;
42
42
  export declare const getOrderBySelect: (orderBy: OrderBy | undefined | null, typeObject: TypeObject) => any;
package/lib/src/query.js CHANGED
@@ -70,7 +70,6 @@ const warnAboutNonProcessedKeys = (location, rest) => {
70
70
  };
71
71
  exports.warnAboutNonProcessedKeys = warnAboutNonProcessedKeys;
72
72
  const getValueByFieldExpression = (object, path) => {
73
- // TODO: review types. According to Expression it might be nested array but looks like we ignore it everywhere
74
73
  return path.reduce((memo, key) => {
75
74
  if (memo === undefined) {
76
75
  return undefined;
@@ -187,9 +186,9 @@ const getOrderBySelect = (orderBy, typeObject) => {
187
186
  const orderingExpression = ordering[0];
188
187
  return (0, exports.getQuerySelectForExpression)({
189
188
  typeObject,
190
- expression: (0, utils_1.isDateRangeFunctionExpression)(orderingExpression)
189
+ expression: ((0, utils_1.isDateRangeFunctionExpression)(orderingExpression)
191
190
  ? orderingExpression[1]
192
- : orderingExpression,
191
+ : orderingExpression),
193
192
  });
194
193
  })
195
194
  // always include rank, as it is used for card creation, see `calculateNewCardRank`.
@@ -23,7 +23,7 @@ export declare const annotateNormalizedSelect: (normalizedSelect: Select) => ({
23
23
  isDynamicSelect: boolean;
24
24
  };
25
25
  rhs: {
26
- value: any;
26
+ value: Expression | Record<string, Expression>;
27
27
  isDynamicSelect: boolean;
28
28
  isQueryExpression: boolean;
29
29
  isPlainObject: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/query-utils",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Construct, normalize and denormalize Fibery core queries",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "memoize-one": "6.0.0",
28
28
  "moment": "2.29.4",
29
29
  "uuid": "11.1.0",
30
- "@fibery/expression-utils": "9.6.1",
30
+ "@fibery/expression-utils": "9.6.2",
31
31
  "@fibery/helpers": "1.4.0"
32
32
  },
33
33
  "devDependencies": {
@@ -39,10 +39,10 @@
39
39
  "typescript": "5.9.3",
40
40
  "@fibery/babel-preset": "7.4.1",
41
41
  "@fibery/eslint-config": "9.0.0",
42
- "@fibery/schema": "10.2.12"
42
+ "@fibery/schema": "10.2.13"
43
43
  },
44
44
  "peerDependencies": {
45
- "@fibery/schema": "10.2.12"
45
+ "@fibery/schema": "10.2.13"
46
46
  },
47
47
  "jest": {
48
48
  "testEnvironment": "node",