@finos/legend-query-builder 4.14.88 → 4.14.89

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
  2. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +2 -4
  3. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  4. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
  5. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +17 -3
  6. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
  7. package/lib/index.css +1 -1
  8. package/lib/index.d.ts +3 -1
  9. package/lib/index.d.ts.map +1 -1
  10. package/lib/index.js +3 -1
  11. package/lib/index.js.map +1 -1
  12. package/lib/package.json +1 -1
  13. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.d.ts +2 -2
  14. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.d.ts.map +1 -1
  15. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.js.map +1 -1
  16. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +4 -4
  17. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  18. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +3 -3
  19. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  20. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.d.ts.map +1 -1
  21. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js +12 -2
  22. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js.map +1 -1
  23. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.d.ts.map +1 -1
  24. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js +5 -5
  25. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js.map +1 -1
  26. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.d.ts +3 -3
  27. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.d.ts.map +1 -1
  28. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.js +32 -20
  29. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.js.map +1 -1
  30. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.d.ts +3 -3
  31. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.d.ts.map +1 -1
  32. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +5 -5
  33. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
  34. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.d.ts +3 -3
  35. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.d.ts.map +1 -1
  36. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +5 -5
  37. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
  38. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.d.ts +3 -3
  39. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
  40. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +6 -6
  41. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  42. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.d.ts +2 -2
  43. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
  44. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +4 -4
  45. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  46. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.d.ts +2 -2
  47. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.d.ts.map +1 -1
  48. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js +4 -4
  49. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js.map +1 -1
  50. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.d.ts +3 -3
  51. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.d.ts.map +1 -1
  52. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js +5 -5
  53. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js.map +1 -1
  54. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.d.ts +2 -2
  55. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.d.ts.map +1 -1
  56. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js +3 -3
  57. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js.map +1 -1
  58. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.d.ts +2 -2
  59. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
  60. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +4 -4
  61. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  62. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.d.ts +2 -2
  63. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.d.ts.map +1 -1
  64. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js +4 -4
  65. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js.map +1 -1
  66. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.d.ts +3 -3
  67. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.d.ts.map +1 -1
  68. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +5 -5
  69. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
  70. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  71. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  72. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.d.ts.map +1 -1
  73. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.js +13 -3
  74. package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.js.map +1 -1
  75. package/package.json +5 -5
  76. package/src/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +4 -5
  77. package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +23 -7
  78. package/src/index.ts +7 -0
  79. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.ts +2 -0
  80. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +14 -3
  81. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.ts +14 -11
  82. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.ts +9 -3
  83. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.ts +51 -27
  84. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +7 -2
  85. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +7 -2
  86. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +7 -2
  87. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +5 -2
  88. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.ts +5 -2
  89. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.ts +7 -2
  90. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.ts +5 -2
  91. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +5 -2
  92. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.ts +5 -2
  93. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +7 -2
  94. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +0 -2
  95. package/src/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuidler.ts +30 -2
@@ -19,6 +19,7 @@ import {
19
19
  type ValueSpecification,
20
20
  AbstractPropertyExpression,
21
21
  type FunctionExpression,
22
+ type LambdaFunction,
22
23
  PRIMITIVE_TYPE,
23
24
  PrimitiveType,
24
25
  } from '@finos/legend-graph';
@@ -35,7 +36,7 @@ import type {
35
36
  QueryBuilderPostFilterState,
36
37
  } from '../QueryBuilderPostFilterState.js';
37
38
  import { isTypeCompatibleForAssignment } from '../../../../QueryBuilderValueSpecificationHelper.js';
38
- import { buildPostFilterConditionExpression } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
39
+ import { buildPostFilterConditionExpressionHelper } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
39
40
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../graph/QueryBuilderMetaModelConst.js';
40
41
  import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../../../QueryBuilderStateHashUtils.js';
