@sap/cds-compiler 4.7.4 → 4.7.6
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 +10 -0
- package/lib/transform/draft/odata.js +16 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
Note: `beta` fixes, changes and features are usually not listed in this ChangeLog but [here](doc/CHANGELOG_BETA.md).
|
|
8
8
|
The compiler behavior concerning `beta` features can change at any time without notice.
|
|
9
9
|
|
|
10
|
+
|
|
11
|
+
## Version 4.7.6 - 2024-02-29
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- OData: Restored compatibility with the Java runtime.
|
|
16
|
+
Drafts generation was applied twice.
|
|
17
|
+
|
|
18
|
+
|
|
10
19
|
## Version 4.7.4 - 2024-02-27
|
|
11
20
|
|
|
12
21
|
### Fixed
|
|
@@ -20,6 +29,7 @@ The compiler behavior concerning `beta` features can change at any time without
|
|
|
20
29
|
|
|
21
30
|
- Restored compatibility with `@sap/cds-dk` for Java runtime
|
|
22
31
|
|
|
32
|
+
|
|
23
33
|
## Version 4.7.0 - 2024-02-23
|
|
24
34
|
|
|
25
35
|
### Added
|
|
@@ -80,9 +80,24 @@ function generateDrafts( csn, options, services, messageFunctions ) {
|
|
|
80
80
|
*/
|
|
81
81
|
function generateDraftForOdata( artifact, artifactName, rootArtifact ) {
|
|
82
82
|
// Nothing to do if already draft-enabled (composition traversal may have circles)
|
|
83
|
-
if (
|
|
83
|
+
if ((artifact['@Common.DraftRoot.PreparationAction'] || artifact['@Common.DraftNode.PreparationAction']) &&
|
|
84
|
+
artifact.actions && artifact.actions.draftPrepare)
|
|
84
85
|
return;
|
|
85
86
|
|
|
87
|
+
const draftPrepare = createAction('draftPrepare', artifactName, 'SideEffectsQualifier', 'cds.String');
|
|
88
|
+
assignAction(draftPrepare, artifact);
|
|
89
|
+
// Generate the actions into the draft-enabled artifact (only draft roots can be activated/edited)
|
|
90
|
+
|
|
91
|
+
// action draftPrepare (SideEffectsQualifier: String) return <artifact>;
|
|
92
|
+
if (artifact === rootArtifact) {
|
|
93
|
+
// action draftActivate() return <artifact>;
|
|
94
|
+
const draftActivate = createAction('draftActivate', artifactName);
|
|
95
|
+
assignAction(draftActivate, artifact);
|
|
96
|
+
|
|
97
|
+
// action draftEdit (PreserveChanges: Boolean) return <artifact>;
|
|
98
|
+
const draftEdit = createAction('draftEdit', artifactName, 'PreserveChanges', 'cds.Boolean');
|
|
99
|
+
assignAction(draftEdit, artifact);
|
|
100
|
+
}
|
|
86
101
|
|
|
87
102
|
// Generate the DraftAdministrativeData projection into the service, unless there is already one
|
|
88
103
|
// @ts-ignore
|
|
@@ -195,22 +210,6 @@ function generateDrafts( csn, options, services, messageFunctions ) {
|
|
|
195
210
|
});
|
|
196
211
|
}
|
|
197
212
|
}
|
|
198
|
-
|
|
199
|
-
// Generate the actions into the draft-enabled artifact (only draft roots can be activated/edited)
|
|
200
|
-
|
|
201
|
-
// action draftPrepare (SideEffectsQualifier: String) return <artifact>;
|
|
202
|
-
const draftPrepare = createAction('draftPrepare', artifactName, 'SideEffectsQualifier', 'cds.String');
|
|
203
|
-
assignAction(draftPrepare, artifact);
|
|
204
|
-
|
|
205
|
-
if (artifact === rootArtifact) {
|
|
206
|
-
// action draftActivate() return <artifact>;
|
|
207
|
-
const draftActivate = createAction('draftActivate', artifactName);
|
|
208
|
-
assignAction(draftActivate, artifact);
|
|
209
|
-
|
|
210
|
-
// action draftEdit (PreserveChanges: Boolean) return <artifact>;
|
|
211
|
-
const draftEdit = createAction('draftEdit', artifactName, 'PreserveChanges', 'cds.Boolean');
|
|
212
|
-
assignAction(draftEdit, artifact);
|
|
213
|
-
}
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
215
|
|