@sap/cds-compiler 3.8.0 → 3.9.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 +61 -0
- package/bin/cdsc.js +2 -2
- package/doc/CHANGELOG_BETA.md +26 -5
- package/lib/api/.eslintrc.json +3 -2
- package/lib/api/options.js +3 -1
- package/lib/api/validate.js +1 -1
- package/lib/base/message-registry.js +27 -18
- package/lib/base/messages.js +6 -1
- package/lib/base/model.js +2 -2
- package/lib/checks/.eslintrc.json +1 -0
- package/lib/checks/actionsFunctions.js +6 -6
- package/lib/checks/annotationsOData.js +1 -1
- package/lib/checks/elements.js +28 -17
- package/lib/checks/foreignKeys.js +1 -1
- package/lib/checks/invalidTarget.js +1 -1
- package/lib/checks/onConditions.js +11 -6
- package/lib/checks/queryNoDbArtifacts.js +1 -1
- package/lib/checks/types.js +1 -1
- package/lib/checks/utils.js +1 -1
- package/lib/checks/validator.js +3 -2
- package/lib/compiler/assert-consistency.js +8 -3
- package/lib/compiler/base.js +19 -13
- package/lib/compiler/builtins.js +7 -0
- package/lib/compiler/checks.js +73 -6
- package/lib/compiler/define.js +10 -5
- package/lib/compiler/extend.js +924 -1709
- package/lib/compiler/finalize-parse-cdl.js +1 -1
- package/lib/compiler/generate.js +838 -0
- package/lib/compiler/index.js +2 -0
- package/lib/compiler/populate.js +2 -2
- package/lib/compiler/propagator.js +20 -8
- package/lib/compiler/resolve.js +3 -3
- package/lib/compiler/shared.js +11 -6
- package/lib/edm/annotations/genericTranslation.js +6 -6
- package/lib/edm/csn2edm.js +1 -1
- package/lib/edm/edm.js +25 -11
- package/lib/edm/edmPreprocessor.js +47 -23
- package/lib/edm/edmUtils.js +37 -9
- package/lib/gen/Dictionary.json +5 -7
- package/lib/gen/language.checksum +1 -1
- package/lib/gen/language.interp +3 -1
- package/lib/gen/language.tokens +24 -23
- package/lib/gen/languageLexer.interp +4 -1
- package/lib/gen/languageLexer.js +792 -784
- package/lib/gen/languageLexer.tokens +12 -11
- package/lib/gen/languageParser.js +3944 -3865
- package/lib/json/from-csn.js +27 -6
- package/lib/json/to-csn.js +10 -6
- package/lib/language/antlrParser.js +11 -3
- package/lib/language/genericAntlrParser.js +4 -2
- package/lib/language/language.g4 +32 -24
- package/lib/model/csnRefs.js +15 -7
- package/lib/model/csnUtils.js +41 -76
- package/lib/modelCompare/utils/.eslintrc.json +1 -1
- package/lib/optionProcessor.js +7 -4
- package/lib/render/.eslintrc.json +1 -1
- package/lib/render/toCdl.js +244 -168
- package/lib/render/toHdbcds.js +18 -10
- package/lib/render/toSql.js +24 -2
- package/lib/transform/db/.eslintrc.json +4 -3
- package/lib/transform/db/cdsPersistence.js +1 -1
- package/lib/transform/db/expansion.js +11 -6
- package/lib/transform/db/flattening.js +22 -15
- package/lib/transform/db/rewriteCalculatedElements.js +50 -29
- package/lib/transform/db/temporal.js +1 -1
- package/lib/transform/db/views.js +1 -1
- package/lib/transform/draft/db.js +1 -1
- package/lib/transform/draft/odata.js +3 -4
- package/lib/transform/forOdataNew.js +5 -6
- package/lib/transform/forRelationalDB.js +7 -7
- package/lib/transform/odata/toFinalBaseType.js +6 -6
- package/lib/transform/odata/typesExposure.js +12 -3
- package/lib/transform/odata/utils.js +3 -0
- package/lib/transform/transformUtilsNew.js +11 -26
- package/lib/transform/translateAssocsToJoins.js +9 -9
- package/lib/transform/universalCsn/.eslintrc.json +3 -2
- package/lib/transform/universalCsn/coreComputed.js +1 -1
- package/lib/transform/universalCsn/universalCsnEnricher.js +6 -4
- package/package.json +1 -1
package/lib/optionProcessor.js
CHANGED
|
@@ -108,7 +108,6 @@ optionProcessor
|
|
|
108
108
|
enableUniversalCsn
|
|
109
109
|
postgres
|
|
110
110
|
aspectWithoutElements
|
|
111
|
-
odataOpenType
|
|
112
111
|
odataTerms
|
|
113
112
|
optionalActionFunctionParameters
|
|
114
113
|
--deprecated <list> Comma separated list of deprecated options.
|
|
@@ -222,11 +221,12 @@ optionProcessor.command('O, toOdata')
|
|
|
222
221
|
.option('-j, --json')
|
|
223
222
|
.option(' --odata-containment')
|
|
224
223
|
.option(' --odata-capabilities-pullup')
|
|
224
|
+
.option(' --odata-openapi-hints')
|
|
225
225
|
.option(' --odata-proxies')
|
|
226
226
|
.option(' --odata-x-service-refs')
|
|
227
227
|
.option(' --odata-foreign-keys')
|
|
228
228
|
.option(' --odata-v2-partial-constr')
|
|
229
|
-
.option(' --odata-
|
|
229
|
+
.option(' --odata-vocabularies <list>')
|
|
230
230
|
.option('-c, --csn')
|
|
231
231
|
.option('-f, --odata-format <format>', ['flat', 'structured'])
|
|
232
232
|
.option('-n, --sql-mapping <style>', ['plain', 'quoted', 'hdbcds'], { aliases: [ '--names' ] })
|
|
@@ -250,13 +250,14 @@ optionProcessor.command('O, toOdata')
|
|
|
250
250
|
structured : (V4 only) Render structured metadata
|
|
251
251
|
--odata-containment Generate Containment Navigation Properties for compositions (V4 only)
|
|
252
252
|
--odata-capabilities-pullup Rewrite @Capabilities annotations (V4 containment only).
|
|
253
|
+
--odata-openapi-hints Add various annotations to JSON API as input for OpenAPI generation.
|
|
253
254
|
--odata-proxies Generate Proxies for out-of-service navigation targets (V4 only).
|
|
254
255
|
--odata-x-service-refs Generate schema references (V4 only).
|
|
255
256
|
--odata-foreign-keys Render foreign keys in structured format (V4 only)
|
|
256
257
|
--odata-v2-partial-constr Render referential constraints also for partial principal key tuple
|
|
257
258
|
(Not spec compliant and V2 only)
|
|
258
|
-
--odata-
|
|
259
|
-
|
|
259
|
+
--odata-vocabularies <list> JSON array of adhoc vocabulary definitions
|
|
260
|
+
{ prefix: { alias, ns, uri }, ... }
|
|
260
261
|
-n, --sql-mapping <style> Annotate artifacts and elements with "@cds.persistence.name", which is
|
|
261
262
|
the corresponding database name (see "--sql-mapping" for "toHana or "toSql")
|
|
262
263
|
plain : (default) Names in uppercase and flattened with underscores
|
|
@@ -297,6 +298,7 @@ optionProcessor.command('Q, toSql')
|
|
|
297
298
|
.option(' --pre2134ReferentialConstraintNames')
|
|
298
299
|
.option(' --disable-hana-comments')
|
|
299
300
|
.option(' --generated-by-comment')
|
|
301
|
+
.option(' --better-sqlite-session-variables')
|
|
300
302
|
.help(`
|
|
301
303
|
Usage: cdsc toSql [options] <files...>
|
|
302
304
|
|
|
@@ -348,6 +350,7 @@ optionProcessor.command('Q, toSql')
|
|
|
348
350
|
--pre2134ReferentialConstraintNames Do not prefix the constraint identifier with "c__"
|
|
349
351
|
--disable-hana-comments Disable rendering of doc comments as SAP HANA comments.
|
|
350
352
|
--generated-by-comment Enable rendering of the initial SQL comment for HDI-based artifacts
|
|
353
|
+
--better-sqlite-session-variables Enable better-sqlite compatible rendering of $user. Only active if sqlDialect is \`sqlite\`
|
|
351
354
|
|
|
352
355
|
`);
|
|
353
356
|
|