41
42
  import { buildDefaultInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
@@ -107,8 +108,9 @@ export class QueryBuilderPostFilterOperator_LessThan
107
108
 
108
109
  buildPostFilterConditionExpression(
109
110
  postFilterConditionState: PostFilterConditionState,
111
+ parentExpression: LambdaFunction | undefined,
110
112
  ): ValueSpecification | undefined {
111
- return buildPostFilterConditionExpression(
113
+ return buildPostFilterConditionExpressionHelper(
112
114
  postFilterConditionState,
113
115
  this,
114
116
  postFilterConditionState.leftConditionValue.getColumnType() ===
@@ -117,6 +119,7 @@ export class QueryBuilderPostFilterOperator_LessThan
117
119
  PrimitiveType.DATETIME
118
120
  ? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_BEFORE_DAY
119
121
  : QUERY_BUILDER_SUPPORTED_FUNCTIONS.LESS_THAN,
122
+ parentExpression,
120
123
  );
121
124
  }
122
125
 
@@ -17,6 +17,7 @@
17
17
  import {
18
18
  type FunctionExpression,
19
19
  type ValueSpecification,
20
+ type LambdaFunction,
20
21
  AbstractPropertyExpression,
21
22
  PRIMITIVE_TYPE,
22
23
  PrimitiveType,
@@ -26,7 +27,7 @@ import type {
26
27
  PostFilterConditionState,
27
28
  QueryBuilderPostFilterState,
28
29
  } from '../QueryBuilderPostFilterState.js';
29
- import { buildPostFilterConditionExpression } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
30
+ import { buildPostFilterConditionExpressionHelper } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
30
31
  import { QueryBuilderPostFilterOperator_LessThan } from './QueryBuilderPostFilterOperator_LessThan.js';
31
32
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../graph/QueryBuilderMetaModelConst.js';
32
33
  import { type Hashable, hashArray } from '@finos/legend-shared';
@@ -42,8 +43,9 @@ export class QueryBuilderPostFilterOperator_LessThanEqual
42
43
 
43
44
  override buildPostFilterConditionExpression(
44
45
  postFilterConditionState: PostFilterConditionState,
46
+ parentExpression: LambdaFunction | undefined,
45
47
  ): ValueSpecification | undefined {
46
- return buildPostFilterConditionExpression(
48
+ return buildPostFilterConditionExpressionHelper(
47
49
  postFilterConditionState,
48
50
  this,
49
51
  postFilterConditionState.leftConditionValue.getColumnType() ===
@@ -52,6 +54,7 @@ export class QueryBuilderPostFilterOperator_LessThanEqual
52
54
  PrimitiveType.DATETIME
53
55
  ? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_OR_BEFORE_DAY
54
56
  : QUERY_BUILDER_SUPPORTED_FUNCTIONS.LESS_THAN_EQUAL,
57
+ parentExpression,
55
58
  );
56
59
  }
57
60
 
@@ -19,6 +19,7 @@ import {
19
19
  type ValueSpecification,
20
20
  type SimpleFunctionExpression,
21
21
  type FunctionExpression,
22
+ type LambdaFunction,
22
23
  PRIMITIVE_TYPE,
23
24
  PrimitiveType,
24
25
  } from '@finos/legend-graph';
@@ -37,7 +38,7 @@ import {
37
38
  buildNotExpression,
38
39
  unwrapNotExpression,
39
40
  } from '../../../../QueryBuilderValueSpecificationHelper.js';
40
- import { buildPostFilterConditionExpression } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
41
+ import { buildPostFilterConditionExpressionHelper } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
41
42
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../graph/QueryBuilderMetaModelConst.js';
42
43
  import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../../../QueryBuilderStateHashUtils.js';
43
44
  import { buildDefaultInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
@@ -89,11 +90,13 @@ export class QueryBuilderPostFilterOperator_StartWith
89
90
 
90
91
  buildPostFilterConditionExpression(
91
92
  postFilterConditionState: PostFilterConditionState,
93
+ parentExpression: LambdaFunction | undefined,
92
94
  ): ValueSpecification | undefined {
93
- return buildPostFilterConditionExpression(
95
+ return buildPostFilterConditionExpressionHelper(
94
96
  postFilterConditionState,
95
97
  this,
96
98
  QUERY_BUILDER_SUPPORTED_FUNCTIONS.STARTS_WITH,
99
+ parentExpression,
97
100
  );
98
101
  }
99
102
 
@@ -125,9 +128,11 @@ export class QueryBuilderPostFilterOperator_NotStartWith
125
128
 
126
129
  override buildPostFilterConditionExpression(
127
130
  postFilterConditionState: PostFilterConditionState,
131
+ parentExpression: LambdaFunction | undefined,
128
132
  ): ValueSpecification | undefined {
129
133
  const expression = super.buildPostFilterConditionExpression(
130
134
  postFilterConditionState,
135
+ parentExpression,
131
136
  );
132
137
  return expression ? buildNotExpression(expression) : undefined;
133
138
  }
@@ -251,7 +251,6 @@ export const appendProjection = (
251
251
  lambdaFunction.expressionSequence[0],
252
252
  `Can't build projection expression: preceding expression is not defined`,
253
253
  );
254
-
255
254
  // build projection
256
255
  if (tdsState.aggregationState.columns.length) {
257
256
  // aggregation
@@ -498,7 +497,6 @@ export const appendProjection = (
498
497
  lambdaFunction.expressionSequence[0] = projectFunction;
499
498
  }
500
499
  }
501
-
502
500
  // build olapGroupBy
503
501
  appendOLAPGroupByState(tdsState.windowState, lambdaFunction);
504
502
 
@@ -26,6 +26,11 @@ import {
26
26
  V1_serializeRawValueSpecification,
27
27
  V1_transformRawLambda,
28
28
  V1_GraphTransformerContextBuilder,
29
+ GenericType,
30
+ GenericTypeExplicitReference,
31
+ Relation_Relation,
32
+ Relation_RelationalColumn,
33
+ Relation_RelationType,
29
34
  } from '@finos/legend-graph';
30
35
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../graph/QueryBuilderMetaModelConst.js';
31
36
  import {
@@ -38,7 +43,10 @@ import {
38
43
  buildPropertyExpressionChain,
39
44
  type LambdaFunctionBuilderOption,
40
45
  } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
41
- import { UnsupportedOperationError } from '@finos/legend-shared';
46
+ import {
47
+ guaranteeNonNullable,
48
+ UnsupportedOperationError,
49
+ } from '@finos/legend-shared';
42
50
 
43
51
  export const buildRelationProjection = (
44
52
  precedingExpression: ValueSpecification,
@@ -46,7 +54,9 @@ export const buildRelationProjection = (
46
54
  options?: LambdaFunctionBuilderOption,
47
55
  ): SimpleFunctionExpression => {
48
56
  const projectFunction = new SimpleFunctionExpression(
49
- extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.TDS_PROJECT),
57
+ extractElementNameFromPath(
58
+ QUERY_BUILDER_SUPPORTED_FUNCTIONS.RELATION_PROJECT,
59
+ ),
50
60
  );
51
61
  const queryBuilderState = tdsState.queryBuilderState;
52
62
 
@@ -54,6 +64,7 @@ export const buildRelationProjection = (
54
64
 
55
65
  const colSepcArray = new ColSpecArray();
56
66
  instanceVal.values = [colSepcArray];
67
+ const relationType = new Relation_RelationType(Relation_RelationType.ID);
57
68
 
58
69
  tdsState.projectionColumns.forEach((projectionColumnState) => {
59
70
  const colSpec = new ColSpec();
@@ -102,7 +113,24 @@ export const buildRelationProjection = (
102
113
  );
103
114
  }
104
115
  colSpec.function1 = columnLambda;
116
+ const returnType = guaranteeNonNullable(
117
+ projectionColumnState.getColumnType(),
118
+ `Can't create value spec for projection column ${projectionColumnState.columnName}`,
119
+ );
120
+ relationType.columns.push(
121
+ new Relation_RelationalColumn(
122
+ projectionColumnState.columnName,
123
+ returnType,
124
+ ),
125
+ );
105
126
  });
106
127
  projectFunction.parametersValues = [precedingExpression, instanceVal];
128
+ const relationGenericType = new GenericType(Relation_Relation.INSTANCE);
129
+ const relationTypeGenericType = new GenericType(relationType);
130
+ relationGenericType.typeArguments = [
131
+ GenericTypeExplicitReference.create(relationTypeGenericType),
132
+ ];
133
+ projectFunction.genericType =
134
+ GenericTypeExplicitReference.create(relationGenericType);
107
135
  return projectFunction;
108
136
  };