@sap/cds-dk 9.2.1 → 9.3.0

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 (55) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/bin/bind.js +5 -8
  3. package/bin/up.js +12 -8
  4. package/lib/bind/cf.js +4 -0
  5. package/lib/bind/k8s.js +21 -0
  6. package/lib/bind/plugin.js +9 -0
  7. package/lib/build/buildTaskProviderFactory.js +8 -14
  8. package/lib/build/constants.js +1 -0
  9. package/lib/build/index.js +17 -2
  10. package/lib/build/plugin.js +5 -7
  11. package/lib/build/provider/hana/index.js +4 -4
  12. package/lib/env/schemas/cds-rc.js +2 -2
  13. package/lib/init/constants.js +3 -2
  14. package/lib/init/projectReader.js +2 -4
  15. package/lib/init/template/ams/index.js +1 -2
  16. package/lib/init/template/approuter/files/containerize.yaml.hbs +1 -1
  17. package/lib/init/template/approuter/index.js +1 -1
  18. package/lib/init/template/extension/files/.base/index.cds +6 -6
  19. package/lib/init/template/extension/index.js +5 -5
  20. package/lib/init/template/github-actions/files/{cf-github-deploy → github-deployment}/action.yaml +7 -5
  21. package/lib/init/template/github-actions/files/kyma-info/action.yaml +1 -1
  22. package/lib/init/template/github-actions/files/workflows/cf.yaml.hbs +10 -7
  23. package/lib/init/template/github-actions/files/workflows/kyma.yaml.hbs +6 -3
  24. package/lib/init/template/github-actions/files/workflows/test.yaml.hbs +5 -2
  25. package/lib/init/template/github-actions/index.js +8 -9
  26. package/lib/init/template/hana/index.js +2 -1
  27. package/lib/init/template/html5-repo/files/mta.yaml.hbs +5 -1
  28. package/lib/init/template/html5-repo/files/package.json.hbs +1 -1
  29. package/lib/init/template/html5-repo/index.js +24 -19
  30. package/lib/init/template/ias/files/mta.yaml.hbs +4 -3
  31. package/lib/init/template/ias/files/values.yaml.hbs +41 -40
  32. package/lib/init/template/mta/files/package.json +1 -1
  33. package/lib/init/template/nodejs/files/.vscode/extensions.json +0 -1
  34. package/lib/init/template/nodejs/files/package.json.hbs +3 -9
  35. package/lib/init/template/portal/files/mta.yaml.hbs +5 -1
  36. package/lib/init/template/portal/index.js +0 -1
  37. package/lib/init/template/sample/files/app/_i18n/i18n.properties +15 -0
  38. package/lib/init/template/sample/files/app/_i18n/i18n_de.properties +15 -0
  39. package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +14 -15
  40. package/lib/init/template/sample/files/app/browse/fiori-service.cds +44 -44
  41. package/lib/init/template/sample/files/app/common.cds +99 -84
  42. package/lib/init/template/sample/files/db/schema.cds +22 -17
  43. package/lib/init/template/sample/files/package.json.hbs +1 -3
  44. package/lib/init/template/sample/files/srv/admin-service.cds +4 -3
  45. package/lib/init/template/sample/files/srv/cat-service.cds +28 -11
  46. package/lib/init/template/tiny-sample/files/nodejs/db/schema.cds +3 -3
  47. package/lib/init/template/typescript/files/package.json +1 -1
  48. package/lib/init/template/ui5/index.js +22 -0
  49. package/lib/lint/eslintHelp.json +5 -3
  50. package/npm-shrinkwrap.json +13 -13
  51. package/package.json +1 -1
  52. package/lib/init/template/sample/files/javascript/admin-service.js.hbs +0 -24
  53. package/lib/init/template/sample/files/javascript/cat-service.js.hbs +0 -43
  54. package/lib/init/template/sample/files/typescript/admin-service.ts.hbs +0 -16
  55. package/lib/init/template/sample/files/typescript/cat-service.ts.hbs +0 -38
@@ -2,8 +2,11 @@
2
2
  Common Annotations shared by all apps
3
3
  */
4
4
 
5
- using { sap.capire.bookshop as my } from '../db/schema';
6
- using { sap.common, sap.common.Currencies } from '@sap/cds/common';
5
+ using {sap.capire.bookshop as my} from '../db/schema';
6
+ using {
7
+ sap.common,
8
+ sap.common.Currencies
9
+ } from '@sap/cds/common';
7
10
 
