@finos/legend-query-builder 4.2.4 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +3 -1
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderSideBar.d.ts +16 -0
  5. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  6. package/lib/components/QueryBuilderSideBar.js +85 -7
  7. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  8. package/lib/components/QueryChat.d.ts.map +1 -1
  9. package/lib/components/QueryChat.js +1 -1
  10. package/lib/components/QueryChat.js.map +1 -1
  11. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +2 -2
  12. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
  13. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
  14. package/lib/components/explorer/QueryBuilderExplorerPanel.js +5 -1
  15. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  16. package/lib/components/workflows/ClassQueryBuilder.d.ts.map +1 -1
  17. package/lib/components/workflows/ClassQueryBuilder.js +13 -9
  18. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  19. package/lib/components/workflows/MappingQueryBuilder.d.ts.map +1 -1
  20. package/lib/components/workflows/MappingQueryBuilder.js +13 -11
  21. package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
  22. package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
  23. package/lib/components/workflows/ServiceQueryBuilder.js +3 -2
  24. package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
  25. package/lib/index.css +1 -1
  26. package/lib/index.d.ts +1 -0
  27. package/lib/index.d.ts.map +1 -1
  28. package/lib/index.js +1 -0
  29. package/lib/index.js.map +1 -1
  30. package/lib/package.json +1 -1
  31. package/lib/stores/QueryBuilderExecutionContextState.d.ts +34 -0
  32. package/lib/stores/QueryBuilderExecutionContextState.d.ts.map +1 -0
  33. package/lib/stores/QueryBuilderExecutionContextState.js +59 -0
  34. package/lib/stores/QueryBuilderExecutionContextState.js.map +1 -0
  35. package/lib/stores/QueryBuilderInternalizeState.d.ts +24 -0
  36. package/lib/stores/QueryBuilderInternalizeState.d.ts.map +1 -0
  37. package/lib/stores/QueryBuilderInternalizeState.js +26 -0
  38. package/lib/stores/QueryBuilderInternalizeState.js.map +1 -0
  39. package/lib/stores/QueryBuilderResultState.js +5 -5
  40. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  41. package/lib/stores/QueryBuilderState.d.ts +7 -5
  42. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  43. package/lib/stores/QueryBuilderState.js +19 -17
  44. package/lib/stores/QueryBuilderState.js.map +1 -1
  45. package/lib/stores/QueryBuilderStateBuilder.d.ts +1 -1
  46. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  47. package/lib/stores/QueryBuilderStateBuilder.js +27 -2
  48. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  49. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  50. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +28 -2
  51. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  52. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.d.ts.map +1 -1
  53. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js +2 -2
  54. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js.map +1 -1
  55. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.d.ts.map +1 -1
  56. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.js +6 -4
  57. package/lib/stores/entitlements/QueryBuilderCheckEntitlementsState.js.map +1 -1
  58. package/lib/stores/explorer/QueryBuilderExplorerState.js +9 -9
  59. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  60. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +2 -1
  61. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
  62. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +25 -2
  63. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  64. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +1 -1
  65. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  66. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  67. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +3 -1
  68. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  69. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  70. package/lib/stores/filter/QueryBuilderFilterState.js +2 -1
  71. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  72. package/lib/stores/workflows/ClassQueryBuilderState.d.ts.map +1 -1
  73. package/lib/stores/workflows/ClassQueryBuilderState.js +2 -1
  74. package/lib/stores/workflows/ClassQueryBuilderState.js.map +1 -1
  75. package/lib/stores/workflows/FunctionQueryBuilderState.d.ts +23 -0
  76. package/lib/stores/workflows/FunctionQueryBuilderState.d.ts.map +1 -0
  77. package/lib/stores/workflows/FunctionQueryBuilderState.js +27 -0
  78. package/lib/stores/workflows/FunctionQueryBuilderState.js.map +1 -0
  79. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
  80. package/lib/stores/workflows/ServiceQueryBuilderState.js +7 -7
  81. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  82. package/package.json +4 -4
  83. package/src/components/QueryBuilder.tsx +5 -1
  84. package/src/components/QueryBuilderSideBar.tsx +211 -7
  85. package/src/components/QueryChat.tsx +2 -1
  86. package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +2 -2
  87. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +5 -1
  88. package/src/components/workflows/ClassQueryBuilder.tsx +17 -9
  89. package/src/components/workflows/MappingQueryBuilder.tsx +15 -11
  90. package/src/components/workflows/ServiceQueryBuilder.tsx +3 -2
  91. package/src/index.ts +1 -0
  92. package/src/stores/QueryBuilderExecutionContextState.ts +69 -0
  93. package/src/stores/QueryBuilderInternalizeState.ts +34 -0
  94. package/src/stores/QueryBuilderResultState.ts +6 -6
  95. package/src/stores/QueryBuilderState.ts +28 -21
  96. package/src/stores/QueryBuilderStateBuilder.ts +79 -1
  97. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +50 -1
  98. package/src/stores/__test-utils__/QueryBuilderStateTestUtils.ts +4 -2
  99. package/src/stores/entitlements/QueryBuilderCheckEntitlementsState.ts +6 -4
  100. package/src/stores/explorer/QueryBuilderExplorerState.ts +9 -9
  101. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +64 -2
  102. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +1 -1
  103. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +4 -2
  104. package/src/stores/filter/QueryBuilderFilterState.ts +5 -2
  105. package/src/stores/workflows/ClassQueryBuilderState.ts +2 -1
  106. package/src/stores/workflows/FunctionQueryBuilderState.ts +38 -0
  107. package/src/stores/workflows/ServiceQueryBuilderState.ts +7 -11
  108. package/tsconfig.json +3 -0
