@finos/legend-extension-dsl-persistence 0.0.1
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/LICENSE +201 -0
- package/README.md +3 -0
- package/lib/DSLPersistence_Extension.d.ts +22 -0
- package/lib/DSLPersistence_Extension.d.ts.map +1 -0
- package/lib/DSLPersistence_Extension.js +31 -0
- package/lib/DSLPersistence_Extension.js.map +1 -0
- package/lib/components/studio/DSLPersistence_LegendStudioPlugin.d.ts +27 -0
- package/lib/components/studio/DSLPersistence_LegendStudioPlugin.d.ts.map +1 -0
- package/lib/components/studio/DSLPersistence_LegendStudioPlugin.js +84 -0
- package/lib/components/studio/DSLPersistence_LegendStudioPlugin.js.map +1 -0
- package/lib/graph/DSLPersistence_PureGraphPlugin.d.ts +22 -0
- package/lib/graph/DSLPersistence_PureGraphPlugin.d.ts.map +1 -0
- package/lib/graph/DSLPersistence_PureGraphPlugin.js +27 -0
- package/lib/graph/DSLPersistence_PureGraphPlugin.js.map +1 -0
- package/lib/graphManager/DSLPersistence_GraphManagerHelper.d.ts +19 -0
- package/lib/graphManager/DSLPersistence_GraphManagerHelper.d.ts.map +1 -0
- package/lib/graphManager/DSLPersistence_GraphManagerHelper.js +18 -0
- package/lib/graphManager/DSLPersistence_GraphManagerHelper.js.map +1 -0
- package/lib/graphManager/DSLPersistence_PureGraphManagerPlugin.d.ts +24 -0
- package/lib/graphManager/DSLPersistence_PureGraphManagerPlugin.d.ts.map +1 -0
- package/lib/graphManager/DSLPersistence_PureGraphManagerPlugin.js +53 -0
- package/lib/graphManager/DSLPersistence_PureGraphManagerPlugin.js.map +1 -0
- package/lib/graphManager/action/changeDetection/DSLPersistence_ObserverHelper.d.ts +18 -0
- package/lib/graphManager/action/changeDetection/DSLPersistence_ObserverHelper.d.ts.map +1 -0
- package/lib/graphManager/action/changeDetection/DSLPersistence_ObserverHelper.js +30 -0
- package/lib/graphManager/action/changeDetection/DSLPersistence_ObserverHelper.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/models/DSLPersistence_ModelUtils.d.ts +52 -0
- package/lib/models/DSLPersistence_ModelUtils.d.ts.map +1 -0
- package/lib/models/DSLPersistence_ModelUtils.js +65 -0
- package/lib/models/DSLPersistence_ModelUtils.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Auditing.d.ts +27 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Auditing.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Auditing.js +34 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Auditing.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_DeduplicationStrategy.d.ts +34 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_DeduplicationStrategy.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_DeduplicationStrategy.js +50 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_DeduplicationStrategy.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_IngestMode.d.ts +57 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_IngestMode.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_IngestMode.js +98 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_IngestMode.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_MergeStrategy.d.ts +28 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_MergeStrategy.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_MergeStrategy.js +36 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_MergeStrategy.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Milestoning.d.ts +58 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Milestoning.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Milestoning.js +97 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Milestoning.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Notifier.d.ts +32 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Notifier.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Notifier.js +44 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Notifier.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persistence.d.ts +30 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persistence.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persistence.js +39 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persistence.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persister.d.ts +33 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persister.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persister.js +42 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persister.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.d.ts +30 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.js +40 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.d.ts +46 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.js +68 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Trigger.d.ts +31 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Trigger.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Trigger.js +42 -0
- package/lib/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Trigger.js.map +1 -0
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.d.ts +26 -0
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.d.ts.map +1 -0
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.js +90 -0
- package/lib/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Auditing.d.ts +27 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Auditing.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Auditing.js +34 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Auditing.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_DeduplicationStrategy.d.ts +34 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_DeduplicationStrategy.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_DeduplicationStrategy.js +50 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_DeduplicationStrategy.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_IngestMode.d.ts +57 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_IngestMode.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_IngestMode.js +98 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_IngestMode.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_MergeStrategy.d.ts +28 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_MergeStrategy.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_MergeStrategy.js +36 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_MergeStrategy.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Milestoning.d.ts +58 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Milestoning.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Milestoning.js +97 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Milestoning.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Notifier.d.ts +32 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Notifier.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Notifier.js +44 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Notifier.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persistence.d.ts +30 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persistence.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persistence.js +39 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persistence.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persister.d.ts +33 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persister.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persister.js +42 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persister.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.d.ts +30 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.js +40 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_TargetShape.d.ts +45 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_TargetShape.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_TargetShape.js +68 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_TargetShape.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Trigger.d.ts +31 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Trigger.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Trigger.js +42 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Trigger.js.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.d.ts +98 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.js +343 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.js.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceBuilder.d.ts +101 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceBuilder.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceBuilder.js +347 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceBuilder.js.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.d.ts +24 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.js +565 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.js.map +1 -0
- package/lib/package.json +77 -0
- package/package.json +77 -0
- package/src/DSLPersistence_Extension.ts +36 -0
- package/src/components/studio/DSLPersistence_LegendStudioPlugin.tsx +120 -0
- package/src/graph/DSLPersistence_PureGraphPlugin.ts +30 -0
- package/src/graphManager/DSLPersistence_GraphManagerHelper.ts +25 -0
- package/src/graphManager/DSLPersistence_PureGraphManagerPlugin.ts +68 -0
- package/src/graphManager/action/changeDetection/DSLPersistence_ObserverHelper.ts +39 -0
- package/src/index.ts +18 -0
- package/src/models/DSLPersistence_ModelUtils.ts +76 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Auditing.ts +39 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_DeduplicationStrategy.ts +70 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_IngestMode.ts +123 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_MergeStrategy.ts +44 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Milestoning.ts +136 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Notifier.ts +52 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persistence.ts +52 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persister.ts +51 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.ts +51 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_TargetShape.ts +78 -0
- package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Trigger.ts +47 -0
- package/src/models/protocols/pure/DSLPersistence_PureProtocolProcessorPlugin.ts +138 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Auditing.ts +39 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_DeduplicationStrategy.ts +70 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_IngestMode.ts +123 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_MergeStrategy.ts +47 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Milestoning.ts +136 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Notifier.ts +52 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persistence.ts +50 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Persister.ts +51 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Sink.ts +47 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_TargetShape.ts +77 -0
- package/src/models/protocols/pure/v1/model/packageableElements/persistence/V1_DSLPersistence_Trigger.ts +47 -0
- package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_PersistenceTransformer.ts +604 -0
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_PersistenceBuilder.ts +616 -0
- package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLPersistence_ProtocolHelper.ts +971 -0
- package/tsconfig.json +85 -0
- package/tsconfig.package.json +41 -0
|
@@ -0,0 +1,70 @@
|
|
|
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 { PERSISTENCE_HASH_STRUCTURE } from '../../../../../DSLPersistence_ModelUtils';
|
|
18
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
19
|
+
|
|
20
|
+
export abstract class DeduplicationStrategy implements Hashable {
|
|
21
|
+
abstract get hashCode(): string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class NoDeduplicationStrategy
|
|
25
|
+
extends DeduplicationStrategy
|
|
26
|
+
implements Hashable
|
|
27
|
+
{
|
|
28
|
+
override get hashCode(): string {
|
|
29
|
+
return hashArray([PERSISTENCE_HASH_STRUCTURE.NO_DEDUPLICATION_STRATEGY]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class AnyVersionDeduplicationStrategy
|
|
34
|
+
extends DeduplicationStrategy
|
|
35
|
+
implements Hashable
|
|
36
|
+
{
|
|
37
|
+
override get hashCode(): string {
|
|
38
|
+
return hashArray([
|
|
39
|
+
PERSISTENCE_HASH_STRUCTURE.ANY_VERSION_DEDUPLICATION_STRATEGY,
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class MaxVersionDeduplicationStrategy
|
|
45
|
+
extends DeduplicationStrategy
|
|
46
|
+
implements Hashable
|
|
47
|
+
{
|
|
48
|
+
versionField!: string;
|
|
49
|
+
|
|
50
|
+
override get hashCode(): string {
|
|
51
|
+
return hashArray([
|
|
52
|
+
PERSISTENCE_HASH_STRUCTURE.MAX_VERSION_DEDUPLICATION_STRATEGY,
|
|
53
|
+
this.versionField,
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class DuplicateCountDeduplicationStrategy
|
|
59
|
+
extends DeduplicationStrategy
|
|
60
|
+
implements Hashable
|
|
61
|
+
{
|
|
62
|
+
duplicateCountName!: string;
|
|
63
|
+
|
|
64
|
+
override get hashCode(): string {
|
|
65
|
+
return hashArray([
|
|
66
|
+
PERSISTENCE_HASH_STRUCTURE.DUPLICATE_COUNT_DEDUPLICATION_STRATEGY,
|
|
67
|
+
this.duplicateCountName,
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { Auditing } from './DSLPersistence_Auditing';
|
|
18
|
+
import type { MergeStrategy } from './DSLPersistence_MergeStrategy';
|
|
19
|
+
import type {
|
|
20
|
+
TransactionMilestoning,
|
|
21
|
+
ValidityMilestoning,
|
|
22
|
+
} from './DSLPersistence_Milestoning';
|
|
23
|
+
import { PERSISTENCE_HASH_STRUCTURE } from '../../../../../DSLPersistence_ModelUtils';
|
|
24
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
25
|
+
|
|
26
|
+
export abstract class IngestMode implements Hashable {
|
|
27
|
+
abstract get hashCode(): string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// snapshot
|
|
31
|
+
|
|
32
|
+
export class NontemporalSnapshot extends IngestMode implements Hashable {
|
|
33
|
+
auditing!: Auditing;
|
|
34
|
+
|
|
35
|
+
override get hashCode(): string {
|
|
36
|
+
return hashArray([
|
|
37
|
+
PERSISTENCE_HASH_STRUCTURE.NONTEMPORAL_SNAPSHOT,
|
|
38
|
+
this.auditing,
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class UnitemporalSnapshot extends IngestMode implements Hashable {
|
|
44
|
+
transactionMilestoning!: TransactionMilestoning;
|
|
45
|
+
|
|
46
|
+
override get hashCode(): string {
|
|
47
|
+
return hashArray([
|
|
48
|
+
PERSISTENCE_HASH_STRUCTURE.UNITEMPORAL_SNAPSHOT,
|
|
49
|
+
this.transactionMilestoning,
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class BitemporalSnapshot extends IngestMode implements Hashable {
|
|
55
|
+
transactionMilestoning!: TransactionMilestoning;
|
|
56
|
+
validityMilestoning!: ValidityMilestoning;
|
|
57
|
+
|
|
58
|
+
override get hashCode(): string {
|
|
59
|
+
return hashArray([
|
|
60
|
+
PERSISTENCE_HASH_STRUCTURE.BITEMPORAL_SNAPSHOT,
|
|
61
|
+
this.transactionMilestoning,
|
|
62
|
+
this.validityMilestoning,
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// delta
|
|
68
|
+
|
|
69
|
+
export class NontemporalDelta extends IngestMode implements Hashable {
|
|
70
|
+
mergeStrategy!: MergeStrategy;
|
|
71
|
+
auditing!: Auditing;
|
|
72
|
+
|
|
73
|
+
override get hashCode(): string {
|
|
74
|
+
return hashArray([
|
|
75
|
+
PERSISTENCE_HASH_STRUCTURE.NONTEMPORAL_DELTA,
|
|
76
|
+
this.mergeStrategy,
|
|
77
|
+
this.auditing,
|
|
78
|
+
]);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class UnitemporalDelta extends IngestMode implements Hashable {
|
|
83
|
+
mergeStrategy!: MergeStrategy;
|
|
84
|
+
transactionMilestoning!: TransactionMilestoning;
|
|
85
|
+
|
|
86
|
+
override get hashCode(): string {
|
|
87
|
+
return hashArray([
|
|
88
|
+
PERSISTENCE_HASH_STRUCTURE.UNITEMPORAL_DELTA,
|
|
89
|
+
this.mergeStrategy,
|
|
90
|
+
this.transactionMilestoning,
|
|
91
|
+
]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export class BitemporalDelta extends IngestMode implements Hashable {
|
|
96
|
+
mergeStrategy!: MergeStrategy;
|
|
97
|
+
transactionMilestoning!: TransactionMilestoning;
|
|
98
|
+
validityMilestoning!: ValidityMilestoning;
|
|
99
|
+
|
|
100
|
+
override get hashCode(): string {
|
|
101
|
+
return hashArray([
|
|
102
|
+
PERSISTENCE_HASH_STRUCTURE.BITEMPORAL_DELTA,
|
|
103
|
+
this.mergeStrategy,
|
|
104
|
+
this.transactionMilestoning,
|
|
105
|
+
this.validityMilestoning,
|
|
106
|
+
]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// append only
|
|
111
|
+
|
|
112
|
+
export class AppendOnly extends IngestMode implements Hashable {
|
|
113
|
+
auditing!: Auditing;
|
|
114
|
+
filterDuplicates!: boolean;
|
|
115
|
+
|
|
116
|
+
override get hashCode(): string {
|
|
117
|
+
return hashArray([
|
|
118
|
+
PERSISTENCE_HASH_STRUCTURE.APPEND_ONLY,
|
|
119
|
+
this.auditing,
|
|
120
|
+
this.filterDuplicates.toString(),
|
|
121
|
+
]);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { PERSISTENCE_HASH_STRUCTURE } from '../../../../../DSLPersistence_ModelUtils';
|
|
18
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
19
|
+
|
|
20
|
+
export abstract class MergeStrategy implements Hashable {
|
|
21
|
+
abstract get hashCode(): string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class NoDeletesMergeStrategy extends MergeStrategy implements Hashable {
|
|
25
|
+
override get hashCode(): string {
|
|
26
|
+
return hashArray([PERSISTENCE_HASH_STRUCTURE.NO_DELETES_MERGE_STRATEGY]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class DeleteIndicatorMergeStrategy
|
|
31
|
+
extends MergeStrategy
|
|
32
|
+
implements Hashable
|
|
33
|
+
{
|
|
34
|
+
deleteField!: string;
|
|
35
|
+
deleteValues: string[] = [];
|
|
36
|
+
|
|
37
|
+
override get hashCode(): string {
|
|
38
|
+
return hashArray([
|
|
39
|
+
PERSISTENCE_HASH_STRUCTURE.DELETE_INDICATOR_MERGE_STRATEGY,
|
|
40
|
+
this.deleteField,
|
|
41
|
+
hashArray(this.deleteValues),
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
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 { PERSISTENCE_HASH_STRUCTURE } from '../../../../../DSLPersistence_ModelUtils';
|
|
18
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
19
|
+
|
|
20
|
+
// transaction milestoning
|
|
21
|
+
|
|
22
|
+
export abstract class TransactionMilestoning implements Hashable {
|
|
23
|
+
abstract get hashCode(): string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class BatchIdTransactionMilestoning
|
|
27
|
+
extends TransactionMilestoning
|
|
28
|
+
implements Hashable
|
|
29
|
+
{
|
|
30
|
+
batchIdInName!: string;
|
|
31
|
+
batchIdOutName!: string;
|
|
32
|
+
|
|
33
|
+
override get hashCode(): string {
|
|
34
|
+
return hashArray([
|
|
35
|
+
PERSISTENCE_HASH_STRUCTURE.BATCH_ID_TRANSACTION_MILESTONING,
|
|
36
|
+
this.batchIdInName,
|
|
37
|
+
this.batchIdOutName,
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class DateTimeTransactionMilestoning
|
|
43
|
+
extends TransactionMilestoning
|
|
44
|
+
implements Hashable
|
|
45
|
+
{
|
|
46
|
+
dateTimeInName!: string;
|
|
47
|
+
dateTimeOutName!: string;
|
|
48
|
+
|
|
49
|
+
override get hashCode(): string {
|
|
50
|
+
return hashArray([
|
|
51
|
+
PERSISTENCE_HASH_STRUCTURE.DATE_TIME_TRANSACTION_MILESTONING,
|
|
52
|
+
this.dateTimeInName,
|
|
53
|
+
this.dateTimeOutName,
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class BatchIdAndDateTimeTransactionMilestoning
|
|
59
|
+
extends TransactionMilestoning
|
|
60
|
+
implements Hashable
|
|
61
|
+
{
|
|
62
|
+
batchIdInName!: string;
|
|
63
|
+
batchIdOutName!: string;
|
|
64
|
+
dateTimeInName!: string;
|
|
65
|
+
dateTimeOutName!: string;
|
|
66
|
+
|
|
67
|
+
override get hashCode(): string {
|
|
68
|
+
return hashArray([
|
|
69
|
+
PERSISTENCE_HASH_STRUCTURE.BATCH_ID_AND_DATE_TIME_TRANSACTION_MILESTONING,
|
|
70
|
+
this.batchIdInName,
|
|
71
|
+
this.batchIdOutName,
|
|
72
|
+
this.dateTimeInName,
|
|
73
|
+
this.dateTimeOutName,
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// validity milestoning
|
|
79
|
+
|
|
80
|
+
export abstract class ValidityMilestoning implements Hashable {
|
|
81
|
+
abstract get hashCode(): string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class DateTimeValidityMilestoning
|
|
85
|
+
extends ValidityMilestoning
|
|
86
|
+
implements Hashable
|
|
87
|
+
{
|
|
88
|
+
dateTimeFromName!: string;
|
|
89
|
+
dateTimeThruName!: string;
|
|
90
|
+
derivation!: ValidityDerivation;
|
|
91
|
+
|
|
92
|
+
override get hashCode(): string {
|
|
93
|
+
return hashArray([
|
|
94
|
+
PERSISTENCE_HASH_STRUCTURE.DATE_TIME_VALIDITY_MILESTONING,
|
|
95
|
+
this.dateTimeFromName,
|
|
96
|
+
this.dateTimeThruName,
|
|
97
|
+
this.derivation,
|
|
98
|
+
]);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// validity derivation
|
|
103
|
+
|
|
104
|
+
export abstract class ValidityDerivation implements Hashable {
|
|
105
|
+
abstract get hashCode(): string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export class SourceSpecifiesFromDateTime
|
|
109
|
+
extends ValidityDerivation
|
|
110
|
+
implements Hashable
|
|
111
|
+
{
|
|
112
|
+
sourceDateTimeFromField!: string;
|
|
113
|
+
|
|
114
|
+
override get hashCode(): string {
|
|
115
|
+
return hashArray([
|
|
116
|
+
PERSISTENCE_HASH_STRUCTURE.SOURCE_SPECIFIES_FROM_DATE_TIME,
|
|
117
|
+
this.sourceDateTimeFromField,
|
|
118
|
+
]);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export class SourceSpecifiesFromAndThruDateTime
|
|
123
|
+
extends ValidityDerivation
|
|
124
|
+
implements Hashable
|
|
125
|
+
{
|
|
126
|
+
sourceDateTimeFromField!: string;
|
|
127
|
+
sourceDateTimeThruField!: string;
|
|
128
|
+
|
|
129
|
+
override get hashCode(): string {
|
|
130
|
+
return hashArray([
|
|
131
|
+
PERSISTENCE_HASH_STRUCTURE.SOURCE_SPECIFIES_FROM_AND_THRU_DATE_TIME,
|
|
132
|
+
this.sourceDateTimeFromField,
|
|
133
|
+
this.sourceDateTimeThruField,
|
|
134
|
+
]);
|
|
135
|
+
}
|
|
136
|
+
}
|
package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Notifier.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
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 { PERSISTENCE_HASH_STRUCTURE } from '../../../../../DSLPersistence_ModelUtils';
|
|
18
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
19
|
+
|
|
20
|
+
export class Notifier implements Hashable {
|
|
21
|
+
notifyees: Notifyee[] = [];
|
|
22
|
+
|
|
23
|
+
get hashCode(): string {
|
|
24
|
+
return hashArray([
|
|
25
|
+
PERSISTENCE_HASH_STRUCTURE.NOTIFIER,
|
|
26
|
+
hashArray(this.notifyees),
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export abstract class Notifyee implements Hashable {
|
|
32
|
+
abstract get hashCode(): string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class EmailNotifyee extends Notifyee implements Hashable {
|
|
36
|
+
address!: string;
|
|
37
|
+
|
|
38
|
+
override get hashCode(): string {
|
|
39
|
+
return hashArray([PERSISTENCE_HASH_STRUCTURE.EMAIL_NOTIFYEE, this.address]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class PagerDutyNotifyee extends Notifyee implements Hashable {
|
|
44
|
+
url!: string;
|
|
45
|
+
|
|
46
|
+
override get hashCode(): string {
|
|
47
|
+
return hashArray([
|
|
48
|
+
PERSISTENCE_HASH_STRUCTURE.PAGER_DUTY_NOTIFYEE,
|
|
49
|
+
this.url,
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { Notifier } from './DSLPersistence_Notifier';
|
|
18
|
+
import type { Persister } from './DSLPersistence_Persister';
|
|
19
|
+
import type { Trigger } from './DSLPersistence_Trigger';
|
|
20
|
+
import { PERSISTENCE_HASH_STRUCTURE } from '../../../../../DSLPersistence_ModelUtils';
|
|
21
|
+
import {
|
|
22
|
+
PackageableElement,
|
|
23
|
+
type PackageableElementReference,
|
|
24
|
+
type PackageableElementVisitor,
|
|
25
|
+
type Service,
|
|
26
|
+
} from '@finos/legend-graph';
|
|
27
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
28
|
+
|
|
29
|
+
export class Persistence extends PackageableElement implements Hashable {
|
|
30
|
+
documentation!: string;
|
|
31
|
+
trigger!: Trigger;
|
|
32
|
+
service!: PackageableElementReference<Service>;
|
|
33
|
+
persister!: Persister;
|
|
34
|
+
notifier!: Notifier;
|
|
35
|
+
|
|
36
|
+
protected override get _elementHashCode(): string {
|
|
37
|
+
return hashArray([
|
|
38
|
+
PERSISTENCE_HASH_STRUCTURE.PERSISTENCE,
|
|
39
|
+
this.documentation,
|
|
40
|
+
this.trigger,
|
|
41
|
+
this.service.hashValue,
|
|
42
|
+
this.persister,
|
|
43
|
+
this.notifier,
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
accept_PackageableElementVisitor<T>(
|
|
48
|
+
visitor: PackageableElementVisitor<T>,
|
|
49
|
+
): T {
|
|
50
|
+
return visitor.visit_PackageableElement(this);
|
|
51
|
+
}
|
|
52
|
+
}
|
package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Persister.ts
ADDED
|
@@ -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 type { IngestMode } from './DSLPersistence_IngestMode';
|
|
18
|
+
import type { Sink } from './DSLPersistence_Sink';
|
|
19
|
+
import type { TargetShape } from './DSLPersistence_TargetShape';
|
|
20
|
+
import { PERSISTENCE_HASH_STRUCTURE } from '../../../../../DSLPersistence_ModelUtils';
|
|
21
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
22
|
+
|
|
23
|
+
export abstract class Persister implements Hashable {
|
|
24
|
+
abstract get hashCode(): string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class StreamingPersister extends Persister implements Hashable {
|
|
28
|
+
sink!: Sink;
|
|
29
|
+
|
|
30
|
+
override get hashCode(): string {
|
|
31
|
+
return hashArray([
|
|
32
|
+
PERSISTENCE_HASH_STRUCTURE.STREAMING_PERSISTER,
|
|
33
|
+
this.sink,
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class BatchPersister extends Persister implements Hashable {
|
|
39
|
+
sink!: Sink;
|
|
40
|
+
ingestMode!: IngestMode;
|
|
41
|
+
targetShape!: TargetShape;
|
|
42
|
+
|
|
43
|
+
override get hashCode(): string {
|
|
44
|
+
return hashArray([
|
|
45
|
+
PERSISTENCE_HASH_STRUCTURE.BATCH_PERSISTER,
|
|
46
|
+
this.sink,
|
|
47
|
+
this.ingestMode,
|
|
48
|
+
this.targetShape,
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/models/metamodels/pure/model/packageableElements/persistence/DSLPersistence_Sink.ts
ADDED
|
@@ -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 { PERSISTENCE_HASH_STRUCTURE } from '../../../../../DSLPersistence_ModelUtils';
|
|
18
|
+
import type {
|
|
19
|
+
Binding,
|
|
20
|
+
Connection,
|
|
21
|
+
PackageableElementReference,
|
|
22
|
+
} from '@finos/legend-graph';
|
|
23
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
24
|
+
|
|
25
|
+
export abstract class Sink implements Hashable {
|
|
26
|
+
abstract get hashCode(): string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class RelationalSink extends Sink implements Hashable {
|
|
30
|
+
connection?: Connection;
|
|
31
|
+
|
|
32
|
+
override get hashCode(): string {
|
|
33
|
+
return hashArray([
|
|
34
|
+
PERSISTENCE_HASH_STRUCTURE.RELATIONAL_SINK,
|
|
35
|
+
this.connection ?? '',
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class ObjectStorageSink extends Sink implements Hashable {
|
|
41
|
+
binding!: PackageableElementReference<Binding>;
|
|
42
|
+
connection!: Connection;
|
|
43
|
+
|
|
44
|
+
override get hashCode(): string {
|
|
45
|
+
return hashArray([
|
|
46
|
+
PERSISTENCE_HASH_STRUCTURE.OBJECT_STORAGE_SINK,
|
|
47
|
+
this.binding.hashValue,
|
|
48
|
+
this.connection,
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
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 { DeduplicationStrategy } from './DSLPersistence_DeduplicationStrategy';
|
|
18
|
+
import { PERSISTENCE_HASH_STRUCTURE } from '../../../../../DSLPersistence_ModelUtils';
|
|
19
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
20
|
+
import type { Class, PackageableElementReference } from '@finos/legend-graph';
|
|
21
|
+
|
|
22
|
+
export abstract class TargetShape implements Hashable {
|
|
23
|
+
abstract get hashCode(): string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class FlatTarget extends TargetShape implements Hashable {
|
|
27
|
+
modelClass?: PackageableElementReference<Class>;
|
|
28
|
+
targetName!: string;
|
|
29
|
+
partitionFields: string[] = [];
|
|
30
|
+
deduplicationStrategy!: DeduplicationStrategy;
|
|
31
|
+
|
|
32
|
+
override get hashCode(): string {
|
|
33
|
+
return hashArray([
|
|
34
|
+
PERSISTENCE_HASH_STRUCTURE.FLAT_TARGET,
|
|
35
|
+
this.modelClass?.hashValue ?? '',
|
|
36
|
+
this.targetName,
|
|
37
|
+
hashArray(this.partitionFields),
|
|
38
|
+
this.deduplicationStrategy,
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class MultiFlatTarget extends TargetShape implements Hashable {
|
|
44
|
+
modelClass!: PackageableElementReference<Class>;
|
|
45
|
+
transactionScope!: TransactionScope;
|
|
46
|
+
parts: MultiFlatTargetPart[] = [];
|
|
47
|
+
|
|
48
|
+
override get hashCode(): string {
|
|
49
|
+
return hashArray([
|
|
50
|
+
PERSISTENCE_HASH_STRUCTURE.MULTI_FLAT_TARGET,
|
|
51
|
+
this.modelClass.hashValue,
|
|
52
|
+
this.transactionScope,
|
|
53
|
+
hashArray(this.parts),
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class MultiFlatTargetPart implements Hashable {
|
|
59
|
+
modelProperty!: string;
|
|
60
|
+
targetName!: string;
|
|
61
|
+
partitionFields: string[] = [];
|
|
62
|
+
deduplicationStrategy!: DeduplicationStrategy;
|
|
63
|
+
|
|
64
|
+
get hashCode(): string {
|
|
65
|
+
return hashArray([
|
|
66
|
+
PERSISTENCE_HASH_STRUCTURE.MULTI_FLAT_TARGET_PART,
|
|
67
|
+
this.modelProperty,
|
|
68
|
+
this.targetName,
|
|
69
|
+
hashArray(this.partitionFields),
|
|
70
|
+
this.deduplicationStrategy,
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export enum TransactionScope {
|
|
76
|
+
SINGLE_TARGET = 'SINGLE_TARGET',
|
|
77
|
+
ALL_TARGETS = 'ALL_TARGETS',
|
|
78
|
+
}
|