@finos/legend-graph 32.1.14 → 32.1.15

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 (32) hide show
  1. package/lib/graph/metamodel/pure/packageableElements/domain/PrimitiveType.d.ts +2 -0
  2. package/lib/graph/metamodel/pure/packageableElements/domain/PrimitiveType.d.ts.map +1 -1
  3. package/lib/graph/metamodel/pure/packageableElements/domain/PrimitiveType.js +32 -0
  4. package/lib/graph/metamodel/pure/packageableElements/domain/PrimitiveType.js.map +1 -1
  5. package/lib/graph-manager/AbstractPureGraphManager.d.ts +1 -0
  6. package/lib/graph-manager/AbstractPureGraphManager.d.ts.map +1 -1
  7. package/lib/graph-manager/AbstractPureGraphManager.js.map +1 -1
  8. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts +3 -0
  9. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  10. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +37 -9
  11. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  12. package/lib/graph-manager/protocol/pure/v1/helpers/V1_DomainObserverHelper.d.ts +18 -0
  13. package/lib/graph-manager/protocol/pure/v1/helpers/V1_DomainObserverHelper.d.ts.map +1 -0
  14. package/lib/graph-manager/protocol/pure/v1/helpers/V1_DomainObserverHelper.js +29 -0
  15. package/lib/graph-manager/protocol/pure/v1/helpers/V1_DomainObserverHelper.js.map +1 -0
  16. package/lib/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.d.ts +48 -0
  17. package/lib/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.d.ts.map +1 -0
  18. package/lib/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.js +244 -0
  19. package/lib/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.js.map +1 -0
  20. package/lib/index.d.ts +10 -1
  21. package/lib/index.d.ts.map +1 -1
  22. package/lib/index.js +10 -1
  23. package/lib/index.js.map +1 -1
  24. package/lib/package.json +1 -1
  25. package/package.json +1 -1
  26. package/src/graph/metamodel/pure/packageableElements/domain/PrimitiveType.ts +35 -0
  27. package/src/graph-manager/AbstractPureGraphManager.ts +9 -0
  28. package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +111 -28
  29. package/src/graph-manager/protocol/pure/v1/helpers/V1_DomainObserverHelper.ts +35 -0
  30. package/src/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.ts +405 -0
  31. package/src/index.ts +13 -1
  32. package/tsconfig.json +2 -0
@@ -122,7 +122,7 @@ import {
122
122
  V1_RawValueSpecificationTransformer,
123
123
  } from './transformation/pureGraph/from/V1_RawValueSpecificationTransformer.js';
124
124
  import { V1_transformRuntime } from './transformation/pureGraph/from/V1_RuntimeTransformer.js';
