Skip to content

Commit bf3385c

Browse files
feat(dcs): optimize decorate models (#857)
* feat(dcs): optimize decorate models Signed-off-by: Sanket Shevkar <[email protected]> * refactor(core): optimized decorateModels added Signed-off-by: sanketshevkar <[email protected]> * chore(core): code refactor and cleanup Signed-off-by: sanketshevkar <[email protected]> * chore(core): code refactor and cleanup Signed-off-by: sanketshevkar <[email protected]> * chore(core): new test added for validation of new and old methods used to decorate models Signed-off-by: sanketshevkar <[email protected]> * chore(core): code refactor Signed-off-by: sanketshevkar <[email protected]> * chore(core): resolve review comments and suggestions Signed-off-by: sanketshevkar <[email protected]> * chore(*): resolve PR suggestions and comments Signed-off-by: sanketshevkar <[email protected]> * chore(*): resolve PR suggestions and comments Signed-off-by: sanketshevkar <[email protected]> --------- Signed-off-by: Sanket Shevkar <[email protected]> Signed-off-by: sanketshevkar <[email protected]>
1 parent c252d82 commit bf3385c

File tree

11 files changed

+999
-49
lines changed

11 files changed

+999
-49
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/concerto-core/api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class DecoratorManager {
6565
+ void validateCommand(ModelManager,command)
6666
+ Boolean falsyOrEqual(string||,string[])
6767
+ void applyDecorator(decorated,string,newDecorator)
68-
+ void executeCommand(string,declaration,command,boolean?)
68+
+ void executeCommand(string,declaration,command,property?,object?,boolean?)
6969
+ void executePropertyCommand(property,command)
7070
}
7171
+ string[] intersect()

packages/concerto-core/changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
# Note that the latest public API is documented using JSDocs and is available in api.txt.
2525
#
2626

27+
Version 3.17.2 {eb3903401fdcf7c26cca1f3f8a029171} 2024-07-17
28+
- Added new optimized methods for decorating models with decorator commandsets
29+
- fixed other decorator command set bugs
30+
2731
Version 3.17.1 {ddc91ebd1ff660b421b60302d1e92271} 2024-06-21
2832
- Added 'enableAliasedType' option to BaseModelManager
2933
- Aliased types mapped to FQN in modelfile

packages/concerto-core/lib/decoratormanager.js

Lines changed: 202 additions & 41 deletions
Large diffs are not rendered by default.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
2+
3+
@Declaration()
4+
@NamespaceDeclaration()
5+
@NamespaceDeprecated()
6+
@Namespace()
7+
scalar SSN extends String
8+
9+
@Editable
10+
@NamespaceDeprecated()
11+
@Namespace()
12+
concept Person {
13+
@Custom
14+
@Type("Property")
15+
o String firstName
16+
@Type("Property")
17+
o String lastName
18+
@Type("Property")
19+
o String bio
20+
o SSN ssn
21+
@Type("Property")
22+
o String address1
23+
@Type("Property")
24+
o String address2
25+
@Type("Property")
26+
o String city
27+
@Property()
28+
@DeclarationProperty()
29+
@NamespaceDeclarationProperty()
30+
@NamespaceProperty()
31+
@NamespaceDeclarationPropertyType()
32+
@NamespacePropertyType()
33+
@DeclarationPropertyType()
34+
@PropertyType()
35+
@Type("Property")
36+
@NamespaceDeclarationTypeProperties()
37+
@Properties()
38+
@DeclarationProperties()
39+
@NamespaceDeclarationProperties()
40+
@NamespaceProperties()
41+
@NamespaceTypeProperties()
42+
o String country
43+
@Properties()
44+
@DeclarationProperties()
45+
@NamespaceDeclarationProperties()
46+
@NamespaceProperties()
47+
@DeclarationTypeProperties()
48+
o Integer zip
49+
o Dictionary dictionary
50+
}
51+
52+
@NamespaceDeprecated()
53+
@Namespace()
54+
map Dictionary {
55+
@MapElement()
56+
@DeclarationMapElement()
57+
@NamespaceDeclarationMapElement()
58+
@NamespaceMapElement()
59+
o String
60+
@NamespaceDeclarationTypeMapElement()
61+
@MapElement()
62+
@NamespaceTypeMapElement()
63+
@DeclarationTypeMapElement()
64+
@Type("MapValue")
65+
o String
66+
}
67+
68+
@NamespaceDeprecated()
69+
@Namespace()
70+
map Rolodex {
71+
@MapElement()
72+
@NamespaceMapElement()
73+
o String
74+
@MapElement()
75+
@NamespaceTypeMapElement()
76+
@Type("MapValue")
77+
o String
78+
}
79+
80+
@NamespaceDeprecated()
81+
@Namespace()
82+
enum Miscellaneous {
83+
@Property()
84+
@NamespaceProperty()
85+
@Properties()
86+
@NamespaceProperties()
87+
@PropertiesType()
88+
o country
89+
o USA
90+
@Properties()
91+
@NamespaceProperties()
92+
@PropertiesType()
93+
o zip
94+
o dictionary
95+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
3+
@Declaration()
4+
@NamespaceDeclaration()
5+
@NamespaceDeprecated()
6+
@MapElement()
7+
@NamespaceMapElement()
8+
@Namespace()
9+
scalar SSN extends String
10+
11+
@Editable
12+
@NamespaceDeprecated()
13+
@MapElement()
14+
@NamespaceMapElement()
15+
@Namespace()
16+
concept Person {
17+
@Custom
18+
@Type("Property")
19+
o String firstName
20+
@Type("Property")
21+
o String lastName
22+
@Type("Property")
23+
o String bio
24+
o SSN ssn
25+
@Type("Property")
26+
o String address1
27+
@Type("Property")
28+
@NamespaceDeclarationTypeProperties()
29+
@Properties()
30+
@DeclarationProperties()
31+
@NamespaceDeclarationProperties()
32+
@NamespaceProperties()
33+
@NamespaceTypeProperties()
34+
@DeclarationTypeProperties()
35+
@PropertiesType()
36+
o String address2
37+
@Type("Property")
38+
o String city
39+
@Property()
40+
@DeclarationProperty()
41+
@NamespaceDeclarationProperty()
42+
@NamespaceProperty()
43+
@NamespaceDeclarationPropertyType()
44+
@NamespacePropertyType()
45+
@DeclarationPropertyType()
46+
@PropertyType()
47+
@Type("Property")
48+
o String country
49+
o Integer zip
50+
o Dictionary dictionary
51+
}
52+
53+
@NamespaceDeprecated()
54+
@Property()
55+
@NamespaceProperty()
56+
@Properties()
57+
@NamespaceProperties()
58+
@Namespace()
59+
map Dictionary {
60+
@MapElement()
61+
@DeclarationMapElement()
62+
@NamespaceDeclarationMapElement()
63+
@NamespaceMapElement()
64+
o String
65+
@NamespaceDeclarationTypeMapElement()
66+
@MapElement()
67+
@NamespaceTypeMapElement()
68+
@DeclarationTypeMapElement()
69+
@TypeMapElement()
70+
@Type("MapValue")
71+
o String
72+
}
73+
74+
@NamespaceDeprecated()
75+
@Property()
76+
@NamespaceProperty()
77+
@Properties()
78+
@NamespaceProperties()
79+
@Namespace()
80+
map Rolodex {
81+
@MapElement()
82+
@NamespaceMapElement()
83+
o String
84+
@MapElement()
85+
@NamespaceTypeMapElement()
86+
@TypeMapElement()
87+
@Type("MapValue")
88+
o String
89+
}

0 commit comments

Comments
 (0)