@finos/legend-graph 31.8.0 → 31.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/lib/graph/Core_HashUtils.d.ts +3 -1
  2. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  3. package/lib/graph/Core_HashUtils.js +2 -0
  4. package/lib/graph/Core_HashUtils.js.map +1 -1
  5. package/lib/graph/MetaModelConst.d.ts +4 -2
  6. package/lib/graph/MetaModelConst.d.ts.map +1 -1
  7. package/lib/graph/MetaModelConst.js +2 -0
  8. package/lib/graph/MetaModelConst.js.map +1 -1
  9. package/lib/graph/metamodel/pure/functionActivator/HostedServiceDeploymentConfiguration.d.ts +23 -0
  10. package/lib/graph/metamodel/pure/functionActivator/HostedServiceDeploymentConfiguration.d.ts.map +1 -0
  11. package/lib/graph/metamodel/pure/functionActivator/HostedServiceDeploymentConfiguration.js +26 -0
  12. package/lib/graph/metamodel/pure/functionActivator/HostedServiceDeploymentConfiguration.js.map +1 -0
  13. package/lib/graph/metamodel/pure/packageableElements/PackageableElement.d.ts +2 -0
  14. package/lib/graph/metamodel/pure/packageableElements/PackageableElement.d.ts.map +1 -1
  15. package/lib/graph/metamodel/pure/packageableElements/PackageableElement.js.map +1 -1
  16. package/lib/graph/metamodel/pure/packageableElements/function/FunctionActivator.d.ts +2 -2
  17. package/lib/graph/metamodel/pure/packageableElements/function/FunctionActivator.d.ts.map +1 -1
  18. package/lib/graph/metamodel/pure/packageableElements/function/FunctionActivator.js.map +1 -1
  19. package/lib/graph/metamodel/pure/packageableElements/function/HostedService.d.ts +31 -0
  20. package/lib/graph/metamodel/pure/packageableElements/function/HostedService.d.ts.map +1 -0
  21. package/lib/graph/metamodel/pure/packageableElements/function/HostedService.js +45 -0
  22. package/lib/graph/metamodel/pure/packageableElements/function/HostedService.js.map +1 -0
  23. package/lib/graph-manager/action/changeDetection/DSL_FunctionActivatorObserverHelper.d.ts +5 -1
  24. package/lib/graph-manager/action/changeDetection/DSL_FunctionActivatorObserverHelper.d.ts.map +1 -1
  25. package/lib/graph-manager/action/changeDetection/DSL_FunctionActivatorObserverHelper.js +27 -0
  26. package/lib/graph-manager/action/changeDetection/DSL_FunctionActivatorObserverHelper.js.map +1 -1
  27. package/lib/graph-manager/action/changeDetection/DomainObserverHelper.d.ts +2 -0
  28. package/lib/graph-manager/action/changeDetection/DomainObserverHelper.d.ts.map +1 -1
  29. package/lib/graph-manager/action/changeDetection/DomainObserverHelper.js +19 -1
  30. package/lib/graph-manager/action/changeDetection/DomainObserverHelper.js.map +1 -1
  31. package/lib/graph-manager/action/changeDetection/PackageableElementObserver.d.ts.map +1 -1
  32. package/lib/graph-manager/action/changeDetection/PackageableElementObserver.js +4 -1
  33. package/lib/graph-manager/action/changeDetection/PackageableElementObserver.js.map +1 -1
  34. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  35. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +4 -0
  36. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  37. package/lib/graph-manager/protocol/pure/v1/engine/functionActivator/V1_HostedServiceDeploymentConfiguration.d.ts +24 -0
  38. package/lib/graph-manager/protocol/pure/v1/engine/functionActivator/V1_HostedServiceDeploymentConfiguration.d.ts.map +1 -0
  39. package/lib/graph-manager/protocol/pure/v1/engine/functionActivator/V1_HostedServiceDeploymentConfiguration.js +26 -0
  40. package/lib/graph-manager/protocol/pure/v1/engine/functionActivator/V1_HostedServiceDeploymentConfiguration.js.map +1 -0
  41. package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.d.ts +2 -1
  42. package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.d.ts.map +1 -1
  43. package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.js +1 -1
  44. package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.js.map +1 -1
  45. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.d.ts +2 -0
  46. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.d.ts.map +1 -1
  47. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.js.map +1 -1
  48. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_FunctionActivator.d.ts +1 -1
  49. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_FunctionActivator.d.ts.map +1 -1
  50. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_HostedService.d.ts +29 -0
  51. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_HostedService.d.ts.map +1 -0
  52. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_HostedService.js +41 -0
  53. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_HostedService.js.map +1 -0
  54. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.d.ts.map +1 -1
  55. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.js +3 -3
  56. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.js.map +1 -1
  57. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_FunctionActivatorTransformer.d.ts +8 -3
  58. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_FunctionActivatorTransformer.d.ts.map +1 -1
  59. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_FunctionActivatorTransformer.js +22 -6
  60. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_FunctionActivatorTransformer.js.map +1 -1
  61. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.d.ts.map +1 -1
  62. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.js +22 -1
  63. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.js.map +1 -1
  64. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.d.ts +2 -0
  65. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.d.ts.map +1 -1
  66. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.js +3 -0
  67. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.js.map +1 -1
  68. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.d.ts +2 -0
  69. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.d.ts.map +1 -1
  70. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js +16 -0
  71. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js.map +1 -1
  72. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.d.ts +2 -0
  73. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.d.ts.map +1 -1
  74. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.js +3 -0
  75. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.js.map +1 -1
  76. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts +2 -0
  77. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  78. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +15 -1
  79. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  80. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.d.ts +2 -0
  81. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.d.ts.map +1 -1
  82. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js +3 -0
  83. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js.map +1 -1
  84. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.js +1 -1
  85. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.js.map +1 -1
  86. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FunctionActivatorBuilderHelper.d.ts +8 -3
  87. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FunctionActivatorBuilderHelper.d.ts.map +1 -1
  88. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FunctionActivatorBuilderHelper.js +17 -4
  89. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FunctionActivatorBuilderHelper.js.map +1 -1
  90. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.d.ts.map +1 -1
  91. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.js +6 -1
  92. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.js.map +1 -1
  93. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.d.ts.map +1 -1
  94. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.js +12 -2
  95. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.js.map +1 -1
  96. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.d.ts +3 -0
  97. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.d.ts.map +1 -1
  98. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.js +22 -1
  99. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.js.map +1 -1
  100. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionActivatorSerializationHelper.d.ts +6 -2
  101. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionActivatorSerializationHelper.d.ts.map +1 -1
  102. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionActivatorSerializationHelper.js +29 -10
  103. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionActivatorSerializationHelper.js.map +1 -1
  104. package/lib/index.d.ts +4 -1
  105. package/lib/index.d.ts.map +1 -1
  106. package/lib/index.js +4 -1
  107. package/lib/index.js.map +1 -1
  108. package/lib/package.json +1 -1
  109. package/package.json +1 -1
  110. package/src/graph/Core_HashUtils.ts +2 -0
  111. package/src/graph/MetaModelConst.ts +2 -0
  112. package/src/graph/metamodel/pure/functionActivator/HostedServiceDeploymentConfiguration.ts +28 -0
  113. package/src/graph/metamodel/pure/packageableElements/PackageableElement.ts +2 -0
  114. package/src/graph/metamodel/pure/packageableElements/function/FunctionActivator.ts +2 -2
  115. package/src/graph/metamodel/pure/packageableElements/function/HostedService.ts +61 -0
  116. package/src/graph-manager/action/changeDetection/DSL_FunctionActivatorObserverHelper.ts +42 -1
  117. package/src/graph-manager/action/changeDetection/DomainObserverHelper.ts +29 -1
  118. package/src/graph-manager/action/changeDetection/PackageableElementObserver.ts +6 -0
  119. package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +3 -0
  120. package/src/graph-manager/protocol/pure/v1/engine/functionActivator/V1_HostedServiceDeploymentConfiguration.ts +31 -0
  121. package/src/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.ts +3 -2
  122. package/src/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.ts +2 -0
  123. package/src/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_FunctionActivator.ts +1 -1
  124. package/src/graph-manager/protocol/pure/v1/model/packageableElements/function/V1_HostedService.ts +51 -0
  125. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.ts +9 -3
  126. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_FunctionActivatorTransformer.ts +32 -7
  127. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.ts +30 -0
  128. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.ts +5 -0
  129. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.ts +31 -0
  130. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.ts +5 -0
  131. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +36 -1
  132. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.ts +5 -0
  133. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.ts +1 -1
  134. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FunctionActivatorBuilderHelper.ts +28 -2
  135. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.ts +11 -0
  136. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.ts +21 -1
  137. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.ts +30 -0
  138. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionActivatorSerializationHelper.ts +44 -11
  139. package/src/index.ts +7 -0
  140. package/tsconfig.json +4 -0
