@api-client/core 0.18.24 → 0.18.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/build/src/modeling/DomainEntity.d.ts +6 -1
  2. package/build/src/modeling/DomainEntity.d.ts.map +1 -1
  3. package/build/src/modeling/DomainEntity.js +24 -5
  4. package/build/src/modeling/DomainEntity.js.map +1 -1
  5. package/build/src/modeling/Semantics.d.ts +68 -0
  6. package/build/src/modeling/Semantics.d.ts.map +1 -1
  7. package/build/src/modeling/Semantics.js +217 -0
  8. package/build/src/modeling/Semantics.js.map +1 -1
  9. package/build/src/modeling/definitions/Email.js +1 -1
  10. package/build/src/modeling/definitions/Email.js.map +1 -1
  11. package/build/src/modeling/definitions/Password.d.ts.map +1 -1
  12. package/build/src/modeling/definitions/Password.js +1 -3
  13. package/build/src/modeling/definitions/Password.js.map +1 -1
  14. package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
  15. package/build/src/modeling/helpers/Intelisense.js +24 -58
  16. package/build/src/modeling/helpers/Intelisense.js.map +1 -1
  17. package/build/tsconfig.tsbuildinfo +1 -1
  18. package/data/models/example-generator-api.json +15 -15
  19. package/package.json +1 -1
  20. package/src/modeling/DomainEntity.ts +27 -5
  21. package/src/modeling/Semantics.ts +254 -0
  22. package/src/modeling/definitions/Email.ts +1 -1
  23. package/src/modeling/definitions/Password.ts +1 -3
  24. package/src/modeling/helpers/Intelisense.ts +26 -58
  25. package/tests/unit/modeling/definitions/password.spec.ts +0 -2
  26. package/tests/unit/modeling/domain_entity_parents.spec.ts +243 -0
  27. package/tests/unit/modeling/semantic_runtime.spec.ts +113 -0
  28. package/tests/unit/modeling/semantics.spec.ts +68 -0
@@ -3,6 +3,8 @@ import {
3
3
  SemanticType,
4
4
  SemanticScope,
5
5
  SemanticCategory,
6
+ SemanticTiming,
7
+ SemanticOperation,
6
8
  isEntitySemantic,
7
9
  isPropertySemantic,
8
10
  isAssociationSemantic,
@@ -50,6 +52,10 @@ test.group('Semantics', () => {
50
52
  scope: SemanticScope.Entity,
51
53
  category: SemanticCategory.Identity,
52
54
  hasConfig: false,
55
+ runtime: {
56
+ timing: SemanticTiming.None,
57
+ operations: [],
58
+ },
53
59
  }
54
60
  const propertySemantic: PropertySemantic = {
55
61
  id: SemanticType.CreatedTimestamp,
@@ -58,6 +64,12 @@ test.group('Semantics', () => {
58
64
  scope: SemanticScope.Property,
59
65
  category: SemanticCategory.Lifecycle,
60
66
  hasConfig: false,
67
+ applicableDataTypes: ['datetime'],
68
+ runtime: {
69
+ timing: SemanticTiming.Before,
70
+ operations: [SemanticOperation.Create],
71
+ priority: 90,
72
+ },
61
73
  }
62
74
  const associationSemantic: AssociationSemantic = {
63
75
  id: SemanticType.ResourceOwnerIdentifier,
@@ -66,6 +78,18 @@ test.group('Semantics', () => {
66
78
  scope: SemanticScope.Association,
67
79
  category: SemanticCategory.Identity,
68
80
  hasConfig: false,
81
+ runtime: {
82
+ timing: SemanticTiming.Before,
83
+ operations: [
84
+ SemanticOperation.Create,
85
+ SemanticOperation.Read,
86
+ SemanticOperation.Update,
87
+ SemanticOperation.Delete,
88
+ SemanticOperation.List,
89
+ ],
90
+ priority: 5,
91
+ canDisable: false,
92
+ },
69
93
  }
70
94
 
71
95
  assert.isTrue(isEntitySemantic(entitySemantic))
@@ -81,6 +105,10 @@ test.group('Semantics', () => {
81
105
  scope: SemanticScope.Entity,
82
106
  category: SemanticCategory.Identity,
83
107
  hasConfig: false,
108
+ runtime: {
109
+ timing: SemanticTiming.None,
110
+ operations: [],
111
+ },
84
112
  }
85
113
  const propertySemantic: PropertySemantic = {
86
114
  id: SemanticType.CreatedTimestamp,
@@ -89,6 +117,12 @@ test.group('Semantics', () => {
89
117
  scope: SemanticScope.Property,
90
118
  category: SemanticCategory.Lifecycle,
91
119
  hasConfig: false,
120
+ applicableDataTypes: ['datetime'],
121
+ runtime: {
122
+ timing: SemanticTiming.Before,
123
+ operations: [SemanticOperation.Create],
124
+ priority: 90,
125
+ },
92
126
  }
93
127
  const associationSemantic: AssociationSemantic = {
94
128
  id: SemanticType.ResourceOwnerIdentifier,
@@ -97,6 +131,18 @@ test.group('Semantics', () => {
97
131
  scope: SemanticScope.Association,
98
132
  category: SemanticCategory.Identity,
99
133
  hasConfig: false,
134
+ runtime: {
135
+ timing: SemanticTiming.Before,
136
+ operations: [
137
+ SemanticOperation.Create,
138
+ SemanticOperation.Read,
139
+ SemanticOperation.Update,
140
+ SemanticOperation.Delete,
141
+ SemanticOperation.List,
142
+ ],
143
+ priority: 5,
144
+ canDisable: false,
145
+ },
100
146
  }
101
147
 
102
148
  assert.isFalse(isPropertySemantic(entitySemantic))
@@ -112,6 +158,10 @@ test.group('Semantics', () => {
112
158
  scope: SemanticScope.Entity,
113
159
  category: SemanticCategory.Identity,
114
160
  hasConfig: false,
161
+ runtime: {
162
+ timing: SemanticTiming.None,
163
+ operations: [],
164
+ },
115
165
  }
116
166
  const propertySemantic: PropertySemantic = {
117
167
  id: SemanticType.CreatedTimestamp,
@@ -120,6 +170,12 @@ test.group('Semantics', () => {
120
170
  scope: SemanticScope.Property,
121
171
  category: SemanticCategory.Lifecycle,
122
172
  hasConfig: false,
173
+ applicableDataTypes: ['datetime'],
174
+ runtime: {
175
+ timing: SemanticTiming.Before,
176
+ operations: [SemanticOperation.Create],
177
+ priority: 90,
178
+ },
123
179
  }
124
180
  const associationSemantic: AssociationSemantic = {
125
181
  id: SemanticType.ResourceOwnerIdentifier,
@@ -128,6 +184,18 @@ test.group('Semantics', () => {
128
184
  scope: SemanticScope.Association,
129
185
  category: SemanticCategory.Identity,
130
186
  hasConfig: false,
187
+ runtime: {
188
+ timing: SemanticTiming.Before,
189
+ operations: [
190
+ SemanticOperation.Create,
191
+ SemanticOperation.Read,
192
+ SemanticOperation.Update,
193
+ SemanticOperation.Delete,
194
+ SemanticOperation.List,
195
+ ],
196
+ priority: 5,
197
+ canDisable: false,
198
+ },
131
199
  }
132
200
 
133
201
  assert.isFalse(isAssociationSemantic(entitySemantic))