@@ -78,12 +78,8 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
78
78
  this.onExecutionContextChange = onExecutionContextChange;
79
79
 
80
80
  if (service.execution instanceof PureSingleExecution) {
81
- assertTrue(
82
- Boolean(service.execution.mapping && service.execution.runtime),
83
- 'Service queries without runtime/mapping are not supported',
84
- );
85
- this.mapping = service.execution.mapping?.value;
86
- this.runtimeValue = service.execution.runtime;
81
+ this.executionContextState.mapping = service.execution.mapping?.value;
82
+ this.executionContextState.runtimeValue = service.execution.runtime;
87
83
  } else if (service.execution instanceof PureMultiExecution) {
88
84
  this.executionContexts = service.execution.executionParameters.map(
89
85
  (ep) => ({
@@ -92,7 +88,6 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
92
88
  runtimeValue: ep.runtime,
93
89
  }),
94
90
  );
95
-
96
91
  let selectedExecutionContext: ServiceExecutionContext;
97
92
  if (executionContextKey) {
98
93
  const matchingExecutionContext = this.executionContexts.find(
@@ -115,8 +110,9 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
115
110
  }
116
111
 
117
112
  this.setSelectedExecutionContext(selectedExecutionContext);
118
- this.mapping = selectedExecutionContext.mapping;
119
- this.runtimeValue = selectedExecutionContext.runtimeValue;
113
+ this.executionContextState.mapping = selectedExecutionContext.mapping;
114
+ this.executionContextState.runtimeValue =
115
+ selectedExecutionContext.runtimeValue;
120
116
  }
121
117
  }
122
118
 
@@ -131,11 +127,11 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
131
127
  }
132
128
 
133
129
  override get isMappingReadOnly(): boolean {
134
- return true;
130
+ return !this.executionContextState.specifiedInQuery;
135
131
  }
136
132
 
137
133
  override get isRuntimeReadOnly(): boolean {
138
- return true;
134
+ return !this.executionContextState.specifiedInQuery;
139
135
  }
140
136
 
141
137
  /**
package/tsconfig.json CHANGED
@@ -58,7 +58,9 @@
58
58
  "./src/stores/QueryBuilderCommand.ts",
59
59
  "./src/stores/QueryBuilderConfig.ts",
60
60
  "./src/stores/QueryBuilderConstantsState.ts",
61
+ "./src/stores/QueryBuilderExecutionContextState.ts",
61
62
  "./src/stores/QueryBuilderGroupOperationHelper.ts",
63
+ "./src/stores/QueryBuilderInternalizeState.ts",
62
64
  "./src/stores/QueryBuilderParametersState.ts",
63
65
  "./src/stores/QueryBuilderPreviewDataHelper.ts",
64
66
  "./src/stores/QueryBuilderPropertyEditorState.ts",
@@ -205,6 +207,7 @@
205
207
  "./src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts",
206
208
  "./src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts",
207
209
  "./src/stores/workflows/ClassQueryBuilderState.ts",
210
+ "./src/stores/workflows/FunctionQueryBuilderState.ts",
208
211
  "./src/stores/workflows/MappingQueryBuilderState.ts",
209
212
  "./src/stores/workflows/ServiceQueryBuilderState.ts",
210
213
  "./src/components/QueryBuilder.tsx",