@finos/legend-extension-dsl-data-space 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/CHANGELOG.md +9 -0
- package/LICENSE +201 -0
- package/README.md +3 -0
- package/lib/DSLDataSpace_Extension.d.ts +27 -0
- package/lib/DSLDataSpace_Extension.d.ts.map +1 -0
- package/lib/DSLDataSpace_Extension.js +43 -0
- package/lib/DSLDataSpace_Extension.js.map +1 -0
- package/lib/components/studio/DSLDataSpace_StudioPlugin.d.ts +30 -0
- package/lib/components/studio/DSLDataSpace_StudioPlugin.d.ts.map +1 -0
- package/lib/components/studio/DSLDataSpace_StudioPlugin.js +107 -0
- package/lib/components/studio/DSLDataSpace_StudioPlugin.js.map +1 -0
- package/lib/components/studio/DataSpaceEditor.d.ts +19 -0
- package/lib/components/studio/DataSpaceEditor.d.ts.map +1 -0
- package/lib/components/studio/DataSpaceEditor.js +100 -0
- package/lib/components/studio/DataSpaceEditor.js.map +1 -0
- package/lib/graph/DSLDataSpace_PureGraphPlugin.d.ts +24 -0
- package/lib/graph/DSLDataSpace_PureGraphPlugin.d.ts.map +1 -0
- package/lib/graph/DSLDataSpace_PureGraphPlugin.js +30 -0
- package/lib/graph/DSLDataSpace_PureGraphPlugin.js.map +1 -0
- package/lib/graphManager/DSLDataSpace_GraphManagerHelper.d.ts +19 -0
- package/lib/graphManager/DSLDataSpace_GraphManagerHelper.d.ts.map +1 -0
- package/lib/graphManager/DSLDataSpace_GraphManagerHelper.js +18 -0
- package/lib/graphManager/DSLDataSpace_GraphManagerHelper.js.map +1 -0
- package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts +25 -0
- package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts.map +1 -0
- package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js +45 -0
- package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -0
- package/lib/models/DSLDataSpace_ModelUtils.d.ts +19 -0
- package/lib/models/DSLDataSpace_ModelUtils.d.ts.map +1 -0
- package/lib/models/DSLDataSpace_ModelUtils.js +20 -0
- package/lib/models/DSLDataSpace_ModelUtils.js.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.d.ts +34 -0
- package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.d.ts.map +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.js +58 -0
- package/lib/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.js.map +1 -0
- package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts +27 -0
- package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -0
- package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js +119 -0
- package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.d.ts +33 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.js +49 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.js.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.d.ts +19 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.js +18 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.js.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts +19 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js +36 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js.map +1 -0
- package/lib/stores/studio/DataSpaceEditorState.d.ts +42 -0
- package/lib/stores/studio/DataSpaceEditorState.d.ts.map +1 -0
- package/lib/stores/studio/DataSpaceEditorState.js +76 -0
- package/lib/stores/studio/DataSpaceEditorState.js.map +1 -0
- package/package.json +80 -0
- package/src/DSLDataSpace_Extension.ts +49 -0
- package/src/components/studio/DSLDataSpace_StudioPlugin.tsx +146 -0
- package/src/components/studio/DataSpaceEditor.tsx +275 -0
- package/src/graph/DSLDataSpace_PureGraphPlugin.ts +38 -0
- package/src/graphManager/DSLDataSpace_GraphManagerHelper.ts +21 -0
- package/src/graphManager/DSLDataSpace_PureGraphManagerPlugin.ts +56 -0
- package/src/index.ts +17 -0
- package/src/models/DSLDataSpace_ModelUtils.ts +19 -0
- package/src/models/metamodels/pure/model/packageableElements/dataSpace/DataSpace.ts +73 -0
- package/src/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.ts +180 -0
- package/src/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.ts +60 -0
- package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.ts +30 -0
- package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts +82 -0
- package/src/stores/studio/DataSpaceEditorState.ts +108 -0
- package/tsconfig.json +64 -0
- package/tsconfig.package.json +40 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { hashArray } from '@finos/legend-shared';
|
|
17
|
+
import { DATA_SPACE_HASH_STRUCTURE } from '../../../../../../DSLDataSpace_ModelUtils';
|
|
18
|
+
import { V1_PackageableElement } from '@finos/legend-graph';
|
|
19
|
+
export class V1_DataSpace extends V1_PackageableElement {
|
|
20
|
+
stereotypes = [];
|
|
21
|
+
taggedValues = [];
|
|
22
|
+
groupId;
|
|
23
|
+
artifactId;
|
|
24
|
+
versionId;
|
|
25
|
+
mapping;
|
|
26
|
+
runtime;
|
|
27
|
+
diagrams;
|
|
28
|
+
description;
|
|
29
|
+
supportEmail;
|
|
30
|
+
get hashCode() {
|
|
31
|
+
return hashArray([
|
|
32
|
+
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE,
|
|
33
|
+
hashArray(this.stereotypes),
|
|
34
|
+
hashArray(this.taggedValues),
|
|
35
|
+
this.groupId,
|
|
36
|
+
this.artifactId,
|
|
37
|
+
this.versionId,
|
|
38
|
+
this.mapping,
|
|
39
|
+
this.runtime,
|
|
40
|
+
hashArray(this.diagrams ?? []),
|
|
41
|
+
this.description ?? '',
|
|
42
|
+
this.supportEmail ?? '',
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
accept_PackageableElementVisitor(visitor) {
|
|
46
|
+
return visitor.visit_PackageableElement(this);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=V1_DataSpace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_DataSpace.js","sourceRoot":"","sources":["../../../../../../../../src/models/protocols/pure/v1/model/packageableElements/dataSpace/V1_DataSpace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAMtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,OAAO,YAAa,SAAQ,qBAAqB;IACrD,WAAW,GAAuB,EAAE,CAAC;IACrC,YAAY,GAAqB,EAAE,CAAC;IACpC,OAAO,CAAU;IACjB,UAAU,CAAU;IACpB,SAAS,CAAU;IACnB,OAAO,CAAU;IACjB,OAAO,CAAU;IACjB,QAAQ,CAAwB;IAChC,WAAW,CAAsB;IACjC,YAAY,CAAsB;IAElC,IAAa,QAAQ;QACnB,OAAO,SAAS,CAAC;YACf,yBAAyB,CAAC,UAAU;YACpC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC;YAC3B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC;YAC5B,IAAI,CAAC,OAAO;YACZ,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,SAAS;YACd,IAAI,CAAC,OAAO;YACZ,IAAI,CAAC,OAAO;YACZ,SAAS,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;YAC9B,IAAI,CAAC,WAAW,IAAI,EAAE;YACtB,IAAI,CAAC,YAAY,IAAI,EAAE;SACxB,CAAC,CAAC;IACL,CAAC;IAED,gCAAgC,CAC9B,OAAwC;QAExC,OAAO,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { DataSpace } from '../../../../../metamodels/pure/model/packageableElements/dataSpace/DataSpace';
|
|
17
|
+
import type { PackageableElementImplicitReference, V1_GraphBuilderContext } from '@finos/legend-graph';
|
|
18
|
+
export declare const V1_resolveDataSpace: (path: string, context: V1_GraphBuilderContext) => PackageableElementImplicitReference<DataSpace>;
|
|
19
|
+
//# sourceMappingURL=V1_DSLDataSpace_GraphBuilderHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_DSLDataSpace_GraphBuilderHelper.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8EAA8E,CAAC;AAC9G,OAAO,KAAK,EACV,mCAAmC,EACnC,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,mBAAmB,SACxB,MAAM,WACH,sBAAsB,KAC9B,oCAAoC,SAAS,CAG7C,CAAC"}
|
package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { getDataSpace } from '../../../../../../graphManager/DSLDataSpace_GraphManagerHelper';
|
|
17
|
+
export const V1_resolveDataSpace = (path, context) => context.createImplicitPackageableElementReference(path, (_path) => getDataSpace(_path, context.graph));
|
|
18
|
+
//# sourceMappingURL=V1_DSLDataSpace_GraphBuilderHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_DSLDataSpace_GraphBuilderHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDataSpace_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gEAAgE,CAAC;AAO9F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,IAAY,EACZ,OAA+B,EACiB,EAAE,CAClD,OAAO,CAAC,yCAAyC,CAAC,IAAI,EAAE,CAAC,KAAa,EAAE,EAAE,CACxE,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CACnC,CAAC"}
|
package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { V1_DataSpace } from '../../model/packageableElements/dataSpace/V1_DataSpace';
|
|
17
|
+
export declare const V1_DATA_SPACE_ELEMENT_PROTOCOL_TYPE = "dataSpace";
|
|
18
|
+
export declare const V1_dataSpaceModelSchema: import("serializr").ModelSchema<V1_DataSpace>;
|
|
19
|
+
//# sourceMappingURL=V1_DSLDataSpace_ProtocolHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_DSLDataSpace_ProtocolHelper.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,OAAO,EAAE,YAAY,EAAE,MAAM,wDAAwD,CAAC;AAEtF,eAAO,MAAM,mCAAmC,cAAc,CAAC;AAE/D,eAAO,MAAM,uBAAuB,+CA2ClC,CAAC"}
|
package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { V1_stereotypePtrSchema, V1_taggedValueSchema, } from '@finos/legend-graph';
|
|
17
|
+
import { deserializeArray, serializeArray, usingConstantValueSchema, } from '@finos/legend-shared';
|
|
18
|
+
import { createModelSchema, custom, deserialize, optional, primitive, serialize, } from 'serializr';
|
|
19
|
+
import { V1_DataSpace } from '../../model/packageableElements/dataSpace/V1_DataSpace';
|
|
20
|
+
export const V1_DATA_SPACE_ELEMENT_PROTOCOL_TYPE = 'dataSpace';
|
|
21
|
+
export const V1_dataSpaceModelSchema = createModelSchema(V1_DataSpace, {
|
|
22
|
+
_type: usingConstantValueSchema(V1_DATA_SPACE_ELEMENT_PROTOCOL_TYPE),
|
|
23
|
+
artifactId: primitive(),
|
|
24
|
+
description: optional(primitive()),
|
|
25
|
+
diagrams: custom((values) => serializeArray(values, (value) => value, true), (values) => deserializeArray(values, (value) => value, false)),
|
|
26
|
+
groupId: primitive(),
|
|
27
|
+
mapping: primitive(),
|
|
28
|
+
name: primitive(),
|
|
29
|
+
package: primitive(),
|
|
30
|
+
runtime: primitive(),
|
|
31
|
+
stereotypes: custom((values) => serializeArray(values, (value) => serialize(V1_stereotypePtrSchema, value), true), (values) => deserializeArray(values, (v) => deserialize(V1_stereotypePtrSchema, v), false)),
|
|
32
|
+
supportEmail: optional(primitive()),
|
|
33
|
+
taggedValues: custom((values) => serializeArray(values, (value) => serialize(V1_taggedValueSchema, value), true), (values) => deserializeArray(values, (v) => deserialize(V1_taggedValueSchema, v), false)),
|
|
34
|
+
versionId: primitive(),
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=V1_DSLDataSpace_ProtocolHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1_DSLDataSpace_ProtocolHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,YAAY,EAAE,MAAM,wDAAwD,CAAC;AAEtF,MAAM,CAAC,MAAM,mCAAmC,GAAG,WAAW,CAAC;AAE/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,YAAY,EAAE;IACrE,KAAK,EAAE,wBAAwB,CAAC,mCAAmC,CAAC;IACpE,UAAU,EAAE,SAAS,EAAE;IACvB,WAAW,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAClC,QAAQ,EAAE,MAAM,CACd,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAC1D,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAC9D;IACD,OAAO,EAAE,SAAS,EAAE;IACpB,OAAO,EAAE,SAAS,EAAE;IACpB,IAAI,EAAE,SAAS,EAAE;IACjB,OAAO,EAAE,SAAS,EAAE;IACpB,OAAO,EAAE,SAAS,EAAE;IACpB,WAAW,EAAE,MAAM,CACjB,CAAC,MAAM,EAAE,EAAE,CACT,cAAc,CACZ,MAAM,EACN,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,sBAAsB,EAAE,KAAK,CAAC,EACnD,IAAI,CACL,EACH,CAAC,MAAM,EAAE,EAAE,CACT,gBAAgB,CACd,MAAM,EACN,CAAC,CAAmB,EAAE,EAAE,CAAC,WAAW,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAC/D,KAAK,CACN,CACJ;IACD,YAAY,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IACnC,YAAY,EAAE,MAAM,CAClB,CAAC,MAAM,EAAE,EAAE,CACT,cAAc,CACZ,MAAM,EACN,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,oBAAoB,EAAE,KAAK,CAAC,EACjD,IAAI,CACL,EACH,CAAC,MAAM,EAAE,EAAE,CACT,gBAAgB,CACd,MAAM,EACN,CAAC,CAAmB,EAAE,EAAE,CAAC,WAAW,CAAC,oBAAoB,EAAE,CAAC,CAAC,EAC7D,KAAK,CACN,CACJ;IACD,SAAS,EAAE,SAAS,EAAE;CACvB,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { EditorStore } from '@finos/legend-studio';
|
|
17
|
+
import { ElementEditorState } from '@finos/legend-studio';
|
|
18
|
+
import type { PackageableElement } from '@finos/legend-graph';
|
|
19
|
+
import { DataSpace } from '../../models/metamodels/pure/model/packageableElements/dataSpace/DataSpace';
|
|
20
|
+
import type { DiagramRenderer } from '@finos/legend-extension-dsl-diagram';
|
|
21
|
+
import { Diagram } from '@finos/legend-extension-dsl-diagram';
|
|
22
|
+
export declare enum DATA_SPACE_VIEWER_ACTIVITY_MODE {
|
|
23
|
+
MODELS = "MODELS",
|
|
24
|
+
EXECUTION = "EXECUTION",
|
|
25
|
+
ENTITLEMENT = "ENTITLEMENT",
|
|
26
|
+
SUPPORT = "SUPPORT"
|
|
27
|
+
}
|
|
28
|
+
export declare class DataSpaceEditorState extends ElementEditorState {
|
|
29
|
+
_renderer?: DiagramRenderer | undefined;
|
|
30
|
+
currentDiagram?: Diagram | undefined;
|
|
31
|
+
currentActivity: DATA_SPACE_VIEWER_ACTIVITY_MODE;
|
|
32
|
+
diagrams: Diagram[];
|
|
33
|
+
constructor(editorStore: EditorStore, element: PackageableElement);
|
|
34
|
+
get dataSpace(): DataSpace;
|
|
35
|
+
get renderer(): DiagramRenderer;
|
|
36
|
+
get isDiagramRendererInitialized(): boolean;
|
|
37
|
+
setRenderer(val: DiagramRenderer): void;
|
|
38
|
+
setCurrentDiagram(val: Diagram): void;
|
|
39
|
+
setCurrentActivity(val: DATA_SPACE_VIEWER_ACTIVITY_MODE): void;
|
|
40
|
+
reprocess(newElement: PackageableElement, editorStore: EditorStore): ElementEditorState;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=DataSpaceEditorState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataSpaceEditorState.d.ts","sourceRoot":"","sources":["../../../src/stores/studio/DataSpaceEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,4EAA4E,CAAC;AACvG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAE9D,oBAAY,+BAA+B;IACzC,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;CACpB;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,SAAS,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACxC,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,eAAe,kCAA0C;IACzD,QAAQ,EAAE,OAAO,EAAE,CAAM;gBAEb,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB;IA4BjE,IAAI,SAAS,IAAI,SAAS,CAMzB;IAED,IAAI,QAAQ,IAAI,eAAe,CAK9B;IAED,IAAI,4BAA4B,IAAI,OAAO,CAE1C;IAED,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAIvC,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAIrC,kBAAkB,CAAC,GAAG,EAAE,+BAA+B,GAAG,IAAI;IAI9D,SAAS,CACP,UAAU,EAAE,kBAAkB,EAC9B,WAAW,EAAE,WAAW,GACvB,kBAAkB;CAOtB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { computed, action, makeObservable, observable } from 'mobx';
|
|
17
|
+
import { guaranteeNonNullable, guaranteeType } from '@finos/legend-shared';
|
|
18
|
+
import { ElementEditorState } from '@finos/legend-studio';
|
|
19
|
+
import { DataSpace } from '../../models/metamodels/pure/model/packageableElements/dataSpace/DataSpace';
|
|
20
|
+
import { Diagram } from '@finos/legend-extension-dsl-diagram';
|
|
21
|
+
export var DATA_SPACE_VIEWER_ACTIVITY_MODE;
|
|
22
|
+
(function (DATA_SPACE_VIEWER_ACTIVITY_MODE) {
|
|
23
|
+
DATA_SPACE_VIEWER_ACTIVITY_MODE["MODELS"] = "MODELS";
|
|
24
|
+
DATA_SPACE_VIEWER_ACTIVITY_MODE["EXECUTION"] = "EXECUTION";
|
|
25
|
+
DATA_SPACE_VIEWER_ACTIVITY_MODE["ENTITLEMENT"] = "ENTITLEMENT";
|
|
26
|
+
DATA_SPACE_VIEWER_ACTIVITY_MODE["SUPPORT"] = "SUPPORT";
|
|
27
|
+
})(DATA_SPACE_VIEWER_ACTIVITY_MODE || (DATA_SPACE_VIEWER_ACTIVITY_MODE = {}));
|
|
28
|
+
export class DataSpaceEditorState extends ElementEditorState {
|
|
29
|
+
_renderer;
|
|
30
|
+
currentDiagram;
|
|
31
|
+
currentActivity = DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS;
|
|
32
|
+
diagrams = [];
|
|
33
|
+
constructor(editorStore, element) {
|
|
34
|
+
super(editorStore, element);
|
|
35
|
+
makeObservable(this, {
|
|
36
|
+
_renderer: observable,
|
|
37
|
+
currentDiagram: observable,
|
|
38
|
+
currentActivity: observable,
|
|
39
|
+
renderer: computed,
|
|
40
|
+
dataSpace: computed,
|
|
41
|
+
setRenderer: action,
|
|
42
|
+
setCurrentDiagram: action,
|
|
43
|
+
setCurrentActivity: action,
|
|
44
|
+
reprocess: action,
|
|
45
|
+
});
|
|
46
|
+
this.dataSpace.diagrams.forEach((diagram) => {
|
|
47
|
+
this.diagrams.push(this.editorStore.graphManagerState.graph.getExtensionElement(diagram, Diagram));
|
|
48
|
+
});
|
|
49
|
+
if (this.diagrams.length !== 0) {
|
|
50
|
+
this.setCurrentDiagram(this.diagrams[0]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
get dataSpace() {
|
|
54
|
+
return guaranteeType(this.element, DataSpace, 'Element inside data space editor state must be a data space element');
|
|
55
|
+
}
|
|
56
|
+
get renderer() {
|
|
57
|
+
return guaranteeNonNullable(this._renderer, `Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)`);
|
|
58
|
+
}
|
|
59
|
+
get isDiagramRendererInitialized() {
|
|
60
|
+
return Boolean(this._renderer);
|
|
61
|
+
}
|
|
62
|
+
setRenderer(val) {
|
|
63
|
+
this._renderer = val;
|
|
64
|
+
}
|
|
65
|
+
setCurrentDiagram(val) {
|
|
66
|
+
this.currentDiagram = val;
|
|
67
|
+
}
|
|
68
|
+
setCurrentActivity(val) {
|
|
69
|
+
this.currentActivity = val;
|
|
70
|
+
}
|
|
71
|
+
reprocess(newElement, editorStore) {
|
|
72
|
+
const newElementEditorState = new DataSpaceEditorState(editorStore, newElement);
|
|
73
|
+
return newElementEditorState;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=DataSpaceEditorState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataSpaceEditorState.js","sourceRoot":"","sources":["../../../src/stores/studio/DataSpaceEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,4EAA4E,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAE9D,MAAM,CAAN,IAAY,+BAKX;AALD,WAAY,+BAA+B;IACzC,oDAAiB,CAAA;IACjB,0DAAuB,CAAA;IACvB,8DAA2B,CAAA;IAC3B,sDAAmB,CAAA;AACrB,CAAC,EALW,+BAA+B,KAA/B,+BAA+B,QAK1C;AAED,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IAC1D,SAAS,CAA+B;IACxC,cAAc,CAAuB;IACrC,eAAe,GAAG,+BAA+B,CAAC,MAAM,CAAC;IACzD,QAAQ,GAAc,EAAE,CAAC;IAEzB,YAAY,WAAwB,EAAE,OAA2B;QAC/D,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE5B,cAAc,CAAC,IAAI,EAAE;YACnB,SAAS,EAAE,UAAU;YACrB,cAAc,EAAE,UAAU;YAC1B,eAAe,EAAE,UAAU;YAC3B,QAAQ,EAAE,QAAQ;YAClB,SAAS,EAAE,QAAQ;YACnB,WAAW,EAAE,MAAM;YACnB,iBAAiB,EAAE,MAAM;YACzB,kBAAkB,EAAE,MAAM;YAC1B,SAAS,EAAE,MAAM;SAClB,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAChB,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,mBAAmB,CAC1D,OAAO,EACP,OAAO,CACR,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1C;IACH,CAAC;IAED,IAAI,SAAS;QACX,OAAO,aAAa,CAClB,IAAI,CAAC,OAAO,EACZ,SAAS,EACT,qEAAqE,CACtE,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,oBAAoB,CACzB,IAAI,CAAC,SAAS,EACd,wGAAwG,CACzG,CAAC;IACJ,CAAC;IAED,IAAI,4BAA4B;QAC9B,OAAO,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,WAAW,CAAC,GAAoB;QAC9B,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;IACvB,CAAC;IAED,iBAAiB,CAAC,GAAY;QAC5B,IAAI,CAAC,cAAc,GAAG,GAAG,CAAC;IAC5B,CAAC;IAED,kBAAkB,CAAC,GAAoC;QACrD,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC;IAC7B,CAAC;IAED,SAAS,CACP,UAA8B,EAC9B,WAAwB;QAExB,MAAM,qBAAqB,GAAG,IAAI,oBAAoB,CACpD,WAAW,EACX,UAAU,CACX,CAAC;QACF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@finos/legend-extension-dsl-data-space",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Legend extension for Data Space DSL",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"legend",
|
|
7
|
+
"legend-extension",
|
|
8
|
+
"dsl",
|
|
9
|
+
"dsl-data-space"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/finos/legend-studio/tree/master/packages/legend-extension-dsl-data-space",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/finos/legend-studio/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/finos/legend-studio.git",
|
|
18
|
+
"directory": "packages/legend-extension-dsl-data-space"
|
|
19
|
+
},
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "lib/index.js",
|
|
24
|
+
"module": "lib/index.js",
|
|
25
|
+
"types": "lib/index.d.ts",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "yarn clean && yarn build:sass && yarn build:tsc",
|
|
28
|
+
"build:sass": "cross-env INIT_CWD=$INIT_CWD sass ./style/index.scss ./lib/index.css --style=compressed && node ../../scripts/copyright/addBundledCodeCopyrightHeader.js ./lib/index.css",
|
|
29
|
+
"build:tsc": "tsc --project ./tsconfig.build.json",
|
|
30
|
+
"clean": "rimraf \"lib\" \"build\"",
|
|
31
|
+
"dev": "npm-run-all --parallel dev:sass dev:tsc",
|
|
32
|
+
"dev:sass": "sass ./style/index.scss ./lib/index.css --watch",
|
|
33
|
+
"dev:tsc": "tsc --watch --preserveWatchOutput",
|
|
34
|
+
"lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\" \"./src/**/*.{js,ts,tsx}\"",
|
|
35
|
+
"publish:prepare": "node ../../scripts/release/preparePublishContent.js",
|
|
36
|
+
"test": "jest",
|
|
37
|
+
"test:watch": "jest --watch"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@finos/legend-application": "0.0.8",
|
|
41
|
+
"@finos/legend-art": "0.0.5",
|
|
42
|
+
"@finos/legend-extension-dsl-diagram": "0.0.8",
|
|
43
|
+
"@finos/legend-graph": "0.0.6",
|
|
44
|
+
"@finos/legend-model-storage": "0.0.4",
|
|
45
|
+
"@finos/legend-shared": "0.0.4",
|
|
46
|
+
"@finos/legend-studio": "0.2.21",
|
|
47
|
+
"@types/react": "17.0.24",
|
|
48
|
+
"mobx": "6.3.3",
|
|
49
|
+
"mobx-react-lite": "3.2.1",
|
|
50
|
+
"monaco-editor": "0.28.1",
|
|
51
|
+
"react": "17.0.2",
|
|
52
|
+
"react-dom": "17.0.2",
|
|
53
|
+
"react-resize-detector": "6.7.6",
|
|
54
|
+
"serializr": "2.0.5"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@finos/legend-dev-utils": "0.0.9",
|
|
58
|
+
"cross-env": "7.0.3",
|
|
59
|
+
"eslint": "7.32.0",
|
|
60
|
+
"jest": "27.2.1",
|
|
61
|
+
"npm-run-all": "4.1.5",
|
|
62
|
+
"rimraf": "3.0.2",
|
|
63
|
+
"sass": "1.42.1",
|
|
64
|
+
"typescript": "4.4.3"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"react": "^17.0.0"
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"directory": "build/publishContent"
|
|
71
|
+
},
|
|
72
|
+
"extensions": {
|
|
73
|
+
"graphPreset": "@finos/legend-graph-preset-dsl-data-space",
|
|
74
|
+
"pureProtocolProcessorPlugin": "@finos/legend-graph-plugin-dsl-data-space-pure-protocol-processor",
|
|
75
|
+
"pureGraphManagerPlugin": "@finos/legend-graph-plugin-dsl-data-space-pure-graph-manager",
|
|
76
|
+
"pureGraphPlugin": "@finos/legend-graph-plugin-dsl-data-space-pure-graph",
|
|
77
|
+
"studioPreset": "@finos/legend-studio-preset-dsl-data-space",
|
|
78
|
+
"studioPlugin": "@finos/legend-studio-plugin-dsl-data-space"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 packageJson from '../package.json';
|
|
18
|
+
import { AbstractPreset } from '@finos/legend-shared';
|
|
19
|
+
import { DSLDataSpace_PureGraphManagerPlugin } from './graphManager/DSLDataSpace_PureGraphManagerPlugin';
|
|
20
|
+
import { DSLDataSpace_PureProtocolProcessorPlugin } from './models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin';
|
|
21
|
+
import type { GraphPluginManager } from '@finos/legend-graph';
|
|
22
|
+
import type { StudioPluginManager } from '@finos/legend-studio';
|
|
23
|
+
import { DSLDataSpace_StudioPlugin } from './components/studio/DSLDataSpace_StudioPlugin';
|
|
24
|
+
import { DSLDataSpace_PureGraphPlugin } from './graph/DSLDataSpace_PureGraphPlugin';
|
|
25
|
+
|
|
26
|
+
export class DSLDataSpace_GraphPreset extends AbstractPreset {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(packageJson.extensions.graphPreset, packageJson.version);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
install(pluginManager: GraphPluginManager): void {
|
|
32
|
+
new DSLDataSpace_PureGraphPlugin().install(pluginManager);
|
|
33
|
+
new DSLDataSpace_PureGraphManagerPlugin().install(pluginManager);
|
|
34
|
+
new DSLDataSpace_PureProtocolProcessorPlugin().install(pluginManager);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class DSLDataSpace_StudioPreset extends AbstractPreset {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(packageJson.extensions.studioPreset, packageJson.version);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
install(pluginManager: StudioPluginManager): void {
|
|
44
|
+
new DSLDataSpace_StudioPlugin().install(pluginManager);
|
|
45
|
+
new DSLDataSpace_PureGraphPlugin().install(pluginManager);
|
|
46
|
+
new DSLDataSpace_PureGraphManagerPlugin().install(pluginManager);
|
|
47
|
+
new DSLDataSpace_PureProtocolProcessorPlugin().install(pluginManager);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
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 packageJson from '../../../package.json';
|
|
18
|
+
import type {
|
|
19
|
+
StudioPluginManager,
|
|
20
|
+
NewElementFromStateCreator,
|
|
21
|
+
EditorStore,
|
|
22
|
+
ElementEditorState,
|
|
23
|
+
ElementEditorStateCreator,
|
|
24
|
+
ElementTypeGetter,
|
|
25
|
+
ElementProjectExplorerDnDTypeGetter,
|
|
26
|
+
ElementIconGetter,
|
|
27
|
+
DSL_StudioPlugin_Extension,
|
|
28
|
+
NewElementState,
|
|
29
|
+
ElementEditorRenderer,
|
|
30
|
+
} from '@finos/legend-studio';
|
|
31
|
+
import { StudioPlugin } from '@finos/legend-studio';
|
|
32
|
+
import { SquareIcon } from '@finos/legend-art';
|
|
33
|
+
import type { PackageableElement } from '@finos/legend-graph';
|
|
34
|
+
import { DataSpace } from '../../models/metamodels/pure/model/packageableElements/dataSpace/DataSpace';
|
|
35
|
+
import { DataSpaceEditorState } from '../../stores/studio/DataSpaceEditorState';
|
|
36
|
+
import { DataSpaceViewer } from './DataSpaceEditor';
|
|
37
|
+
|
|
38
|
+
const DATA_SPACE_ELEMENT_TYPE = 'DATA SPACE';
|
|
39
|
+
const DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE =
|
|
40
|
+
'PROJECT_EXPLORER_DATA_SPACE';
|
|
41
|
+
|
|
42
|
+
export class DSLDataSpace_StudioPlugin
|
|
43
|
+
extends StudioPlugin
|
|
44
|
+
implements DSL_StudioPlugin_Extension
|
|
45
|
+
{
|
|
46
|
+
constructor() {
|
|
47
|
+
super(packageJson.extensions.studioPlugin, packageJson.version);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
install(pluginManager: StudioPluginManager): void {
|
|
51
|
+
pluginManager.registerStudioPlugin(this);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
getExtraSupportedElementTypes(): string[] {
|
|
55
|
+
return [DATA_SPACE_ELEMENT_TYPE];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
getExtraElementTypeGetters(): ElementTypeGetter[] {
|
|
59
|
+
return [
|
|
60
|
+
(element: PackageableElement): string | undefined => {
|
|
61
|
+
if (element instanceof DataSpace) {
|
|
62
|
+
return DATA_SPACE_ELEMENT_TYPE;
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
getExtraElementIconGetters(): ElementIconGetter[] {
|
|
70
|
+
return [
|
|
71
|
+
(type: string): React.ReactNode | undefined => {
|
|
72
|
+
if (type === DATA_SPACE_ELEMENT_TYPE) {
|
|
73
|
+
return (
|
|
74
|
+
<div className="icon icon--text-element">
|
|
75
|
+
<SquareIcon />
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
getExtraElementEditorRenderers(): ElementEditorRenderer[] {
|
|
85
|
+
return [
|
|
86
|
+
(elementEditorState: ElementEditorState): React.ReactNode | undefined => {
|
|
87
|
+
if (elementEditorState instanceof DataSpaceEditorState) {
|
|
88
|
+
return <DataSpaceViewer key={elementEditorState.uuid} />;
|
|
89
|
+
}
|
|
90
|
+
return undefined;
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
getExtraNewElementFromStateCreators(): NewElementFromStateCreator[] {
|
|
96
|
+
return [
|
|
97
|
+
(
|
|
98
|
+
type: string,
|
|
99
|
+
name: string,
|
|
100
|
+
state: NewElementState,
|
|
101
|
+
): PackageableElement | undefined => {
|
|
102
|
+
if (type === DATA_SPACE_ELEMENT_TYPE) {
|
|
103
|
+
const dataSpace = new DataSpace(name);
|
|
104
|
+
dataSpace.groupId =
|
|
105
|
+
state.editorStore.projectConfigurationEditorState.currentProjectConfiguration.groupId;
|
|
106
|
+
dataSpace.artifactId =
|
|
107
|
+
state.editorStore.projectConfigurationEditorState.currentProjectConfiguration.artifactId;
|
|
108
|
+
dataSpace.versionId = 'latest';
|
|
109
|
+
dataSpace.mapping = 'dummyMapping';
|
|
110
|
+
dataSpace.runtime = 'dummyRuntime';
|
|
111
|
+
return dataSpace;
|
|
112
|
+
}
|
|
113
|
+
return undefined;
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
getExtraElementEditorStateCreators(): ElementEditorStateCreator[] {
|
|
119
|
+
return [
|
|
120
|
+
(
|
|
121
|
+
editorStore: EditorStore,
|
|
122
|
+
element: PackageableElement,
|
|
123
|
+
): ElementEditorState | undefined => {
|
|
124
|
+
if (element instanceof DataSpace) {
|
|
125
|
+
return new DataSpaceEditorState(editorStore, element);
|
|
126
|
+
}
|
|
127
|
+
return undefined;
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
getExtraElementProjectExplorerDnDTypeGetters(): ElementProjectExplorerDnDTypeGetter[] {
|
|
133
|
+
return [
|
|
134
|
+
(element: PackageableElement): string | undefined => {
|
|
135
|
+
if (element instanceof DataSpace) {
|
|
136
|
+
return DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE;
|
|
137
|
+
}
|
|
138
|
+
return undefined;
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
getExtraGrammarTextEditorDnDTypes(): string[] {
|
|
144
|
+
return [DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE];
|
|
145
|
+
}
|
|
146
|
+
}
|