@sap/cds-dk 10.1.0 → 10.1.1
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 +12 -0
- package/bin/bind.js +4 -0
- package/bin/build.js +1 -0
- package/bin/compile/index.js +12 -11
- package/bin/completion/index.js +21 -10
- package/bin/completion/scripts/cds.fish +179 -127
- package/bin/completion/scripts/cds.ps1 +88 -14
- package/bin/completion/scripts/cds.sh +71 -5
- package/bin/completion/scripts/cds.zsh +81 -15
- package/bin/completion/templates/cds-tmpl.ps1 +15 -6
- package/bin/deploy/index.js +7 -3
- package/bin/env.js +4 -1
- package/bin/export.js +9 -1
- package/bin/import.js +4 -1
- package/bin/init.js +1 -0
- package/bin/inspect.js +3 -1
- package/bin/lint.js +5 -3
- package/bin/minify.js +6 -1
- package/bin/repl.js +11 -2
- package/bin/run.js +12 -1
- package/bin/serve.js +13 -2
- package/bin/up.js +4 -1
- package/bin/util/containerize.js +2 -0
- package/bin/watch/index.js +8 -1
- package/lib/build/util.js +2 -4
- package/lib/init/constants.js +1 -1
- package/lib/init/template/data/as-json.js +3 -0
- package/node_modules/@cap-js/db-service/CHANGELOG.md +17 -0
- package/node_modules/@cap-js/db-service/lib/common/generic-pool.js +4 -7
- package/node_modules/@cap-js/db-service/lib/cqn2pql.js +1 -1
- package/node_modules/@cap-js/db-service/lib/cqn2sql.js +15 -11
- package/node_modules/@cap-js/db-service/lib/cqn4sql.js +119 -19
- package/node_modules/@cap-js/db-service/lib/infer/index.js +27 -16
- package/node_modules/@cap-js/db-service/lib/recursion-guard.js +40 -0
- package/node_modules/@cap-js/db-service/lib/search.js +1 -1
- package/node_modules/@cap-js/db-service/package.json +1 -1
- package/node_modules/@cap-js/sqlite/CHANGELOG.md +19 -0
- package/node_modules/@cap-js/sqlite/lib/SQLiteService.js +110 -14
- package/node_modules/@cap-js/sqlite/package.json +3 -3
- package/node_modules/@sap/cds-compiler/CHANGELOG.md +15 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +7 -3
- package/node_modules/@sap/cds-compiler/lib/model/csnUtils.js +2 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/applyTransformations.js +12 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/associations.js +5 -3
- package/node_modules/@sap/cds-compiler/lib/transform/db/flattening.js +4 -3
- package/node_modules/@sap/cds-compiler/lib/transform/effective/flattening.js +17 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/main.js +19 -0
- package/node_modules/@sap/cds-compiler/lib/transform/fioriTreeViews.js +12 -1
- package/node_modules/@sap/cds-compiler/lib/transform/forRelationalDB.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/odata/adaptAnnotationRefs.js +11 -5
- package/node_modules/@sap/cds-compiler/lib/transform/translateAssocsToJoins.js +29 -2
- package/node_modules/@sap/cds-compiler/package.json +1 -1
- package/node_modules/@sap/cds-mtxs/CHANGELOG.md +34 -0
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +26 -5
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +3 -0
- package/node_modules/@sap/cds-mtxs/lib/utils.js +5 -4
- package/node_modules/@sap/cds-mtxs/package.json +1 -1
- package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +62 -7
- package/node_modules/@sap/cds-mtxs/srv/cf/saas-provisioning-service.js +1 -1
- package/node_modules/@sap/cds-mtxs/srv/cf/sms-provisioning-service.js +23 -3
- package/node_modules/@sap/cds-mtxs/srv/extensibility/compat/update.js +15 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/annotations.js +2 -2
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/config.js +2 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +2 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/protected-namespace.js +45 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +8 -3
- package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +49 -10
- package/node_modules/@sap/cds-mtxs/srv/model-provider.js +11 -2
- package/node_modules/@sap/cds-mtxs/srv/plugins/common.js +19 -12
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi-ctnr-mgr.js +6 -3
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/serverless.js +271 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +3 -2
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker-pool.js +212 -0
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker.js +61 -0
- package/package.json +2 -2
- /package/node_modules/@sap/cds-mtxs/srv/worker/{pool.js → model-worker-pool.js} +0 -0
- /package/node_modules/@sap/cds-mtxs/srv/worker/{load.js → model-worker.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
8
8
|
|
|
9
|
+
## Version 10.1.1 - 2026-09-09
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Various `cds` commands now offer shell completions for their options, including folder suggestions for positional arguments and path options like `--run`, `--from`, and `--with`.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- `cds up` now forwards `BP_DEPENDENCY_MIRROR_*` variables to Paketo buildpacks.
|
|
18
|
+
- `cds init` uses CAP Java 5.1.1
|
|
19
|
+
- `cds add data` no longer includes excluded bounds when generating scaled decimals for open `@assert.range` intervals.
|
|
20
|
+
|
|
9
21
|
## Version 10.1.0 - 2026-09-03
|
|
10
22
|
|
|
11
23
|
### Added
|
package/bin/bind.js
CHANGED
|
@@ -4,8 +4,12 @@ const { FILE } = require('./completion')
|
|
|
4
4
|
module.exports = Object.assign(cds_bind, {
|
|
5
5
|
staticCompletions: () => ({
|
|
6
6
|
'--on': ['cf', 'k8s'],
|
|
7
|
+
'--for': ['development', 'production', 'hybrid'],
|
|
8
|
+
'-4': ['development', 'production', 'hybrid'],
|
|
7
9
|
'--out': FILE(),
|
|
8
10
|
'--output-file': FILE(),
|
|
11
|
+
'--credentials': FILE('json'),
|
|
12
|
+
'-c': FILE('json'),
|
|
9
13
|
}),
|
|
10
14
|
options: ['--to', '--for', '--on', '--kind', '--out', '--to-app-services', '--credentials', '--output-file'],
|
|
11
15
|
flags: ['--exec', '--no-create-service-key'],
|
package/bin/build.js
CHANGED
|
@@ -4,6 +4,7 @@ module.exports = Object.assign(build, {
|
|
|
4
4
|
staticCompletions: () => ({
|
|
5
5
|
'--for': ['hana', 'helm', 'java', 'mtx', 'mtx-extension', 'mtx-sidecar', 'nodejs'],
|
|
6
6
|
'--log-level':['debug', 'info', 'warn', 'error'],
|
|
7
|
+
'--project': DIR(),
|
|
7
8
|
'--dest': DIR(),
|
|
8
9
|
'--src': DIR(),
|
|
9
10
|
}),
|
package/bin/compile/index.js
CHANGED
|
@@ -2,17 +2,18 @@ const { FILE, DIR } = require('../completion');
|
|
|
2
2
|
|
|
3
3
|
module.exports = Object.assign ( compile, {
|
|
4
4
|
staticCompletions: () => ({
|
|
5
|
-
'--to':
|
|
6
|
-
'--for':
|
|
7
|
-
'--dialect':
|
|
8
|
-
'--sql-dialect':
|
|
9
|
-
'--log-level':
|
|
10
|
-
'--odata-version':['4.0', '4.01'],
|
|
11
|
-
'--flavor':
|
|
12
|
-
'--service':
|
|
13
|
-
'--lang':
|
|
14
|
-
'--dest':
|
|
15
|
-
'
|
|
5
|
+
'--to': ['json', 'yml', 'edm', 'edmx', 'edmx-v2', 'edmx-v4', 'sql', 'hdbtable', 'hana', 'cdl', 'xsuaa', 'openapi', 'asyncapi'],
|
|
6
|
+
'--for': ['odata', 'sql'],
|
|
7
|
+
'--dialect': ['sqlite', 'h2', 'postgres', 'hana'],
|
|
8
|
+
'--sql-dialect': ['sqlite', 'h2', 'postgres', 'hana'],
|
|
9
|
+
'--log-level': ['debug', 'info', 'warn', 'error'],
|
|
10
|
+
'--odata-version': ['4.0', '4.01'],
|
|
11
|
+
'--flavor': ['sources', 'files', 'parsed', 'xtended', 'inferred'],
|
|
12
|
+
'--service': ['all'],
|
|
13
|
+
'--lang': ['all'],
|
|
14
|
+
'--dest': DIR(),
|
|
15
|
+
'--openapi:config-file': FILE('json'),
|
|
16
|
+
'_': FILE('cds,json', { dirs: true }),
|
|
16
17
|
}),
|
|
17
18
|
options: [
|
|
18
19
|
'--from',
|
package/bin/completion/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const completionFs = require('./completionFs');
|
|
|
7
7
|
const completionSetup = require('../../lib/init/template/completion/completionSetup');
|
|
8
8
|
|
|
9
9
|
// Sentinel factories — returned by staticCompletions() to mark special argument types.
|
|
10
|
-
const FILE = (exts) => exts ? { type: ':file', ext: exts.split(',').map(e => e.trim()) } : ':file';
|
|
10
|
+
const FILE = (exts, { dirs } = {}) => exts ? { type: ':file', ext: exts.split(',').map(e => e.trim()), dirs: dirs ?? false } : ':file';
|
|
11
11
|
const DIR = () => ':dir';
|
|
12
12
|
const COMMA = (values) => ({ type: ':comma', values });
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ const POSITIONAL_KEY = '_';
|
|
|
16
16
|
|
|
17
17
|
const isFileSentinel = s => s === ':file' || s === ':dir' || (s?.type === ':file' && Array.isArray(s.ext));
|
|
18
18
|
const fileRegex = s => s.ext ? new RegExp(`\\.(${s.ext.join('|')})$`) : null;
|
|
19
|
-
const filePs1 = s => s.ext ? `':file:${s.ext.join(',')}'` : `'${s}'`;
|
|
19
|
+
const filePs1 = s => s.ext ? (s.dirs ? `':file+dir:${s.ext.join(',')}'` : `':file:${s.ext.join(',')}'`) : `'${s}'`;
|
|
20
20
|
|
|
21
21
|
module.exports = Object.assign(completion, {
|
|
22
22
|
staticCompletions: () => ({ '--shell': completionSetup.supportedShells }),
|
|
@@ -232,19 +232,29 @@ function shortcutCaseBlock(shortcuts, indent = ' ') {
|
|
|
232
232
|
// Bash: expression that completes to files matching a sentinel's extensions.
|
|
233
233
|
function bashFileExpr(sentinel) {
|
|
234
234
|
if (!sentinel.ext) return 'compgen -f -- "$current"';
|
|
235
|
-
|
|
235
|
+
const files = `compgen -f -- "$current" | grep -E '\\.(${sentinel.ext.join('|')})$'`;
|
|
236
|
+
if (!sentinel.dirs) return files;
|
|
237
|
+
return `{ ${files}; compgen -d -- "$current"; }`;
|
|
236
238
|
}
|
|
237
239
|
|
|
238
240
|
// Zsh: compadd call that completes to files matching a sentinel's extensions.
|
|
241
|
+
// _path_files is used instead of _files to avoid the '*:all-files' fallback tier
|
|
242
|
+
// that _files always appends, which would show every file type regardless of the glob.
|
|
243
|
+
// Multiple extensions are passed as space-separated patterns in one -g argument
|
|
244
|
+
// (e.g. '*.cds *.json') — _path_files word-splits the value, no extendedglob needed.
|
|
239
245
|
function zshFileComp(sentinel) {
|
|
240
|
-
if (!sentinel.ext) return '
|
|
241
|
-
|
|
246
|
+
if (!sentinel.ext) return '_path_files';
|
|
247
|
+
const glob = sentinel.ext.map(e => `*.${e}`).join(' ');
|
|
248
|
+
if (!sentinel.dirs) return `_path_files -g '${glob}'`;
|
|
249
|
+
return `_path_files -g '${glob}' -/`;
|
|
242
250
|
}
|
|
243
251
|
|
|
244
252
|
// Fish: expression that completes to files matching a sentinel's extensions.
|
|
245
253
|
function fishFileComp(sentinel) {
|
|
246
254
|
if (!sentinel.ext) return '__fish_complete_path';
|
|
247
|
-
|
|
255
|
+
const files = `string match -r '\\.(${sentinel.ext.join('|')})\\$' -- (__fish_complete_path)`;
|
|
256
|
+
if (!sentinel.dirs) return files;
|
|
257
|
+
return `${files}; __fish_complete_directories`;
|
|
248
258
|
}
|
|
249
259
|
|
|
250
260
|
// Reads a shell template and substitutes {{PLACEHOLDER}} tokens.
|
|
@@ -293,7 +303,8 @@ function zshOptionValueCases(commandMap) {
|
|
|
293
303
|
const comp = sentinel
|
|
294
304
|
? (sentinel === DIR() ? '_files -/' : zshFileComp(sentinel))
|
|
295
305
|
: `compadd -S '' -- ${shellQuoteList([...val].sort())}`;
|
|
296
|
-
|
|
306
|
+
const prefix = sentinel ? `compstate[nomatches]='' ; ` : '';
|
|
307
|
+
return ` ${flag}) ${prefix}${comp} ; return ;;`;
|
|
297
308
|
});
|
|
298
309
|
}
|
|
299
310
|
|
|
@@ -435,7 +446,7 @@ async function generateZsh(map) {
|
|
|
435
446
|
const sentinel = e.fileCases?.[POSITIONAL_KEY];
|
|
436
447
|
if (!sentinel) return '';
|
|
437
448
|
const comp = sentinel === DIR() ? '_files -/' : zshFileComp(sentinel);
|
|
438
|
-
return ` ${cmd}) ${comp} ; return ;;`;
|
|
449
|
+
return ` ${cmd}) compstate[nomatches]='' ; ${comp} ; return ;;`;
|
|
439
450
|
})
|
|
440
451
|
.filter(Boolean)
|
|
441
452
|
.join('\n');
|
|
@@ -643,8 +654,8 @@ async function getCompletions(cdsCmd, previousWord, currentWord, segments) {
|
|
|
643
654
|
|
|
644
655
|
// Reads the file/dir sentinel for a resolved entry and returns matching paths.
|
|
645
656
|
const resolveSentinel = (sentinel, word) => {
|
|
646
|
-
if (sentinel === DIR())
|
|
647
|
-
if (isFileSentinel(sentinel)) return completionFs.readdir(word, fileRegex(sentinel) ? { fileRegex: fileRegex(sentinel) } : {});
|
|
657
|
+
if (sentinel === DIR()) return completionFs.readdir(word, { files: false });
|
|
658
|
+
if (isFileSentinel(sentinel)) return completionFs.readdir(word, fileRegex(sentinel) ? { fileRegex: fileRegex(sentinel), folders: sentinel.dirs ?? false } : {});
|
|
648
659
|
return null;
|
|
649
660
|
};
|
|
650
661
|
|