@finos/legend-graph 32.1.26 → 32.1.28
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.
- package/lib/graph/metamodel/pure/packageableElements/PackageableElement.d.ts +2 -0
- package/lib/graph/metamodel/pure/packageableElements/PackageableElement.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/PackageableElement.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.d.ts +26 -0
- package/lib/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js +28 -0
- package/lib/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js.map +1 -0
- package/lib/graph-manager/action/changeDetection/PackageableElementObserver.d.ts.map +1 -1
- package/lib/graph-manager/action/changeDetection/PackageableElementObserver.js +3 -0
- package/lib/graph-manager/action/changeDetection/PackageableElementObserver.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +7 -2
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/entitlements/V1_ConsumerEntitlements.d.ts +10 -3
- package/lib/graph-manager/protocol/pure/v1/entitlements/V1_ConsumerEntitlements.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/entitlements/V1_ConsumerEntitlements.js +10 -3
- package/lib/graph-manager/protocol/pure/v1/entitlements/V1_ConsumerEntitlements.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.d.ts +24 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.js +24 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.js +8 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.js +3 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js +19 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.js +3 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +3 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js +3 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.js +7 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.d.ts +4 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js +11 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.d.ts +20 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.js +30 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.js.map +1 -0
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/graph/metamodel/pure/packageableElements/PackageableElement.ts +2 -0
- package/src/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.ts +34 -0
- package/src/graph-manager/action/changeDetection/PackageableElementObserver.ts +5 -0
- package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +9 -8
- package/src/graph-manager/protocol/pure/v1/entitlements/V1_ConsumerEntitlements.ts +12 -3
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.ts +3 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.ts +31 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.ts +10 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.ts +5 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.ts +40 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFourthPassBuilder.ts +4 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +5 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.ts +5 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.ts +10 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.ts +16 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.ts +40 -0
- package/src/index.ts +5 -0
- package/tsconfig.json +3 -0
|
@@ -482,6 +482,7 @@ export const V1_indexPureModelContextData = (
|
|
|
482
482
|
}
|
|
483
483
|
isIndexedAsOtherElement = true;
|
|
484
484
|
}
|
|
485
|
+
// we index everything else as native
|
|
485
486
|
if (!isIndexedAsOtherElement) {
|
|
486
487
|
index.nativeElements.push(el);
|
|
487
488
|
}
|
|
@@ -1259,25 +1260,24 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1259
1260
|
inputs.flatMap(async (input) => {
|
|
1260
1261
|
// create the package cache
|
|
1261
1262
|
const packageCache = new Map<string, Package>();
|
|
1262
|
-
|
|
1263
1263
|
await Promise.all(
|
|
1264
|
-
input.data.nativeElements.map((element) =>
|
|
1265
|
-
this.visitWithGraphBuilderErrorHandling(
|
|
1264
|
+
input.data.nativeElements.map((element) => {
|
|
1265
|
+
return this.visitWithGraphBuilderErrorHandling(
|
|
1266
1266
|
element,
|
|
1267
1267
|
new V1_ElementFirstPassBuilder(
|
|
1268
1268
|
this.getBuilderContext(graph, input.model, element, options),
|
|
1269
1269
|
packageCache,
|
|
1270
1270
|
elementPathCache,
|
|
1271
1271
|
),
|
|
1272
|
-
)
|
|
1273
|
-
),
|
|
1272
|
+
);
|
|
1273
|
+
}),
|
|
1274
1274
|
);
|
|
1275
1275
|
await Promise.all(
|
|
1276
1276
|
this.graphBuilderExtensions.sortedExtraElementBuilders.flatMap(
|
|
1277
1277
|
(builder) =>
|
|
1278
1278
|
(input.data.otherElementsByBuilder.get(builder) ?? []).map(
|
|
1279
|
-
(element) =>
|
|
1280
|
-
this.visitWithGraphBuilderErrorHandling(
|
|
1279
|
+
(element) => {
|
|
1280
|
+
return this.visitWithGraphBuilderErrorHandling(
|
|
1281
1281
|
element,
|
|
1282
1282
|
new V1_ElementFirstPassBuilder(
|
|
1283
1283
|
this.getBuilderContext(
|
|
@@ -1289,7 +1289,8 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1289
1289
|
packageCache,
|
|
1290
1290
|
elementPathCache,
|
|
1291
1291
|
),
|
|
1292
|
-
)
|
|
1292
|
+
);
|
|
1293
|
+
},
|
|
1293
1294
|
),
|
|
1294
1295
|
),
|
|
1295
1296
|
);
|
|
@@ -72,9 +72,9 @@ export class V1_ContractUserMembership {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
export enum V1_UserApprovalStatus {
|
|
75
|
-
PENDING,
|
|
76
|
-
APPROVED,
|
|
77
|
-
DENIED,
|
|
75
|
+
PENDING = 'PENDING',
|
|
76
|
+
APPROVED = 'APPROVED',
|
|
77
|
+
DENIED = 'DENIED',
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export enum V1_ContractState {
|
|
@@ -149,3 +149,12 @@ export type V1_DataContractsCreation = {
|
|
|
149
149
|
accessPointGroup: string;
|
|
150
150
|
consumer: PlainObject<V1_AdhocTeam>;
|
|
151
151
|
};
|
|
152
|
+
|
|
153
|
+
export class V1_TaskMetadata {
|
|
154
|
+
rec!: V1_ContractUserEventRecord;
|
|
155
|
+
assignees: string[] = [];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export class V1_TaskResponse {
|
|
159
|
+
tasks: V1_TaskMetadata[] | undefined;
|
|
160
|
+
}
|
package/src/graph-manager/protocol/pure/v1/model/packageableElements/V1_PackageableElement.ts
CHANGED
|
@@ -41,6 +41,7 @@ import type { V1_SnowflakeApp } from './function/V1_SnowflakeApp.js';
|
|
|
41
41
|
import type { V1_INTERNAL__UnknownElement } from './V1_INTERNAL__UnknownElement.js';
|
|
42
42
|
import type { V1_HostedService } from './function/V1_HostedService.js';
|
|
43
43
|
import type { V1_DataProduct } from './dataProduct/V1_DataProduct.js';
|
|
44
|
+
import type { V1_IngestDefinition } from './ingest/V1_IngestDefinition.js';
|
|
44
45
|
|
|
45
46
|
export interface V1_PackageableElementVisitor<T> {
|
|
46
47
|
visit_PackageableElement(element: V1_PackageableElement): T;
|
|
@@ -48,6 +49,7 @@ export interface V1_PackageableElementVisitor<T> {
|
|
|
48
49
|
visit_INTERNAL__UnknownPackageableElement(
|
|
49
50
|
element: V1_INTERNAL__UnknownPackageableElement,
|
|
50
51
|
): T;
|
|
52
|
+
|
|
51
53
|
visit_INTERNAL__UnknownFunctionActivator(
|
|
52
54
|
element: V1_INTERNAL__UnknownFunctionActivator,
|
|
53
55
|
): T;
|
|
@@ -77,6 +79,7 @@ export interface V1_PackageableElementVisitor<T> {
|
|
|
77
79
|
visit_HostedService(element: V1_HostedService): T;
|
|
78
80
|
|
|
79
81
|
visit_DataProduct(element: V1_DataProduct): T;
|
|
82
|
+
visit_IngestDefinition(element: V1_IngestDefinition): T;
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
export abstract class V1_PackageableElement implements Hashable {
|
package/src/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.ts
ADDED
|
@@ -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 type { V1_AppDirNode } from '../../../entitlements/V1_CoreEntitlements.js';
|
|
18
|
+
import { V1_INTERNAL__UnknownPackageableElement } from '../V1_INTERNAL__UnknownPackageableElement.js';
|
|
19
|
+
import type { V1_PackageableElementVisitor } from '../V1_PackageableElement.js';
|
|
20
|
+
|
|
21
|
+
export const V1_INGEST_DEFINITION_TYPE = 'ingestDefinition';
|
|
22
|
+
|
|
23
|
+
export class V1_IngestDefinition extends V1_INTERNAL__UnknownPackageableElement {
|
|
24
|
+
appDirDeployment: V1_AppDirNode | undefined;
|
|
25
|
+
|
|
26
|
+
override accept_PackageableElementVisitor<T>(
|
|
27
|
+
visitor: V1_PackageableElementVisitor<T>,
|
|
28
|
+
): T {
|
|
29
|
+
return visitor.visit_IngestDefinition(this);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -98,6 +98,8 @@ import { V1_HostedService } from '../../../model/packageableElements/function/V1
|
|
|
98
98
|
import { V1_transformFunctionActivatorActions } from '../to/helpers/V1_LegendLambdaTransformerHelper.js';
|
|
99
99
|
import type { DataProduct } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
|
|
100
100
|
import { V1_transformDataProduct } from './V1_DataProductTransformer.js';
|
|
101
|
+
import type { IngestDefinition } from '../../../../../../../graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js';
|
|
102
|
+
import { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
|
|
101
103
|
|
|
102
104
|
class V1_PackageableElementTransformer
|
|
103
105
|
implements PackageableElementVisitor<V1_PackageableElement>
|
|
@@ -147,6 +149,14 @@ class V1_PackageableElementTransformer
|
|
|
147
149
|
return protocol;
|
|
148
150
|
}
|
|
149
151
|
|
|
152
|
+
visit_IngestDefinition(element: IngestDefinition): V1_PackageableElement {
|
|
153
|
+
const protocol = new V1_IngestDefinition();
|
|
154
|
+
V1_initPackageableElement(protocol, element);
|
|
155
|
+
protocol.content = element.content;
|
|
156
|
+
// we don't take into account appDirDeployment here as it is still read only
|
|
157
|
+
return protocol;
|
|
158
|
+
}
|
|
159
|
+
|
|
150
160
|
visit_INTERNAL__UnknownFunctionActivator(
|
|
151
161
|
element: INTERNAL__UnknownFunctionActivator,
|
|
152
162
|
): V1_PackageableElement {
|
package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFifthPassBuilder.ts
CHANGED
|
@@ -52,6 +52,7 @@ import type { V1_SnowflakeApp } from '../../../model/packageableElements/functio
|
|
|
52
52
|
import type { V1_INTERNAL__UnknownElement } from '../../../model/packageableElements/V1_INTERNAL__UnknownElement.js';
|
|
53
53
|
import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
|
|
54
54
|
import type { V1_DataProduct } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
55
|
+
import type { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
|
|
55
56
|
|
|
56
57
|
export class V1_ElementFifthPassBuilder
|
|
57
58
|
implements V1_PackageableElementVisitor<void>
|
|
@@ -100,6 +101,10 @@ export class V1_ElementFifthPassBuilder
|
|
|
100
101
|
throw new UnsupportedOperationError();
|
|
101
102
|
}
|
|
102
103
|
|
|
104
|
+
visit_IngestDefinition(element: V1_IngestDefinition): void {
|
|
105
|
+
throw new UnsupportedOperationError();
|
|
106
|
+
}
|
|
107
|
+
|
|
103
108
|
visit_Class(element: V1_Class): void {
|
|
104
109
|
const _class = this.context.currentSubGraph.getOwnClass(
|
|
105
110
|
V1_buildFullPath(element.package, element.name),
|
package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.ts
CHANGED
|
@@ -85,6 +85,11 @@ import { GenericTypeImplicitReference } from '../../../../../../../graph/metamod
|
|
|
85
85
|
import { GenericType } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/GenericType.js';
|
|
86
86
|
import type { V1_DataProduct } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
87
87
|
import { DataProduct } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
|
|
88
|
+
import type { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
|
|
89
|
+
import {
|
|
90
|
+
AppDirNode,
|
|
91
|
+
IngestDefinition,
|
|
92
|
+
} from '../../../../../../../graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js';
|
|
88
93
|
|
|
89
94
|
export class V1_ElementFirstPassBuilder
|
|
90
95
|
implements V1_PackageableElementVisitor<PackageableElement>
|
|
@@ -172,6 +177,41 @@ export class V1_ElementFirstPassBuilder
|
|
|
172
177
|
return metamodel;
|
|
173
178
|
}
|
|
174
179
|
|
|
180
|
+
visit_IngestDefinition(element: V1_IngestDefinition): PackageableElement {
|
|
181
|
+
assertNonEmptyString(
|
|
182
|
+
element.package,
|
|
183
|
+
`Element 'package' field is missing or empty`,
|
|
184
|
+
);
|
|
185
|
+
assertNonEmptyString(
|
|
186
|
+
element.name,
|
|
187
|
+
`Element 'name' field is missing or empty`,
|
|
188
|
+
);
|
|
189
|
+
const metamodel = new IngestDefinition(element.name);
|
|
190
|
+
const appDir = element.appDirDeployment;
|
|
191
|
+
if (appDir) {
|
|
192
|
+
const metamodelApp = new AppDirNode();
|
|
193
|
+
metamodelApp.appDirId = appDir.appDirId;
|
|
194
|
+
metamodelApp.level = appDir.level;
|
|
195
|
+
metamodel.appDirDeployment = metamodelApp;
|
|
196
|
+
}
|
|
197
|
+
const path = V1_buildFullPath(element.package, element.name);
|
|
198
|
+
V1_checkDuplicatedElement(path, this.context, this.elementPathCache);
|
|
199
|
+
this.context.currentSubGraph.INTERNAL__setOwnUnknownElement(
|
|
200
|
+
path,
|
|
201
|
+
metamodel,
|
|
202
|
+
);
|
|
203
|
+
addElementToPackage(
|
|
204
|
+
getOrCreateGraphPackage(
|
|
205
|
+
this.context.currentSubGraph,
|
|
206
|
+
element.package,
|
|
207
|
+
this.packageCache,
|
|
208
|
+
),
|
|
209
|
+
metamodel,
|
|
210
|
+
);
|
|
211
|
+
metamodel.content = element.content;
|
|
212
|
+
return metamodel;
|
|
213
|
+
}
|
|
214
|
+
|
|
175
215
|
visit_SnowflakeApp(element: V1_SnowflakeApp): PackageableElement {
|
|
176
216
|
assertNonEmptyString(
|
|
177
217
|
element.package,
|
|
@@ -64,6 +64,7 @@ import type { V1_SnowflakeApp } from '../../../model/packageableElements/functio
|
|
|
64
64
|
import type { V1_INTERNAL__UnknownElement } from '../../../model/packageableElements/V1_INTERNAL__UnknownElement.js';
|
|
65
65
|
import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
|
|
66
66
|
import type { V1_DataProduct } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
67
|
+
import type { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
|
|
67
68
|
|
|
68
69
|
export class V1_ElementFourthPassBuilder
|
|
69
70
|
implements V1_PackageableElementVisitor<void>
|
|
@@ -156,6 +157,9 @@ export class V1_ElementFourthPassBuilder
|
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
159
|
|
|
160
|
+
visit_IngestDefinition(element: V1_IngestDefinition): void {
|
|
161
|
+
throw new UnsupportedOperationError();
|
|
162
|
+
}
|
|
159
163
|
visit_Database(element: V1_Database): void {
|
|
160
164
|
const database = this.context.currentSubGraph.getOwnDatabase(
|
|
161
165
|
V1_buildFullPath(element.package, element.name),
|
|
@@ -116,6 +116,7 @@ import type { V1_HostedService } from '../../../model/packageableElements/functi
|
|
|
116
116
|
import { type V1_DataProduct } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
117
117
|
import { AccessPointGroup } from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
|
|
118
118
|
import { V1_buildAccessPoint } from './helpers/V1_DataProductBuilder.js';
|
|
119
|
+
import type { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
|
|
119
120
|
|
|
120
121
|
export class V1_ElementSecondPassBuilder
|
|
121
122
|
implements V1_PackageableElementVisitor<void>
|
|
@@ -142,6 +143,10 @@ export class V1_ElementSecondPassBuilder
|
|
|
142
143
|
throw new UnsupportedOperationError();
|
|
143
144
|
}
|
|
144
145
|
|
|
146
|
+
visit_IngestDefinition(element: V1_IngestDefinition): void {
|
|
147
|
+
throw new UnsupportedOperationError();
|
|
148
|
+
}
|
|
149
|
+
|
|
145
150
|
visit_INTERNAL__UnknownFunctionActivator(
|
|
146
151
|
element: V1_INTERNAL__UnknownFunctionActivator,
|
|
147
152
|
): void {
|
package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.ts
CHANGED
|
@@ -67,6 +67,7 @@ import type { V1_SnowflakeApp } from '../../../model/packageableElements/functio
|
|
|
67
67
|
import type { V1_INTERNAL__UnknownElement } from '../../../model/packageableElements/V1_INTERNAL__UnknownElement.js';
|
|
68
68
|
import type { V1_HostedService } from '../../../model/packageableElements/function/V1_HostedService.js';
|
|
69
69
|
import type { V1_DataProduct } from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
70
|
+
import type { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
|
|
70
71
|
|
|
71
72
|
export class V1_ElementThirdPassBuilder
|
|
72
73
|
implements V1_PackageableElementVisitor<void>
|
|
@@ -93,6 +94,10 @@ export class V1_ElementThirdPassBuilder
|
|
|
93
94
|
throw new UnsupportedOperationError();
|
|
94
95
|
}
|
|
95
96
|
|
|
97
|
+
visit_IngestDefinition(element: V1_IngestDefinition): void {
|
|
98
|
+
throw new UnsupportedOperationError();
|
|
99
|
+
}
|
|
100
|
+
|
|
96
101
|
visit_INTERNAL__UnknownFunctionActivator(
|
|
97
102
|
element: V1_INTERNAL__UnknownFunctionActivator,
|
|
98
103
|
): void {
|
|
@@ -126,6 +126,8 @@ import {
|
|
|
126
126
|
type V1_DataProduct,
|
|
127
127
|
} from '../../model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
128
128
|
import { V1_dataProductModelSchema } from './serializationHelpers/V1_DataProductSerializationHelper.js';
|
|
129
|
+
import { V1_INGEST_DEFINITION_TYPE } from '../../model/packageableElements/ingest/V1_IngestDefinition.js';
|
|
130
|
+
import { V1_createIngestDef } from './serializationHelpers/V1_IngestSerializationHelper.js';
|
|
129
131
|
|
|
130
132
|
class V1_PackageableElementSerializer
|
|
131
133
|
implements V1_PackageableElementVisitor<PlainObject<V1_PackageableElement>>
|
|
@@ -166,6 +168,12 @@ class V1_PackageableElementSerializer
|
|
|
166
168
|
return element.content;
|
|
167
169
|
}
|
|
168
170
|
|
|
171
|
+
visit_IngestDefinition(
|
|
172
|
+
element: V1_INTERNAL__UnknownPackageableElement,
|
|
173
|
+
): PlainObject<V1_PackageableElement> {
|
|
174
|
+
return this.visit_INTERNAL__UnknownPackageableElement(element);
|
|
175
|
+
}
|
|
176
|
+
|
|
169
177
|
visit_INTERNAL__UnknownFunctionActivator(
|
|
170
178
|
element: V1_INTERNAL__UnknownFunctionActivator,
|
|
171
179
|
): PlainObject<V1_PackageableElement> {
|
|
@@ -365,6 +373,8 @@ export const V1_deserializePackageableElement = (
|
|
|
365
373
|
return deserialize(V1_HostedServiceModelSchema(plugins), json);
|
|
366
374
|
case V1_DATA_PRODUCT_ELEMENT_PROTOCOL_TYPE:
|
|
367
375
|
return deserialize(V1_dataProductModelSchema, json);
|
|
376
|
+
case V1_INGEST_DEFINITION_TYPE:
|
|
377
|
+
return V1_createIngestDef(name, packagePath, json);
|
|
368
378
|
default: {
|
|
369
379
|
for (const deserializer of extraElementProtocolDeserializers) {
|
|
370
380
|
const protocol = deserializer(json, plugins);
|
|
@@ -32,6 +32,8 @@ import {
|
|
|
32
32
|
V1_DataContractsRecord,
|
|
33
33
|
V1_DataProduct_Entitlements,
|
|
34
34
|
V1_PendingTasksRespond,
|
|
35
|
+
V1_TaskMetadata,
|
|
36
|
+
V1_TaskResponse,
|
|
35
37
|
V1_TaskStatusChangeResponse,
|
|
36
38
|
} from '../../../entitlements/V1_ConsumerEntitlements.js';
|
|
37
39
|
import {
|
|
@@ -175,6 +177,14 @@ export const V1_contractUserEventRecordModelSchema = createModelSchema(
|
|
|
175
177
|
type: primitive(),
|
|
176
178
|
},
|
|
177
179
|
);
|
|
180
|
+
export const V1_taskMetadataModelSchema = createModelSchema(V1_TaskMetadata, {
|
|
181
|
+
rec: usingModelSchema(V1_contractUserEventRecordModelSchema),
|
|
182
|
+
assignees: list(primitive()),
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
export const V1_taskResponseModelSchema = createModelSchema(V1_TaskResponse, {
|
|
186
|
+
tasks: customListWithSchema(V1_taskMetadataModelSchema),
|
|
187
|
+
});
|
|
178
188
|
|
|
179
189
|
export const V1_pendingTasksRespondModelSchema = createModelSchema(
|
|
180
190
|
V1_PendingTasksRespond,
|
|
@@ -201,3 +211,9 @@ export const V1_DataContractsRecordModelSchemaToContracts = (
|
|
|
201
211
|
const contracts = deserialize(V1_DataContractsRecordModelSchema, json);
|
|
202
212
|
return contracts.dataContracts.map((e) => e.dataContract);
|
|
203
213
|
};
|
|
214
|
+
|
|
215
|
+
export const V1_deserializeTaskResponse = (
|
|
216
|
+
json: PlainObject<V1_TaskMetadata>,
|
|
217
|
+
): V1_TaskMetadata[] => {
|
|
218
|
+
return deserialize(V1_taskResponseModelSchema, json).tasks ?? [];
|
|
219
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
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 type { PlainObject } from '@finos/legend-shared';
|
|
18
|
+
import { V1_IngestDefinition } from '../../../model/packageableElements/ingest/V1_IngestDefinition.js';
|
|
19
|
+
import type { V1_PackageableElement } from '../../../model/packageableElements/V1_PackageableElement.js';
|
|
20
|
+
import type { V1_AppDirNode } from '../../../entitlements/V1_CoreEntitlements.js';
|
|
21
|
+
import { V1_AppDirNodeModelSchema } from './V1_EntitlementSerializationHelper.js';
|
|
22
|
+
import { deserialize } from 'serializr';
|
|
23
|
+
|
|
24
|
+
export const V1_createIngestDef = (
|
|
25
|
+
name: string,
|
|
26
|
+
packagePath: string,
|
|
27
|
+
json: PlainObject<V1_PackageableElement>,
|
|
28
|
+
): V1_IngestDefinition => {
|
|
29
|
+
const ingestDef = new V1_IngestDefinition();
|
|
30
|
+
const appDir = (
|
|
31
|
+
json as { appDirDeployment: PlainObject<V1_AppDirNode> | undefined }
|
|
32
|
+
).appDirDeployment;
|
|
33
|
+
ingestDef.appDirDeployment = appDir
|
|
34
|
+
? deserialize(V1_AppDirNodeModelSchema, appDir)
|
|
35
|
+
: undefined;
|
|
36
|
+
ingestDef.name = name;
|
|
37
|
+
ingestDef.package = packagePath;
|
|
38
|
+
ingestDef.content = json;
|
|
39
|
+
return ingestDef;
|
|
40
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -94,6 +94,7 @@ export {
|
|
|
94
94
|
HostedService,
|
|
95
95
|
DEFAULT_HOSTED_SERVICE_PATTERN,
|
|
96
96
|
} from './graph/metamodel/pure/packageableElements/function/HostedService.js';
|
|
97
|
+
export * from './graph/metamodel/pure/packageableElements/ingest/IngestDefinition.js';
|
|
97
98
|
export { HostedServiceDeploymentConfiguration } from './graph/metamodel/pure/functionActivator/HostedServiceDeploymentConfiguration.js';
|
|
98
99
|
export { PostDeploymentAction } from './graph/metamodel/pure/functionActivator/PostDeploymentAction.js';
|
|
99
100
|
export {
|
|
@@ -271,6 +272,9 @@ export {
|
|
|
271
272
|
type V1_DataContractsCreation,
|
|
272
273
|
V1_TaskStatus,
|
|
273
274
|
V1_TaskStatusChangeResponse,
|
|
275
|
+
V1_TaskResponse,
|
|
276
|
+
V1_UserApprovalStatus,
|
|
277
|
+
V1_TaskMetadata,
|
|
274
278
|
} from './graph-manager/protocol/pure/v1/entitlements/V1_ConsumerEntitlements.js';
|
|
275
279
|
export {
|
|
276
280
|
V1_AppDirLevel,
|
|
@@ -287,6 +291,7 @@ export {
|
|
|
287
291
|
V1_TaskStatusChangeResponseModelSchema,
|
|
288
292
|
V1_AdhocTeamModelSchema,
|
|
289
293
|
V1_DataContractsRecordModelSchemaToContracts,
|
|
294
|
+
V1_deserializeTaskResponse,
|
|
290
295
|
} from './graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js';
|
|
291
296
|
export {
|
|
292
297
|
V1_CreateSubscriptionInput,
|
package/tsconfig.json
CHANGED
|
@@ -196,6 +196,7 @@
|
|
|
196
196
|
"./src/graph/metamodel/pure/packageableElements/generationSpecification/AbstractGenerationSpecification.ts",
|
|
197
197
|
"./src/graph/metamodel/pure/packageableElements/generationSpecification/GenerationSpecification.ts",
|
|
198
198
|
"./src/graph/metamodel/pure/packageableElements/generationSpecification/ModelGenerationSpecification.ts",
|
|
199
|
+
"./src/graph/metamodel/pure/packageableElements/ingest/IngestDefinition.ts",
|
|
199
200
|
"./src/graph/metamodel/pure/packageableElements/mapping/AssociationImplementation.ts",
|
|
200
201
|
"./src/graph/metamodel/pure/packageableElements/mapping/DEPRECATED__MappingTest.ts",
|
|
201
202
|
"./src/graph/metamodel/pure/packageableElements/mapping/EmbeddedSetImplementation.ts",
|
|
@@ -598,6 +599,7 @@
|
|
|
598
599
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/generationSpecification/V1_AbstractGenerationSpecification.ts",
|
|
599
600
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/generationSpecification/V1_GenerationSpecification.ts",
|
|
600
601
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/generationSpecification/V1_ModelGenerationSpecification.ts",
|
|
602
|
+
"./src/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.ts",
|
|
601
603
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_AssociationMapping.ts",
|
|
602
604
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_ClassMapping.ts",
|
|
603
605
|
"./src/graph-manager/protocol/pure/v1/model/packageableElements/mapping/V1_DEPRECATED__MappingTest.ts",
|
|
@@ -857,6 +859,7 @@
|
|
|
857
859
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionActivatorSerializationHelper.ts",
|
|
858
860
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionSerializationHelper.ts",
|
|
859
861
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_GenerationSpecificationSerializationHelper.ts",
|
|
862
|
+
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.ts",
|
|
860
863
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts",
|
|
861
864
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.ts",
|
|
862
865
|
"./src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_PostProcessorSerializationHelper.ts",
|