@sap/cds-compiler 6.4.6 → 6.5.2
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 +42 -1156
- package/README.md +1 -10
- package/bin/cdsc.js +1 -1
- package/doc/IncompatibleChanges_v5.md +436 -0
- package/doc/IncompatibleChanges_v6.md +659 -0
- package/doc/Versioning.md +3 -7
- package/lib/api/main.js +1 -0
- package/lib/api/options.js +5 -0
- package/lib/api/validate.js +3 -0
- package/lib/base/message-registry.js +31 -8
- package/lib/base/messages.js +1 -1
- package/lib/base/model.js +3 -2
- package/lib/checks/actionsFunctions.js +6 -3
- package/lib/checks/existsInForbiddenPlaces.js +32 -0
- package/lib/checks/validator.js +2 -0
- package/lib/compiler/assert-consistency.js +3 -5
- package/lib/compiler/checks.js +4 -8
- package/lib/compiler/define.js +330 -558
- package/lib/compiler/extend.js +302 -18
- package/lib/compiler/finalize-parse-cdl.js +2 -10
- package/lib/compiler/generate.js +33 -5
- package/lib/compiler/kick-start.js +8 -7
- package/lib/compiler/populate.js +25 -70
- package/lib/compiler/propagator.js +1 -2
- package/lib/compiler/resolve.js +4 -13
- package/lib/compiler/shared.js +18 -5
- package/lib/compiler/tweak-assocs.js +13 -9
- package/lib/compiler/utils.js +98 -2
- package/lib/compiler/xpr-rewrite.js +2 -1
- package/lib/edm/annotations/edmJson.js +9 -6
- package/lib/edm/annotations/genericTranslation.js +8 -4
- package/lib/edm/csn2edm.js +3 -4
- package/lib/edm/edmInboundChecks.js +1 -2
- package/lib/edm/edmPreprocessor.js +3 -3
- package/lib/gen/CdlGrammar.checksum +1 -1
- package/lib/gen/CdlParser.js +1 -1
- package/lib/gen/Dictionary.json +16 -1
- package/lib/json/from-csn.js +4 -6
- package/lib/json/to-csn.js +3 -3
- package/lib/model/csnRefs.js +19 -5
- package/lib/model/enrichCsn.js +4 -2
- package/lib/optionProcessor.js +8 -4
- package/lib/render/toSql.js +0 -4
- package/lib/render/utils/sql.js +3 -2
- package/lib/transform/db/applyTransformations.js +1 -1
- package/lib/transform/db/assertUnique.js +3 -3
- package/lib/transform/db/assocsToQueries/normalizeFrom.js +33 -0
- package/lib/transform/db/assocsToQueries/transformExists.js +14 -3
- package/lib/transform/db/assocsToQueries/utils.js +1 -1
- package/lib/transform/db/backlinks.js +4 -4
- package/lib/transform/db/cdsPersistence.js +4 -4
- package/lib/transform/db/constraints.js +4 -4
- package/lib/transform/db/expansion.js +5 -5
- package/lib/transform/db/flattening.js +4 -5
- package/lib/transform/db/rewriteCalculatedElements.js +3 -3
- package/lib/transform/db/temporal.js +11 -11
- package/lib/transform/draft/db.js +2 -0
- package/lib/transform/draft/odata.js +5 -7
- package/lib/transform/effective/flattening.js +1 -2
- package/lib/transform/forOdata.js +3 -3
- package/lib/transform/forRelationalDB.js +1 -1
- package/lib/transform/odata/createForeignKeys.js +1 -2
- package/lib/transform/odata/flattening.js +1 -2
- package/lib/transform/odata/toFinalBaseType.js +52 -55
- package/lib/transform/transformUtils.js +3 -4
- package/package.json +1 -1
- package/doc/CHANGELOG_BETA.md +0 -464
- package/doc/CHANGELOG_DEPRECATED.md +0 -235
|
@@ -11,8 +11,8 @@ const validToString = '@cds.valid.to';
|
|
|
11
11
|
const validFromString = '@cds.valid.from';
|
|
12
12
|
/**
|
|
13
13
|
* Get the forEachDefinition callback function that adds a where condition to views that
|
|
14
|
-
* - are annotated with
|
|
15
|
-
* - have only one
|
|
14
|
+
* - are annotated with `@cds.valid.from` and `@cds.valid.to`,
|
|
15
|
+
* - have only one `@cds.valid.from` and `@cds.valid.to`,
|
|
16
16
|
* - and both annotations come from the same entity
|
|
17
17
|
*
|
|
18
18
|
* If the view has one of the annotations but the other conditions are not met, an error will be raised.
|
|
@@ -30,8 +30,8 @@ function getViewDecorator( csn, messageFunctions, csnUtils, options ) {
|
|
|
30
30
|
return addTemporalWhereConditionToView;
|
|
31
31
|
/**
|
|
32
32
|
* Add a where condition to views that
|
|
33
|
-
* - are annotated with
|
|
34
|
-
* - have only one
|
|
33
|
+
* - are annotated with `@cds.valid.from` and `@cds.valid.to`,
|
|
34
|
+
* - have only one `@cds.valid.from` and `@cds.valid.to`,
|
|
35
35
|
* - and both annotations come from the same entity
|
|
36
36
|
*
|
|
37
37
|
* If the view has one of the annotations but the other conditions are not met, an error will be raised.
|
|
@@ -97,10 +97,10 @@ function getViewDecorator( csn, messageFunctions, csnUtils, options ) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
* Get all elements tagged with
|
|
100
|
+
* Get all elements tagged with `@cds.valid.from/to` from the union of all entities of the from-clause.
|
|
101
101
|
*
|
|
102
|
-
* @param {
|
|
103
|
-
* @returns {Array[]} Array where first field is array of elements with
|
|
102
|
+
* @param {CSN.QueryFrom} combined union of all entities of the from-clause
|
|
103
|
+
* @returns {Array[]} Array where first field is array of elements with `@cds.valid.from`, second field is array of elements with `@cds.valid.to`.
|
|
104
104
|
*/
|
|
105
105
|
function getFromToElements( combined ) {
|
|
106
106
|
const from = [];
|
|
@@ -121,7 +121,7 @@ function getViewDecorator( csn, messageFunctions, csnUtils, options ) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* Check if the given SELECT has a falsy
|
|
124
|
+
* Check if the given SELECT has a falsy `@cds.valid.from` and a falsy `@cds.valid.to`
|
|
125
125
|
*
|
|
126
126
|
* @param {CSN.QuerySelect} SELECT
|
|
127
127
|
* @param {CSN.Elements} elements
|
|
@@ -150,13 +150,13 @@ function getViewDecorator( csn, messageFunctions, csnUtils, options ) {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
|
-
* Get the forEachDefinition callback function that collects all usages of
|
|
153
|
+
* Get the forEachDefinition callback function that collects all usages of `@cds.valid.from/to/key` and checks that
|
|
154
154
|
* - the assignment is on a valid element
|
|
155
155
|
* - the annotation is only assigned once
|
|
156
156
|
* - key is only used in conjunction with from and to
|
|
157
157
|
*
|
|
158
|
-
* Furthermore,
|
|
159
|
-
* If
|
|
158
|
+
* Furthermore, `@cds.valid.from` and `@cds.valid.key` is processed - `@cds.valid.from` is marked as key or marked as unique if `@cds.valid.key` is used.
|
|
159
|
+
* If `@cds.valid.key` is used, the real key-elements have their key-property removed (set non-enumerable as $key) and instead the `@cds.valid.key`-marked elements have it added.
|
|
160
160
|
*
|
|
161
161
|
* @param {CSN.Model} csn
|
|
162
162
|
* @param {CSN.Options} options
|
|
@@ -188,6 +188,8 @@ function generateDrafts( csn, options, pathDelimiter, messageFunctions ) {
|
|
|
188
188
|
// Copy all elements
|
|
189
189
|
for (const elemName in artifact.elements) {
|
|
190
190
|
const origElem = artifact.elements[elemName];
|
|
191
|
+
// elements with $calc are rendered as usual
|
|
192
|
+
|
|
191
193
|
if (origElem.value?.stored) {
|
|
192
194
|
calcOnWriteElements.push(elemName);
|
|
193
195
|
}
|
|
@@ -27,11 +27,12 @@ const { makeMessageFunction } = require('../../base/messages');
|
|
|
27
27
|
* @param {CSN.Options} options
|
|
28
28
|
* @param {string[]|undefined} services Will be calculated JIT if not provided
|
|
29
29
|
* @param {object} [messageFunctions]
|
|
30
|
+
* @param {function} [isExternalServiceMember]
|
|
30
31
|
* @returns {CSN.Model} Returns the transformed input model
|
|
31
32
|
* @todo should be done by the compiler - Check associations for valid foreign keys
|
|
32
33
|
* @todo check if needed at all: Remove '$projection' from paths in the element's ON-condition
|
|
33
34
|
*/
|
|
34
|
-
function generateDrafts( csn, options, services, messageFunctions ) {
|
|
35
|
+
function generateDrafts( csn, options, services, messageFunctions, isExternalServiceMember ) {
|
|
35
36
|
// TEMP(2024-02-26): Temporary! Umbrella uses this file directly in cds/lib/compile/for/drafts.js#L1
|
|
36
37
|
messageFunctions ??= makeMessageFunction(csn, options, 'odata-drafts');
|
|
37
38
|
|
|
@@ -53,14 +54,11 @@ function generateDrafts( csn, options, services, messageFunctions ) {
|
|
|
53
54
|
services = getServiceNames(csn);
|
|
54
55
|
|
|
55
56
|
const visitedArtifacts = Object.create(null);
|
|
56
|
-
|
|
57
|
-
const externalServices = services.filter(serviceName => csn.definitions[serviceName]['@cds.external']);
|
|
58
|
-
// @ts-ignore
|
|
59
|
-
const isExternalServiceMember = (_art, name) => externalServices.includes(getServiceName(name));
|
|
57
|
+
|
|
60
58
|
const filterDict = Object.create(null);
|
|
61
59
|
|
|
62
60
|
// validate the 'DRAFT.DraftAdministrativeData_DraftMessage' type if already present in the model
|
|
63
|
-
if (options.draftMessages) {
|
|
61
|
+
if (options.draftMessages && options.odataVersion === 'v4') {
|
|
64
62
|
const draftAdminDataMessagesType = csn.definitions['DRAFT.DraftAdministrativeData_DraftMessage'];
|
|
65
63
|
if (draftAdminDataMessagesType && !isValidDraftAdminDataMessagesType(draftAdminDataMessagesType)) {
|
|
66
64
|
error(null, [ 'definitions', 'DRAFT.DraftAdministrativeData_DraftMessage' ], { name: 'DRAFT.DraftAdministrativeData_DraftMessage' },
|
|
@@ -181,7 +179,7 @@ function generateDrafts( csn, options, services, messageFunctions ) {
|
|
|
181
179
|
// ... on SiblingEntity.IsActiveEntity != IsActiveEntity ...
|
|
182
180
|
siblingEntity.SiblingEntity.on = createAssociationPathComparison('SiblingEntity', 'IsActiveEntity', '!=', 'IsActiveEntity');
|
|
183
181
|
|
|
184
|
-
if (options.draftMessages) {
|
|
182
|
+
if (options.draftMessages && options.odataVersion === 'v4') {
|
|
185
183
|
const draftMessages = { DraftMessages: { '@Core.Computed': true, virtual: true, items: { type: 'DRAFT.DraftAdministrativeData_DraftMessage' } } };
|
|
186
184
|
addElement(draftMessages, artifact, artifactName);
|
|
187
185
|
|
|
@@ -62,13 +62,12 @@ function flattenRefs(csn, options, csnUtils, messageFunctions) {
|
|
|
62
62
|
|
|
63
63
|
// explicit binding parameter of bound action
|
|
64
64
|
if (def.actions) {
|
|
65
|
-
const special$self = !csn?.definitions?.$self && '$self';
|
|
66
65
|
Object.entries(def.actions).forEach(([ an, a ]) => {
|
|
67
66
|
if (a.params) {
|
|
68
67
|
const params = Object.entries(a.params);
|
|
69
68
|
const firstParam = params[0][1];
|
|
70
69
|
const type = firstParam?.items?.type || firstParam?.type;
|
|
71
|
-
if (type ===
|
|
70
|
+
if (type === '$self') {
|
|
72
71
|
const bindingParamName = params[0][0];
|
|
73
72
|
const markBindingParam = {
|
|
74
73
|
ref: (parent, prop, xpr) => {
|
|
@@ -117,9 +117,9 @@ function transform4odataWithCsn(inputModel, options, messageFunctions) {
|
|
|
117
117
|
// use the array when there is a need to identify if an artifact is in a service or not
|
|
118
118
|
const services = getServiceNames(csn);
|
|
119
119
|
// @ts-ignore
|
|
120
|
-
const externalServices = services.filter(serviceName => csn.definitions[serviceName]['@cds.external']);
|
|
120
|
+
const externalServices = services.filter(serviceName => csn.definitions[serviceName]['@cds.external'] && csn.definitions[serviceName]['@cds.external'] !== 2);
|
|
121
121
|
// @ts-ignore
|
|
122
|
-
const isExternalServiceMember = (art, name) => !!(externalServices.includes(getServiceName(name)) || (art && art['@cds.external']));
|
|
122
|
+
const isExternalServiceMember = (art, name) => !!(externalServices.includes(getServiceName(name)) || (art && art['@cds.external'] && art['@cds.external'] !== 2));
|
|
123
123
|
|
|
124
124
|
if (options.csnFlavor === 'universal' && isBetaEnabled(options, 'enableUniversalCsn'))
|
|
125
125
|
enrichUniversalCsn(csn, options);
|
|
@@ -127,7 +127,7 @@ function transform4odataWithCsn(inputModel, options, messageFunctions) {
|
|
|
127
127
|
// - Generate artificial draft fields on a structured CSN if requested, flattening and struct
|
|
128
128
|
// expansion do their magic including foreign key generation and annotation propagation.
|
|
129
129
|
// Tenantenizer has to decorate the DraftAdministrativeData, so draft decoration must be done before.
|
|
130
|
-
generateDrafts(csn, options, services, messageFunctions);
|
|
130
|
+
generateDrafts(csn, options, services, messageFunctions, isExternalServiceMember);
|
|
131
131
|
|
|
132
132
|
if (options.tenantDiscriminator)
|
|
133
133
|
addTenantFields(csn, options);
|
|
@@ -49,7 +49,7 @@ function forEachDefinition(csn, cb) {
|
|
|
49
49
|
* such as flattening, wildcard expansion, etc.
|
|
50
50
|
*
|
|
51
51
|
* @param {CSN.Model} csn
|
|
52
|
-
* @param {
|
|
52
|
+
* @param {SqlOptions} options
|
|
53
53
|
* @param {object} messageFunctions Message functions such as `error()`, `info()`, …
|
|
54
54
|
*/
|
|
55
55
|
function transformForRelationalDBWithCsn(csn, options, messageFunctions) {
|
|
@@ -76,7 +76,6 @@ function createForeignKeyElements(csn, options, messageFunctions, csnUtils, iter
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function createForeignKeysForElement(path, element, prefix, csn, options, pathDelimiter, lvl = 0, originalKey = {} ) {
|
|
79
|
-
const special$self = !csn?.definitions?.$self && '$self';
|
|
80
79
|
const isInspectRefResult = !Array.isArray(path);
|
|
81
80
|
|
|
82
81
|
let fks = [];
|
|
@@ -87,7 +86,7 @@ function createForeignKeyElements(csn, options, messageFunctions, csnUtils, iter
|
|
|
87
86
|
let finalTypeName;
|
|
88
87
|
|
|
89
88
|
// resolve derived type
|
|
90
|
-
if (element.type && !isBuiltinType(element.type)
|
|
89
|
+
if (element.type && !isBuiltinType(element.type)) {
|
|
91
90
|
const tmpElt = csnUtils.effectiveType(element);
|
|
92
91
|
// effective type resolves to structs and enums only but not scalars
|
|
93
92
|
if (Object.keys(tmpElt).length) {
|
|
@@ -102,13 +102,12 @@ function allInOneFlattening(csn, refFlattener, adaptRefs, inspectRef, getFinalTy
|
|
|
102
102
|
setProp(def, '$flatAnnotations', flatAnnos);
|
|
103
103
|
// explicit binding parameter of bound action
|
|
104
104
|
if (def.actions) {
|
|
105
|
-
const special$self = !csn?.definitions?.$self && '$self';
|
|
106
105
|
Object.entries(def.actions).forEach(([ actionName, action ]) => {
|
|
107
106
|
if (action.params) {
|
|
108
107
|
const params = Object.entries(action.params);
|
|
109
108
|
const firstParam = params[0][1];
|
|
110
109
|
const type = firstParam?.items?.type || firstParam?.type;
|
|
111
|
-
if (type ===
|
|
110
|
+
if (type === '$self') {
|
|
112
111
|
const bindingParamName = params[0][0];
|
|
113
112
|
const markBindingParam = {
|
|
114
113
|
ref: (parent, prop, xpr) => {
|
|
@@ -13,7 +13,6 @@ const { cloneCsnDict, cloneCsnNonDict } = require('../../model/cloneCsn');
|
|
|
13
13
|
|
|
14
14
|
function expandToFinalBaseType(csn, transformers, csnUtils, services, options, error) {
|
|
15
15
|
const isV4 = options.odataVersion === 'v4';
|
|
16
|
-
const special$self = !csn?.definitions?.$self && '$self';
|
|
17
16
|
forEachDefinition(csn, (def, defName) => {
|
|
18
17
|
// Unravel derived type chains to final one for elements, actions, action parameters (propagating annotations)
|
|
19
18
|
forEachMemberRecursively(def, (member, _memberName) => {
|
|
@@ -112,65 +111,63 @@ function expandToFinalBaseType(csn, transformers, csnUtils, services, options, e
|
|
|
112
111
|
else {
|
|
113
112
|
if (isExpandable(finalBaseType) || node.kind === 'type') {
|
|
114
113
|
// 1. Get the final type of the node (resolve derived type chain)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
type X: Integer;
|
|
114
|
+
// The type replacement depends on whether 'node' is a definition or a member[element].
|
|
115
|
+
if (node.kind) {
|
|
116
|
+
/*
|
|
117
|
+
It is a definition and we expand to builtin type and to elements
|
|
118
|
+
type T: S; --> Integer;
|
|
119
|
+
type S: X; --> Integer;
|
|
120
|
+
type X: Integer;
|
|
123
121
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
type A: B; -> {...}
|
|
123
|
+
type B: C; -> { ... }
|
|
124
|
+
type C { .... };
|
|
125
|
+
*/
|
|
126
|
+
if (isBuiltinType(finalBaseType.type)) {
|
|
127
|
+
/*
|
|
128
|
+
use transformUtils::toFinalBaseType for the moment,
|
|
129
|
+
as it is collects along the chain of types
|
|
130
|
+
attributes that need to be propagated
|
|
131
|
+
enum, length, scale, etc.
|
|
127
132
|
*/
|
|
128
|
-
|
|
129
|
-
/*
|
|
130
|
-
use transformUtils::toFinalBaseType for the moment,
|
|
131
|
-
as it is collects along the chain of types
|
|
132
|
-
attributes that need to be propagated
|
|
133
|
-
enum, length, scale, etc.
|
|
134
|
-
*/
|
|
135
|
-
transformers.toFinalBaseType(node);
|
|
136
|
-
}
|
|
137
|
-
else if (csnUtils.isStructured(finalBaseType)) {
|
|
138
|
-
cloneElements(node, finalBaseType);
|
|
139
|
-
}
|
|
140
|
-
else if (node.type && node.items) {
|
|
141
|
-
delete node.type;
|
|
142
|
-
}
|
|
133
|
+
transformers.toFinalBaseType(node);
|
|
143
134
|
}
|
|
144
|
-
else {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
135
|
+
else if (csnUtils.isStructured(finalBaseType)) {
|
|
136
|
+
cloneElements(node, finalBaseType);
|
|
137
|
+
}
|
|
138
|
+
else if (node.type && node.items) {
|
|
139
|
+
delete node.type;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
/*
|
|
144
|
+
this is a member and we expand to final base only if builtin
|
|
145
|
+
type T: S; --> Integer;
|
|
146
|
+
type S: X; --> Integer;
|
|
147
|
+
type X: Integer;
|
|
150
148
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
149
|
+
type {
|
|
150
|
+
struct_elt: many A; ---> stays the same
|
|
151
|
+
scalar_elt: T; ---> Integer;
|
|
152
|
+
type_ref_elt: type of struct_elt;
|
|
153
|
+
};
|
|
154
|
+
type A: B; -> {...}
|
|
155
|
+
type B: C; -> { ... }
|
|
156
|
+
type C { .... };
|
|
157
|
+
*/
|
|
158
|
+
// eslint-disable-next-line no-lonely-if
|
|
159
|
+
if (isBuiltinType(finalBaseType.type)) {
|
|
160
|
+
/*
|
|
161
|
+
use transformUtils::toFinalBaseType for the moment,
|
|
162
|
+
as it is collects along the chain of types
|
|
163
|
+
attributes that need to be propagated
|
|
164
|
+
enum, length, scale, etc.
|
|
159
165
|
*/
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
attributes that need to be propagated
|
|
166
|
-
enum, length, scale, etc.
|
|
167
|
-
*/
|
|
168
|
-
transformers.toFinalBaseType(node);
|
|
169
|
-
// node.type = finalType;
|
|
170
|
-
}
|
|
171
|
-
else if (node.type.ref) {
|
|
172
|
-
cloneElements(node, finalBaseType);
|
|
173
|
-
}
|
|
166
|
+
transformers.toFinalBaseType(node);
|
|
167
|
+
// node.type = finalType;
|
|
168
|
+
}
|
|
169
|
+
else if (node.type.ref) {
|
|
170
|
+
cloneElements(node, finalBaseType);
|
|
174
171
|
}
|
|
175
172
|
}
|
|
176
173
|
}
|
|
@@ -397,7 +397,7 @@ function getTransformers(model, options, msgFunctions, pathDelimiter = '_') {
|
|
|
397
397
|
if (!draftAdminDataEntity) {
|
|
398
398
|
draftAdminDataEntity = createAndAddDraftAdminDataEntity();
|
|
399
399
|
model.definitions['DRAFT.DraftAdministrativeData'] = draftAdminDataEntity;
|
|
400
|
-
if (options.draftMessages && options.transformation === 'odata' &&
|
|
400
|
+
if (options.draftMessages && options.transformation === 'odata' && options.odataVersion === 'v4' &&
|
|
401
401
|
!model.definitions['DRAFT.DraftAdministrativeData_DraftMessage'])
|
|
402
402
|
model.definitions['DRAFT.DraftAdministrativeData_DraftMessage'] = createDraftAdminDataMessagesType();
|
|
403
403
|
|
|
@@ -493,7 +493,7 @@ function getTransformers(model, options, msgFunctions, pathDelimiter = '_') {
|
|
|
493
493
|
draftIsProcessedByMe.DraftIsProcessedByMe['@Common.Label'] = '{i18n>Draft_DraftIsProcessedByMe}';
|
|
494
494
|
addElement(draftIsProcessedByMe, artifact, artifactName);
|
|
495
495
|
|
|
496
|
-
if (options.transformation !== 'odata' || options.draftMessages) {
|
|
496
|
+
if (options.transformation !== 'odata' || (options.draftMessages && options.odataVersion === 'v4')) {
|
|
497
497
|
const messages = { DraftMessages: { } };
|
|
498
498
|
if (options.transformation === 'odata')
|
|
499
499
|
messages.DraftMessages = { items: { type: 'DRAFT.DraftAdministrativeData_DraftMessage' } };
|
|
@@ -888,12 +888,11 @@ function getTransformers(model, options, msgFunctions, pathDelimiter = '_') {
|
|
|
888
888
|
* @param {CSN.Model} csn
|
|
889
889
|
*/
|
|
890
890
|
function rewriteBuiltinTypeRef(csn) {
|
|
891
|
-
const special$self = !csn?.definitions?.$self && '$self';
|
|
892
891
|
applyTransformations(csn, {
|
|
893
892
|
type: (parent, _prop, type) => {
|
|
894
893
|
if (type?.ref && (
|
|
895
894
|
isBuiltinType(type.ref[0]) ||
|
|
896
|
-
type.ref[0] ===
|
|
895
|
+
type.ref[0] === '$self')
|
|
897
896
|
)
|
|
898
897
|
parent.type = type.ref[0];
|
|
899
898
|
},
|