@sap/cds-dk 8.9.5 → 9.0.5
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 +101 -2012
- package/LICENSE +15 -21
- package/bin/bind.js +1 -1
- package/bin/build.js +35 -37
- package/bin/cds.js +13 -30
- package/bin/compile/index.js +2 -2
- package/bin/debug.js +27 -7
- package/bin/deploy/index.js +6 -23
- package/bin/deploy/to-hana.js +4 -2
- package/bin/help.js +5 -3
- package/bin/init.js +1 -1
- package/bin/up.js +45 -12
- package/bin/watch.js +45 -63
- package/lib/bind/cf.js +2 -1
- package/lib/bind/k8s.js +2 -2
- package/lib/bind/plugin.js +1 -1
- package/lib/bind/shared.js +16 -25
- package/lib/build/buildTaskEngine.js +26 -10
- package/lib/build/buildTaskFactory.js +3 -2
- package/lib/build/buildTaskProvider.js +18 -7
- package/lib/build/buildTaskProviderFactory.js +35 -13
- package/lib/build/constants.js +4 -0
- package/lib/build/index.js +1 -1
- package/lib/build/plugin.js +89 -54
- package/lib/build/plugins/helm/files/subcharts/web-application/Chart.yaml +3 -1
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/_helpers.tpl +4 -2
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/api-rule.yaml +4 -2
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/deployment.yaml +18 -1
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/service-binding.yaml +0 -1
- package/lib/build/plugins/helm/files/subcharts/web-application/values.schema.json +34 -2
- package/lib/build/plugins/helm/files/subcharts/web-application/values.yaml +9 -2
- package/lib/build/plugins/helm/index.js +2 -1
- package/lib/build/plugins.js +24 -10
- package/lib/build/provider/edmxBuildPlugin.js +1 -11
- package/lib/build/provider/fiori/index.js +4 -4
- package/lib/build/provider/hana/index.js +12 -5
- package/lib/build/provider/hana/template/package.json +1 -1
- package/lib/build/provider/internalBuildPlugin.js +1 -1
- package/lib/build/provider/internalBuildTaskProvider.js +3 -24
- package/lib/build/provider/java/index.js +1 -1
- package/lib/build/provider/mtx-extension/index.js +15 -8
- package/lib/build/provider/nodejs/index.js +28 -6
- package/lib/build/util.js +186 -125
- package/lib/deploy/index.js +5 -0
- package/lib/deploy/to-hana/hana.js +27 -33
- package/lib/deploy/to-hana/hdiDeployUtil.js +2 -2
- package/lib/import/odata/v2parser.js +34 -3
- package/lib/import/openapi/importOpenAPI.js +4 -0
- package/lib/index.js +2 -11
- package/lib/init/constants.js +1 -2
- package/lib/init/merge.js +101 -77
- package/lib/init/mvn.js +3 -3
- package/lib/init/projectReader.js +1 -1
- package/lib/init/template/ams/files/mta.yaml.hbs +6 -1
- package/lib/init/template/ams/files/package.json.hbs +1 -1
- package/lib/init/template/approuter/files/mta.yaml.hbs +5 -0
- package/lib/init/template/cf-manifest/files/manifest.yml.hbs +1 -1
- package/lib/init/template/cloud-logging/files/package.json.hbs +3 -3
- package/lib/init/template/data/as-json.js +3 -3
- package/lib/init/template/dynatrace/files/mta.yaml.hbs +1 -1
- package/lib/init/template/dynatrace/files/package.json.hbs +2 -2
- package/lib/init/template/dynatrace/index.js +2 -1
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +6 -0
- package/lib/init/template/enterprise-messaging/index.js +5 -1
- package/lib/init/template/extensibility/files/package.json.hbs +1 -1
- package/lib/init/template/hana/files/db/package.json +1 -1
- package/lib/init/template/hana/files/package.json.hbs +2 -4
- package/lib/init/template/hana/index.js +2 -2
- package/lib/init/template/handler/index.js +16 -12
- package/lib/init/template/helm/index.js +13 -22
- package/lib/init/template/helm-unified-runtime/index.js +2 -1
- package/lib/init/template/html5-repo/files/values.yaml.hbs +12 -1
- package/lib/init/template/html5-repo/index.js +10 -5
- package/lib/init/template/http/index.js +1 -1
- package/lib/init/template/ias/files/mta.yaml.hbs +1 -1
- package/lib/init/template/ias/files/sidecar.package.json.hbs +0 -7
- package/lib/init/template/ias/index.js +5 -4
- package/lib/init/template/lint/files/package.json +6 -0
- package/lib/init/template/lint/index.js +61 -204
- package/lib/init/template/mta/files/package.json +1 -1
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +2 -2
- package/lib/init/template/multitenancy/files/package.json.hbs +1 -1
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +7 -4
- package/lib/init/template/multitenancy/index.js +3 -0
- package/lib/init/template/nodejs/files/package.json.hbs +6 -3
- package/lib/init/template/postgres/files/package.json.hbs +1 -1
- package/lib/init/template/redis/files/package.json.hbs +1 -1
- package/lib/init/template/sample/files/app/admin-books/fiori-service.cds +6 -0
- package/lib/init/template/sample/files/app/admin-books/webapp/manifest.json +1 -0
- package/lib/init/template/sample/files/app/browse/fiori-service.cds +3 -2
- package/lib/init/template/sample/files/app/common.cds +0 -11
- package/lib/init/template/sqlite/files/package.json +1 -1
- package/lib/init/template/toggles/files/package.json.hbs +1 -1
- package/lib/init/template/typescript/files/package.json +2 -4
- package/lib/init/template/workzone-standard/index.js +2 -0
- package/lib/init/template/xsuaa/index.js +2 -6
- package/lib/lint/Linter.js +203 -331
- package/lib/lint/generators.js +52 -46
- package/lib/lint/io.js +77 -289
- package/lib/util/fs.js +2 -1
- package/lib/util/git.js +1 -1
- package/lib/util/glob.js +77 -0
- package/lib/watch/livereload-server.js +3 -4
- package/lib/watch/node-watch.js +3 -4
- package/lib/watch/watched.js +1 -1
- package/npm-shrinkwrap.json +200 -858
- package/package.json +6 -8
- package/readme.md +1 -1
- package/lib/lint/checks.js +0 -135
package/LICENSE
CHANGED
|
@@ -1,38 +1,32 @@
|
|
|
1
1
|
SAP DEVELOPER LICENSE AGREEMENT
|
|
2
2
|
|
|
3
|
-
Version 3.
|
|
3
|
+
Version 3.2 CAP
|
|
4
4
|
|
|
5
5
|
Please scroll down and read the following Developer License Agreement carefully ("Developer Agreement"). By clicking "I Accept" or by attempting to download, or install, or use the SAP software and other materials that accompany this Developer Agreement ("SAP Materials"), You agree that this Developer Agreement forms a legally binding agreement between You ("You" or "Your") and SAP SE, for and on behalf of itself and its subsidiaries and affiliates (as defined in Section 15 of the German Stock Corporation Act) and You agree to be bound by all of the terms and conditions stated in this Developer Agreement. If You are trying to access or download the SAP Materials on behalf of Your employer or as a consultant or agent of a third party (either "Your Company"), You represent and warrant that You have the authority to act on behalf of and bind Your Company to the terms of this Developer Agreement and everywhere in this Developer Agreement that refers to 'You' or 'Your' shall also include Your Company. If You do not agree to these terms, do not click "I Accept", and do not attempt to access or use the SAP Materials.
|
|
6
6
|
|
|
7
|
-
1.
|
|
7
|
+
1. LICENSE: SAP grants You a non-exclusive, non-transferable, non-sublicensable, revocable, limited use license to copy and reproduce the application programming interfaces ("API"), documentation, plug-ins, templates, scripts and sample code, libraries, software development kits ("Tools") to create new applications ("Customer Applications") being developed either for (a) testing and only non-productive use (“Customer Test Applications”) or (b) for productive use deployed and operated exclusively on “SAP Business Technology Platform (BTP)” or any other platform licensed from SAP (“Customer Productive Applications”). Only under this prerequisite SAP will grant You a non-exclusive, non-transferable, revocable, limited use license to copy, reproduce and distribute SAP’s underlying rights in the Customer Productive Application. You agree that any Customer Applications will not: (a) unreasonably impair, degrade or reduce the performance or security of any SAP software applications, services or related technology ("Software"); (b) enable the bypassing or circumventing of SAP's license restrictions and/or provide users with access to the Software to which such users are not licensed; (c) render or provide, without prior written consent from SAP, any information concerning SAP software license terms, Software, or any other information related to SAP products; or (d) permit mass data extraction from an SAP product to a non-SAP product, including use, modification, saving or other processing of such data in the non-SAP product, except and only to the extent that the extraction is solely used for and required for interoperability with an SAP product. In exchange for the right to develop any Customer Applications under this Agreement, You covenant not to assert any Intellectual Property Rights in Customer Applications created by You against any SAP product, service, or future SAP development.
|
|
8
8
|
|
|
9
|
-
2.
|
|
10
|
-
(b) Subject to SAP's underlying rights in any part of the APIs, Tools or Software, You retain all ownership and intellectual property rights in Your Customer Applications.
|
|
9
|
+
2. INTELLECTUAL PROPERTY: (a) SAP or its licensors retain all ownership and intellectual property rights in the APIs, Tools and Software. You may not: a) remove or modify any marks or proprietary notices of SAP, b) provide or make the APIs, Tools or Software available to any third party, except in cases APIs and Tools have been made part of the overall Customer Productive Application to function, c) assign this Developer Agreement or give or transfer the APIs, Tools or Software or an interest in them to another individual or entity, d) decompile, disassemble or reverse engineer (except to the extent permitted by applicable law) the APIs Tools or Software, e) create derivative works of or based on the APIs, Tools or Software, subject to Customer Productive Applications, being exclusively deployed and operated on “SAP Business Technology Platform (BTP)” or on any other platform licensed from SAP, f) use any SAP name, trademark or logo, or g) use the APIs or Tools to modify existing Software or other SAP product functionality or to access the Software or other SAP products' source code or metadata. (b) Subject to SAP's underlying rights in any part of the APIs, Tools or Software, You retain all ownership and intellectual property rights in Your Customer Applications.
|
|
11
10
|
|
|
12
|
-
3.
|
|
11
|
+
3. ARTIFICIAL INTELLIGENCE TRAINING: You are expressly prohibited from using the Software, Tools or APIs as well as any Customer Applications or any part thereof for the purpose of training (developing) artificial intelligence models or systems (“AI Training”). Prohibition of AI Training includes, but is not limited to, using the Software, Tools, APIs and/or Customer Applications or part thereof in any training data set, algorithm development, model development or refinement (including language learning models) related to artificial intelligence, as well as text and data mining in accordance with §44b UrhG and Art. 4 of EU Directive 2019/790. For the avoidance of doubt, by accepting this Developer Agreement You agree that Your ownership of Customer Applications shall not create nor encompass any right to use Customer Applications for AI Training and, hence, You will not use Customer Applications or any part of it for AI Training.
|
|
13
12
|
|
|
14
|
-
4.
|
|
13
|
+
4. FREE AND OPEN SOURCE COMPONENTS: The SAP Materials may include certain third party free or open source components ("FOSS Components"). You may have additional rights in such FOSS Components that are provided by the third party licensors of those components.
|
|
15
14
|
|
|
15
|
+
5. THIRD PARTY DEPENDENCIES: The SAP Materials may require certain third party software dependencies ("Dependencies") for the use or operation of such SAP Materials. These dependencies may be identified by SAP in Maven POM files, product documentation or by other means. SAP does not grant You any rights in or to such Dependencies under this Developer Agreement. You are solely responsible for the acquisition, installation and use of Dependencies. SAP DOES NOT MAKE ANY REPRESENTATIONS OR WARRANTIES IN RESPECT OF DEPENDENCIES, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY AND OF FITNESS FOR A PARTICULAR PURPOSE. IN PARTICULAR, SAP DOES NOT WARRANT THAT DEPENDENCIES WILL BE AVAILABLE, ERROR FREE, INTEROPERABLE WITH THE SAP MATERIALS, SUITABLE FOR ANY PARTICULAR PURPOSE OR NON-INFRINGING. YOU ASSUME ALL RISKS ASSOCIATED WITH THE USE OF DEPENDENCIES, INCLUDING WITHOUT LIMITATION RISKS RELATING TO QUALITY, AVAILABILITY, PERFORMANCE, DATA LOSS, UTILITY IN A PRODUCTION ENVIRONMENT, AND NON-INFRINGEMENT. IN NO EVENT WILL SAP BE LIABLE DIRECTLY OR INDIRECTLY IN RESPECT OF ANY USE OF DEPENDENCIES BY YOU.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
a) If You are located outside the US or Canada: AS THE API AND TOOLS ARE PROVIDED TO YOU FREE OF CHARGE, SAP DOES NOT GUARANTEE OR WARRANT ANY FEATURES OR QUALITIES OF THE TOOLS OR API OR GIVE ANY UNDERTAKING WITH REGARD TO ANY OTHER QUALITY. NO SUCH WARRANTY OR UNDERTAKING SHALL BE IMPLIED BY YOU FROM ANY DESCRIPTION IN THE API OR TOOLS OR ANY AVAILABLE DOCUMENTATION OR ANY OTHER COMMUNICATION OR ADVERTISEMENT. IN PARTICULAR, SAP DOES NOT WARRANT THAT THE SOFTWARE WILL BE AVAILABLE UNINTERRUPTED, ERROR FREE, OR PERMANENTLY AVAILABLE. FOR THE TOOLS AND API ALL WARRANTY CLAIMS ARE SUBJECT TO THE LIMITATION OF LIABILITY STIPULATED IN SECTION 4 BELOW.
|
|
19
|
-
b) If You are located in the US or Canada: THE API AND TOOLS ARE LICENSED TO YOU "AS IS", WITHOUT ANY WARRANTY, ESCROW, TRAINING, MAINTENANCE, OR SERVICE OBLIGATIONS WHATSOEVER ON THE PART OF SAP. SAP MAKES NO EXPRESS OR IMPLIED WARRANTIES OR CONDITIONS OF SALE OF ANY TYPE WHATSOEVER, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY AND OF FITNESS FOR A PARTICULAR PURPOSE. IN PARTICULAR, SAP DOES NOT WARRANT THAT THE SOFTWARE WILL BE AVAILABLE UNINTERRUPTED, ERROR FREE, OR PERMANENTLY AVAILABLE. YOU ASSUME ALL RISKS ASSOCIATED WITH THE USE OF THE API AND TOOLS, INCLUDING WITHOUT LIMITATION RISKS RELATING TO QUALITY, AVAILABILITY, PERFORMANCE, DATA LOSS, AND UTILITY IN A PRODUCTION ENVIRONMENT.
|
|
17
|
+
6. WARRANTY: a) If You are located outside the US or Canada: AS THE API AND TOOLS ARE PROVIDED TO YOU FREE OF CHARGE, SAP DOES NOT GUARANTEE OR WARRANT ANY FEATURES OR QUALITIES OF THE TOOLS OR API OR GIVE ANY UNDERTAKING WITH REGARD TO ANY OTHER QUALITY OR TO YOUR CUSTOMERS. NO SUCH WARRANTY OR UNDERTAKING SHALL BE IMPLIED BY YOU FROM ANY DESCRIPTION IN THE API OR TOOLS OR ANY AVAILABLE DOCUMENTATION OR ANY OTHER COMMUNICATION OR ADVERTISEMENT. IN PARTICULAR, SAP DOES NOT WARRANT THAT THE SOFTWARE WILL BE AVAILABLE UNINTERRUPTED, ERROR FREE, OR PERMANENTLY AVAILABLE. FOR THE TOOLS AND API ALL WARRANTY CLAIMS ARE SUBJECT TO THE LIMITATION OF LIABILITY STIPULATED IN SECTION 4 BELOW. b) If You are located in the US or Canada: THE API AND TOOLS ARE LICENSED TO YOU "AS IS", WITHOUT ANY WARRANTY, ESCROW, TRAINING, MAINTENANCE, OR SERVICE OBLIGATIONS WHATSOEVER ON THE PART OF SAP. SAP MAKES NO EXPRESS OR IMPLIED WARRANTIES OR CONDITIONS OF SALE OF ANY TYPE WHATSOEVER, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY AND OF FITNESS FOR A PARTICULAR PURPOSE. IN PARTICULAR, SAP DOES NOT WARRANT THAT THE SOFTWARE WILL BE AVAILABLE UNINTERRUPTED, ERROR FREE, OR PERMANENTLY AVAILABLE. YOU ASSUME ALL RISKS ASSOCIATED WITH THE USE AND DISTRIBUTION (IF ANY) OF THE API AND TOOLS, INCLUDING WITHOUT LIMITATION RISKS RELATING TO QUALITY, AVAILABILITY, PERFORMANCE, DATA LOSS, AND UTILITY IN A PRODUCTION ENVIRONMENT.
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
b) If You are located in the US or Canada: IN NO EVENT SHALL SAP BE LIABLE TO YOU, YOUR COMPANY OR TO ANY THIRD PARTY FOR ANY DAMAGES IN AN AMOUNT IN EXCESS OF $100 ARISING IN CONNECTION WITH YOUR USE OF OR INABILITY TO USE THE TOOLS OR API OR IN CONNECTION WITH SAP'S PROVISION OF OR FAILURE TO PROVIDE SERVICES PERTAINING TO THE TOOLS OR API, OR AS A RESULT OF ANY DEFECT IN THE API OR TOOLS. THIS DISCLAIMER OF LIABILITY SHALL APPLY REGARDLESS OF THE FORM OF ACTION THAT MAY BE BROUGHT AGAINST SAP, WHETHER IN CONTRACT OR TORT, INCLUDING WITHOUT LIMITATION ANY ACTION FOR NEGLIGENCE. YOUR SOLE REMEDY IN THE EVENT OF BREACH OF THIS DEVELOPER AGREEMENT BY SAP OR FOR ANY OTHER CLAIM RELATED TO THE API OR TOOLS SHALL BE TERMINATION OF THIS AGREEMENT. NOTWITHSTANDING ANYTHING TO THE CONTRARY HEREIN, UNDER NO CIRCUMSTANCES SHALL SAP AND ITS LICENSORS BE LIABLE TO YOU OR ANY OTHER PERSON OR ENTITY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR INDIRECT DAMAGES, LOSS OF GOOD WILL OR BUSINESS PROFITS, WORK STOPPAGE, DATA LOSS, COMPUTER FAILURE OR MALFUNCTION, ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSS, OR EXEMPLARY OR PUNITIVE DAMAGES.
|
|
19
|
+
7. LIMITATION OF LIABILITY: a) If You are located outside the US or Canada: IRRESPECTIVE OF THE LEGAL REASONS, SAP SHALL ONLY BE LIABLE FOR DAMAGES UNDER THIS AGREEMENT IF SUCH DAMAGE (I) CAN BE CLAIMED UNDER THE GERMAN PRODUCT LIABILITY ACT OR (II) IS CAUSED BY INTENTIONAL MISCONDUCT OF SAP OR (III) CONSISTS OF PERSONAL INJURY. IN ALL OTHER CASES, NEITHER SAP NOR ITS EMPLOYEES, AGENTS AND SUBCONTRACTORS SHALL BE LIABLE FOR ANY KIND OF DAMAGE OR CLAIMS HEREUNDER.
|
|
20
|
+
b) If You are located in the US or Canada: IN NO EVENT SHALL SAP BE LIABLE TO YOU, YOUR COMPANY, YOUR CUSTOMERS OR TO ANY THIRD PARTY FOR ANY DAMAGES IN AN AMOUNT IN EXCESS OF $100 ARISING IN CONNECTION WITH YOUR USE OF OR INABILITY TO USE THE TOOLS OR API OR IN CONNECTION WITH SAP'S PROVISION OF OR FAILURE TO PROVIDE SERVICES PERTAINING TO THE TOOLS OR API, OR AS A RESULT OF ANY DEFECT IN THE API OR TOOLS OR ANY THIRD PARTY RIGHTS INFRINGEMENT BY THE APIs, TOOLS OR SOFTWARE. THIS DISCLAIMER OF LIABILITY SHALL APPLY REGARDLESS OF THE FORM OF ACTION THAT MAY BE BROUGHT AGAINST SAP, WHETHER IN CONTRACT OR TORT, INCLUDING WITHOUT LIMITATION ANY ACTION FOR NEGLIGENCE. YOUR SOLE REMEDY IN THE EVENT OF BREACH OF THIS DEVELOPER AGREEMENT BY SAP OR FOR ANY OTHER CLAIM RELATED TO THE API OR TOOLS SHALL BE TERMINATION OF THIS AGREEMENT. NOTWITHSTANDING ANYTHING TO THE CONTRARY HEREIN, UNDER NO CIRCUMSTANCES SHALL SAP AND ITS LICENSORS BE LIABLE TO YOU OR ANY OTHER PERSON IN PARTICULAR COMPANY AND YOUR CUSTOMERS OR ENTITY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR INDIRECT DAMAGES, LOSS OF GOOD WILL OR BUSINESS PROFITS, WORK STOPPAGE, DATA LOSS, COMPUTER FAILURE OR MALFUNCTION, ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSS, OR EXEMPLARY OR PUNITIVE DAMAGES.
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
8. INDEMNITY: You will fully indemnify, hold harmless and defend SAP against law suits based on any claim: (a) that any Customer Application created by You infringes or misappropriates any patent, copyright, trademark, trade secrets, or other proprietary rights of a third party, or (b) related to Your alleged violation of the terms of this Developer Agreement
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
9. EXPORT: The Tools and API are subject to German, EU and US export control regulations. You confirm that: a) You will not use the Tools or API for, and will not allow the Tools or API to be used for, any purposes prohibited by German, EU and US law, including, without limitation, for the development, design, manufacture or production of nuclear, chemical or biological weapons of mass destruction; b) You are not located in and/or will not download or otherwise export or re-export the API or Tools, directly or indirectly, to Cuba, Iran, North Korea, Syria, Crimea/Sevastopol or the so-called Donetsk People’s Republic (DNR) / Luhansk People’s Republic (LNR)nor any other country to which Germany, the European Union and/or the United States has prohibited export; c) You are not listed on any applicable sanctioned party lists (e.g., European Union Sanctions List, U.S. Specially Designated National (SDN) lists, U.S. Denied Persons List, BIS Entity List, United Nations Security Council Sanctions); d) You will not download or otherwise export or re-export the API or Tools , directly or indirectly, to persons on the above-mentioned lists.
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
10. SUPPORT: Other than what is made available on the SAP Community Website (SCN) by SAP at its sole discretion and by SCN members, SAP does not offer support for the API or Tools which are the subject of this Developer Agreement. In case of Customer Productive Applications developed and made available by You in accordance with this Developer Agreement, You and third parties may request support in line with Your licensing agreement for SAP.
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
11. TERM AND TERMINATION: You may terminate this Developer Agreement by destroying all copies of the API and Tools on Your Computer(s). SAP may terminate Your license to use the API and Tools immediately if You fail to comply with any of the terms of this Developer Agreement, or, for SAP's convenience by providing you with ten (10) day's written notice of termination (including email). In case of termination or expiration of this Developer Agreement, You must destroy all copies of the API and Tools immediately. In the event Your Company or any of the intellectual property you create using the API, Tools or Software are acquired (by merger, purchase of stock, assets or intellectual property or exclusive license), or You become employed, by a direct competitor of SAP, then this Development Agreement and all licenses granted in this Developer Agreement shall immediately terminate upon the date of such acquisition.
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
a) If You are located outside the US or Canada: This Developer Agreement is governed by and construed in accordance with the laws of the Germany. You and SAP agree to submit to the exclusive jurisdiction of, and venue in, the courts of Karlsruhe in Germany in any dispute arising out of or relating to this Developer Agreement.
|
|
35
|
-
b) If You are located in the US or Canada: This Developer Agreement shall be governed by and construed under the Commonwealth of Pennsylvania law without reference to its conflicts of law principles. In the event of any conflicts between foreign law, rules, and regulations, and United States of America law, rules, and regulations, United States of America law, rules, and regulations shall prevail and govern. The United Nations Convention on Contracts for the International Sale of Goods shall not apply to this Developer Agreement. The Uniform Computer Information Transactions Act as enacted shall not apply.
|
|
36
|
-
|
|
37
|
-
12. MISCELLANEOUS: This Developer Agreement is the complete agreement for the API and Tools licensed (including reference to information/documentation contained in a URL). This Developer Agreement supersedes all prior or contemporaneous agreements or representations with regards to the subject matter of this Developer Agreement. If any term of this Developer Agreement is found to be invalid or unenforceable, the surviving provisions shall remain effective. SAP's failure to enforce any right or provisions stipulated in this Developer Agreement will not constitute a waiver of such provision, or any other provision of this Developer Agreement.
|
|
30
|
+
12. LAW/VENUE: a) If You are located outside the US or Canada: This Developer Agreement is governed by and construed in accordance with the laws of the Germany. You and SAP agree to submit to the exclusive jurisdiction of, and venue in, the courts of Karlsruhe in Germany in any dispute arising out of or relating to this Developer Agreement. b) If You are located in the US or Canada: This Developer Agreement shall be governed by and construed under the Commonwealth of Pennsylvania law without reference to its conflicts of law principles. In the event of any conflicts between foreign law, rules, and regulations, and United States of America law, rules, and regulations, United States of America law, rules, and regulations shall prevail and govern. The United Nations Convention on Contracts for the International Sale of Goods shall not apply to this Developer Agreement. The Uniform Computer Information Transactions Act as enacted shall not apply.
|
|
38
31
|
|
|
32
|
+
13. MISCELLANEOUS: This Developer Agreement is the complete agreement for the API and Tools licensed (including reference to information/documentation contained in a URL). This Developer Agreement supersedes all prior or contemporaneous agreements or representations with regards to the subject matter of this Developer Agreement. If any term of this Developer Agreement is found to be invalid or unenforceable, the surviving provisions shall remain effective. SAP's failure to enforce any right or provisions stipulated in this Developer Agreement will not constitute a waiver of such provision, or any other provision of this Developer Agreement.
|
package/bin/bind.js
CHANGED
|
@@ -214,7 +214,7 @@ async function cds_bind_exec(command) { // eslint-disable-lint
|
|
|
214
214
|
const cds = require('../lib/cds');
|
|
215
215
|
const env = cds.env.for('cds', process.cwd());
|
|
216
216
|
|
|
217
|
-
const { bindingEnv } = require('../lib/bind/shared')
|
|
217
|
+
const { env: bindingEnv } = require('../lib/bind/shared')
|
|
218
218
|
const processEnv = Object.assign(process.env, await bindingEnv({env}))
|
|
219
219
|
|
|
220
220
|
execAndExit({ env: processEnv }, ...command);
|
package/bin/build.js
CHANGED
|
@@ -2,79 +2,76 @@ module.exports = Object.assign(build, {
|
|
|
2
2
|
handleCompletion,
|
|
3
3
|
options: ['--project', '--src', '--dest', '--for', '--opts', '--log-level', '--options-model'],
|
|
4
4
|
shortcuts: ['-in', '-s', '-o', '-4'],
|
|
5
|
-
flags: ['--
|
|
5
|
+
flags: ['--no-clean', '--ws', '--ws-pack'],
|
|
6
6
|
help: `
|
|
7
7
|
# SYNOPSIS
|
|
8
8
|
|
|
9
9
|
*cds build* [<project>] [<options>]
|
|
10
10
|
|
|
11
|
-
Builds
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
Builds modules in current project by compiling resolved CDS sources.
|
|
12
|
+
|
|
13
|
+
Modules are folders in the project root directory. All well known
|
|
14
14
|
modules (db, srv, app) or those configured by build tasks defined in
|
|
15
15
|
*package.json* or *.cdsrc.json* are built.
|
|
16
16
|
|
|
17
17
|
# OPTIONS
|
|
18
18
|
|
|
19
19
|
*-4 | --for* hana | java | nodejs | mtx | mtx-sidecar | mtx-extension
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
project setup
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
otherwise.
|
|
20
|
+
|
|
21
|
+
Name of the build task applied to the source folder. Explicitly configured
|
|
22
|
+
in the build tasks or derived from the project setup and plugins.
|
|
23
|
+
|
|
24
|
+
For example, the 'hana' build task will create SAP HANA artifacts.
|
|
26
25
|
|
|
27
26
|
*-s | --src* <folder>
|
|
28
|
-
|
|
29
|
-
'--for'.
|
|
30
|
-
This option is only supported
|
|
31
|
-
|
|
27
|
+
|
|
28
|
+
The module folder to build using the build task defined by option '--for'.
|
|
29
|
+
This option is only supported for building an individual module of the project.
|
|
30
|
+
|
|
32
31
|
The folder is resolved based on '<project>/<cds.env.build.target>'.
|
|
33
|
-
A default
|
|
34
|
-
|
|
35
|
-
*hana* build task, 'srv' for *nodejs* or *java* build task.
|
|
32
|
+
A default may be pre-configured, for example, the folder 'db' for
|
|
33
|
+
the *hana* build task, or 'srv' for *nodejs* and *java*.
|
|
36
34
|
|
|
37
35
|
*-o | --dest* <folder>
|
|
38
|
-
|
|
39
|
-
option '--for'.
|
|
36
|
+
|
|
37
|
+
Output folder of the build task. The type of build task is defined by option '--for'.
|
|
40
38
|
The folder is resolved based on '<project>/<cds.env.build.target>'.
|
|
41
|
-
Default
|
|
42
|
-
Note: <cds.env.build.target> can be configured in *.cdsrc.json* or
|
|
43
|
-
|
|
44
|
-
For Node
|
|
45
|
-
written to '<project
|
|
46
|
-
For Java projects '.' is used by default. The output is written to
|
|
47
|
-
'<project>/*<dest>*/*'.
|
|
39
|
+
Default: folder defined by option '--src'.
|
|
40
|
+
Note: <cds.env.build.target> can be configured in *.cdsrc.json* or *package.json*.
|
|
41
|
+
|
|
42
|
+
For Node 'gen' is used by default - output is written to '<project>/gen/*<dest>*/*'.
|
|
43
|
+
For Java '.' is used by default - output is written to '<project>/*<dest>*/*'.
|
|
48
44
|
|
|
49
45
|
*--opts* <build task specific options>
|
|
46
|
+
|
|
50
47
|
Add a comma-separated list of build task specific options in the format
|
|
51
48
|
<opt1>=[value1,value2],<opt2>=value.
|
|
52
49
|
For example, --opts model=[db,srv,schema.cds] loads and compiles the CDS
|
|
53
50
|
model based on the given sources.
|
|
54
51
|
|
|
55
52
|
*--profile* <profile,...>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
E.g. you may want to create the HANA deployment artefacts only if the
|
|
59
|
-
*production* profile is set.
|
|
53
|
+
|
|
54
|
+
Loads the configuration data for the specified profile(s).
|
|
60
55
|
The *development* profile is used by default.
|
|
61
56
|
|
|
62
57
|
*--production*
|
|
63
|
-
|
|
58
|
+
|
|
59
|
+
Shortcut for '--profile production'.
|
|
64
60
|
|
|
65
61
|
*--log-level* <debug | info | warn | error>
|
|
62
|
+
|
|
66
63
|
Choose which level of cds build messages to log, default is *warn*.
|
|
67
64
|
|
|
68
65
|
*-in | --project* [<project>]
|
|
69
|
-
|
|
70
|
-
directory.
|
|
66
|
+
|
|
67
|
+
Runs 'cds build' for the specified project, default is the current working directory.
|
|
71
68
|
|
|
72
69
|
*--no-clean*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
consistent build results.
|
|
70
|
+
|
|
71
|
+
Skips cleaning the output folder before running the build.
|
|
76
72
|
|
|
77
73
|
*--ws-pack* (beta)
|
|
74
|
+
|
|
78
75
|
Enable tarball based packaging of npm workspace dependencies - typically defined for
|
|
79
76
|
Node.js mono or multi-repo setups.
|
|
80
77
|
For each workspace dependency of your project using '*' as version identifier,
|
|
@@ -83,7 +80,8 @@ module.exports = Object.assign(build, {
|
|
|
83
80
|
Contents is packaged based on the rules of the 'npm pack' command.
|
|
84
81
|
|
|
85
82
|
*--ws* (beta)
|
|
86
|
-
|
|
83
|
+
|
|
84
|
+
NPM workspaces are typically used in mono or multi-repo setups whereas each workspace
|
|
87
85
|
folder represents a microservice CAP project with subfolders _db_, _srv_, _app_.
|
|
88
86
|
With the *ws* option the model scope used in executed build tasks is calculated based on
|
|
89
87
|
all workspaces. This also applies to the feature toggles. Feature toggles defined cross workspace
|
package/bin/cds.js
CHANGED
|
@@ -22,7 +22,7 @@ const cli = {
|
|
|
22
22
|
o: 'logout',
|
|
23
23
|
t: 'test',
|
|
24
24
|
v: 'version', '-v':'version', '--version':'version',
|
|
25
|
-
h: 'help', '?':'help', '-?':'help', '--help':'help',
|
|
25
|
+
h: 'help', '?':'help', '-?':'help', '--help':'help', '-h':'help',
|
|
26
26
|
r: 'repl', '-r':'repl',
|
|
27
27
|
'-e':'eval'
|
|
28
28
|
},
|
|
@@ -49,7 +49,7 @@ const cli = {
|
|
|
49
49
|
// const { handleCompletion } = require('./util/completion');
|
|
50
50
|
// await handleCompletion(process.argv, allCmds, this);
|
|
51
51
|
|
|
52
|
-
const task = this.load(cmd, /*else*/(f) => argv.unshift(cmd) && (cmd = 'compile') &&
|
|
52
|
+
const task = this.load(cmd, /*else*/(f) => argv.unshift(cmd) && (cmd = 'compile') && _isDefaultCompile(argv, f))
|
|
53
53
|
if (task) {
|
|
54
54
|
// REVISIT bind: '--' handling for cds bind --exec. Should be moved to cds_cli
|
|
55
55
|
const endOfOptions = argv.indexOf('--')
|
|
@@ -106,12 +106,7 @@ const cli = {
|
|
|
106
106
|
},
|
|
107
107
|
|
|
108
108
|
load (cmd,_default) {
|
|
109
|
-
|
|
110
|
-
console.error(`'cds build/all' is no longer supported, use 'cds build' instead`)
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return /[\\/.-@]/.test(cmd) && _default && _default(true) // like `cds ./srv` or `cds @capire/bookshop`
|
|
109
|
+
return /[\\/.\-@]/.test(cmd) && _default && _default(true) // like `cds ./srv` or `cds @capire/bookshop`
|
|
115
110
|
|| /cds/i.test(cmd) && _dieForUnknownCommand (cmd) // cds cds
|
|
116
111
|
|| _require ('./'+cmd) // cds-dk commands
|
|
117
112
|
|| _default && _default()
|
|
@@ -171,32 +166,20 @@ const DEBUG = /\b(y|all|cli)\b/.test(process.env.DEBUG) ? console.debug : undefi
|
|
|
171
166
|
|
|
172
167
|
async function _resolveBindings(options) {
|
|
173
168
|
const cds = require('../lib/cds')
|
|
174
|
-
const { bindingEnv } = require('../lib/bind/shared')
|
|
169
|
+
const { env: bindingEnv } = require('../lib/bind/shared')
|
|
175
170
|
Object.assign(process.env, await bindingEnv(options))
|
|
176
171
|
cds.env = cds.env.for('cds') // reload env // FIXME: This is too early!
|
|
177
172
|
cds.requires = cds.env.requires // REVISIT: We should clean this up!
|
|
178
173
|
}
|
|
179
174
|
|
|
180
|
-
function
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
function _defaultCompile (argv, _force) {
|
|
189
|
-
// Try all arguments if one resolves to a model. If yes, we assume 'compile' is intended.
|
|
190
|
-
const model = _force || _is_model(argv)
|
|
191
|
-
if (model) return _require ('./compile')
|
|
192
|
-
DEBUG?.(`[cds] - Command is not a model to compile: ${argv}`)
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function _is_model (argv) {
|
|
196
|
-
// IMPORTANT: have a separate env here, so that the normal one is not initialized before `cds_cli.args` above
|
|
197
|
-
const env = require (_local('@sap/cds/lib/env/cds-env', ()=>_local('@sap/cds/lib/env'))).for('cds')
|
|
198
|
-
const cds = require (_local('@sap/cds'))
|
|
199
|
-
return !!cds.resolve(argv,{env,cache:{}})
|
|
175
|
+
function _isDefaultCompile (argv, _force) {
|
|
176
|
+
const _is_model = a => /\*|\.(cds|json|csn)$/.test(a)
|
|
177
|
+
const compile = _require('./compile')
|
|
178
|
+
if (_force) return compile
|
|
179
|
+
// first argument must be a model file or an option
|
|
180
|
+
if (!_is_model(argv[0]) && !argv[0].startsWith('-')) return false
|
|
181
|
+
// at least one model file must in the arguments
|
|
182
|
+
if (argv.some(_is_model)) return compile
|
|
200
183
|
}
|
|
201
184
|
|
|
202
185
|
function _dieForUnknownCommand(cmd) {
|
|
@@ -277,7 +260,7 @@ function _prepareTsIfNeeded(cds) {
|
|
|
277
260
|
if (!process.env.CDS_TYPESCRIPT ) {
|
|
278
261
|
try {
|
|
279
262
|
cds._localOrGlobal('tsx/cjs') // cjs is needed as we are in CJS code
|
|
280
|
-
|
|
263
|
+
DEBUG?.(`[cds] - Detected ${path.relative(cds.root, tsconfig)}. Running with tsx.\n`)
|
|
281
264
|
process.env.CDS_TYPESCRIPT = 'tsx'
|
|
282
265
|
}
|
|
283
266
|
catch (e) {
|
package/bin/compile/index.js
CHANGED
|
@@ -41,7 +41,7 @@ module.exports = Object.assign ( compile, {
|
|
|
41
41
|
|
|
42
42
|
- json, yml
|
|
43
43
|
- edm, edmx, edmx-v2, edmx-v4, edmx-w4, edmx-x4
|
|
44
|
-
- sql,
|
|
44
|
+
- sql, hana, hdbtable
|
|
45
45
|
- cdl
|
|
46
46
|
- xsuaa
|
|
47
47
|
- openapi
|
|
@@ -165,7 +165,7 @@ async function handleCompletion(currentWord, previousWord, argv, util) {
|
|
|
165
165
|
switch (previousWord) {
|
|
166
166
|
case '-2':
|
|
167
167
|
case '--to':
|
|
168
|
-
return ['json', 'yml', 'edm', 'edmx', 'edmx-v2', 'edmx-v4', 'sql', '
|
|
168
|
+
return ['json', 'yml', 'edm', 'edmx', 'edmx-v2', 'edmx-v4', 'sql', 'hdbtable', 'hana', 'cdl', 'xsuaa', 'openapi', 'asyncapi'];
|
|
169
169
|
case '-4':
|
|
170
170
|
case '--for':
|
|
171
171
|
return ['odata', 'sql'];
|
package/bin/debug.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module.exports = Object.assign(debug, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
options: ['--port', '--host', '--force'],
|
|
3
|
+
shortcuts: ['-p', '-h', '-f'],
|
|
4
|
+
flags: [/*'--vscode', '--k8s'*/],
|
|
5
|
+
help: `
|
|
6
6
|
# SYNOPSIS
|
|
7
7
|
|
|
8
8
|
*cds debug* [<app>]
|
|
@@ -28,6 +28,10 @@ module.exports = Object.assign(debug, {
|
|
|
28
28
|
|
|
29
29
|
the debug port (default: '9229' for Node.js, '8000' for Java)
|
|
30
30
|
|
|
31
|
+
*-f* | *--force*
|
|
32
|
+
|
|
33
|
+
if necessary, automatically enable ssh for the app and restart it
|
|
34
|
+
|
|
31
35
|
# EXAMPLES
|
|
32
36
|
|
|
33
37
|
*cds debug*
|
|
@@ -41,7 +45,7 @@ async function debug() {
|
|
|
41
45
|
const DEBUG = /\b(y|all|debug)\b/.test(process.env.DEBUG) ? console.debug : undefined
|
|
42
46
|
|
|
43
47
|
const [appName] = cds.cli.argv
|
|
44
|
-
const { port, host = '127.0.0.1', vscode } = cds.cli.options
|
|
48
|
+
const { port, host = '127.0.0.1', vscode, force } = cds.cli.options
|
|
45
49
|
|
|
46
50
|
const maxAttempts = 15
|
|
47
51
|
let attempts = 0
|
|
@@ -64,7 +68,7 @@ async function debug() {
|
|
|
64
68
|
// to be implemented
|
|
65
69
|
}
|
|
66
70
|
else { // Cloud Foundry
|
|
67
|
-
const [pid, kind] = processInfo(appName)
|
|
71
|
+
const [pid, kind] = processInfo(appName, force)
|
|
68
72
|
console.log(`Found process of type ${kind}, ID: ${pid}`)
|
|
69
73
|
|
|
70
74
|
if (kind === 'node') {
|
|
@@ -115,7 +119,23 @@ async function debug() {
|
|
|
115
119
|
return portLocal
|
|
116
120
|
}
|
|
117
121
|
|
|
118
|
-
function processInfo(appName) {
|
|
122
|
+
function processInfo(appName, force) {
|
|
123
|
+
if (force !== false) {
|
|
124
|
+
const enabled = _execSyncSafe(`cf ssh-enabled ${appName}`)
|
|
125
|
+
if (enabled.match(/disabled/i)) {
|
|
126
|
+
if (force) {
|
|
127
|
+
console.log(`Trying to enable SSH for app '${appName}'...`)
|
|
128
|
+
_execSyncSafe(`cf enable-ssh ${appName}`)
|
|
129
|
+
_execSyncSafe(`cf restart ${appName}`)
|
|
130
|
+
return processInfo(appName, false)
|
|
131
|
+
}
|
|
132
|
+
throw (
|
|
133
|
+
`SSH support is disabled for app '${appName}'.` +
|
|
134
|
+
`\nRun "cds debug ${appName} --force" to automatically enable SSH for your application.`
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
119
139
|
const pidOf = exe => _execSyncSafe(`cf ssh ${appName} -c "pidof ${exe}"`)
|
|
120
140
|
const exeTypes = ['node', 'java']
|
|
121
141
|
for (const exe of exeTypes) {
|
package/bin/deploy/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
const { options, flags, shortcuts } = require('../../lib/deploy/index.js');
|
|
2
|
+
|
|
1
3
|
module.exports = Object.assign(deploy, {
|
|
2
|
-
options
|
|
3
|
-
flags
|
|
4
|
-
shortcuts
|
|
4
|
+
options,
|
|
5
|
+
flags,
|
|
6
|
+
shortcuts,
|
|
5
7
|
help: `
|
|
6
8
|
# SYNOPSIS
|
|
7
9
|
|
|
@@ -70,16 +72,10 @@ module.exports = Object.assign(deploy, {
|
|
|
70
72
|
*--vcap-file*
|
|
71
73
|
|
|
72
74
|
Use credentials from the given file when deploying to *SAP HANA*, instead of
|
|
73
|
-
creating new credentials. File must be in *
|
|
75
|
+
creating new credentials. File must be in *cf env* format, with a root
|
|
74
76
|
node *VCAP_SERVICES*. The following hdi related entries are supported:
|
|
75
77
|
TARGET_CONTAINER, VCAP_SERVICES and SERVICE_REPLACEMENTS.
|
|
76
78
|
|
|
77
|
-
*--store-credentials* (only in combination with *--to hana*)
|
|
78
|
-
|
|
79
|
-
Stores credentials in *default-env.json file*. This is the former default behavior
|
|
80
|
-
which has been replaced by creating and storing connection information in file
|
|
81
|
-
*.cdsrc-private.json*.
|
|
82
|
-
|
|
83
79
|
*--model-only*
|
|
84
80
|
|
|
85
81
|
Schema evolution: only update the information about the prior cds model.
|
|
@@ -148,17 +144,9 @@ async function deploy(_model, options) {
|
|
|
148
144
|
options.messages = []
|
|
149
145
|
if (options.script) options.dry = true // to ensure that we don't accidentally execute any SQLs
|
|
150
146
|
if (options.out) {
|
|
151
|
-
ensureVersion(cds.version, 8, 3, `Option --out is available with @sap/cds >= 8.3.0, current version is ${cds.version}`)
|
|
152
147
|
options.schema_log = []
|
|
153
148
|
}
|
|
154
149
|
|
|
155
|
-
const isVersionLess8 = Number(cds.version.split('.')[0]) < 8
|
|
156
|
-
const localizedViewsSetting = cds.env?.sql?.transitive_localized_views
|
|
157
|
-
if (isVersionLess8 && !localizedViewsSetting ) {
|
|
158
|
-
cds.env.sql ??= {}
|
|
159
|
-
cds.env.sql.transitive_localized_views = true
|
|
160
|
-
console.warn(`transitive_localized_views = false requires @sap/cds >= 8.0.0, current version is ${cds.version}. transitive_localized_views has been set to true for this run. Will continue accordingly.`)
|
|
161
|
-
}
|
|
162
150
|
await deployer.deploy(_model, _db, options)
|
|
163
151
|
const log = this.log || _log
|
|
164
152
|
if (options.messages.length) log (options.messages, options)
|
|
@@ -186,8 +174,3 @@ function _log (messages, options) {
|
|
|
186
174
|
messages = sortMessagesSeverityAware (messages)
|
|
187
175
|
cds._log (messages, options)
|
|
188
176
|
}
|
|
189
|
-
|
|
190
|
-
function ensureVersion(version, reqMajor, reqMinor, message) {
|
|
191
|
-
const [major, minor] = version.split('.').map(Number)
|
|
192
|
-
if (major < reqMajor || (major === reqMajor && minor < reqMinor)) throw message
|
|
193
|
-
}
|
package/bin/deploy/to-hana.js
CHANGED
|
@@ -7,7 +7,9 @@ exports.deploy = (model, serviceName, options) => {
|
|
|
7
7
|
serviceName,
|
|
8
8
|
tunnelAddress: options['tunnel-address'],
|
|
9
9
|
vcapFile: options['vcap-file'],
|
|
10
|
-
hdiOptions: {
|
|
11
|
-
|
|
10
|
+
hdiOptions: {
|
|
11
|
+
autoUndeploy: options['auto-undeploy'],
|
|
12
|
+
parameter: {"com.sap.hana.di.table/try_fast_table_migration": "true" }
|
|
13
|
+
}
|
|
12
14
|
});
|
|
13
15
|
}
|
package/bin/help.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const cds = require('../lib/cds')
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
module.exports = exports = Object.assign (help, {formatHelp, handleCompletion, help:`
|
|
5
5
|
# USAGE
|
|
6
6
|
|
|
@@ -13,7 +13,6 @@ module.exports = exports = Object.assign (help, {formatHelp, handleCompletion, h
|
|
|
13
13
|
*i* | *init* jump-start cds-based projects
|
|
14
14
|
*a* | *add* add a feature to an existing project
|
|
15
15
|
* * | *gen* generate models/data using a descriptive prompt [beta]
|
|
16
|
-
*y* | *bind* bind application to remote services
|
|
17
16
|
*m* | *import* add models from external sources
|
|
18
17
|
*c* | *compile* compile cds models to different outputs
|
|
19
18
|
*p* | *parse* parses given cds models
|
|
@@ -23,7 +22,10 @@ module.exports = exports = Object.assign (help, {formatHelp, handleCompletion, h
|
|
|
23
22
|
*r* | *repl* read-eval-event loop
|
|
24
23
|
*e* | *env* inspect effective configuration
|
|
25
24
|
*b* | *build* prepare for deployment
|
|
26
|
-
*d* | *deploy* deploy to databases
|
|
25
|
+
*d* | *deploy* deploy to databases
|
|
26
|
+
* * | *up* build and deploy your application to the cloud
|
|
27
|
+
*y* | *bind* bind application to remote services
|
|
28
|
+
* * | *debug* debug your application
|
|
27
29
|
* * | *subscribe* subscribe a tenant to a multitenant SaaS app
|
|
28
30
|
* * | *unsubscribe* unsubscribe a tenant from a multitenant SaaS app
|
|
29
31
|
*l* | *login* login to extensible multitenant SaaS app
|
package/bin/init.js
CHANGED
|
@@ -47,7 +47,7 @@ ${require('../lib/init').help()}
|
|
|
47
47
|
*cds init* bookshop --java
|
|
48
48
|
*cds init* bookshop --add hana
|
|
49
49
|
*cds init* bookshop --add multitenancy,mta
|
|
50
|
-
*cds init* --java --java:mvn
|
|
50
|
+
*cds init* --java --java:mvn DgroupId=myGroup,DartifactId=newId,Dpackage=my.company
|
|
51
51
|
|
|
52
52
|
# SEE ALSO
|
|
53
53
|
|
package/bin/up.js
CHANGED
|
@@ -21,32 +21,56 @@ module.exports = Object.assign(up, {
|
|
|
21
21
|
*cds up --to k8s*
|
|
22
22
|
`})
|
|
23
23
|
|
|
24
|
-
const { execSync } = require('node:child_process')
|
|
24
|
+
const { execSync, spawn } = require('node:child_process')
|
|
25
25
|
const cds = require('../lib/cds')
|
|
26
|
-
const { highlight } = require('../lib/util/term')
|
|
27
|
-
const { exists, path
|
|
26
|
+
const { highlight, bold } = require('../lib/util/term')
|
|
27
|
+
const { exists, fs, path } = cds.utils
|
|
28
28
|
const { readProject } = require('../lib/init/projectReader')
|
|
29
29
|
|
|
30
30
|
const run = cmd => {
|
|
31
31
|
console.log(highlight(cmd))
|
|
32
32
|
try {
|
|
33
|
-
execSync(cmd, {
|
|
33
|
+
return execSync(cmd, {
|
|
34
|
+
stdio: 'inherit',
|
|
35
|
+
env: { ...process.env, FORCE_COLOR: cds.utils.colors.enabled }
|
|
36
|
+
})
|
|
34
37
|
} catch (error) {
|
|
35
38
|
throw error.message
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
|
|
42
|
+
const runDetectingError = async (cmd, errorRegex) => {
|
|
43
|
+
console.log(highlight(cmd))
|
|
44
|
+
return new Promise((resolve, reject) => {
|
|
45
|
+
const child = spawn(cmd, { shell: true, stdio: 'pipe' })
|
|
46
|
+
let out = '';
|
|
47
|
+
['stdout', 'stderr'].forEach(key => {
|
|
48
|
+
child[key].on('data', data => {
|
|
49
|
+
process[key].write(data.toString())
|
|
50
|
+
out += data.toString()
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
child.on('close', () => {
|
|
54
|
+
const error = out.match(errorRegex)
|
|
55
|
+
if (error) {
|
|
56
|
+
return reject('Error in command: ' + bold(cmd) + ' → exiting')
|
|
57
|
+
}
|
|
58
|
+
resolve(out)
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
39
63
|
async function up() {
|
|
40
|
-
const { apps, appName,
|
|
64
|
+
const { apps, appName, hasApprouter, hasXsuaa } = readProject()
|
|
41
65
|
|
|
42
66
|
for (const { app } of apps) {
|
|
43
|
-
const appPath = join(cds.root, cds.env.folders.app, app)
|
|
44
|
-
if (exists(join(appPath, 'package.json')) && !exists(join(appPath, 'package-lock.json'))) {
|
|
67
|
+
const appPath = path.join(cds.root, cds.env.folders.app, app)
|
|
68
|
+
if (exists(path.join(appPath, 'package.json')) && !exists(path.join(appPath, 'package-lock.json'))) {
|
|
45
69
|
run(`npm i --package-lock-only --prefix ${appPath}`)
|
|
46
70
|
}
|
|
47
71
|
}
|
|
48
72
|
|
|
49
|
-
if (
|
|
73
|
+
if (exists('mtx/sidecar') && !exists('mtx/sidecar/package-lock.json')) {
|
|
50
74
|
run('npm i --package-lock-only --prefix mtx/sidecar')
|
|
51
75
|
}
|
|
52
76
|
|
|
@@ -56,20 +80,29 @@ async function up() {
|
|
|
56
80
|
} else {
|
|
57
81
|
if (!exists('mta.yaml')) {
|
|
58
82
|
run('cds add mta')
|
|
59
|
-
|
|
60
|
-
|
|
83
|
+
}
|
|
84
|
+
if (!exists('package-lock.json')) {
|
|
61
85
|
run('npm i --package-lock-only')
|
|
62
86
|
}
|
|
63
87
|
}
|
|
88
|
+
const prefix = execSync('npm prefix', { encoding: 'utf8' }).trim()
|
|
89
|
+
if (prefix !== cds.root) {
|
|
90
|
+
const source = path.join(prefix, 'package-lock.json')
|
|
91
|
+
const target = path.join(process.cwd(), 'package-lock.json')
|
|
92
|
+
if (exists(target) || fs.lstatSync(target).isSymbolicLink()) fs.unlinkSync(target)
|
|
93
|
+
const relative = path.relative(process.cwd(), source)
|
|
94
|
+
fs.symlinkSync(relative, target, 'junction')
|
|
95
|
+
}
|
|
64
96
|
|
|
65
97
|
if (cds.cli.options.to === 'k8s') {
|
|
66
|
-
run('
|
|
98
|
+
run('npm i --package-lock')
|
|
99
|
+
await runDetectingError('ctz containerize.yaml --log --push', /^\[?ERROR\]?.*/m)
|
|
67
100
|
let helmUpgrade = `helm upgrade --install ${appName} ./gen/chart --wait --wait-for-jobs`
|
|
68
101
|
if (hasXsuaa) helmUpgrade += ' --set-file xsuaa.jsonParameters=xs-security.json'
|
|
69
102
|
run(helmUpgrade)
|
|
70
103
|
run(`kubectl rollout status deployment ${appName}-srv --timeout=8m`)
|
|
71
104
|
if (hasApprouter) run(`kubectl rollout status deployment ${appName}-approuter --timeout=8m`)
|
|
72
|
-
if (
|
|
105
|
+
if (exists('mtx/sidecar')) run(`kubectl rollout status deployment ${appName}-sidecar --timeout=8m`)
|
|
73
106
|
} else {
|
|
74
107
|
run('mbt build -t gen --mtar mta.tar')
|
|
75
108
|
run('cf deploy gen/mta.tar -f')
|