8
11
  ////////////////////////////////////////////////////////////////////////////
9
12
  //
@@ -11,27 +14,33 @@ using { sap.common, sap.common.Currencies } from '@sap/cds/common';
11
14
  //
12
15
  annotate my.Books with @(
13
16
  Common.SemanticKey: [ID],
14
- UI: {
15
- Identification: [{ Value: title }],
17
+ UI : {
18
+ Identification : [{Value: title}],
16
19
  SelectionFields: [
17
20
  ID,
18
21
  author_ID,
19
22
  price,
20
23
  currency_code
21
24
  ],
22
- LineItem: [
23
- { Value: ID, Label: '{i18n>Title}' },
24
- { Value: author.ID, Label: '{i18n>Author}' },
25
- { Value: genre.name },
26
- { Value: stock },
27
- { Value: price },
28
- { Value: currency.symbol },
25
+ LineItem : [
26
+ {
27
+ Value: ID,
28
+ Label: '{i18n>Title}'
29
+ },
30
+ {
31
+ Value: author.ID,
32
+ Label: '{i18n>Author}'
33
+ },
34
+ {Value: genre.name},
35
+ {Value: stock},
36
+ {Value: price},
37
+ {Value: currency.symbol},
29
38
  ]
30
39
  }
31
40
  ) {
32
- ID @Common: {
33
- SemanticObject: 'Books',
34
- Text: title,
41
+ ID @Common : {
42
+ SemanticObject : 'Books',
43
+ Text : title,
35
44
  TextArrangement: #TextOnly
36
45
  };
37
46
  author @ValueList.entity: 'Authors';
@@ -47,14 +56,19 @@ annotate Currencies with {
47
56
  // Books Elements
48
57
  //
49
58
  annotate my.Books with {
50
- ID @title: '{i18n>ID}';
51
- title @title: '{i18n>Title}';
52
- genre @title: '{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly };
53
- author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
54
- price @title: '{i18n>Price}' @Measures.ISOCurrency: currency_code;
55
- stock @title: '{i18n>Stock}';
56
- descr @title: '{i18n>Description}' @UI.MultiLineText;
57
- image @title: '{i18n>Image}';
59
+ ID @title: '{i18n>ID}';
60
+ title @title: '{i18n>Title}';
61
+ genre @title: '{i18n>Genre}' @Common : {
62
+ Text : genre.name,
63
+ TextArrangement: #TextOnly
64
+ };
65
+ author @title: '{i18n>Author}' @Common : {
66
+ Text : author.name,
67
+ TextArrangement: #TextOnly
68
+ };
69
+ price @title: '{i18n>Price}' @Measures.ISOCurrency: currency_code;
70
+ stock @title: '{i18n>Stock}';
71
+ descr @title: '{i18n>Description}' @UI.MultiLineText;
58
72
  }
59
73
 
60
74
  ////////////////////////////////////////////////////////////////////////////
@@ -63,35 +77,35 @@ annotate my.Books with {
63
77
  //
64
78
  annotate my.Genres with @(
65
79
  Common.SemanticKey: [name],
66
- UI: {
80
+ UI : {
67
81
  SelectionFields: [name],
68
- LineItem: [
69
- { Value: name },
82
+ LineItem : [
83
+ {Value: name},
70
84
  {
71
85
  Value: parent.name,
72
- Label: 'Main Genre'
86
+ Label: '{i18n>MainGenre}'
73
87
  },
74
88
  ],
75
89
  }
76
90
  );
77
91
 
78
92
  annotate my.Genres with {
79
- ID @Common.Text : name @Common.TextArrangement : #TextOnly;
93
+ ID @Common.Text: name @Common.TextArrangement: #TextOnly;
80
94
  }
81
95
 
82
96
  ////////////////////////////////////////////////////////////////////////////
83
97
  //
84
98
  // Genre Details
85
99
  //
86
- annotate my.Genres with @(UI : {
87
- Identification: [{ Value: name}],
88
- HeaderInfo: {
100
+ annotate my.Genres with @(UI: {
101
+ Identification: [{Value: name}],
102
+ HeaderInfo : {
89
103
  TypeName : '{i18n>Genre}',
90
104
  TypeNamePlural: '{i18n>Genres}',
91
- Title : { Value: name },
92
- Description : { Value: ID }
105
+ Title : {Value: name},
106
+ Description : {Value: ID}
93
107
  },
94
- Facets: [{
108
+ Facets : [{
95
109
  $Type : 'UI.ReferenceFacet',
96
110
  Label : '{i18n>SubGenres}',
97
111
  Target: 'children/@UI.LineItem'
@@ -113,21 +127,21 @@ annotate my.Genres with {
113
127
  //
114
128
  annotate my.Authors with @(
115
129
  Common.SemanticKey: [ID],
116
- UI: {
117
- Identification : [{ Value: name}],
118
- SelectionFields: [ name ],
130
+ UI : {
131
+ Identification : [{Value: name}],
132
+ SelectionFields: [name],
119
133
  LineItem : [
120
- { Value: ID },
121
- { Value: dateOfBirth },
122
- { Value: dateOfDeath },
123
- { Value: placeOfBirth },
124
- { Value: placeOfDeath },
134
+ {Value: ID},
135
+ {Value: dateOfBirth},
136
+ {Value: dateOfDeath},
137
+ {Value: placeOfBirth},
138
+ {Value: placeOfDeath},
125
139
  ],
126
140
  }
127
141
  ) {
128
142
  ID @Common: {
129
- SemanticObject: 'Authors',
130
- Text: name,
143
+ SemanticObject : 'Authors',
144
+ Text : name,
131
145
  TextArrangement: #TextOnly,
132
146
  };
133
147
  };
@@ -136,14 +150,14 @@ annotate my.Authors with @(
136
150
  //
137
151
  // Author Details
138
152
  //
139
- annotate my.Authors with @(UI : {
153
+ annotate my.Authors with @(UI: {
140
154
  HeaderInfo: {
141
155
  TypeName : '{i18n>Author}',
142
156
  TypeNamePlural: '{i18n>Authors}',
143
- Title : { Value: name },
144
- Description : { Value: dateOfBirth }
157
+ Title : {Value: name},
158
+ Description : {Value: dateOfBirth}
145
159
  },
146
- Facets: [{
160
+ Facets : [{
147
161
  $Type : 'UI.ReferenceFacet',
148
162
  Target: 'books/@UI.LineItem'
149
163
  }],
@@ -169,12 +183,15 @@ annotate my.Authors with {
169
183
  //
170
184
  annotate common.Languages with @(
171
185
  Common.SemanticKey: [code],
172
- Identification: [{ Value: code }],
173
- UI: {
174
- SelectionFields: [ name, descr ],
175
- LineItem: [
176
- { Value: code },
177
- { Value: name },
186
+ Identification : [{Value: code}],
187
+ UI : {
188
+ SelectionFields: [
189
+ name,
190
+ descr
191
+ ],
192
+ LineItem : [
193
+ {Value: code},
194
+ {Value: name},
178
195
  ],
179
196
  }
180
197
  );
@@ -183,22 +200,22 @@ annotate common.Languages with @(
183
200
  //
184
201
  // Language Details
185
202
  //
186
- annotate common.Languages with @(UI : {
187
- HeaderInfo: {
203
+ annotate common.Languages with @(UI: {
204
+ HeaderInfo : {
188
205
  TypeName : '{i18n>Language}',
189
206
  TypeNamePlural: '{i18n>Languages}',
190
- Title : { Value: name },
191
- Description : { Value: descr }
207
+ Title : {Value: name},
208
+ Description : {Value: descr}
192
209
  },
193
- Facets: [{
210
+ Facets : [{
194
211
  $Type : 'UI.ReferenceFacet',
195
212
  Label : '{i18n>Details}',
196
213
  Target: '@UI.FieldGroup#Details'
197
214
  }, ],
198
- FieldGroup #Details: {Data : [
199
- { Value: code },
200
- { Value: name },
201
- { Value: descr }
215
+ FieldGroup #Details: {Data: [
216
+ {Value: code},
217
+ {Value: name},
218
+ {Value: descr}
202
219
  ]},
203
220
  });
204
221
 
@@ -208,16 +225,16 @@ annotate common.Languages with @(UI : {
208
225
  //
209
226
  annotate common.Currencies with @(
210
227
  Common.SemanticKey: [code],
211
- Identification: [{ Value: code}],
212
- UI: {
228
+ Identification : [{Value: code}],
229
+ UI : {
213
230
  SelectionFields: [
214
231
  name,
215
232
  descr
216
233
  ],
217
- LineItem: [
218
- { Value: descr },
219
- { Value: symbol },
220
- { Value: code },
234
+ LineItem : [
235
+ {Value: descr},
236
+ {Value: symbol},
237
+ {Value: code},
221
238
  ],
222
239
  }
223
240
  );
@@ -226,24 +243,22 @@ annotate common.Currencies with @(
226
243
  //
227
244
  // Currency Details
228
245
  //
229
- annotate common.Currencies with @(UI : {
230
- HeaderInfo: {
246
+ annotate common.Currencies with @(UI: {
247
+ HeaderInfo : {
231
248
  TypeName : '{i18n>Currency}',
232
249
  TypeNamePlural: '{i18n>Currencies}',
233
- Title : { Value: descr },
234
- Description : { Value: code }
250
+ Title : {Value: descr},
251
+ Description : {Value: code}
235
252
  },
236
- Facets: [
237
- {
238
- $Type : 'UI.ReferenceFacet',
239
- Label : '{i18n>Details}',
240
- Target: '@UI.FieldGroup#Details'
241
- }
242
- ],
243
- FieldGroup #Details: {Data : [
244
- { Value: name },
245
- { Value: symbol },
246
- { Value: code },
247
- { Value: descr }
253
+ Facets : [{
254
+ $Type : 'UI.ReferenceFacet',
255
+ Label : '{i18n>Details}',
256
+ Target: '@UI.FieldGroup#Details'
257
+ }],
258
+ FieldGroup #Details: {Data: [
259
+ {Value: name},
260
+ {Value: symbol},
261
+ {Value: code},
262
+ {Value: descr}
248
263
  ]}
249
264
  });
@@ -1,31 +1,36 @@
1
- using { Currency, managed, sap } from '@sap/cds/common';
1
+ using {
2
+ Currency,
3
+ managed,
4
+ cuid,
5
+ sap
6
+ } from '@sap/cds/common';
7
+
2
8
  namespace sap.capire.bookshop;
3
9
 
4
- entity Books : managed {
5
- key ID : Integer;
6
- @mandatory title : localized String(111);
7
- descr : localized String(1111);
8
- @mandatory author : Association to Authors;
9
- genre : Association to Genres;
10
- stock : Integer;
11
- price : Decimal;
10
+ entity Books : managed, cuid {
11
+ title : localized String(111) @mandatory;
12
+ descr : localized String(1111);
13
+ author : Association to Authors @mandatory;
14
+ genre : Association to Genres;
15
+ stock : Integer;
16
+ price : Decimal;
12
17
  currency : Currency;
13
- image : LargeBinary @Core.MediaType : 'image/png';
14
18
  }
15
19
 
16
- entity Authors : managed {
17
- key ID : Integer;
18
- @mandatory name : String(111);
20
+ entity Authors : managed, cuid {
21
+ name : String(111) @mandatory;
19
22
  dateOfBirth : Date;
20
23
  dateOfDeath : Date;
21
24
  placeOfBirth : String;
22
25
  placeOfDeath : String;
23
- books : Association to many Books on books.author = $self;
26
+ books : Association to many Books
27
+ on books.author = $self;
24
28
  }
25
29
 
26
30
  /** Hierarchically organized Code List for Genres */
27
31
  entity Genres : sap.common.CodeList {
28
- key ID : Integer;
29
- parent : Association to Genres;
30
- children : Composition of many Genres on children.parent = $self;
32
+ key ID : Integer;
33
+ parent : Association to Genres;
34
+ children : Composition of many Genres
35
+ on children.parent = $self;
31
36
  }
@@ -1,3 +1 @@
1
- {
2
- "sapux": ["{{& appPath}}admin-books", "{{& appPath}}browse"]
3
- }
1
+ {}
@@ -1,5 +1,6 @@
1
- using { sap.capire.bookshop as my } from '../db/schema';
2
- service AdminService @(requires:'admin') {
3
- entity Books as projection on my.Books;
1
+ using {sap.capire.bookshop as my} from '../db/schema';
2
+
3
+ service AdminService @(requires: 'admin') {
4
+ entity Books as projection on my.Books;
4
5
  entity Authors as projection on my.Authors;
5
6
  }
@@ -1,20 +1,37 @@
1
- using { sap.capire.bookshop as my } from '../db/schema';
1
+ using {sap.capire.bookshop as my} from '../db/schema';
2
+
2
3
  service CatalogService {
3
4
 
4
5
  /** For displaying lists of Books */
5
- @readonly entity ListOfBooks as projection on Books
6
- excluding { descr };
6
+ @readonly
7
+ entity ListOfBooks as
8
+ projection on Books
9
+ excluding {
10
+ descr
11
+ };
7
12
 
8
13
  /** For display in details pages */
9
- @readonly entity Books as projection on my.Books { *,
10
- author.name as author
11
- } excluding { createdBy, modifiedBy };
14
+ @readonly
15
+ entity Books as
16
+ projection on my.Books {
17
+ *,
18
+ author.name as author
19
+ }
20
+ excluding {
21
+ createdBy,
22
+ modifiedBy
23
+ };
12
24
 
13
25
  @requires: 'authenticated-user'
14
- action submitOrder (
15
- book : Books:ID @mandatory,
16
- quantity: Integer @mandatory
17
- ) returns { stock: Integer };
26
+ action submitOrder(book : Books : ID @mandatory,
27
+ quantity : Integer @mandatory
28
+ ) returns {
29
+ stock : Integer
30
+ };
18
31
 
19
- event OrderedBook : { book: Books:ID; quantity: Integer; buyer: String };
32
+ event OrderedBook : {
33
+ book : Books : ID;
34
+ quantity : Integer;
35
+ buyer : String
36
+ };
20
37
  }
@@ -1,7 +1,7 @@
1
1
  namespace my.bookshop;
2
2
 
3
3
  entity Books {
4
- key ID : Integer;
5
- title : String;
6
- stock : Integer;
4
+ key ID : Integer;
5
+ title : String;
6
+ stock : Integer;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@cap-js/cds-types": "^0.13.0",
3
+ "@cap-js/cds-types": "^0.14.0",
4
4
  "@types/node": "^22.0.0",
5
5
  "tsx": "^4",
6
6
  "typescript": "^5"
@@ -0,0 +1,22 @@
1
+ const cds = require('../../../cds'), { exists, fs, path } = cds.utils
2
+ const { readProject } = require('../../projectReader')
3
+ const { merge } = require('../../merge')
4
+
5
+ module.exports = class extends require('../../plugin') {
6
+
7
+ static hasInProduction() {
8
+ const startPage = path.join(cds.root, cds.env.folders.app, 'index.html')
9
+ const packageJson = path.join(cds.root, 'package.json')
10
+ return exists(startPage) && fs.readFileSync(startPage).includes('https://sapui5') ||
11
+ exists(packageJson) && fs.readFileSync(packageJson).includes('"sapux":')
12
+ }
13
+
14
+ static help() {
15
+ return 'SAP UI5 integration'
16
+ }
17
+
18
+ async run() {
19
+ const project = readProject()
20
+ await merge({ sapux: project.apps.map(({ app }) => project.appPath + app) }).into('package.json')
21
+ }
22
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "9.32.0",
3
- "help": "\n# SYNOPSIS\n\n *cds lint* [options] file.js [file.js] [dir]\n\n Runs environment checks and/or checks the specified models\n based on the ESLint framework\n\n# OPTIONS\n \n Basic configuration:\n --no-config-lookup Disable look up for eslint.config.js\n -c, --config path::String Use this configuration instead of eslint.config.js, eslint.config.mjs, or eslint.config.cjs\n --inspect-config Open the config inspector with the current configuration\n --ext [String] Specify additional file extensions to lint\n --global [String] Define global variables\n --parser String Specify the parser to be used\n --parser-options Object Specify parser options\n \n Specify Rules and Plugins:\n --plugin [String] Specify plugins\n --rule Object Specify rules\n \n Fix Problems:\n --fix Automatically fix problems\n --fix-dry-run Automatically fix problems without saving the changes to the file system\n --fix-type Array Specify the types of fixes to apply (directive, problem, suggestion, layout)\n \n Ignore Files:\n --no-ignore Disable use of ignore files and patterns\n --ignore-pattern [String] Patterns of files to ignore\n \n Use stdin:\n --stdin Lint code provided on <STDIN> - default: false\n --stdin-filename String Specify filename to process STDIN as\n \n Handle Warnings:\n --quiet Report errors only - default: false\n --max-warnings Int Number of warnings to trigger nonzero exit code - default: -1\n \n Output:\n -o, --output-file path::String Specify file to write report to\n -f, --format String Use a specific output format - default: stylish\n --color, --no-color Force enabling/disabling of color\n \n Inline configuration comments:\n --no-inline-config Prevent comments from changing config or rules\n --report-unused-disable-directives Adds reported errors for unused eslint-disable and eslint-enable directives\n --report-unused-disable-directives-severity String Chooses severity level for reporting unused eslint-disable and eslint-enable directives - either: off, warn, error, 0, 1, or 2\n --report-unused-inline-configs String Adds reported errors for unused eslint inline config comments - either: off, warn, error, 0, 1, or 2\n \n Caching:\n --cache Only check changed files - default: false\n --cache-file path::String Path to the cache file. Deprecated: use --cache-location - default: .eslintcache\n --cache-location path::String Path to the cache file or directory\n --cache-strategy String Strategy to use for detecting changed files in the cache - either: metadata or content - default: metadata\n \n Suppressing Violations:\n --suppress-all Suppress all violations - default: false\n --suppress-rule [String] Suppress specific rules\n --suppressions-location path::String Specify the location of the suppressions file\n --prune-suppressions Prune unused suppressions - default: false\n --pass-on-unpruned-suppressions Ignore unused suppressions - default: false\n \n Miscellaneous:\n --init Run config initialization wizard - default: false\n --env-info Output execution environment information - default: false\n --no-error-on-unmatched-pattern Prevent errors when pattern is unmatched\n --exit-on-fatal-error Exit with exit code 2 in case of fatal error - default: false\n --no-warn-ignored Suppress warnings when the file list includes ignored files\n --pass-on-no-patterns Exit with exit code 0 in case no file patterns are passed\n --debug Output debugging information\n -h, --help Show help\n -v, --version Output the version number\n --print-config path::String Print the configuration for the given file\n --stats Add statistics to the lint report - default: false\n --flag [String] Enable a feature flag\n --mcp Start the ESLint MCP server\n \n",
2
+ "version": "9.34.0",
3
+ "help": "\n# SYNOPSIS\n\n *cds lint* [options] file.js [file.js] [dir]\n\n Runs environment checks and/or checks the specified models\n based on the ESLint framework\n\n# OPTIONS\n \n Basic configuration:\n --no-config-lookup Disable look up for eslint.config.js\n -c, --config path::String Use this configuration instead of eslint.config.js, eslint.config.mjs, or eslint.config.cjs\n --inspect-config Open the config inspector with the current configuration\n --ext [String] Specify additional file extensions to lint\n --global [String] Define global variables\n --parser String Specify the parser to be used\n --parser-options Object Specify parser options\n \n Specify Rules and Plugins:\n --plugin [String] Specify plugins\n --rule Object Specify rules\n \n Fix Problems:\n --fix Automatically fix problems\n --fix-dry-run Automatically fix problems without saving the changes to the file system\n --fix-type Array Specify the types of fixes to apply (directive, problem, suggestion, layout)\n \n Ignore Files:\n --no-ignore Disable use of ignore files and patterns\n --ignore-pattern [String] Patterns of files to ignore\n \n Use stdin:\n --stdin Lint code provided on <STDIN> - default: false\n --stdin-filename String Specify filename to process STDIN as\n \n Handle Warnings:\n --quiet Report errors only - default: false\n --max-warnings Int Number of warnings to trigger nonzero exit code - default: -1\n \n Output:\n -o, --output-file path::String Specify file to write report to\n -f, --format String Use a specific output format - default: stylish\n --color, --no-color Force enabling/disabling of color\n \n Inline configuration comments:\n --no-inline-config Prevent comments from changing config or rules\n --report-unused-disable-directives Adds reported errors for unused eslint-disable and eslint-enable directives\n --report-unused-disable-directives-severity String Chooses severity level for reporting unused eslint-disable and eslint-enable directives - either: off, warn, error, 0, 1, or 2\n --report-unused-inline-configs String Adds reported errors for unused eslint inline config comments - either: off, warn, error, 0, 1, or 2\n \n Caching:\n --cache Only check changed files - default: false\n --cache-file path::String Path to the cache file. Deprecated: use --cache-location - default: .eslintcache\n --cache-location path::String Path to the cache file or directory\n --cache-strategy String Strategy to use for detecting changed files in the cache - either: metadata or content - default: metadata\n \n Suppressing Violations:\n --suppress-all Suppress all violations - default: false\n --suppress-rule [String] Suppress specific rules\n --suppressions-location path::String Specify the location of the suppressions file\n --prune-suppressions Prune unused suppressions - default: false\n --pass-on-unpruned-suppressions Ignore unused suppressions - default: false\n \n Miscellaneous:\n --init Run config initialization wizard - default: false\n --env-info Output execution environment information - default: false\n --no-error-on-unmatched-pattern Prevent errors when pattern is unmatched\n --exit-on-fatal-error Exit with exit code 2 in case of fatal error - default: false\n --no-warn-ignored Suppress warnings when the file list includes ignored files\n --pass-on-no-patterns Exit with exit code 0 in case no file patterns are passed\n --debug Output debugging information\n -h, --help Show help\n -v, --version Output the version number\n --print-config path::String Print the configuration for the given file\n --stats Add statistics to the lint report - default: false\n --flag [String] Enable a feature flag\n --mcp Start the ESLint MCP server\n --concurrency Int|String Number of linting threads, auto to choose automatically, off for no multithreading - default: off\n \n",
4
4
  "options": [
5
5
  "--config",
6
6
  "--output-file",
@@ -24,7 +24,8 @@
24
24
  "--suppress-rule",
25
25
  "--suppressions-location",
26
26
  "--print-config",
27
- "--flag"
27
+ "--flag",
28
+ "--concurrency"
28
29
  ],
29
30
  "shortcuts": [
30
31
  "-c",
@@ -50,6 +51,7 @@
50
51
  null,
51
52
  null,
52
53
  null,
54
+ null,
53
55
  "-v",
54
56
  "-h"
55
57
  ],
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "9.2.1",
3
+ "version": "9.3.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@sap/cds-dk",
9
- "version": "9.2.1",
9
+ "version": "9.3.0",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "dependencies": {
12
12
  "@cap-js/asyncapi": "^1.0.0",
@@ -42,8 +42,8 @@
42
42
  }
43
43
  },
44
44
  "node_modules/@cap-js/db-service": {
45
- "version": "2.3.0",
46
- "integrity": "sha512-KkYrnI05bx0PvwP5jxEUos8UQ+XYPucUMQt3i0muQXWJw3rEkWvEArvOwCYjTNnjzHqtVQfpPXsy1+ehkHUrWg==",
45
+ "version": "2.4.0",
46
+ "integrity": "sha512-tWZUkgAPgZQIVu3xownD9cA9joXPI84KDstx3ZezOxXJuRsapgM2QEs0TXwQK5XLG43FUAsGO7wVJPoZ29ZH2Q==",
47
47
  "devOptional": true,
48
48
  "license": "Apache-2.0",
49
49
  "dependencies": {
@@ -78,8 +78,8 @@
78
78
  }
79
79
  },
80
80
  "node_modules/@eslint/js": {
81
- "version": "9.33.0",
82
- "integrity": "sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==",
81
+ "version": "9.34.0",
82
+ "integrity": "sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==",
83
83
  "license": "MIT",
84
84
  "peer": true,
85
85
  "engines": {
@@ -90,11 +90,11 @@
90
90
  }
91
91
  },
92
92
  "node_modules/@sap/cds": {
93
- "version": "9.2.1",
94
- "integrity": "sha512-0zjjZGlBvcJMyVj48hTs6Q22/w9hNnJR6O88rGoEj4R87uaP4uM5gFLf3PDnPDUwkAeveVHgJRnWPqDGqIMgvA==",
93
+ "version": "9.3.0",
94
+ "integrity": "sha512-2JaY4AlYvDP88DpZj5vo7B+9+r2ICmY5ktcCxHpnPoC9cmauYmXQtSn6gfuDwuBAWnFMSQEMu6qXz+7Yt8o7mQ==",
95
95
  "license": "SEE LICENSE IN LICENSE",
96
96
  "dependencies": {
97
- "@sap/cds-compiler": "^6",
97
+ "@sap/cds-compiler": "^6.1",
98
98
  "@sap/cds-fiori": "^2",
99
99
  "js-yaml": "^4.1.0"
100
100
  },
@@ -120,8 +120,8 @@
120
120
  }
121
121
  },
122
122
  "node_modules/@sap/cds-compiler": {
123
- "version": "6.2.2",
124
- "integrity": "sha512-LqRNfBsWnEJpXVJ6/v52VqAdelWoETLbECMPcy7BfoHE63DGBpKA/ZIgoH11t7vUm7GYQDcSfR7ryy02Q/fP7A==",
123
+ "version": "6.3.0",
124
+ "integrity": "sha512-4HhZuiKa8SztqtjfM9Iey7yb2U6xQGzUbjib3JXcSSP6AJ6Bz0gViliTwf8dASPTLRtv7HU82277m4uqxU2qjw==",
125
125
  "license": "SEE LICENSE IN LICENSE",
126
126
  "bin": {
127
127
  "cdsc": "bin/cdsc.js",
@@ -142,8 +142,8 @@
142
142
  }
143
143
  },
144
144
  "node_modules/@sap/cds-mtxs": {
145
- "version": "3.2.0",
146
- "integrity": "sha512-8X+fK0rsnOaKZpettVAXuzCJT9MRebpuzN1JjNEWPiYVafvIjXIQc2diYgq8rtzhfdFWk6QNlZUjMM7jLgNfsw==",
145
+ "version": "3.3.0",
146
+ "integrity": "sha512-udIzKk+qUoYWLJKbGUJm0csuZP5r54msnTNy11bFDsuESio07ppgDkCIk+oGXCjsJLeoLZULCGgFvifLRi0ATg==",
147
147
  "license": "SEE LICENSE IN LICENSE",
148
148
  "dependencies": {
149
149
  "@sap/hdi-deploy": "^5"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "9.2.1",
3
+ "version": "9.3.0",
4
4
  "description": "Command line client and development toolkit for the SAP Cloud Application Programming Model",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [
@@ -1,24 +0,0 @@
1
- {{#isESM}}
2
- import cds from '@sap/cds'
3
-
4
- export class AdminService extends cds.ApplicationService { init() {
5
- {{/isESM}}
6
- {{^isESM}}
7
- const cds = require('@sap/cds')
8
-
9
- module.exports = class AdminService extends cds.ApplicationService { init() {
10
- {{/isESM}}
11
-
12
- const { Books } = this.entities
13
-
14
- /**
15
- * Generate IDs for new Books drafts
16
- */
17
- this.before ('NEW', Books.drafts, async (req) => {
18
- if (req.data.ID) return
19
- const { ID:id1 } = await SELECT.one.from(Books).columns('max(ID) as ID')
20
- const { ID:id2 } = await SELECT.one.from(Books.drafts).columns('max(ID) as ID')
21
- req.data.ID = Math.max(id1||0, id2||0) + 1
22
- })
23
- return super.init()
24
- }}
@@ -1,43 +0,0 @@
1
- {{#isESM}}
2
- import cds from '@sap/cds'
3
-
4
- export class CatalogService extends cds.ApplicationService { init() {
5
- {{/isESM}}
6
- {{^isESM}}
7
- const cds = require('@sap/cds')
8
-
9
- module.exports = class CatalogService extends cds.ApplicationService { init() {
10
- {{/isESM}}
11
-
12
- const { Books } = cds.entities('sap.capire.bookshop')
13
- const { ListOfBooks } = this.entities
14
-
15
- // Add some discount for overstocked books
16
- this.after('each', ListOfBooks, book => {
17
- if (book.stock > 111) book.title += ` -- 11% discount!`
18
- })
19
-
20
- // Reduce stock of ordered books if available stock suffices
21
- this.on('submitOrder', async req => {
22
- let { book:id, quantity } = req.data
23
- let book = await SELECT.one.from (Books, id, b => b.stock)
24
-
25
- // Validate input data
26
- if (!book) return req.error (404, `Book #${id} doesn't exist`)
27
- if (quantity < 1) return req.error (400, `quantity has to be 1 or more`)
28
- if (!book.stock || quantity > book.stock) return req.error (409, `${quantity} exceeds stock for book #${id}`)
29
-
30
- // Reduce stock in database and return updated stock value
31
- await UPDATE (Books, id) .with ({ stock: book.stock -= quantity })
32
- return book
33
- })
34
-
35
- // Emit event when an order has been submitted
36
- this.after('submitOrder', async (_,req) => {
37
- let { book, quantity } = req.data
38
- await this.emit('OrderedBook', { book, quantity, buyer: req.user.id })
39
- })
40
-
41
- // Delegate requests to the underlying generic service
42
- return super.init()
43
- }}