@finos/legend-application-data-cube 0.1.5 → 0.1.7

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.
Files changed (181) hide show
  1. package/lib/__lib__/LegendDataCubeNavigation.d.ts +5 -5
  2. package/lib/__lib__/LegendDataCubeNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendDataCubeNavigation.js +5 -5
  4. package/lib/__lib__/LegendDataCubeNavigation.js.map +1 -1
  5. package/lib/{stores/source/CubeInputSource.js → __lib__/LegendDataCubeSetting.d.ts} +6 -14
  6. package/lib/__lib__/LegendDataCubeSetting.d.ts.map +1 -0
  7. package/lib/__lib__/LegendDataCubeSetting.js +25 -0
  8. package/lib/__lib__/LegendDataCubeSetting.js.map +1 -0
  9. package/lib/{stores/model/DataCubeQueryContent.js → __lib__/LegendDataCubeUserData.d.ts} +4 -5
  10. package/lib/__lib__/LegendDataCubeUserData.d.ts.map +1 -0
  11. package/lib/{stores/model/DataCubeGenericSource.d.ts → __lib__/LegendDataCubeUserData.js} +6 -3
  12. package/lib/__lib__/LegendDataCubeUserData.js.map +1 -0
  13. package/lib/application/LegendDataCube.d.ts.map +1 -1
  14. package/lib/application/LegendDataCube.js.map +1 -1
  15. package/lib/application/LegendDataCubeApplicationConfig.d.ts +1 -1
  16. package/lib/application/LegendDataCubeApplicationConfig.d.ts.map +1 -1
  17. package/lib/application/LegendDataCubeApplicationConfig.js +3 -1
  18. package/lib/application/LegendDataCubeApplicationConfig.js.map +1 -1
  19. package/lib/application/LegendDataCubePluginManager.d.ts.map +1 -1
  20. package/lib/application/LegendDataCubePluginManager.js.map +1 -1
  21. package/lib/components/LegendDataCubeFrameworkProvider.d.ts +2 -2
  22. package/lib/components/LegendDataCubeFrameworkProvider.d.ts.map +1 -1
  23. package/lib/components/LegendDataCubeFrameworkProvider.js +5 -5
  24. package/lib/components/LegendDataCubeFrameworkProvider.js.map +1 -1
  25. package/lib/components/LegendDataCubeWebApplication.d.ts.map +1 -1
  26. package/lib/components/LegendDataCubeWebApplication.js +25 -6
  27. package/lib/components/LegendDataCubeWebApplication.js.map +1 -1
  28. package/lib/components/{source/DataCubeSourceEditor.d.ts → query-builder/LegendDataCubeNewQueryBuilder.d.ts} +4 -4
  29. package/lib/components/query-builder/LegendDataCubeNewQueryBuilder.d.ts.map +1 -0
  30. package/lib/components/query-builder/LegendDataCubeNewQueryBuilder.js +45 -0
  31. package/lib/components/query-builder/LegendDataCubeNewQueryBuilder.js.map +1 -0
  32. package/{src/stores/model/DataCubeGenericSource.ts → lib/components/query-builder/LegendDataCubeQueryBuilder.d.ts} +2 -2
  33. package/lib/components/query-builder/LegendDataCubeQueryBuilder.d.ts.map +1 -0
  34. package/lib/components/query-builder/LegendDataCubeQueryBuilder.js +85 -0
  35. package/lib/components/query-builder/LegendDataCubeQueryBuilder.js.map +1 -0
  36. package/lib/components/query-builder/LegendDataCubeQueryBuilderStoreProvider.d.ts +19 -0
  37. package/lib/components/query-builder/LegendDataCubeQueryBuilderStoreProvider.d.ts.map +1 -0
  38. package/lib/components/query-builder/LegendDataCubeQueryBuilderStoreProvider.js +33 -0
  39. package/lib/components/query-builder/LegendDataCubeQueryBuilderStoreProvider.js.map +1 -0
  40. package/lib/components/{source/ExistingDataCubeQuery.d.ts → query-builder/LegendDataCubeQueryLoader.d.ts} +2 -2
  41. package/lib/components/query-builder/LegendDataCubeQueryLoader.d.ts.map +1 -0
  42. package/lib/components/query-builder/LegendDataCubeQueryLoader.js +99 -0
  43. package/lib/components/query-builder/LegendDataCubeQueryLoader.js.map +1 -0
  44. package/lib/components/{DataCubeEditor.d.ts → query-builder/LegendDataCubeQuerySaver.d.ts} +2 -2
  45. package/lib/components/query-builder/LegendDataCubeQuerySaver.d.ts.map +1 -0
  46. package/lib/components/query-builder/LegendDataCubeQuerySaver.js +49 -0
  47. package/lib/components/query-builder/LegendDataCubeQuerySaver.js.map +1 -0
  48. package/lib/components/{source/SavedQuerySourceEditor.d.ts → query-builder/source-builder/AdhocQueryDataCubeSourceBuilder.d.ts} +4 -4
  49. package/lib/components/query-builder/source-builder/AdhocQueryDataCubeSourceBuilder.d.ts.map +1 -0
  50. package/lib/components/query-builder/source-builder/AdhocQueryDataCubeSourceBuilder.js +22 -0
  51. package/lib/components/query-builder/source-builder/AdhocQueryDataCubeSourceBuilder.js.map +1 -0
  52. package/lib/components/query-builder/source-builder/LegendQueryDataCubeSourceBuilder.d.ts +22 -0
  53. package/lib/components/query-builder/source-builder/LegendQueryDataCubeSourceBuilder.d.ts.map +1 -0
  54. package/lib/components/query-builder/source-builder/LegendQueryDataCubeSourceBuilder.js +97 -0
  55. package/lib/components/query-builder/source-builder/LegendQueryDataCubeSourceBuilder.js.map +1 -0
  56. package/lib/index.css +2 -2
  57. package/lib/index.css.map +1 -1
  58. package/lib/package.json +2 -2
  59. package/lib/stores/LegendDataCubeBaseStore.d.ts +41 -0
  60. package/lib/stores/LegendDataCubeBaseStore.d.ts.map +1 -0
  61. package/lib/stores/LegendDataCubeBaseStore.js +123 -0
  62. package/lib/stores/LegendDataCubeBaseStore.js.map +1 -0
  63. package/lib/stores/LegendDataCubeDataCubeEngine.d.ts +65 -0
  64. package/lib/stores/LegendDataCubeDataCubeEngine.d.ts.map +1 -0
  65. package/lib/stores/LegendDataCubeDataCubeEngine.js +249 -0
  66. package/lib/stores/LegendDataCubeDataCubeEngine.js.map +1 -0
  67. package/lib/stores/model/LegendQueryDataCubeSource.d.ts +32 -0
  68. package/lib/stores/model/LegendQueryDataCubeSource.d.ts.map +1 -0
  69. package/lib/stores/model/LegendQueryDataCubeSource.js +35 -0
  70. package/lib/stores/model/LegendQueryDataCubeSource.js.map +1 -0
  71. package/lib/stores/query-builder/LegendDataCubeNewQueryState.d.ts +34 -0
  72. package/lib/stores/query-builder/LegendDataCubeNewQueryState.d.ts.map +1 -0
  73. package/lib/stores/query-builder/LegendDataCubeNewQueryState.js +92 -0
  74. package/lib/stores/query-builder/LegendDataCubeNewQueryState.js.map +1 -0
  75. package/lib/stores/query-builder/LegendDataCubeQueryBuilderStore.d.ts +52 -0
  76. package/lib/stores/query-builder/LegendDataCubeQueryBuilderStore.d.ts.map +1 -0
  77. package/lib/stores/query-builder/LegendDataCubeQueryBuilderStore.js +211 -0
  78. package/lib/stores/query-builder/LegendDataCubeQueryBuilderStore.js.map +1 -0
  79. package/lib/stores/query-builder/LegendDataCubeQueryLoaderState.d.ts +54 -0
  80. package/lib/stores/query-builder/LegendDataCubeQueryLoaderState.d.ts.map +1 -0
  81. package/lib/stores/query-builder/LegendDataCubeQueryLoaderState.js +197 -0
  82. package/lib/stores/query-builder/LegendDataCubeQueryLoaderState.js.map +1 -0
  83. package/lib/stores/{model/DataCubeQueryContent.d.ts → query-builder/source-builder/AdhocQueryDataCubeSourceBuilderState.d.ts} +7 -7
  84. package/lib/stores/query-builder/source-builder/AdhocQueryDataCubeSourceBuilderState.d.ts.map +1 -0
  85. package/lib/stores/{model/LegendSavedQuerySource.js → query-builder/source-builder/AdhocQueryDataCubeSourceBuilderState.js} +12 -7
  86. package/lib/stores/query-builder/source-builder/AdhocQueryDataCubeSourceBuilderState.js.map +1 -0
  87. package/lib/stores/query-builder/source-builder/LegendDataCubeSourceBuilderState.d.ts +33 -0
  88. package/lib/stores/query-builder/source-builder/LegendDataCubeSourceBuilderState.d.ts.map +1 -0
  89. package/lib/stores/query-builder/source-builder/LegendDataCubeSourceBuilderState.js +31 -0
  90. package/lib/stores/query-builder/source-builder/LegendDataCubeSourceBuilderState.js.map +1 -0
  91. package/lib/stores/query-builder/source-builder/LegendQueryDataCubeSourceBuilderState.d.ts +31 -0
  92. package/lib/stores/query-builder/source-builder/LegendQueryDataCubeSourceBuilderState.d.ts.map +1 -0
  93. package/lib/stores/query-builder/source-builder/LegendQueryDataCubeSourceBuilderState.js +84 -0
  94. package/lib/stores/query-builder/source-builder/LegendQueryDataCubeSourceBuilderState.js.map +1 -0
  95. package/package.json +11 -11
  96. package/src/__lib__/LegendDataCubeNavigation.ts +7 -7
  97. package/src/{stores/model/DataCubeQueryContent.ts → __lib__/LegendDataCubeSetting.ts} +6 -6
  98. package/{lib/stores/model/DataCubeGenericSource.js → src/__lib__/LegendDataCubeUserData.ts} +5 -2
  99. package/src/application/LegendDataCube.tsx +1 -0
  100. package/src/application/LegendDataCubeApplicationConfig.ts +6 -4
  101. package/src/application/LegendDataCubePluginManager.ts +1 -0
  102. package/src/components/LegendDataCubeFrameworkProvider.tsx +7 -7
  103. package/src/components/LegendDataCubeWebApplication.tsx +48 -12
  104. package/src/components/query-builder/LegendDataCubeNewQueryBuilder.tsx +115 -0
  105. package/src/components/query-builder/LegendDataCubeQueryBuilder.tsx +213 -0
  106. package/src/components/query-builder/LegendDataCubeQueryBuilderStoreProvider.tsx +56 -0
  107. package/src/components/query-builder/LegendDataCubeQueryLoader.tsx +310 -0
  108. package/src/components/query-builder/LegendDataCubeQuerySaver.tsx +106 -0
  109. package/src/{stores/source/CubeInputSource.ts → components/query-builder/source-builder/AdhocQueryDataCubeSourceBuilder.tsx} +14 -19
  110. package/src/components/query-builder/source-builder/LegendQueryDataCubeSourceBuilder.tsx +313 -0
  111. package/src/stores/LegendDataCubeBaseStore.ts +198 -0
  112. package/src/stores/LegendDataCubeDataCubeEngine.ts +494 -0
  113. package/src/stores/model/LegendQueryDataCubeSource.ts +46 -0
  114. package/src/stores/query-builder/LegendDataCubeNewQueryState.tsx +139 -0
  115. package/src/stores/query-builder/LegendDataCubeQueryBuilderStore.tsx +296 -0
  116. package/src/stores/query-builder/LegendDataCubeQueryLoaderState.tsx +258 -0
  117. package/src/stores/{source/LegendCubeViewer.ts → query-builder/source-builder/AdhocQueryDataCubeSourceBuilderState.ts} +15 -8
  118. package/src/stores/query-builder/source-builder/LegendDataCubeSourceBuilderState.ts +40 -0
  119. package/src/stores/query-builder/source-builder/LegendQueryDataCubeSourceBuilderState.ts +125 -0
  120. package/tsconfig.json +18 -15
  121. package/lib/components/DataCubeEditor.d.ts.map +0 -1
  122. package/lib/components/DataCubeEditor.js +0 -59
  123. package/lib/components/DataCubeEditor.js.map +0 -1
  124. package/lib/components/source/DataCubeSourceEditor.d.ts.map +0 -1
  125. package/lib/components/source/DataCubeSourceEditor.js +0 -43
  126. package/lib/components/source/DataCubeSourceEditor.js.map +0 -1
  127. package/lib/components/source/ExistingDataCubeQuery.d.ts.map +0 -1
  128. package/lib/components/source/ExistingDataCubeQuery.js +0 -36
  129. package/lib/components/source/ExistingDataCubeQuery.js.map +0 -1
  130. package/lib/components/source/SavedQuerySourceEditor.d.ts.map +0 -1
  131. package/lib/components/source/SavedQuerySourceEditor.js +0 -25
  132. package/lib/components/source/SavedQuerySourceEditor.js.map +0 -1
  133. package/lib/stores/LegendDataCubeEditorStore.d.ts +0 -50
  134. package/lib/stores/LegendDataCubeEditorStore.d.ts.map +0 -1
  135. package/lib/stores/LegendDataCubeEditorStore.js +0 -153
  136. package/lib/stores/LegendDataCubeEditorStore.js.map +0 -1
  137. package/lib/stores/engine/LegendExecutionDataCubeEngine.d.ts +0 -52
  138. package/lib/stores/engine/LegendExecutionDataCubeEngine.d.ts.map +0 -1
  139. package/lib/stores/engine/LegendExecutionDataCubeEngine.js +0 -149
  140. package/lib/stores/engine/LegendExecutionDataCubeEngine.js.map +0 -1
  141. package/lib/stores/model/DataCubeGenericSource.d.ts.map +0 -1
  142. package/lib/stores/model/DataCubeGenericSource.js.map +0 -1
  143. package/lib/stores/model/DataCubeGenericSourceHelper.d.ts +0 -24
  144. package/lib/stores/model/DataCubeGenericSourceHelper.d.ts.map +0 -1
  145. package/lib/stores/model/DataCubeGenericSourceHelper.js +0 -58
  146. package/lib/stores/model/DataCubeGenericSourceHelper.js.map +0 -1
  147. package/lib/stores/model/DataCubeQueryContent.d.ts.map +0 -1
  148. package/lib/stores/model/DataCubeQueryContent.js.map +0 -1
  149. package/lib/stores/model/LegendSavedQuerySource.d.ts +0 -21
  150. package/lib/stores/model/LegendSavedQuerySource.d.ts.map +0 -1
  151. package/lib/stores/model/LegendSavedQuerySource.js.map +0 -1
  152. package/lib/stores/source/CubeInputSource.d.ts +0 -32
  153. package/lib/stores/source/CubeInputSource.d.ts.map +0 -1
  154. package/lib/stores/source/CubeInputSource.js.map +0 -1
  155. package/lib/stores/source/CubeInputSourceLoader.d.ts +0 -37
  156. package/lib/stores/source/CubeInputSourceLoader.d.ts.map +0 -1
  157. package/lib/stores/source/CubeInputSourceLoader.js +0 -39
  158. package/lib/stores/source/CubeInputSourceLoader.js.map +0 -1
  159. package/lib/stores/source/LegendCubeViewer.d.ts +0 -23
  160. package/lib/stores/source/LegendCubeViewer.d.ts.map +0 -1
  161. package/lib/stores/source/LegendCubeViewer.js +0 -24
  162. package/lib/stores/source/LegendCubeViewer.js.map +0 -1
  163. package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts +0 -34
  164. package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts.map +0 -1
  165. package/lib/stores/source/LegendDataCubeSourceBuilder.js +0 -70
  166. package/lib/stores/source/LegendDataCubeSourceBuilder.js.map +0 -1
  167. package/lib/stores/source/SavedQueryInputSourceState.d.ts +0 -35
  168. package/lib/stores/source/SavedQueryInputSourceState.d.ts.map +0 -1
  169. package/lib/stores/source/SavedQueryInputSourceState.js +0 -81
  170. package/lib/stores/source/SavedQueryInputSourceState.js.map +0 -1
  171. package/src/components/DataCubeEditor.tsx +0 -190
  172. package/src/components/source/DataCubeSourceEditor.tsx +0 -133
  173. package/src/components/source/ExistingDataCubeQuery.tsx +0 -101
  174. package/src/components/source/SavedQuerySourceEditor.tsx +0 -62
  175. package/src/stores/LegendDataCubeEditorStore.ts +0 -237
  176. package/src/stores/engine/LegendExecutionDataCubeEngine.ts +0 -267
  177. package/src/stores/model/DataCubeGenericSourceHelper.ts +0 -97
  178. package/src/stores/model/LegendSavedQuerySource.ts +0 -26
  179. package/src/stores/source/CubeInputSourceLoader.ts +0 -56
  180. package/src/stores/source/LegendDataCubeSourceBuilder.ts +0 -98
  181. package/src/stores/source/SavedQueryInputSourceState.ts +0 -142
