@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.
Files changed (77) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/bin/bind.js +4 -0
  3. package/bin/build.js +1 -0
  4. package/bin/compile/index.js +12 -11
  5. package/bin/completion/index.js +21 -10
  6. package/bin/completion/scripts/cds.fish +179 -127
  7. package/bin/completion/scripts/cds.ps1 +88 -14
  8. package/bin/completion/scripts/cds.sh +71 -5
  9. package/bin/completion/scripts/cds.zsh +81 -15
  10. package/bin/completion/templates/cds-tmpl.ps1 +15 -6
  11. package/bin/deploy/index.js +7 -3
  12. package/bin/env.js +4 -1
  13. package/bin/export.js +9 -1
  14. package/bin/import.js +4 -1
  15. package/bin/init.js +1 -0
  16. package/bin/inspect.js +3 -1
  17. package/bin/lint.js +5 -3
  18. package/bin/minify.js +6 -1
  19. package/bin/repl.js +11 -2
  20. package/bin/run.js +12 -1
  21. package/bin/serve.js +13 -2
  22. package/bin/up.js +4 -1
  23. package/bin/util/containerize.js +2 -0
  24. package/bin/watch/index.js +8 -1
  25. package/lib/build/util.js +2 -4
  26. package/lib/init/constants.js +1 -1
  27. package/lib/init/template/data/as-json.js +3 -0
  28. package/node_modules/@cap-js/db-service/CHANGELOG.md +17 -0
  29. package/node_modules/@cap-js/db-service/lib/common/generic-pool.js +4 -7
  30. package/node_modules/@cap-js/db-service/lib/cqn2pql.js +1 -1
  31. package/node_modules/@cap-js/db-service/lib/cqn2sql.js +15 -11
  32. package/node_modules/@cap-js/db-service/lib/cqn4sql.js +119 -19
  33. package/node_modules/@cap-js/db-service/lib/infer/index.js +27 -16
  34. package/node_modules/@cap-js/db-service/lib/recursion-guard.js +40 -0
  35. package/node_modules/@cap-js/db-service/lib/search.js +1 -1
  36. package/node_modules/@cap-js/db-service/package.json +1 -1
  37. package/node_modules/@cap-js/sqlite/CHANGELOG.md +19 -0
  38. package/node_modules/@cap-js/sqlite/lib/SQLiteService.js +110 -14
  39. package/node_modules/@cap-js/sqlite/package.json +3 -3
  40. package/node_modules/@sap/cds-compiler/CHANGELOG.md +15 -0
  41. package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +7 -3
  42. package/node_modules/@sap/cds-compiler/lib/model/csnUtils.js +2 -0
  43. package/node_modules/@sap/cds-compiler/lib/transform/db/applyTransformations.js +12 -0
  44. package/node_modules/@sap/cds-compiler/lib/transform/db/associations.js +5 -3
  45. package/node_modules/@sap/cds-compiler/lib/transform/db/flattening.js +4 -3
  46. package/node_modules/@sap/cds-compiler/lib/transform/effective/flattening.js +17 -1
  47. package/node_modules/@sap/cds-compiler/lib/transform/effective/main.js +19 -0
  48. package/node_modules/@sap/cds-compiler/lib/transform/fioriTreeViews.js +12 -1
  49. package/node_modules/@sap/cds-compiler/lib/transform/forRelationalDB.js +1 -1
  50. package/node_modules/@sap/cds-compiler/lib/transform/odata/adaptAnnotationRefs.js +11 -5
  51. package/node_modules/@sap/cds-compiler/lib/transform/translateAssocsToJoins.js +29 -2
  52. package/node_modules/@sap/cds-compiler/package.json +1 -1
  53. package/node_modules/@sap/cds-mtxs/CHANGELOG.md +34 -0
  54. package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +26 -5
  55. package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +3 -0
  56. package/node_modules/@sap/cds-mtxs/lib/utils.js +5 -4
  57. package/node_modules/@sap/cds-mtxs/package.json +1 -1
  58. package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +62 -7
  59. package/node_modules/@sap/cds-mtxs/srv/cf/saas-provisioning-service.js +1 -1
  60. package/node_modules/@sap/cds-mtxs/srv/cf/sms-provisioning-service.js +23 -3
  61. package/node_modules/@sap/cds-mtxs/srv/extensibility/compat/update.js +15 -0
  62. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/annotations.js +2 -2
  63. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/config.js +2 -0
  64. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +2 -0
  65. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/protected-namespace.js +45 -0
  66. package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +8 -3
  67. package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +49 -10
  68. package/node_modules/@sap/cds-mtxs/srv/model-provider.js +11 -2
  69. package/node_modules/@sap/cds-mtxs/srv/plugins/common.js +19 -12
  70. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi-ctnr-mgr.js +6 -3
  71. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/serverless.js +271 -0
  72. package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +3 -2
  73. package/node_modules/@sap/cds-mtxs/srv/worker/job-worker-pool.js +212 -0
  74. package/node_modules/@sap/cds-mtxs/srv/worker/job-worker.js +61 -0
  75. package/package.json +2 -2
  76. /package/node_modules/@sap/cds-mtxs/srv/worker/{pool.js → model-worker-pool.js} +0 -0
  77. /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
  }),
@@ -2,17 +2,18 @@ const { FILE, DIR } = require('../completion');
2
2
 
3
3
  module.exports = Object.assign ( compile, {
4
4
  staticCompletions: () => ({
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
- '_': FILE('cds,json'),
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',
@@ -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
- return `compgen -f -- "$current" | grep -E '\\.(${sentinel.ext.join('|')})$'`;
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 '_files';
241
- return `_files -g '(${sentinel.ext.map(e => `*.${e}`).join('|')})'`;
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
- return `string match -r '\\.(${sentinel.ext.join('|')})\\$' -- (__fish_complete_path)`;
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
- return ` ${flag}) ${comp} ; return ;;`;
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()) return completionFs.readdir(word, { files: false });
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