@@ -44,6 +44,7 @@ import {
44
44
  observe_Measure,
45
45
  observe_Package,
46
46
  observe_Profile,
47
+ observe_HostedService,
47
48
  observe_SectionIndex,
48
49
  observe_SnowflakeApp,
49
50
  } from './DomainObserverHelper.js';
@@ -73,6 +74,7 @@ import type { INTERNAL__UnknownPackageableElement } from '../../../graph/metamod
73
74
  import type { INTERNAL__UnknownFunctionActivator } from '../../../graph/metamodel/pure/packageableElements/function/INTERNAL__UnknownFunctionActivator.js';
74
75
  import type { INTERNAL__UnknownStore } from '../../../graph/metamodel/pure/packageableElements/store/INTERNAL__UnknownStore.js';
75
76
  import type { SnowflakeApp } from '../../../graph/metamodel/pure/packageableElements/function/SnowflakeApp.js';
77
+ import type { HostedService } from '../../../graph/metamodel/pure/packageableElements/function/HostedService.js';
76
78
 
77
79
  class PackageableElementObserver implements PackageableElementVisitor<void> {
78
80
  observerContext: ObserverContext;
@@ -109,6 +111,10 @@ class PackageableElementObserver implements PackageableElementVisitor<void> {
109
111
  observe_SnowflakeApp(element);
110
112
  }
111
113
 
114
+ visit_HostedService(element: HostedService): void {
115
+ observe_HostedService(element);
116
+ }
117
+
112
118
  visit_INTERNAL__UnknownStore(element: INTERNAL__UnknownStore): void {
113
119
  observe_INTERNAL__UnknownStore(element);
114
120
  }
@@ -320,6 +320,7 @@ import { V1_transformTablePointer } from './transformation/pureGraph/from/V1_Dat
320
320
  import { EngineError } from '../../../action/EngineError.js';
321
321
  import { V1_SnowflakeApp } from './model/packageableElements/function/V1_SnowflakeApp.js';
322
322
  import type { ExecutionResult } from '../../../action/execution/ExecutionResult.js';
323
+ import { V1_HostedService } from './model/packageableElements/function/V1_HostedService.js';
323
324
 
324
325
  class V1_PureModelContextDataIndex {
325
326
  elements: V1_PackageableElement[] = [];
@@ -3924,6 +3925,8 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
3924
3925
  return CORE_PURE_PATH.GENERATION_SPECIFICATION;
3925
3926
  } else if (protocol instanceof V1_SnowflakeApp) {
3926
3927
  return CORE_PURE_PATH.SNOWFLAKE_APP;
3928
+ } else if (protocol instanceof V1_HostedService) {
3929
+ return CORE_PURE_PATH.HOSTED_SERVICE;
3927
3930
  }
3928
3931
  const extraElementProtocolClassifierPathGetters = this.pluginManager
3929
3932
  .getPureProtocolProcessorPlugins()
@@ -0,0 +1,31 @@
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 { hashArray, type Hashable } from '@finos/legend-shared';
18
+ import { V1_DeploymentConfiguration } from './V1_DeploymentConfiguration.js';
19
+
20
+ export class V1_HostedServiceDeploymentConfiguration
21
+ extends V1_DeploymentConfiguration
22
+ implements Hashable
23
+ {
24
+ host: string | undefined;
25
+ port: number | undefined;
26
+ path: string | undefined;
27
+
28
+ override get hashCode(): string {
29
+ return hashArray([this.host ?? '', this.port ?? '', this.path ?? '']);
30
+ }
31
+ }
@@ -21,6 +21,7 @@ import {
21
21
  } from '../../../../../../graph/Core_HashUtils.js';
22
22
  import type { V1_RelationalCSVData } from './V1_RelationalCSVData.js';
23
23
  import type { V1_INTERNAL__UnknownEmbeddedData } from './V1_INTERNAL__UnknownEmbeddedData.js';
24
+ import type { V1_PackageableElementPointer } from '../packageableElements/V1_PackageableElement.js';
24
25
 
25
26
  export interface V1_EmbeddedDataVisitor<T> {
26
27
  visit_EmbeddedData(data: V1_EmbeddedData): T;
@@ -44,12 +45,12 @@ export class V1_DataElementReference
44
45
  extends V1_EmbeddedData
45
46
  implements Hashable
46
47
  {
47
- dataElement!: string;
48
+ dataElement!: V1_PackageableElementPointer;
48
49
 
49
50
  get hashCode(): string {
50
51
  return hashArray([
51
52
  CORE_HASH_STRUCTURE.DATA_ELEMENT_REFERENCE,
52
- this.dataElement,
53
+ this.dataElement.path,
53
54
  ]);
54
55
  }
55
56
 
@@ -38,6 +38,7 @@ import type { V1_INTERNAL__UnknownPackageableElement } from './V1_INTERNAL__Unkn
38
38
  import type { V1_INTERNAL__UnknownFunctionActivator } from './function/V1_INTERNAL__UnknownFunctionActivator.js';
39
39
  import type { V1_INTERNAL__UnknownStore } from './store/V1_INTERNAL__UnknownStore.js';
40
40
  import type { V1_SnowflakeApp } from './function/V1_SnowflakeApp.js';
41
+ import type { V1_HostedService } from './function/V1_HostedService.js';
41
42
 
42
43
  export interface V1_PackageableElementVisitor<T> {
43
44
  visit_PackageableElement(element: V1_PackageableElement): T;
@@ -70,6 +71,7 @@ export interface V1_PackageableElementVisitor<T> {
70
71
  element: V1_ExecutionEnvironmentInstance,
71
72
  ): T;
72
73
  visit_SnowflakeApp(element: V1_SnowflakeApp): T;
74
+ visit_HostedService(element: V1_HostedService): T;
73
75
  }
74
76
 
75
77
  export abstract class V1_PackageableElement implements Hashable {
@@ -30,7 +30,7 @@ export abstract class V1_FunctionActivator
30
30
  {
31
31
  function!: V1_PackageableElementPointer;
32
32
  activationConfiguration: V1_DeploymentConfiguration | undefined;
33
- ownership?: V1_Ownership;
33
+ ownership!: V1_Ownership;
34
34
  stereotypes: V1_StereotypePtr[] = [];
35
35
  taggedValues: V1_TaggedValue[] = [];
36
36
  }
@@ -0,0 +1,51 @@
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 { hashArray } from '@finos/legend-shared';
18
+ import { V1_FunctionActivator } from './V1_FunctionActivator.js';
19
+ import type { V1_PackageableElementVisitor } from '../V1_PackageableElement.js';
20
+ import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
21
+ import type { V1_HostedServiceDeploymentConfiguration } from '../../../engine/functionActivator/V1_HostedServiceDeploymentConfiguration.js';
22
+
23
+ export class V1_HostedService extends V1_FunctionActivator {
24
+ documentation: string | undefined;
25
+ pattern!: string;
26
+ autoActivateUpdates: boolean | undefined;
27
+ storeModel: boolean | undefined;
28
+ generateLineage: boolean | undefined;
29
+ declare activationConfiguration:
30
+ | V1_HostedServiceDeploymentConfiguration
31
+ | undefined;
32
+
33
+ accept_PackageableElementVisitor<T>(
34
+ visitor: V1_PackageableElementVisitor<T>,
35
+ ): T {
36
+ return visitor.visit_HostedService(this);
37
+ }
38
+
39
+ override get hashCode(): string {
40
+ return hashArray([
41
+ CORE_HASH_STRUCTURE.HOSTED_SERVICE,
42
+ this.documentation ?? '',
43
+ this.pattern,
44
+ this.autoActivateUpdates,
45
+ this.storeModel ?? '',
46
+ this.generateLineage ?? '',
47
+ this.activationConfiguration,
48
+ this.ownership,
49
+ ]);
50
+ }
51
+ }
@@ -44,7 +44,10 @@ import {
44
44
  V1_RelationalCSVDataTable,
45
45
  } from '../../../model/data/V1_RelationalCSVData.js';
46
46
  import { V1_DataElement } from '../../../model/packageableElements/data/V1_DataElement.js';
47
- import { V1_initPackageableElement } from './V1_CoreTransformerHelper.js';
47
+ import {
48
+ V1_initPackageableElement,
49
+ V1_transformElementReferencePointer,
50
+ } from './V1_CoreTransformerHelper.js';
48
51
  import {
49
52
  V1_transformStereotype,
50
53
  V1_transformTaggedValue,
@@ -52,6 +55,7 @@ import {
52
55
  import type { V1_GraphTransformerContext } from './V1_GraphTransformerContext.js';
53
56
  import { INTERNAL__UnknownEmbeddedData } from '../../../../../../../graph/metamodel/pure/data/INTERNAL__UnknownEmbeddedData.js';
54
57
  import { V1_INTERNAL__UnknownEmbeddedData } from '../../../model/data/V1_INTERNAL__UnknownEmbeddedData.js';
58
+ import { PackageableElementPointerType } from '../../../../../../../graph/MetaModelConst.js';
55
59
 
56
60
  // ----------------------------------------------- DATA ----------------------------------------
57
61
 
@@ -112,8 +116,10 @@ const V1_transformDataElementReference = (
112
116
  element: DataElementReference,
113
117
  ): V1_DataElementReference => {
114
118
  const dataElementReference = new V1_DataElementReference();
115
- dataElementReference.dataElement =
116
- element.dataElement.valueForSerialization ?? '';
119
+ dataElementReference.dataElement = V1_transformElementReferencePointer(
120
+ PackageableElementPointerType.DATA,
121
+ element.dataElement,
122
+ );
117
123
  return dataElementReference;
118
124
  };
119
125
 
@@ -18,11 +18,18 @@ import { UnsupportedOperationError } from '@finos/legend-shared';
18
18
  import type { SnowflakeAppDeploymentConfiguration } from '../../../../../../../graph/metamodel/pure/functionActivator/SnowflakeAppDeploymentConfiguration.js';
19
19
  import {
20
20
  DeploymentOwner,
21
+ UserList,
21
22
  type Ownership,
22
23
  } from '../../../../../../../graph/metamodel/pure/packageableElements/function/Ownership.js';
23
24
  import { V1_SnowflakeAppDeploymentConfiguration } from '../../../engine/functionActivator/V1_SnowflakeAppDeploymentConfiguration.js';
24
- import { V1_DeploymentOwner } from '../../../model/packageableElements/function/V1_Ownership.js';
25
+ import {
26
+ V1_DeploymentOwner,
27
+ type V1_Ownership,
28
+ V1_UserList,
29
+ } from '../../../model/packageableElements/function/V1_Ownership.js';
25
30
  import { V1_transformConnectionPointer } from './V1_ConnectionTransformer.js';
31
+ import { V1_HostedServiceDeploymentConfiguration } from '../../../engine/functionActivator/V1_HostedServiceDeploymentConfiguration.js';
32
+ import type { HostedServiceDeploymentConfiguration } from '../../../../../../../graph/metamodel/pure/functionActivator/HostedServiceDeploymentConfiguration.js';
26
33
 
27
34
  export const V1_transformSnowflakeAppDeploymentConfiguration = (
28
35
  element: SnowflakeAppDeploymentConfiguration,
@@ -38,20 +45,38 @@ export const V1_transformSnowflakeAppDeploymentConfiguration = (
38
45
  return protocol;
39
46
  };
40
47
 
41
- const transformDeployment = (element: DeploymentOwner): V1_DeploymentOwner => {
48
+ export const V1_transformDeployment = (
49
+ metamodel: DeploymentOwner,
50
+ ): V1_DeploymentOwner => {
42
51
  const ownership = new V1_DeploymentOwner();
43
- ownership.id = element.id;
52
+ ownership.id = metamodel.id;
44
53
  return ownership;
45
54
  };
46
55
 
47
- export const V1_transformDeployment = (
48
- metamodel: Ownership,
49
- ): V1_DeploymentOwner => {
56
+ export const V1_transformUserList = (element: UserList): V1_UserList => {
57
+ const ownership = new V1_UserList();
58
+ ownership.users = element.users;
59
+ return ownership;
60
+ };
61
+
62
+ export const V1_transformOwnership = (metamodel: Ownership): V1_Ownership => {
50
63
  if (metamodel instanceof DeploymentOwner) {
51
- return transformDeployment(metamodel);
64
+ return V1_transformDeployment(metamodel);
65
+ } else if (metamodel instanceof UserList) {
66
+ return V1_transformUserList(metamodel);
52
67
  }
53
68
  throw new UnsupportedOperationError(
54
69
  "Can't transform function activator ownership",
55
70
  metamodel,
56
71
  );
57
72
  };
73
+
74
+ export const V1_transformHostedServiceDeploymentConfiguration = (
75
+ element: HostedServiceDeploymentConfiguration,
76
+ ): V1_HostedServiceDeploymentConfiguration => {
77
+ const protocol = new V1_HostedServiceDeploymentConfiguration();
78
+ protocol.host = element.host;
79
+ protocol.path = element.path;
80
+ protocol.port = element.port;
81
+ return protocol;
82
+ };
@@ -83,9 +83,13 @@ import { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_
83
83
  import type { SnowflakeApp } from '../../../../../../../graph/metamodel/pure/packageableElements/function/SnowflakeApp.js';
84
84
  import {
85
85
  V1_transformDeployment,
86
+ V1_transformHostedServiceDeploymentConfiguration,
87
+ V1_transformOwnership,
86
88
  V1_transformSnowflakeAppDeploymentConfiguration,
87
89
  } from './V1_FunctionActivatorTransformer.js';
88
90
  import { PackageableElementPointerType } from '../../../../../../../graph/MetaModelConst.js';
91
+ import type { HostedService } from '../../../../../../../graph/metamodel/pure/packageableElements/function/HostedService.js';
92
+ import { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
89
93
 
90
94
  class V1_PackageableElementTransformer
91
95
  implements PackageableElementVisitor<V1_PackageableElement>
@@ -163,6 +167,32 @@ class V1_PackageableElementTransformer
163
167
  return protocol;
164
168
  }
165
169
 
170
+ visit_HostedService(element: HostedService): V1_PackageableElement {
171
+ const protocol = new V1_HostedService();
172
+ V1_initPackageableElement(protocol, element);
173
+ protocol.function = new V1_PackageableElementPointer(
174
+ PackageableElementPointerType.FUNCTION,
175
+ generateFunctionPrettyName(element.function.value, {
176
+ fullPath: true,
177
+ spacing: false,
178
+ notIncludeParamName: true,
179
+ }),
180
+ );
181
+ protocol.documentation = element.documentation;
182
+ protocol.pattern = element.pattern;
183
+ protocol.autoActivateUpdates = element.autoActivateUpdates;
184
+ protocol.storeModel = element.storeModel;
185
+ protocol.generateLineage = element.generateLineage;
186
+ protocol.ownership = V1_transformOwnership(element.ownership);
187
+ if (element.activationConfiguration) {
188
+ protocol.activationConfiguration =
189
+ V1_transformHostedServiceDeploymentConfiguration(
190
+ element.activationConfiguration,
191
+ );
192
+ }
193
+ return protocol;
194
+ }
195
+
166
196
  visit_INTERNAL__UnknownStore(
167
197
  element: INTERNAL__UnknownStore,
168
198
  ): V1_PackageableElement {
@@ -49,6 +49,7 @@ import type { V1_INTERNAL__UnknownPackageableElement } from '../../../model/pack
49
49
  import type { V1_INTERNAL__UnknownFunctionActivator } from '../../../model/packageableElements/function/V1_INTERNAL__UnknownFunctionActivator.js';
50
50
  import type { V1_INTERNAL__UnknownStore } from '../../../model/packageableElements/store/V1_INTERNAL__UnknownStore.js';
51
51
  import type { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_SnowflakeApp.js';
52
+ import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
52
53
 
53
54
  export class V1_ElementFifthPassBuilder
54
55
  implements V1_PackageableElementVisitor<void>
@@ -170,4 +171,8 @@ export class V1_ElementFifthPassBuilder
170
171
  visit_SnowflakeApp(element: V1_SnowflakeApp): void {
171
172
  throw new UnsupportedOperationError();
172
173
  }
174
+
175
+ visit_HostedService(element: V1_HostedService): void {
176
+ throw new UnsupportedOperationError();
177
+ }
173
178
  }
@@ -76,6 +76,8 @@ import type { V1_INTERNAL__UnknownStore } from '../../../model/packageableElemen
76
76
  import { INTERNAL__UnknownStore } from '../../../../../../../graph/metamodel/pure/packageableElements/store/INTERNAL__UnknownStore.js';
77
77
  import type { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_SnowflakeApp.js';
78
78
  import { SnowflakeApp } from '../../../../../../../graph/metamodel/pure/packageableElements/function/SnowflakeApp.js';
79
+ import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
80
+ import { HostedService } from '../../../../../../../graph/metamodel/pure/packageableElements/function/HostedService.js';
79
81
 
80
82
  export class V1_ElementFirstPassBuilder
81
83
  implements V1_PackageableElementVisitor<PackageableElement>
@@ -161,6 +163,35 @@ export class V1_ElementFirstPassBuilder
161
163
  return metamodel;
162
164
  }
163
165
 
166
+ visit_HostedService(element: V1_HostedService): PackageableElement {
167
+ assertNonEmptyString(
168
+ element.package,
169
+ `Rest Service 'package' field is missing or empty`,
170
+ );
171
+ assertNonEmptyString(
172
+ element.name,
173
+ `Rest Service 'name' field is missing or empty`,
174
+ );
175
+ const metamodel = new HostedService(element.name);
176
+ const path = V1_buildFullPath(element.package, element.name);
177
+ V1_checkDuplicatedElement(path, this.context, this.elementPathCache);
178
+ this.context.currentSubGraph.setOwnFunctionActivator(path, metamodel);
179
+ addElementToPackage(
180
+ getOrCreateGraphPackage(
181
+ this.context.currentSubGraph,
182
+ element.package,
183
+ this.packageCache,
184
+ ),
185
+ metamodel,
186
+ );
187
+ metamodel.documentation = element.documentation;
188
+ metamodel.pattern = element.pattern;
189
+ metamodel.autoActivateUpdates = element.autoActivateUpdates;
190
+ metamodel.storeModel = element.storeModel;
191
+ metamodel.generateLineage = element.generateLineage;
192
+ return metamodel;
193
+ }
194
+
164
195
  visit_INTERNAL__UnknownFunctionActivator(
165
196
  element: V1_INTERNAL__UnknownFunctionActivator,
166
197
  ): PackageableElement {
@@ -57,6 +57,7 @@ import type { V1_INTERNAL__UnknownPackageableElement } from '../../../model/pack
57
57
  import type { V1_INTERNAL__UnknownFunctionActivator } from '../../../model/packageableElements/function/V1_INTERNAL__UnknownFunctionActivator.js';
58
58
  import type { V1_INTERNAL__UnknownStore } from '../../../model/packageableElements/store/V1_INTERNAL__UnknownStore.js';
59
59
  import type { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_SnowflakeApp.js';
60
+ import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
60
61
 
61
62
  export class V1_ElementFourthPassBuilder
62
63
  implements V1_PackageableElementVisitor<void>
@@ -89,6 +90,10 @@ export class V1_ElementFourthPassBuilder
89
90
  throw new UnsupportedOperationError();
90
91
  }
91
92
 
93
+ visit_HostedService(element: V1_HostedService): void {
94
+ throw new UnsupportedOperationError();
95
+ }
96
+
92
97
  visit_INTERNAL__UnknownStore(element: V1_INTERNAL__UnknownStore): void {
93
98
  return;
94
99
  }
@@ -105,9 +105,12 @@ import { V1_INTERNAL__UnknownMappingInclude } from '../../../model/packageableEl
105
105
  import type { V1_INTERNAL__UnknownStore } from '../../../model/packageableElements/store/V1_INTERNAL__UnknownStore.js';
106
106
  import type { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_SnowflakeApp.js';
107
107
  import {
108
- V1_buildDeploymentOwnership,
108
+ V1_buildHostedServiceDeploymentConfiguration,
109
109
  V1_buildSnowflakeAppDeploymentConfiguration,
110
+ V1_buildDeploymentOwnership,
111
+ V1_builHostedServiceOwnership,
110
112
  } from './helpers/V1_FunctionActivatorBuilderHelper.js';
113
+ import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
111
114
 
112
115
  export class V1_ElementSecondPassBuilder
113
116
  implements V1_PackageableElementVisitor<void>
@@ -176,6 +179,38 @@ export class V1_ElementSecondPassBuilder
176
179
  );
177
180
  }
178
181
 
182
+ visit_HostedService(element: V1_HostedService): void {
183
+ assertNonEmptyString(
184
+ element.pattern,
185
+ `Hosted Service 'pattern' field is missing or empty`,
186
+ );
187
+ const metamodel = this.context.currentSubGraph.getOwnFunctionActivator(
188
+ V1_buildFullPath(element.package, element.name),
189
+ );
190
+ metamodel.function = PackageableElementExplicitReference.create(
191
+ guaranteeNonNullable(
192
+ this.context.graph.functions.find(
193
+ (fn) =>
194
+ generateFunctionPrettyName(fn, {
195
+ fullPath: true,
196
+ spacing: false,
197
+ notIncludeParamName: true,
198
+ }) === element.function.path.replaceAll(/\s*/gu, ''),
199
+ ),
200
+ ),
201
+ );
202
+ metamodel.ownership = V1_builHostedServiceOwnership(
203
+ element.ownership,
204
+ metamodel,
205
+ );
206
+ if (element.activationConfiguration) {
207
+ metamodel.activationConfiguration =
208
+ V1_buildHostedServiceDeploymentConfiguration(
209
+ element.activationConfiguration,
210
+ );
211
+ }
212
+ }
213
+
179
214
  visit_INTERNAL__UnknownStore(element: V1_INTERNAL__UnknownStore): void {
180
215
  return;
181
216
  }
@@ -64,6 +64,7 @@ import type { V1_INTERNAL__UnknownPackageableElement } from '../../../model/pack
64
64
  import type { V1_INTERNAL__UnknownFunctionActivator } from '../../../model/packageableElements/function/V1_INTERNAL__UnknownFunctionActivator.js';
65
65
  import type { V1_INTERNAL__UnknownStore } from '../../../model/packageableElements/store/V1_INTERNAL__UnknownStore.js';
66
66
  import type { V1_SnowflakeApp } from '../../../model/packageableElements/function/V1_SnowflakeApp.js';
67
+ import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
67
68
 
68
69
  export class V1_ElementThirdPassBuilder
69
70
  implements V1_PackageableElementVisitor<void>
@@ -112,6 +113,10 @@ export class V1_ElementThirdPassBuilder
112
113
  throw new UnsupportedOperationError();
113
114
  }
114
115
 
116
+ visit_HostedService(element: V1_HostedService): void {
117
+ throw new UnsupportedOperationError();
118
+ }
119
+
115
120
  visit_ExecutionEnvironmentInstance(
116
121
  element: V1_ExecutionEnvironmentInstance,
117
122
  ): void {
@@ -112,7 +112,7 @@ class V1_EmbeddedDataBuilder implements V1_EmbeddedDataVisitor<EmbeddedData> {
112
112
  ): EmbeddedData {
113
113
  const metamodel = new DataElementReference();
114
114
  metamodel.dataElement = this.context.resolveDataElement(
115
- dataElementReference.dataElement,
115
+ dataElementReference.dataElement.path,
116
116
  );
117
117
  return metamodel;
118
118
  }
@@ -22,13 +22,17 @@ import { V1_buildConnection } from './V1_ConnectionBuilderHelper.js';
22
22
  import { UnsupportedOperationError, guaranteeType } from '@finos/legend-shared';
23
23
  import {
24
24
  DeploymentOwner,
25
+ UserList,
25
26
  type Ownership,
26
27
  } from '../../../../../../../../graph/metamodel/pure/packageableElements/function/Ownership.js';
27
28
  import {
28
29
  V1_DeploymentOwner,
30
+ V1_UserList,
29
31
  type V1_Ownership,
30
32
  } from '../../../../model/packageableElements/function/V1_Ownership.js';
31
33
  import type { FunctionActivator } from '../../../../../../../../graph/metamodel/pure/packageableElements/function/FunctionActivator.js';
34
+ import { HostedServiceDeploymentConfiguration } from '../../../../../../../../graph/metamodel/pure/functionActivator/HostedServiceDeploymentConfiguration.js';
35
+ import type { V1_HostedServiceDeploymentConfiguration } from '../../../../engine/functionActivator/V1_HostedServiceDeploymentConfiguration.js';
32
36
 
33
37
  export const V1_buildSnowflakeAppDeploymentConfiguration = (
34
38
  element: V1_SnowflakeAppDeploymentConfiguration,
@@ -48,11 +52,33 @@ export const V1_buildSnowflakeAppDeploymentConfiguration = (
48
52
  };
49
53
 
50
54
  export const V1_buildDeploymentOwnership = (
51
- ownership: V1_Ownership,
55
+ ownership: V1_DeploymentOwner,
56
+ functionActivator: FunctionActivator,
57
+ ): DeploymentOwner => new DeploymentOwner(ownership.id, functionActivator);
58
+
59
+ export const V1_buildUserList = (
60
+ ownership: V1_UserList,
52
61
  functionActivator: FunctionActivator,
62
+ ): UserList => new UserList(ownership.users, functionActivator);
63
+
64
+ export const V1_builHostedServiceOwnership = (
65
+ ownership: V1_Ownership,
66
+ parentService: FunctionActivator,
53
67
  ): Ownership => {
54
68
  if (ownership instanceof V1_DeploymentOwner) {
55
- return new DeploymentOwner(ownership.id, functionActivator);
69
+ return V1_buildDeploymentOwnership(ownership, parentService);
70
+ } else if (ownership instanceof V1_UserList) {
71
+ return V1_buildUserList(ownership, parentService);
56
72
  }
57
73
  throw new UnsupportedOperationError();
58
74
  };
75
+
76
+ export const V1_buildHostedServiceDeploymentConfiguration = (
77
+ element: V1_HostedServiceDeploymentConfiguration,
78
+ ): HostedServiceDeploymentConfiguration => {
79
+ const metamodel = new HostedServiceDeploymentConfiguration();
80
+ metamodel.host = element.host;
81
+ metamodel.port = element.port;
82
+ metamodel.path = element.path;
83
+ return metamodel;
84
+ };
@@ -93,6 +93,8 @@ import {
93
93
  V1_INTERNAL__UnknownFunctionActivatorModelSchema,
94
94
  V1_snowflakeAppModelSchema,
95
95
  V1_SNOWFLAKE_APP_TYPE,
96
+ V1_HostedServiceModelSchema,
97
+ V1_HOSTED_SERVICE_TYPE,
96
98
  } from './serializationHelpers/V1_DomainSerializationHelper.js';
97
99
  import type {
98
100
  PureProtocolProcessorPlugin,
@@ -114,6 +116,7 @@ import type { V1_INTERNAL__UnknownFunctionActivator } from '../../model/packagea
114
116
  import type { SubtypeInfo } from '../../../../../action/protocol/ProtocolInfo.js';
115
117
  import { V1_INTERNAL__UnknownStore } from '../../model/packageableElements/store/V1_INTERNAL__UnknownStore.js';
116
118
  import type { V1_SnowflakeApp } from '../../model/packageableElements/function/V1_SnowflakeApp.js';
119
+ import type { V1_HostedService } from '../../model/packageableElements/function/V1_HostedService.js';
117
120
 
118
121
  class V1_PackageableElementSerializer
119
122
  implements V1_PackageableElementVisitor<PlainObject<V1_PackageableElement>>
@@ -160,6 +163,12 @@ class V1_PackageableElementSerializer
160
163
  return serialize(V1_snowflakeAppModelSchema, element);
161
164
  }
162
165
 
166
+ visit_HostedService(
167
+ element: V1_HostedService,
168
+ ): PlainObject<V1_PackageableElement> {
169
+ return serialize(V1_HostedServiceModelSchema, element);
170
+ }
171
+
163
172
  visit_INTERNAL__UnknownStore(
164
173
  element: V1_INTERNAL__UnknownStore,
165
174
  ): PlainObject<V1_PackageableElement> {
@@ -329,6 +338,8 @@ export const V1_deserializePackageableElement = (
329
338
  return deserialize(V1_dataElementModelSchema(plugins), json);
330
339
  case V1_SNOWFLAKE_APP_TYPE:
331
340
  return deserialize(V1_snowflakeAppModelSchema, json);
341
+ case V1_HOSTED_SERVICE_TYPE:
342
+ return deserialize(V1_HostedServiceModelSchema, json);
332
343
  default: {
333
344
  for (const deserializer of extraElementProtocolDeserializers) {
334
345
  const protocol = deserializer(json, plugins);
@@ -21,6 +21,7 @@ import {
21
21
  usingModelSchema,
22
22
  customListWithSchema,
23
23
  optionalCustomList,
24
+ isString,
24
25
  } from '@finos/legend-shared';
25
26
  import {
26
27
  createModelSchema,
@@ -54,6 +55,9 @@ import {
54
55
  V1_taggedValueModelSchema,
55
56
  } from './V1_DomainSerializationHelper.js';
56
57
  import { V1_INTERNAL__UnknownEmbeddedData } from '../../../model/data/V1_INTERNAL__UnknownEmbeddedData.js';
58
+ import { V1_packageableElementPointerModelSchema } from './V1_CoreSerializationHelper.js';
59
+ import { V1_PackageableElementPointer } from '../../../model/packageableElements/V1_PackageableElement.js';
60
+ import { PackageableElementPointerType } from '../../../../../../../graph/MetaModelConst.js';
57
61
 
58
62
  export const V1_DATA_ELEMENT_PROTOCOL_TYPE = 'dataElement';
59
63
 
@@ -136,11 +140,27 @@ export const V1_externalFormatDataModelSchema = createModelSchema(
136
140
  },
137
141
  );
138
142
 
143
+ const V1_serializeDataElementReferenceValue = (
144
+ json: PlainObject<V1_PackageableElementPointer> | string,
145
+ ): V1_PackageableElementPointer => {
146
+ // For backward compatible: see https://github.com/finos/legend-engine/pull/2621
147
+ if (isString(json)) {
148
+ return new V1_PackageableElementPointer(
149
+ PackageableElementPointerType.DATA,
150
+ json,
151
+ );
152
+ }
153
+ return deserialize(V1_packageableElementPointerModelSchema, json);
154
+ };
155
+
139
156
  export const V1_dataElementReferenceModelSchema = createModelSchema(
140
157
  V1_DataElementReference,
141
158
  {
142
159
  _type: usingConstantValueSchema(V1_EmbeddedDataType.DATA_ELEMENT_REFERENCE),
143
- dataElement: primitive(),
160
+ dataElement: custom(
161
+ (val) => serialize(V1_packageableElementPointerModelSchema, val),
162
+ (val) => V1_serializeDataElementReferenceValue(val),
163
+ ),
144
164
  },
145
165
  );
146
166