package/lib/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@finos/legend-application-data-cube",
3
- "version": "0.1.5",
4
- "description": "Legend Data Cube application core",
3
+ "version": "0.1.7",
4
+ "description": "Legend DataCube application core",
5
5
  "keywords": [
6
6
  "legend",
7
7
  "legend-application",
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { type ApplicationStore } from '@finos/legend-application';
17
+ import type { LegendDataCubePluginManager } from '../application/LegendDataCubePluginManager.js';
18
+ import { DepotServerClient } from '@finos/legend-server-depot';
19
+ import type { LegendDataCubeApplicationConfig } from '../application/LegendDataCubeApplicationConfig.js';
20
+ import { V1_EngineServerClient, V1_PureGraphManager } from '@finos/legend-graph';
21
+ import { ActionState } from '@finos/legend-shared';
22
+ import { LegendDataCubeDataCubeEngine } from './LegendDataCubeDataCubeEngine.js';
23
+ import { LayoutManagerState, type DataCubeSetting } from '@finos/legend-data-cube';
24
+ export type LegendDataCubeApplicationStore = ApplicationStore<LegendDataCubeApplicationConfig, LegendDataCubePluginManager>;
25
+ export declare class LegendDataCubeBaseStore {
26
+ readonly application: LegendDataCubeApplicationStore;
27
+ readonly pluginManager: LegendDataCubePluginManager;
28
+ readonly layout: LayoutManagerState;
29
+ readonly depotServerClient: DepotServerClient;
30
+ readonly graphManager: V1_PureGraphManager;
31
+ readonly engineServerClient: V1_EngineServerClient;
32
+ readonly engine: LegendDataCubeDataCubeEngine;
33
+ readonly initializeState: ActionState;
34
+ readonly dataCubeSettings: DataCubeSetting[];
35
+ gridClientLicense?: string | undefined;
36
+ constructor(application: LegendDataCubeApplicationStore);
37
+ private getEngineEnableCompressionSettingValue;
38
+ private getEngineServerBaseUrlSettingValue;
39
+ initialize(): Promise<void>;
40
+ }
41
+ //# sourceMappingURL=LegendDataCubeBaseStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendDataCubeBaseStore.d.ts","sourceRoot":"","sources":["../../src/stores/LegendDataCubeBaseStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACzG,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EAKZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAGL,kBAAkB,EAClB,KAAK,eAAe,EAErB,MAAM,yBAAyB,CAAC;AAMjC,MAAM,MAAM,8BAA8B,GAAG,gBAAgB,CAC3D,+BAA+B,EAC/B,2BAA2B,CAC5B,CAAC;AAIF,qBAAa,uBAAuB;IAClC,QAAQ,CAAC,WAAW,EAAE,8BAA8B,CAAC;IACrD,QAAQ,CAAC,aAAa,EAAE,2BAA2B,CAAC;IACpD,QAAQ,CAAC,MAAM,qBAA4B;IAE3C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAC9C,QAAQ,CAAC,eAAe,cAAwB;IAEhD,QAAQ,CAAC,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAE7C,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE3B,WAAW,EAAE,8BAA8B;IAkDvD,OAAO,CAAC,sCAAsC;IAiB9C,OAAO,CAAC,kCAAkC;IAgBpC,UAAU;CA4CjB"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { APPLICATION_EVENT, DEFAULT_TAB_SIZE, } from '@finos/legend-application';
17
+ import { DepotServerClient } from '@finos/legend-server-depot';
18
+ import { V1_EngineServerClient, V1_PureGraphManager, } from '@finos/legend-graph';
19
+ import { ActionState, LogEvent, assertErrorThrown, guaranteeIsBoolean, guaranteeIsString, } from '@finos/legend-shared';
20
+ import { LegendDataCubeDataCubeEngine } from './LegendDataCubeDataCubeEngine.js';
21
+ import { DataCubeSettingGroup, DataCubeSettingType, LayoutManagerState, } from '@finos/legend-data-cube';
22
+ import { LegendDataCubeSettingKey, LegendDataCubeSettingStorageKey, } from '../__lib__/LegendDataCubeSetting.js';
23
+ export class LegendDataCubeBaseStore {
24
+ application;
25
+ pluginManager;
26
+ layout = new LayoutManagerState();
27
+ depotServerClient;
28
+ graphManager;
29
+ engineServerClient;
30
+ engine;
31
+ initializeState = ActionState.create();
32
+ dataCubeSettings;
33
+ gridClientLicense;
34
+ constructor(application) {
35
+ this.application = application;
36
+ this.pluginManager = application.pluginManager;
37
+ this.depotServerClient = new DepotServerClient({
38
+ serverUrl: this.application.config.depotServerUrl,
39
+ });
40
+ this.depotServerClient.setTracerService(application.tracerService);
41
+ this.graphManager = new V1_PureGraphManager(this.application.pluginManager, this.application.logService);
42
+ this.dataCubeSettings = [
43
+ {
44
+ key: LegendDataCubeSettingKey.DEBUGGER__ENGINE_SERVER_CLIENT__ENABLE_COMPRESSION,
45
+ title: `Engine Client Request Payload Compression: Enabled`,
46
+ description: `Specifies if request payload should be compressed for better performance.`,
47
+ group: DataCubeSettingGroup.DEBUG,
48
+ type: DataCubeSettingType.BOOLEAN,
49
+ defaultValue: true,
50
+ action: (newValue) => {
51
+ this.engineServerClient.setCompression(newValue);
52
+ this.graphManager
53
+ .TEMPORARY__getEngineConfig()
54
+ .setUseClientRequestPayloadCompression(newValue);
55
+ },
56
+ },
57
+ {
58
+ key: LegendDataCubeSettingKey.DEBUGGER__ENGINE_SERVER_CLIENT__BASE_URL,
59
+ title: `Engine Server Base URL`,
60
+ description: `Specifies another base URL to be used for engine server.`,
61
+ group: DataCubeSettingGroup.DEBUG,
62
+ type: DataCubeSettingType.STRING,
63
+ defaultValue: application.config.engineServerUrl,
64
+ action: (newValue) => {
65
+ this.engineServerClient.setBaseUrl(newValue);
66
+ this.graphManager.TEMPORARY__getEngineConfig().setBaseUrl(newValue);
67
+ },
68
+ },
69
+ ];
70
+ this.engineServerClient = new V1_EngineServerClient({
71
+ baseUrl: this.getEngineServerBaseUrlSettingValue(),
72
+ queryBaseUrl: this.application.config.engineQueryServerUrl,
73
+ enableCompression: this.getEngineEnableCompressionSettingValue(),
74
+ });
75
+ this.engineServerClient.setTracerService(application.tracerService);
76
+ this.engine = new LegendDataCubeDataCubeEngine(this);
77
+ }
78
+ getEngineEnableCompressionSettingValue() {
79
+ const persistedValues = this.application.settingService.getObjectValue(LegendDataCubeSettingStorageKey.DATA_CUBE);
80
+ return guaranteeIsBoolean(persistedValues?.[LegendDataCubeSettingKey
81
+ .DEBUGGER__ENGINE_SERVER_CLIENT__ENABLE_COMPRESSION] ??
82
+ this.dataCubeSettings.find((configuration) => configuration.key ===
83
+ LegendDataCubeSettingKey.DEBUGGER__ENGINE_SERVER_CLIENT__ENABLE_COMPRESSION)?.defaultValue);
84
+ }
85
+ getEngineServerBaseUrlSettingValue() {
86
+ const persistedValues = this.application.settingService.getObjectValue(LegendDataCubeSettingStorageKey.DATA_CUBE);
87
+ return guaranteeIsString(persistedValues?.[LegendDataCubeSettingKey.DEBUGGER__ENGINE_SERVER_CLIENT__BASE_URL] ??
88
+ this.dataCubeSettings.find((configuration) => configuration.key ===
89
+ LegendDataCubeSettingKey.DEBUGGER__ENGINE_SERVER_CLIENT__BASE_URL)?.defaultValue);
90
+ }
91
+ async initialize() {
92
+ this.initializeState.inProgress();
93
+ try {
94
+ this.application.identityService.setCurrentUser(await this.engineServerClient.getCurrentUserId());
95
+ this.application.telemetryService.setup();
96
+ }
97
+ catch (error) {
98
+ assertErrorThrown(error);
99
+ this.application.logService.error(LogEvent.create(APPLICATION_EVENT.IDENTITY_AUTO_FETCH__FAILURE), error);
100
+ }
101
+ try {
102
+ this.gridClientLicense = AG_GRID_LICENSE;
103
+ await this.graphManager.initialize({
104
+ env: this.application.config.env,
105
+ tabSize: DEFAULT_TAB_SIZE,
106
+ clientConfig: {
107
+ baseUrl: this.getEngineServerBaseUrlSettingValue(),
108
+ queryBaseUrl: this.application.config.engineQueryServerUrl,
109
+ enableCompression: this.getEngineEnableCompressionSettingValue(),
110
+ },
111
+ }, {
112
+ tracerService: this.application.tracerService,
113
+ });
114
+ this.initializeState.pass();
115
+ }
116
+ catch (error) {
117
+ assertErrorThrown(error);
118
+ this.application.logService.error(LogEvent.create(APPLICATION_EVENT.APPLICATION_LOAD__FAILURE), `Can't initialize Legend DataCube`, error);
119
+ this.initializeState.fail();
120
+ }
121
+ }
122
+ }
123
+ //# sourceMappingURL=LegendDataCubeBaseStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendDataCubeBaseStore.js","sourceRoot":"","sources":["../../src/stores/LegendDataCubeBaseStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GAEjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GAGnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAS7C,MAAM,OAAO,uBAAuB;IACzB,WAAW,CAAiC;IAC5C,aAAa,CAA8B;IAC3C,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;IAElC,iBAAiB,CAAoB;IACrC,YAAY,CAAsB;IAClC,kBAAkB,CAAwB;IAC1C,MAAM,CAA+B;IACrC,eAAe,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAEvC,gBAAgB,CAAoB;IAE7C,iBAAiB,CAAsB;IAEvC,YAAY,WAA2C;QACrD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,aAAa,CAAC;QAC/C,IAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,CAAC;YAC7C,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc;SAClD,CAAC,CAAC;QACH,IAAI,CAAC,iBAAiB,CAAC,gBAA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,KAAK,EAAE,CAAC;YACf,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAC/B,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,4BAA4B,CAAC,EAC/D,KAAK,CACN,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,IAAI,CAAC,iBAAiB,GAAG,eAAe,CAAC;YAEzC,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAChC;gBACE,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG;gBAChC,OAAO,EAAE,gBAAgB;gBACzB,YAAY,EAAE;oBACZ,OAAO,EAAE,IAAI,CAAC,kCAAkC,EAAE;oBAClD,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,oBAAoB;oBAC1D,iBAAiB,EAAE,IAAI,CAAC,sCAAsC,EAAE;iBACjE;aACF,EACD;gBACE,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,aAAa;aAC9C,CACF,CAAC;YACF,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAC/B,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,EAC5D,kCAAkC,EAClC,KAAK,CACN,CAAC;YACF,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;QAC9B,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { TDSExecutionResult, type V1_Lambda, type V1_ValueSpecification, type V1_EngineServerClient, type V1_PureGraphManager } from '@finos/legend-graph';
17
+ import { DataCubeEngine, type DataCubeSource, type CompletionItem } from '@finos/legend-data-cube';
18
+ import { LogEvent, type PlainObject, type DocumentationEntry } from '@finos/legend-shared';
19
+ import type { LegendDataCubeApplicationStore, LegendDataCubeBaseStore } from './LegendDataCubeBaseStore.js';
20
+ import { type DepotServerClient } from '@finos/legend-server-depot';
21
+ export declare class LegendDataCubeDataCubeEngine extends DataCubeEngine {
22
+ readonly application: LegendDataCubeApplicationStore;
23
+ readonly graphManager: V1_PureGraphManager;
24
+ readonly depotServerClient: DepotServerClient;
25
+ readonly engineServerClient: V1_EngineServerClient;
26
+ constructor(baseStore: LegendDataCubeBaseStore);
27
+ processQuerySource(value: PlainObject): Promise<DataCubeSource>;
28
+ getQueryTypeahead(code: string, baseQuery: V1_Lambda, source: DataCubeSource): Promise<CompletionItem[]>;
29
+ parseValueSpecification(code: string, returnSourceInformation?: boolean | undefined): Promise<V1_ValueSpecification>;
30
+ getValueSpecificationCode(value: V1_ValueSpecification, pretty?: boolean | undefined): Promise<string>;
31
+ getQueryRelationType(query: V1_Lambda, source: DataCubeSource): Promise<{
32
+ columns: {
33
+ name: string;
34
+ type: string;
35
+ }[];
36
+ }>;
37
+ getQueryCodeRelationReturnType(code: string, baseQuery: V1_ValueSpecification, source: DataCubeSource): Promise<{
38
+ columns: {
39
+ name: string;
40
+ type: string;
41
+ }[];
42
+ }>;
43
+ executeQuery(query: V1_Lambda, source: DataCubeSource): Promise<{
44
+ result: TDSExecutionResult;
45
+ executedQuery: string;
46
+ executedSQL: string;
47
+ }>;
48
+ buildExecutionContext(source: DataCubeSource): import("@finos/legend-graph").V1_AppliedFunction | undefined;
49
+ private _getQueryRelationType;
50
+ private _getLambdaRelationType;
51
+ private _runQuery;
52
+ getDocumentationURL(): string | undefined;
53
+ getDocumentationEntry(key: string): DocumentationEntry | undefined;
54
+ shouldDisplayDocumentationEntry(entry: DocumentationEntry): boolean;
55
+ openLink(url: string): void;
56
+ sendTelemetry(event: string, data: PlainObject): void;
57
+ logDebug(message: string, ...data: unknown[]): void;
58
+ debugProcess(processName: string, ...data: [string, unknown][]): void;
59
+ logInfo(event: LogEvent, ...data: unknown[]): void;
60
+ logWarning(event: LogEvent, ...data: unknown[]): void;
61
+ logError(event: LogEvent, ...data: unknown[]): void;
62
+ logUnhandledError(error: Error): void;
63
+ logIllegalStateError(message: string, error?: Error): void;
64
+ }
65
+ //# sourceMappingURL=LegendDataCubeDataCubeEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendDataCubeDataCubeEngine.d.ts","sourceRoot":"","sources":["../../src/stores/LegendDataCubeDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAqBzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,cAAc,EAUpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,QAAQ,EAER,KAAK,WAAW,EAChB,KAAK,kBAAkB,EAMxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,8BAA8B,CAAC;AAWtC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC;AAEpC,qBAAa,4BAA6B,SAAQ,cAAc;IAC9D,QAAQ,CAAC,WAAW,EAAE,8BAA8B,CAAC;IACrD,QAAQ,CAAC,YAAY,EAAE,mBA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AG,IAAI,EAAE,OAAO,EAAE;IAI3C,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAI9C,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAI5C,iBAAiB,CAAC,KAAK,EAAE,KAAK;IAI9B,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAO7D"}
@@ -0,0 +1,249 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { RelationalExecutionActivities, TDSExecutionResult, V1_PureModelContextPointer, V1_LegendSDLC, V1_serializePureModelContext, V1_buildParserError, V1_ParserError, V1_relationTypeModelSchema, V1_getGenericTypeFullPath, LAMBDA_PIPE, V1_rawBaseExecutionContextModelSchema, V1_deserializeExecutionResult, V1_parameterValueModelSchema, V1_buildExecutionResult, V1_RawBaseExecutionContext, PureClientVersion, V1_buildEngineError, V1_EngineError, } from '@finos/legend-graph';
17
+ import { _elementPtr, DataCubeEngine, _function, DataCubeFunction, _deserializeLambda, AdhocQueryDataCubeSource, ADHOC_QUERY_DATA_CUBE_SOURCE_TYPE, RawAdhocQueryDataCubeSource, _lambda, _serializeValueSpecification, _deserializeValueSpecification, } from '@finos/legend-data-cube';
18
+ import { isNonNullable, LogEvent, UnsupportedOperationError, assertErrorThrown, NetworkClientError, HttpStatus, getNonNullableEntry, assertType, } from '@finos/legend-shared';
19
+ import { APPLICATION_EVENT, shouldDisplayVirtualAssistantDocumentationEntry, } from '@finos/legend-application';
20
+ import { LEGEND_QUERY_DATA_CUBE_SOURCE_TYPE, LegendQueryDataCubeSource, RawLegendQueryDataCubeSource, } from './model/LegendQueryDataCubeSource.js';
21
+ import { deserialize, serialize } from 'serializr';
22
+ import { resolveVersion, } from '@finos/legend-server-depot';
23
+ export class LegendDataCubeDataCubeEngine extends DataCubeEngine {
24
+ application;
25
+ graphManager;
26
+ depotServerClient;
27
+ engineServerClient;
28
+ constructor(baseStore) {
29
+ super();
30
+ this.application = baseStore.application;
31
+ this.graphManager = baseStore.graphManager;
32
+ this.depotServerClient = baseStore.depotServerClient;
33
+ this.engineServerClient = baseStore.engineServerClient;
34
+ }
35
+ // ---------------------------------- IMPLEMENTATION ----------------------------------
36
+ async processQuerySource(value) {
37
+ switch (value._type) {
38
+ case ADHOC_QUERY_DATA_CUBE_SOURCE_TYPE: {
39
+ const rawSource = RawAdhocQueryDataCubeSource.serialization.fromJson(value);
40
+ const source = new AdhocQueryDataCubeSource();
41
+ source.runtime = rawSource.runtime;
42
+ source.model = rawSource.model;
43
+ source.query = await this.parseValueSpecification(rawSource.query, false);
44
+ source.columns = (await this.getQueryRelationType(_lambda([], [source.query]), source)).columns;
45
+ return source;
46
+ }
47
+ case LEGEND_QUERY_DATA_CUBE_SOURCE_TYPE: {
48
+ const rawSource = RawLegendQueryDataCubeSource.serialization.fromJson(value);
49
+ const queryInfo = await this.graphManager.getQueryInfo(rawSource.queryId);
50
+ const executionContext = await this.graphManager.resolveQueryInfoExecutionContext(queryInfo, () => this.depotServerClient.getVersionEntities(queryInfo.groupId, queryInfo.artifactId, queryInfo.versionId));
51
+ const query = new LegendQueryDataCubeSource();
52
+ query.info = queryInfo;
53
+ query.lambda = _deserializeLambda(await this.engineServerClient.grammarToJSON_lambda(queryInfo.content, '', undefined, undefined, false));
54
+ query.mapping = executionContext.mapping;
55
+ query.runtime = executionContext.runtime;
56
+ query.model = V1_serializePureModelContext(new V1_PureModelContextPointer(undefined, new V1_LegendSDLC(queryInfo.groupId, queryInfo.artifactId, resolveVersion(queryInfo.versionId))));
57
+ query.columns = (await this._getLambdaRelationType(_serializeValueSpecification(query.lambda), query.model)).columns;
58
+ query.query = getNonNullableEntry(query.lambda.body, 0);
59
+ // TODO: handle parameter values
60
+ return query;
61
+ }
62
+ default:
63
+ throw new UnsupportedOperationError(`Can't process query source of type '${value._type}'`);
64
+ }
65
+ }
66
+ // TODO: we could optimize this by synthesizing the base query from the source columns
67
+ // instead of having to send the entire graph model
68
+ async getQueryTypeahead(code, baseQuery, source) {
69
+ const baseQueryCode = await this.getValueSpecificationCode(baseQuery);
70
+ let codeBlock = baseQueryCode + code;
71
+ codeBlock = codeBlock.startsWith(LAMBDA_PIPE)
72
+ ? codeBlock.substring(LAMBDA_PIPE.length)
73
+ : codeBlock;
74
+ if (source instanceof AdhocQueryDataCubeSource) {
75
+ return (await this.engineServerClient.completeCode({
76
+ codeBlock,
77
+ model: source.model,
78
+ })).completions;
79
+ }
80
+ else if (source instanceof LegendQueryDataCubeSource) {
81
+ return (await this.engineServerClient.completeCode({
82
+ codeBlock,
83
+ model: source.model,
84
+ })).completions;
85
+ }
86
+ throw new UnsupportedOperationError(`Can't get code completion for lambda with unsupported source`);
87
+ }
88
+ async parseValueSpecification(code, returnSourceInformation) {
89
+ try {
90
+ return _deserializeValueSpecification(await this.engineServerClient.grammarToJSON_valueSpecification(code, '', undefined, undefined, returnSourceInformation));
91
+ }
92
+ catch (error) {
93
+ assertErrorThrown(error);
94
+ if (error instanceof NetworkClientError &&
95
+ error.response.status === HttpStatus.BAD_REQUEST) {
96
+ throw V1_buildParserError(V1_ParserError.serialization.fromJson(error.payload));
97
+ }
98
+ throw error;
99
+ }
100
+ }
101
+ async getValueSpecificationCode(value, pretty) {
102
+ return this.graphManager.valueSpecificationToPureCode(_serializeValueSpecification(value), pretty);
103
+ }
104
+ // TODO: we could optimize this by synthesizing the base query from the source columns
105
+ // instead of having to send the entire graph model
106
+ async getQueryRelationType(query, source) {
107
+ return this._getQueryRelationType(_serializeValueSpecification(query), source);
108
+ }
109
+ // TODO: we could optimize this by synthesizing the base query from the source columns
110
+ // instead of having to send the entire graph model
111
+ async getQueryCodeRelationReturnType(code, baseQuery, source) {
112
+ const baseQueryCode = await this.getValueSpecificationCode(baseQuery);
113
+ const columnOffset = baseQueryCode.length;
114
+ try {
115
+ const lambda = await this.engineServerClient.grammarToJSON_lambda(baseQueryCode + code, '', undefined, undefined, true);
116
+ return await this._getQueryRelationType(lambda, source);
117
+ }
118
+ catch (error) {
119
+ assertErrorThrown(error);
120
+ if (error instanceof NetworkClientError &&
121
+ error.response.status === HttpStatus.BAD_REQUEST) {
122
+ const engineError = V1_buildEngineError(V1_EngineError.serialization.fromJson(error.payload));
123
+ if (engineError.sourceInformation) {
124
+ engineError.sourceInformation.endColumn -= columnOffset;
125
+ engineError.sourceInformation.startColumn -= columnOffset;
126
+ }
127
+ throw engineError;
128
+ }
129
+ throw error;
130
+ }
131
+ }
132
+ async executeQuery(query, source) {
133
+ const queryCodePromise = this.getValueSpecificationCode(query);
134
+ let result;
135
+ if (source instanceof AdhocQueryDataCubeSource) {
136
+ result = await this._runQuery(query, source.model);
137
+ }
138
+ else if (source instanceof LegendQueryDataCubeSource) {
139
+ result = await this._runQuery(query, source.model, source.parameterValues);
140
+ }
141
+ else {
142
+ throw new UnsupportedOperationError(`Can't execute query with unsupported source`);
143
+ }
144
+ assertType(result, TDSExecutionResult, `Can't extract execution result: expected tabular data set format`);
145
+ const queryCode = await queryCodePromise;
146
+ const sql = result.activities?.[0] instanceof RelationalExecutionActivities
147
+ ? result.activities[0].sql
148
+ : undefined;
149
+ if (!sql) {
150
+ throw new Error(`Can't generate SQL for query`);
151
+ }
152
+ return {
153
+ result: result,
154
+ executedQuery: queryCode,
155
+ executedSQL: sql,
156
+ };
157
+ }
158
+ buildExecutionContext(source) {
159
+ if (source instanceof AdhocQueryDataCubeSource) {
160
+ return _function(DataCubeFunction.FROM, [_elementPtr(source.runtime)].filter(isNonNullable));
161
+ }
162
+ else if (source instanceof LegendQueryDataCubeSource) {
163
+ return _function(DataCubeFunction.FROM, [
164
+ source.mapping ? _elementPtr(source.mapping) : undefined,
165
+ _elementPtr(source.runtime),
166
+ ].filter(isNonNullable));
167
+ }
168
+ return undefined;
169
+ }
170
+ // ---------------------------------- UTILITIES ----------------------------------
171
+ async _getQueryRelationType(query, source) {
172
+ if (source instanceof AdhocQueryDataCubeSource) {
173
+ return this._getLambdaRelationType(query, source.model);
174
+ }
175
+ else if (source instanceof LegendQueryDataCubeSource) {
176
+ return this._getLambdaRelationType(query, source.model);
177
+ }
178
+ throw new UnsupportedOperationError(`Can't get relation type for lambda with unsupported source`);
179
+ }
180
+ async _getLambdaRelationType(lambda, model) {
181
+ const relationType = deserialize(V1_relationTypeModelSchema, await this.engineServerClient.lambdaRelationType({
182
+ lambda,
183
+ model,
184
+ }));
185
+ return {
186
+ columns: relationType.columns.map((column) => ({
187
+ name: column.name,
188
+ type: V1_getGenericTypeFullPath(column.genericType),
189
+ })),
190
+ };
191
+ }
192
+ async _runQuery(query, model, parameterValues) {
193
+ return V1_buildExecutionResult(V1_deserializeExecutionResult((await this.engineServerClient.runQuery({
194
+ clientVersion:
195
+ // eslint-disable-next-line no-process-env
196
+ process.env.NODE_ENV === 'development'
197
+ ? PureClientVersion.VX_X_X
198
+ : undefined,
199
+ function: _serializeValueSpecification(query),
200
+ model,
201
+ context: serialize(V1_rawBaseExecutionContextModelSchema, new V1_RawBaseExecutionContext()),
202
+ parameterValues: (parameterValues ?? []).map((parameterValue) => serialize(V1_parameterValueModelSchema, parameterValue)),
203
+ }))));
204
+ }
205
+ // ---------------------------------- APPLICATION ----------------------------------
206
+ getDocumentationURL() {
207
+ return this.application.documentationService.url;
208
+ }
209
+ getDocumentationEntry(key) {
210
+ return this.application.documentationService.getDocEntry(key);
211
+ }
212
+ shouldDisplayDocumentationEntry(entry) {
213
+ return shouldDisplayVirtualAssistantDocumentationEntry(entry);
214
+ }
215
+ openLink(url) {
216
+ this.application.navigationService.navigator.visitAddress(url);
217
+ }
218
+ sendTelemetry(event, data) {
219
+ this.application.telemetryService.logEvent(event, data);
220
+ }
221
+ logDebug(message, ...data) {
222
+ this.application.logService.debug(LogEvent.create(APPLICATION_EVENT.DEBUG), message, ...data);
223
+ }
224
+ debugProcess(processName, ...data) {
225
+ // eslint-disable-next-line no-process-env
226
+ if (process.env.NODE_ENV === 'development') {
227
+ this.application.logService.info(LogEvent.create(APPLICATION_EVENT.DEBUG), `\n------ START DEBUG PROCESS: ${processName} ------`, ...data.flatMap(([key, value]) => [`\n[${key.toUpperCase()}]:`, value]), `\n------- END DEBUG PROCESS: ${processName} -------\n\n`);
228
+ }
229
+ else {
230
+ this.application.logService.debug(LogEvent.create(APPLICATION_EVENT.DEBUG), `\n------ START DEBUG PROCESS: ${processName} ------`, ...data.flatMap(([key, value]) => [`\n[${key.toUpperCase()}]:`, value]), `\n------- END DEBUG PROCESS: ${processName} -------\n\n`);
231
+ }
232
+ }
233
+ logInfo(event, ...data) {
234
+ this.application.logService.info(event, ...data);
235
+ }
236
+ logWarning(event, ...data) {
237
+ this.application.logService.warn(event, ...data);
238
+ }
239
+ logError(event, ...data) {
240
+ this.application.logService.error(event, ...data);
241
+ }
242
+ logUnhandledError(error) {
243
+ this.application.logUnhandledError(error);
244
+ }
245
+ logIllegalStateError(message, error) {
246
+ this.logError(LogEvent.create(APPLICATION_EVENT.ILLEGAL_APPLICATION_STATE_OCCURRED), message, error);
247
+ }
248
+ }
249
+ //# sourceMappingURL=LegendDataCubeDataCubeEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendDataCubeDataCubeEngine.js","sourceRoot":"","sources":["../../src/stores/LegendDataCubeDataCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAMlB,0BAA0B,EAC1B,aAAa,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AEQ,QAAQ,CAAC,KAAe,EAAE,GAAG,IAAe;QACnD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;IACpD,CAAC;IAEQ,iBAAiB,CAAC,KAAY;QACrC,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAEQ,oBAAoB,CAAC,OAAe,EAAE,KAAa;QAC1D,IAAI,CAAC,QAAQ,CACX,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,kCAAkC,CAAC,EACrE,OAAO,EACP,KAAK,CACN,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { DataCubeSource } from '@finos/legend-data-cube';
17
+ import type { ParameterValue, QueryInfo, V1_Lambda } from '@finos/legend-graph';
18
+ import { SerializationFactory, type PlainObject } from '@finos/legend-shared';
19
+ export declare const LEGEND_QUERY_DATA_CUBE_SOURCE_TYPE = "legendQuery";
20
+ export declare class LegendQueryDataCubeSource extends DataCubeSource {
21
+ info: QueryInfo;
22
+ lambda: V1_Lambda;
23
+ mapping?: string | undefined;
24
+ runtime: string;
25
+ model: PlainObject;
26
+ parameterValues: ParameterValue[];
27
+ }
28
+ export declare class RawLegendQueryDataCubeSource {
29
+ queryId: string;
30
+ static readonly serialization: SerializationFactory<RawLegendQueryDataCubeSource>;
31
+ }
32
+ //# sourceMappingURL=LegendQueryDataCubeSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendQueryDataCubeSource.d.ts","sourceRoot":"","sources":["../../../src/stores/model/LegendQueryDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EACL,oBAAoB,EAEpB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,kCAAkC,gBAAgB,CAAC;AAEhE,qBAAa,yBAA0B,SAAQ,cAAc;IAC3D,IAAI,EAAG,SAAS,CAAC;IACjB,MAAM,EAAG,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAG,MAAM,CAAC;IACjB,KAAK,EAAG,WAAW,CAAC;IACpB,eAAe,EAAE,cAAc,EAAE,CAAM;CACxC;AAED,qBAAa,4BAA4B;IACvC,OAAO,EAAG,MAAM,CAAC;IAEjB,MAAM,CAAC,QAAQ,CAAC,aAAa,qDAK3B;CACH"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { DataCubeSource } from '@finos/legend-data-cube';
17
+ import { SerializationFactory, usingConstantValueSchema, } from '@finos/legend-shared';
18
+ import { createModelSchema, primitive } from 'serializr';
19
+ export const LEGEND_QUERY_DATA_CUBE_SOURCE_TYPE = 'legendQuery';
20
+ export class LegendQueryDataCubeSource extends DataCubeSource {
21
+ info;
22
+ lambda;
23
+ mapping;
24
+ runtime;
25
+ model;
26
+ parameterValues = [];
27
+ }
28
+ export class RawLegendQueryDataCubeSource {
29
+ queryId;
30
+ static serialization = new SerializationFactory(createModelSchema(RawLegendQueryDataCubeSource, {
31
+ _type: usingConstantValueSchema(LEGEND_QUERY_DATA_CUBE_SOURCE_TYPE),
32
+ queryId: primitive(),
33
+ }));
34
+ }
35
+ //# sourceMappingURL=LegendQueryDataCubeSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendQueryDataCubeSource.js","sourceRoot":"","sources":["../../../src/stores/model/LegendQueryDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEzD,MAAM,CAAC,MAAM,kCAAkC,GAAG,aAAa,CAAC;AAEhE,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAC3D,IAAI,CAAa;IACjB,MAAM,CAAa;IACnB,OAAO,CAAsB;IAC7B,OAAO,CAAU;IACjB,KAAK,CAAe;IACpB,eAAe,GAAqB,EAAE,CAAC;CACxC;AAED,MAAM,OAAO,4BAA4B;IACvC,OAAO,CAAU;IAEjB,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,4BAA4B,EAAE;QAC9C,KAAK,EAAE,wBAAwB,CAAC,kCAAkC,CAAC;QACnE,OAAO,EAAE,SAAS,EAAE;KACrB,CAAC,CACH,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { ActionState } from '@finos/legend-shared';
17
+ import type { LegendDataCubeApplicationStore } from '../LegendDataCubeBaseStore.js';
18
+ import { LegendDataCubeSourceBuilderType, type LegendDataCubeSourceBuilderState } from './source-builder/LegendDataCubeSourceBuilderState.js';
19
+ import { type DisplayState } from '@finos/legend-data-cube';
20
+ import type { LegendDataCubeDataCubeEngine } from '../LegendDataCubeDataCubeEngine.js';
21
+ import { type LegendDataCubeQueryBuilderStore } from './LegendDataCubeQueryBuilderStore.js';
22
+ export declare class LegendDataCubeNewQueryState {
23
+ readonly application: LegendDataCubeApplicationStore;
24
+ readonly store: LegendDataCubeQueryBuilderStore;
25
+ readonly engine: LegendDataCubeDataCubeEngine;
26
+ readonly display: DisplayState;
27
+ readonly finalizeState: ActionState;
28
+ sourceBuilder: LegendDataCubeSourceBuilderState;
29
+ constructor(store: LegendDataCubeQueryBuilderStore);
30
+ changeSourceBuilder(type: LegendDataCubeSourceBuilderType, skipCheck?: boolean | undefined): void;
31
+ private createSourceBuilder;
32
+ finalize(): Promise<void>;
33
+ }
34
+ //# sourceMappingURL=LegendDataCubeNewQueryState.d.ts.map