125
- import type { V1_RawLambda } from './model/rawValueSpecification/V1_RawLambda.js';
125
+ import { V1_RawLambda } from './model/rawValueSpecification/V1_RawLambda.js';
126
126
  import {
127
127
  V1_ExecuteInput,
128
128
  V1_TestDataGenerationExecutionInput,
@@ -339,7 +339,10 @@ import { V1_HostedService } from './model/packageableElements/function/V1_Hosted
339
339
  import type { PostValidationAssertionResult } from '../../../../DSL_Service_Exports.js';
340
340
  import { V1_UserListOwnership } from './model/packageableElements/service/V1_ServiceOwnership.js';
341
341
  import { V1_PureSingleExecution } from './model/packageableElements/service/V1_ServiceExecution.js';
342
- import { V1_RuntimePointer } from './model/packageableElements/runtime/V1_Runtime.js';
342
+ import {
343
+ type V1_Runtime,
344
+ V1_RuntimePointer,
345
+ } from './model/packageableElements/runtime/V1_Runtime.js';
343
346
  import type { TestDebug } from '../../../../graph/metamodel/pure/test/result/DebugTestsResult.js';
344
347
  import { V1_buildDebugTestsResult } from './engine/test/V1_DebugTestsResult.js';
345
348
  import type { V1_GraphManagerEngine } from './engine/V1_GraphManagerEngine.js';
@@ -2649,25 +2652,45 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
2649
2652
  clientVersion: string | undefined,
2650
2653
  executeInput: V1_ExecuteInput,
2651
2654
  parameterValues?: ParameterValue[],
2655
+ ): V1_ExecuteInput => {
2656
+ return this.createExecutionInputWithPureModelContextWithV1(
2657
+ data,
2658
+ mapping?.path,
2659
+ V1_transformRawLambda(
2660
+ lambda,
2661
+ new V1_GraphTransformerContextBuilder(
2662
+ this.pluginManager.getPureProtocolProcessorPlugins(),
2663
+ ).build(),
2664
+ ),
2665
+ runtime
2666
+ ? V1_transformRuntime(
2667
+ runtime,
2668
+ new V1_GraphTransformerContextBuilder(
2669
+ this.pluginManager.getPureProtocolProcessorPlugins(),
2670
+ ).build(),
2671
+ )
2672
+ : undefined,
2673
+ clientVersion,
2674
+ executeInput,
2675
+ parameterValues,
2676
+ );
2677
+ };
2678
+
2679
+ private createExecutionInputWithPureModelContextWithV1 = (
2680
+ data: V1_PureModelContext,
2681
+ mapping: string | undefined,
2682
+ lambda: V1_RawLambda,
2683
+ runtime: V1_Runtime | undefined,
2684
+ clientVersion: string | undefined,
2685
+ executeInput: V1_ExecuteInput,
2686
+ parameterValues?: ParameterValue[],
2652
2687
  ): V1_ExecuteInput => {
2653
2688
  // NOTE: for execution, we usually will just assume that we send the connections embedded in the runtime value, since we don't want the user to have to create
2654
2689
  // packageable runtime and connection just to play with execution.
2655
2690
  executeInput.clientVersion = clientVersion;
2656
- executeInput.function = V1_transformRawLambda(
2657
- lambda,
2658
- new V1_GraphTransformerContextBuilder(
2659
- this.pluginManager.getPureProtocolProcessorPlugins(),
2660
- ).build(),
2661
- );
2662
- executeInput.mapping = mapping?.path;
2663
- executeInput.runtime = runtime
2664
- ? V1_transformRuntime(
2665
- runtime,
2666
- new V1_GraphTransformerContextBuilder(
2667
- this.pluginManager.getPureProtocolProcessorPlugins(),
2668
- ).build(),
2669
- )
2670
- : undefined;
2691
+ executeInput.function = lambda;
2692
+ executeInput.mapping = mapping;
2693
+ executeInput.runtime = runtime;
2671
2694
  executeInput.model = data;
2672
2695
  executeInput.context = new V1_RawBaseExecutionContext(); // TODO: potentially need to support more types
2673
2696
  if (parameterValues) {
@@ -2678,6 +2701,54 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
2678
2701
  return executeInput;
2679
2702
  };
2680
2703
 
2704
+ async runQueryWithUncompiledGraph(
2705
+ lambda: RawLambda | string,
2706
+ mapping: string | undefined,
2707
+ runtime: string | undefined,
2708
+ graph: PureModel,
2709
+ options?: ExecutionOptions,
2710
+ _report?: GraphManagerOperationReport,
2711
+ ): Promise<ExecutionResultWithMetadata> {
2712
+ let rawLambda: V1_RawLambda;
2713
+ if (isString(lambda)) {
2714
+ const rawValueSpecification = V1_deserializeRawValueSpecification(
2715
+ await this.pureCodeToValueSpecification(lambda),
2716
+ );
2717
+ rawLambda = guaranteeType(rawValueSpecification, V1_RawLambda);
2718
+ } else {
2719
+ rawLambda = V1_transformRawLambda(
2720
+ lambda,
2721
+ new V1_GraphTransformerContextBuilder(
2722
+ this.pluginManager.getPureProtocolProcessorPlugins(),
2723
+ ).build(),
2724
+ );
2725
+ }
2726
+ let v1Runtime: V1_RuntimePointer | undefined = undefined;
2727
+ if (runtime) {
2728
+ const _run = new V1_RuntimePointer();
2729
+ _run.runtime = runtime;
2730
+ v1Runtime = _run;
2731
+ }
2732
+ return this._runQuery(
2733
+ () =>
2734
+ this.createExecutionInputWithPureModelContextWithV1(
2735
+ graph.origin
2736
+ ? this.buildPureModelSDLCPointer(graph.origin, undefined)
2737
+ : this.getFullGraphModelData(graph),
2738
+ mapping,
2739
+ rawLambda,
2740
+ v1Runtime,
2741
+ this.engine.config.useDevClientProtocol
2742
+ ? V1_PureGraphManager.DEV_PROTOCOL_VERSION
2743
+ : V1_PureGraphManager.PROD_PROTOCOL_VERSION,
2744
+ new V1_ExecuteInput(),
2745
+ options?.parameterValues,
2746
+ ),
2747
+ options,
2748
+ _report,
2749
+ );
2750
+ }
2751
+
2681
2752
  async runQuery(
2682
2753
  lambda: RawLambda,
2683
2754
  mapping: Mapping,
@@ -2685,20 +2756,32 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
2685
2756
  graph: PureModel,
2686
2757
  options?: ExecutionOptions,
2687
2758
  _report?: GraphManagerOperationReport,
2759
+ ): Promise<ExecutionResultWithMetadata> {
2760
+ return this._runQuery(
2761
+ () =>
2762
+ this.createExecutionInput(
2763
+ graph,
2764
+ mapping,
2765
+ lambda,
2766
+ runtime,
2767
+ this.engine.config.useDevClientProtocol
2768
+ ? V1_PureGraphManager.DEV_PROTOCOL_VERSION
2769
+ : V1_PureGraphManager.PROD_PROTOCOL_VERSION,
2770
+ options?.parameterValues,
2771
+ ),
2772
+ options,
2773
+ _report,
2774
+ );
2775
+ }
2776
+
2777
+ async _runQuery(
2778
+ createV1ExecuteInputFunc: () => V1_ExecuteInput,
2779
+ options?: ExecutionOptions,
2780
+ _report?: GraphManagerOperationReport,
2688
2781
  ): Promise<ExecutionResultWithMetadata> {
2689
2782
  const report = _report ?? createGraphManagerOperationReport();
2690
2783
  const stopWatch = new StopWatch();
2691
-
2692
- const input = this.createExecutionInput(
2693
- graph,
2694
- mapping,
2695
- lambda,
2696
- runtime,
2697
- this.engine.config.useDevClientProtocol
2698
- ? V1_PureGraphManager.DEV_PROTOCOL_VERSION
2699
- : V1_PureGraphManager.PROD_PROTOCOL_VERSION,
2700
- options?.parameterValues,
2701
- );
2784
+ const input = createV1ExecuteInputFunc();
2702
2785
  stopWatch.record(GRAPH_MANAGER_EVENT.V1_ENGINE_OPERATION_INPUT__SUCCESS);
2703
2786
 
2704
2787
  const result = await this.engine.runQuery(input, options);
@@ -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
+
17
+ import { computed, makeObservable, observable } from 'mobx';
18
+ import type { V1_GenericType } from '../model/packageableElements/type/V1_GenericType.js';
19
+ import { skipObserved } from '../../../../action/changeDetection/CoreObserverHelper.js';
20
+ import { V1_observe_ValueSpecification } from './V1_ValueSpecificationObserver.js';
21
+
22
+ export const V1_observe_GenericType = skipObserved(
23
+ (metamodel: V1_GenericType): V1_GenericType => {
24
+ makeObservable(metamodel, {
25
+ rawType: observable,
26
+ multiplicityArguments: observable,
27
+ hashCode: computed,
28
+ });
29
+
30
+ metamodel.typeArguments.forEach(V1_observe_GenericType);
31
+ metamodel.typeVariableValues.forEach(V1_observe_ValueSpecification);
32
+
33
+ return metamodel;
34
+ },
35
+ );
@@ -0,0 +1,405 @@
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
+
17
+ import { makeObservable, observable } from 'mobx';
18
+ import {
19
+ type V1_ValueSpecification,
20
+ type V1_ValueSpecificationVisitor,
21
+ } from '../model/valueSpecification/V1_ValueSpecification.js';
22
+ import type { V1_Variable } from '../model/valueSpecification/V1_Variable.js';
23
+ import type { V1_Lambda } from '../model/valueSpecification/raw/V1_Lambda.js';
24
+ import type { V1_EnumValue } from '../model/valueSpecification/raw/V1_EnumValue.js';
25
+ import type { V1_AppliedFunction } from '../model/valueSpecification/application/V1_AppliedFunction.js';
26
+ import type { V1_Collection } from '../model/valueSpecification/raw/V1_Collection.js';
27
+ import type { V1_KeyExpression } from '../model/valueSpecification/raw/V1_KeyExpression.js';
28
+ import type { V1_AppliedProperty } from '../model/valueSpecification/application/V1_AppliedProperty.js';
29
+ import type { V1_PackageableElementPtr } from '../model/valueSpecification/raw/V1_PackageableElementPtr.js';
30
+ import type { V1_INTERNAL__UnknownValueSpecification } from '../model/valueSpecification/V1_INTERNAL__UnknownValueSpecfication.js';
31
+ import type { V1_GenericTypeInstance } from '../model/valueSpecification/raw/V1_GenericTypeInstance.js';
32
+ import type { V1_ClassInstance } from '../model/valueSpecification/raw/V1_ClassInstance.js';
33
+ import type { V1_CInteger } from '../model/valueSpecification/raw/V1_CInteger.js';
34
+ import type { V1_CDecimal } from '../model/valueSpecification/raw/V1_CDecimal.js';
35
+ import type { V1_CString } from '../model/valueSpecification/raw/V1_CString.js';
36
+ import type { V1_CBoolean } from '../model/valueSpecification/raw/V1_CBoolean.js';
37
+ import type { V1_CFloat } from '../model/valueSpecification/raw/V1_CFloat.js';
38
+ import type { V1_CDateTime } from '../model/valueSpecification/raw/V1_CDateTime.js';
39
+ import type { V1_CStrictDate } from '../model/valueSpecification/raw/V1_CStrictDate.js';
40
+ import type { V1_CStrictTime } from '../model/valueSpecification/raw/V1_CStrictTime.js';
41
+ import type { V1_CLatestDate } from '../model/valueSpecification/raw/V1_CLatestDate.js';
42
+ import type { V1_CByteArray } from '../model/valueSpecification/raw/V1_CByteArray.js';
43
+ import { skipObserved } from '../../../../action/changeDetection/CoreObserverHelper.js';
44
+ import { V1_observe_GenericType } from './V1_DomainObserverHelper.js';
45
+ import type { V1_AbstractAppliedFunction } from '../model/valueSpecification/raw/V1_AbstractAppliedFunction.js';
46
+ import type { V1_ColSpec } from '../model/valueSpecification/raw/classInstance/relation/V1_ColSpec.js';
47
+ import type { V1_ColSpecArray } from '../model/valueSpecification/raw/classInstance/relation/V1_ColSpecArray.js';
48
+
49
+ const V1_observe_Abstract_ValueSpecification = (
50
+ metamodel: V1_ValueSpecification,
51
+ ): void => {
52
+ makeObservable<V1_ValueSpecification>(metamodel, {});
53
+ };
54
+
55
+ export const V1_observe_Variable = skipObserved(
56
+ (metamodel: V1_Variable): V1_Variable => {
57
+ V1_observe_Abstract_ValueSpecification(metamodel);
58
+
59
+ makeObservable<V1_Variable>(metamodel, {
60
+ name: observable,
61
+ multiplicity: observable,
62
+ genericType: observable,
63
+ });
64
+
65
+ if (metamodel.genericType) {
66
+ V1_observe_GenericType(metamodel.genericType);
67
+ }
68
+
69
+ return metamodel;
70
+ },
71
+ );
72
+
73
+ export const V1_observe_AppliedFunction = skipObserved(
74
+ _V1_observe_AppliedFunction,
75
+ );
76
+
77
+ export const V1_observe_AppliedProperty = skipObserved(
78
+ _V1_observe_AppliedProperty,
79
+ );
80
+
81
+ // Observer functions for primitive types
82
+ const V1_observe_PrimitiveType = skipObserved(
83
+ (
84
+ metamodel:
85
+ | V1_CInteger
86
+ | V1_CDecimal
87
+ | V1_CString
88
+ | V1_CBoolean
89
+ | V1_CFloat
90
+ | V1_CDateTime
91
+ | V1_CStrictDate
92
+ | V1_CStrictTime
93
+ | V1_CByteArray,
94
+ ) => {
95
+ V1_observe_Abstract_ValueSpecification(metamodel);
96
+
97
+ makeObservable(metamodel, {
98
+ value: observable,
99
+ });
100
+
101
+ return metamodel;
102
+ },
103
+ );
104
+
105
+ export const V1_observe_EnumValue = skipObserved(
106
+ (metamodel: V1_EnumValue): V1_EnumValue => {
107
+ V1_observe_Abstract_ValueSpecification(metamodel);
108
+
109
+ makeObservable<V1_EnumValue>(metamodel, {
110
+ fullPath: observable,
111
+ value: observable,
112
+ });
113
+
114
+ return metamodel;
115
+ },
116
+ );
117
+
118
+ export const V1_observe_Collection = skipObserved(_V1_observe_Collection);
119
+
120
+ export const V1_observe_KeyExpression = skipObserved(_V1_observe_KeyExpression);
121
+
122
+ export const V1_observe_ColSpec = skipObserved(_V1_observe_ColSpec);
123
+
124
+ export const V1_observe_ColSpecArray = skipObserved(
125
+ (metamodel: V1_ColSpecArray): V1_ColSpecArray => {
126
+ makeObservable(metamodel, {
127
+ colSpecs: observable,
128
+ });
129
+
130
+ metamodel.colSpecs.forEach(V1_observe_ColSpec);
131
+
132
+ return metamodel;
133
+ },
134
+ );
135
+
136
+ export const V1_observe_Lambda = skipObserved(_V1_observe_Lambda);
137
+
138
+ const V1_observe_INTERNAL__UnknownValueSpecification = skipObserved(
139
+ (
140
+ metamodel: V1_INTERNAL__UnknownValueSpecification,
141
+ ): V1_INTERNAL__UnknownValueSpecification => {
142
+ V1_observe_Abstract_ValueSpecification(metamodel);
143
+
144
+ makeObservable(metamodel, {
145
+ content: observable.ref,
146
+ });
147
+
148
+ return metamodel;
149
+ },
150
+ );
151
+
152
+ export const V1_observe_PackageableElementPtr = skipObserved(
153
+ (metamodel: V1_PackageableElementPtr): V1_PackageableElementPtr => {
154
+ V1_observe_Abstract_ValueSpecification(metamodel);
155
+
156
+ makeObservable<V1_PackageableElementPtr>(metamodel, {
157
+ multiplicity: observable,
158
+ fullPath: observable,
159
+ });
160
+
161
+ return metamodel;
162
+ },
163
+ );
164
+
165
+ export const V1_observe_GenericTypeInstance = skipObserved(
166
+ (metamodel: V1_GenericTypeInstance): V1_GenericTypeInstance => {
167
+ V1_observe_Abstract_ValueSpecification(metamodel);
168
+
169
+ makeObservable<V1_GenericTypeInstance>(metamodel, {
170
+ multiplicity: observable,
171
+ genericType: observable,
172
+ });
173
+
174
+ V1_observe_GenericType(metamodel.genericType);
175
+
176
+ return metamodel;
177
+ },
178
+ );
179
+
180
+ export const V1_observe_ClassInstance = skipObserved(
181
+ (metamodel: V1_ClassInstance): V1_ClassInstance => {
182
+ V1_observe_Abstract_ValueSpecification(metamodel);
183
+
184
+ makeObservable<V1_ClassInstance>(metamodel, {
185
+ multiplicity: observable,
186
+ type: observable,
187
+ value: observable,
188
+ });
189
+
190
+ return metamodel;
191
+ },
192
+ );
193
+
194
+ class V1_ValueSpecificationObserver
195
+ implements V1_ValueSpecificationVisitor<void>
196
+ {
197
+ visit_INTERNAL__UnknownValueSpecfication(
198
+ valueSpecification: V1_INTERNAL__UnknownValueSpecification,
199
+ ): void {
200
+ V1_observe_INTERNAL__UnknownValueSpecification(valueSpecification);
201
+ }
202
+
203
+ visit_AppliedFunction(valueSpecification: V1_AppliedFunction): void {
204
+ V1_observe_AppliedFunction(valueSpecification);
205
+ }
206
+
207
+ visit_Variable(valueSpecification: V1_Variable): void {
208
+ V1_observe_Variable(valueSpecification);
209
+ }
210
+
211
+ visit_Lambda(valueSpecification: V1_Lambda): void {
212
+ V1_observe_Lambda(valueSpecification);
213
+ }
214
+
215
+ visit_KeyExpression(valueSpecification: V1_KeyExpression): void {
216
+ V1_observe_KeyExpression(valueSpecification);
217
+ }
218
+
219
+ visit_AppliedProperty(valueSpecification: V1_AppliedProperty): void {
220
+ V1_observe_AppliedProperty(valueSpecification);
221
+ }
222
+
223
+ visit_PackageableElementPtr(
224
+ valueSpecification: V1_PackageableElementPtr,
225
+ ): void {
226
+ V1_observe_PackageableElementPtr(valueSpecification);
227
+ }
228
+
229
+ visit_GenericTypeInstance(valueSpecification: V1_GenericTypeInstance): void {
230
+ V1_observe_GenericTypeInstance(valueSpecification);
231
+ }
232
+
233
+ visit_Collection(valueSpecification: V1_Collection): void {
234
+ V1_observe_Collection(valueSpecification);
235
+ }
236
+
237
+ visit_EnumValue(valueSpecification: V1_EnumValue): void {
238
+ V1_observe_EnumValue(valueSpecification);
239
+ }
240
+
241
+ visit_CInteger(valueSpecification: V1_CInteger): void {
242
+ V1_observe_PrimitiveType(valueSpecification);
243
+ }
244
+
245
+ visit_CDecimal(valueSpecification: V1_CDecimal): void {
246
+ V1_observe_PrimitiveType(valueSpecification);
247
+ }
248
+
249
+ visit_CString(valueSpecification: V1_CString): void {
250
+ V1_observe_PrimitiveType(valueSpecification);
251
+ }
252
+
253
+ visit_CBoolean(valueSpecification: V1_CBoolean): void {
254
+ V1_observe_PrimitiveType(valueSpecification);
255
+ }
256
+
257
+ visit_CByteArray(valueSpecification: V1_CByteArray): void {
258
+ V1_observe_PrimitiveType(valueSpecification);
259
+ }
260
+
261
+ visit_CFloat(valueSpecification: V1_CFloat): void {
262
+ V1_observe_PrimitiveType(valueSpecification);
263
+ }
264
+
265
+ visit_CDateTime(valueSpecification: V1_CDateTime): void {
266
+ V1_observe_PrimitiveType(valueSpecification);
267
+ }
268
+
269
+ visit_CStrictDate(valueSpecification: V1_CStrictDate): void {
270
+ V1_observe_PrimitiveType(valueSpecification);
271
+ }
272
+
273
+ visit_CStrictTime(valueSpecification: V1_CStrictTime): void {
274
+ V1_observe_PrimitiveType(valueSpecification);
275
+ }
276
+
277
+ visit_CLatestDate(valueSpecification: V1_CLatestDate): void {
278
+ V1_observe_Abstract_ValueSpecification(valueSpecification);
279
+ }
280
+
281
+ visit_ClassInstance(valueSpecification: V1_ClassInstance): void {
282
+ V1_observe_ClassInstance(valueSpecification);
283
+ }
284
+ }
285
+
286
+ /**
287
+ * Make a V1_ValueSpecification observable
288
+ *
289
+ * @param valueSpecification - The V1_ValueSpecification to make observable
290
+ * @returns The observed V1_ValueSpecification
291
+ */
292
+ export const V1_observe_ValueSpecification = skipObserved(
293
+ (valueSpecification: V1_ValueSpecification): V1_ValueSpecification => {
294
+ valueSpecification.accept_ValueSpecificationVisitor(
295
+ new V1_ValueSpecificationObserver(),
296
+ );
297
+ return valueSpecification;
298
+ },
299
+ );
300
+
301
+ function V1_observe_Abstract_AppliedFunction(
302
+ metamodel: V1_AbstractAppliedFunction,
303
+ ): V1_AbstractAppliedFunction {
304
+ V1_observe_Abstract_ValueSpecification(metamodel);
305
+
306
+ makeObservable(metamodel, {
307
+ multiplicity: observable,
308
+ });
309
+
310
+ return metamodel;
311
+ }
312
+
313
+ function _V1_observe_AppliedFunction(
314
+ metamodel: V1_AppliedFunction,
315
+ ): V1_AppliedFunction {
316
+ V1_observe_Abstract_AppliedFunction(metamodel);
317
+
318
+ makeObservable(metamodel, {
319
+ function: observable,
320
+ fControl: observable,
321
+ parameters: observable,
322
+ });
323
+
324
+ metamodel.parameters.forEach(V1_observe_ValueSpecification);
325
+
326
+ return metamodel;
327
+ }
328
+
329
+ function _V1_observe_AppliedProperty(
330
+ metamodel: V1_AppliedProperty,
331
+ ): V1_AppliedProperty {
332
+ V1_observe_Abstract_AppliedFunction(metamodel);
333
+
334
+ makeObservable<V1_AppliedProperty>(metamodel, {
335
+ class: observable,
336
+ property: observable,
337
+ parameters: observable,
338
+ });
339
+
340
+ metamodel.parameters.forEach(V1_observe_ValueSpecification);
341
+
342
+ return metamodel;
343
+ }
344
+
345
+ function _V1_observe_Collection(metamodel: V1_Collection): V1_Collection {
346
+ V1_observe_Abstract_ValueSpecification(metamodel);
347
+
348
+ makeObservable<V1_Collection>(metamodel, {
349
+ multiplicity: observable,
350
+ values: observable,
351
+ });
352
+
353
+ metamodel.values.forEach(V1_observe_ValueSpecification);
354
+
355
+ return metamodel;
356
+ }
357
+
358
+ function _V1_observe_KeyExpression(
359
+ metamodel: V1_KeyExpression,
360
+ ): V1_KeyExpression {
361
+ V1_observe_Abstract_ValueSpecification(metamodel);
362
+
363
+ makeObservable<V1_KeyExpression>(metamodel, {
364
+ add: observable,
365
+ expression: observable,
366
+ key: observable,
367
+ });
368
+
369
+ V1_observe_ValueSpecification(metamodel.key);
370
+ V1_observe_ValueSpecification(metamodel.expression);
371
+
372
+ return metamodel;
373
+ }
374
+
375
+ function _V1_observe_ColSpec(metamodel: V1_ColSpec): V1_ColSpec {
376
+ makeObservable<V1_ColSpec>(metamodel, {
377
+ name: observable,
378
+ type: observable,
379
+ function1: observable,
380
+ function2: observable,
381
+ });
382
+
383
+ if (metamodel.function1) {
384
+ V1_observe_Lambda(metamodel.function1);
385
+ }
386
+ if (metamodel.function2) {
387
+ V1_observe_Lambda(metamodel.function2);
388
+ }
389
+
390
+ return metamodel;
391
+ }
392
+
393
+ function _V1_observe_Lambda(metamodel: V1_Lambda): V1_Lambda {
394
+ V1_observe_Abstract_ValueSpecification(metamodel);
395
+
396
+ makeObservable<V1_Lambda>(metamodel, {
397
+ body: observable,
398
+ parameters: observable,
399
+ });
400
+
401
+ metamodel.body.forEach(V1_observe_ValueSpecification);
402
+ metamodel.parameters.forEach(V1_observe_Variable);
403
+
404
+ return metamodel;
405
+ }
package/src/index.ts CHANGED
@@ -26,7 +26,10 @@ export { SectionIndex } from './graph/metamodel/pure/packageableElements/section
26
26
  export { Multiplicity } from './graph/metamodel/pure/packageableElements/domain/Multiplicity.js';
27
27
  export { Type } from './graph/metamodel/pure/packageableElements/domain/Type.js';
28
28
  export { DataType } from './graph/metamodel/pure/packageableElements/domain/DataType.js';
29
- export { PrimitiveType } from './graph/metamodel/pure/packageableElements/domain/PrimitiveType.js';
29
+ export {
30
+ PrimitiveType,
31
+ getPrimitiveTypeInstanceFromEnum,
32
+ } from './graph/metamodel/pure/packageableElements/domain/PrimitiveType.js';
30
33
  export {
31
34
  GenericTypeReference,
32
35
  GenericTypeExplicitReference,
@@ -137,11 +140,14 @@ export {
137
140
  RootGraphFetchTree,
138
141
  GraphFetchTreeInstanceValue,
139
142
  } from './graph/metamodel/pure/valueSpecification/GraphFetchTree.js';
143
+ export { default as V1_CORE_SYSTEM_MODELS } from './graph-manager/protocol/pure/v1/V1_Core_SystemModels.json' with { type: 'json' };
140
144
  export { V1_PureGraphManager } from './graph-manager/protocol/pure/v1/V1_PureGraphManager.js';
141
145
  export * from './graph-manager/protocol/pure/v1/engine/artifactGeneration/V1_DataSpaceArtifacts.js';
142
146
 
143
147
  // V1 protocols
144
148
  export { V1_Class } from './graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_Class.js';
149
+ export { V1_Enumeration } from './graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_Enumeration.js';
150
+ export { V1_EnumValue } from './graph-manager/protocol/pure/v1/model/packageableElements/domain/V1_EnumValue.js';
145
151
  export { V1_AppliedFunction } from './graph-manager/protocol/pure/v1/model/valueSpecification/application/V1_AppliedFunction.js';
146
152
  export { V1_AppliedProperty } from './graph-manager/protocol/pure/v1/model/valueSpecification/application/V1_AppliedProperty.js';
147
153
  export { V1_Collection } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_Collection.js';
@@ -166,6 +172,8 @@ export {
166
172
  V1_buildEngineError,
167
173
  V1_buildFunctionInfoAnalysis,
168
174
  } from './graph-manager/protocol/pure/v1/engine/V1_EngineHelper.js';
175
+ export * from './graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.js';
176
+ export * from './graph-manager/protocol/pure/v1/helpers/V1_DomainObserverHelper.js';
169
177
  export {
170
178
  V1_getFunctionNameWithoutSignature,
171
179
  V1_getGenericTypeFullPath,
@@ -183,12 +191,15 @@ export * from './graph-manager/protocol/pure/v1/engine/execution/V1_ExecutionRes
183
191
  export { V1_LambdaTdsToRelationInput } from './graph-manager/protocol/pure/v1/engine/pureProtocol/V1_LambdaTdsToRelationInput.js';
184
192
  export { V1_CString } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CString.js';
185
193
  export { V1_CBoolean } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CBoolean.js';
194
+ export { V1_CByteArray } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CByteArray.js';
186
195
  export { V1_CDecimal } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDecimal.js';
187
196
  export { V1_CInteger } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CInteger.js';
188
197
  export { V1_CFloat } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CFloat.js';
198
+ export { V1_CDate } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDate.js';
189
199
  export { V1_CStrictDate } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictDate.js';
190
200
  export { V1_CDateTime } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CDateTime.js';
191
201
  export { V1_CStrictTime } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CStrictTime.js';
202
+ export { V1_CLatestDate } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_CLatestDate.js';
192
203
  export { V1_ClassInstance } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_ClassInstance.js';
193
204
  export { V1_PackageableElementPtr } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/V1_PackageableElementPtr.js';
194
205
  export { V1_ColSpec } from './graph-manager/protocol/pure/v1/model/valueSpecification/raw/classInstance/relation/V1_ColSpec.js';
@@ -215,6 +226,7 @@ export {
215
226
  V1_RelationTypeColumn,
216
227
  } from './graph-manager/protocol/pure/v1/model/packageableElements/type/V1_RelationType.js';
217
228
  export { V1_GenericType } from './graph-manager/protocol/pure/v1/model/packageableElements/type/V1_GenericType.js';
229
+ export { type V1_Type } from './graph-manager/protocol/pure/v1/model/packageableElements/type/V1_Type.js';
218
230
  export { V1_PackageableType } from './graph-manager/protocol/pure/v1/model/packageableElements/type/V1_PackageableType.js';
219
231
 
220
232
  export { V1_Database } from './graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_Database.js';
package/tsconfig.json CHANGED
@@ -487,6 +487,8 @@
487
487
  "./src/graph-manager/protocol/pure/v1/engine/test/V1_RunTestsInput.ts",
488
488
  "./src/graph-manager/protocol/pure/v1/engine/test/V1_RunTestsResult.ts",
489
489
  "./src/graph-manager/protocol/pure/v1/helpers/V1_DomainHelper.ts",
490
+ "./src/graph-manager/protocol/pure/v1/helpers/V1_DomainObserverHelper.ts",
491
+ "./src/graph-manager/protocol/pure/v1/helpers/V1_ValueSpecificationObserver.ts",
490
492
  "./src/graph-manager/protocol/pure/v1/model/V1_Protocol.ts",
491
493
  "./src/graph-manager/protocol/pure/v1/model/V1_SourceInformation.ts",
492
494
  "./src/graph-manager/protocol/pure/v1/model/context/V1_PureModelContext.ts",