@sap/cds-dk 6.7.1 → 6.8.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.
- package/CHANGELOG.md +31 -0
- package/bin/deploy/index.js +1 -1
- package/bin/import.js +5 -3
- package/bin/login.js +29 -9
- package/bin/migrate.js +6 -2
- package/bin/watch.js +16 -0
- package/lib/bind/bindingUtil.js +2 -2
- package/lib/bind/userCdsrcJsonStorageProvider.js +1 -1
- package/lib/client/auth_manager.js +3 -1
- package/lib/client/helper/errors.js +6 -1
- package/lib/client/params.js +22 -20
- package/lib/client/settings_manager.js +17 -3
- package/lib/compile/openapi/csdl2openapi.js +4 -1
- package/lib/import/asyncapi/importAsyncAPI.js +32 -0
- package/lib/import/asyncapi/index.js +15 -0
- package/lib/import/asyncapi/parserContext.js +351 -0
- package/lib/import/asyncapi/utils.js +18 -0
- package/lib/import/common.js +21 -67
- package/lib/import/importapi.js +23 -2
- package/lib/import/message.js +11 -1
- package/lib/import/odata/index.js +14 -11
- package/lib/import/odata/metadataconverter/MetadataConverter.js +35 -35
- package/lib/import/odata/util/MultiMap.js +5 -5
- package/lib/import/odata/v2parser.js +1 -0
- package/lib/import/odata/v4parser.js +1281 -1139
- package/lib/init/constants.js +10 -3
- package/lib/init/template/_merging/registry-mta.js +33 -36
- package/lib/init/template/approuter/files/mtxs-configmap-java.yaml +20 -0
- package/lib/init/template/approuter/files/mtxs-configmap-nodejs.yaml +12 -0
- package/lib/init/template/approuter/index.js +24 -33
- package/lib/init/template/auditlog/files/package.json.hbs +27 -0
- package/lib/init/template/auditlog/index.js +12 -6
- package/lib/init/template/cf-manifest/index.js +1 -1
- package/lib/init/template/connectivity/index.js +1 -1
- package/lib/init/template/destinations/index.js +4 -2
- package/lib/init/template/enterprise-messaging/files/package.json.hbs +19 -0
- package/lib/init/template/enterprise-messaging/index.js +15 -13
- package/lib/init/template/enterprise-messaging-shared/files/event-mesh.json.hbs +31 -0
- package/lib/init/template/enterprise-messaging-shared/files/mta.yaml.hbs +15 -0
- package/lib/init/template/enterprise-messaging-shared/files/package.json.hbs +22 -0
- package/lib/init/template/enterprise-messaging-shared/files/values.yaml +7 -0
- package/lib/init/template/enterprise-messaging-shared/index.js +51 -0
- package/lib/init/template/extensibility/files/package.json.hbs +20 -0
- package/lib/init/template/extensibility/index.js +4 -16
- package/lib/init/template/file-based-messaging/files/package.json.hbs +19 -0
- package/lib/init/template/file-based-messaging/index.js +25 -0
- package/lib/init/template/hana/files/package.json.hbs +33 -0
- package/lib/init/template/hana/index.js +38 -65
- package/lib/init/template/helm/chart/templates/_deployment_helpers.tpl +0 -12
- package/lib/init/template/helm/chart/templates/_helpers.tpl +1 -121
- package/lib/init/template/helm/index.js +1 -1
- package/lib/init/template/html5-repo/index.js +1 -1
- package/lib/init/template/java/index.js +2 -2
- package/lib/init/template/kibana-logging/files/package.json.hbs +17 -0
- package/lib/init/template/kibana-logging/index.js +6 -19
- package/lib/init/template/lint/index.js +1 -1
- package/lib/init/template/mta/index.js +2 -2
- package/lib/init/template/multitenancy/files/mtxs-configmap-java.yaml +3 -5
- package/lib/init/template/multitenancy/files/mtxs-configmap-nodejs.yaml +3 -10
- package/lib/init/template/multitenancy/files/package.json.hbs +5 -4
- package/lib/init/template/multitenancy/index.js +22 -19
- package/lib/init/template/nodejs/files/.vscode/launch.json +11 -3
- package/lib/init/template/nodejs/index.js +1 -1
- package/lib/init/template/pipeline/index.js +1 -1
- package/lib/init/template/redis-messaging/files/mta.yaml.hbs +14 -0
- package/lib/init/template/redis-messaging/files/package.json.hbs +22 -0
- package/lib/init/template/redis-messaging/index.js +50 -0
- package/lib/init/template/samples/index.js +3 -3
- package/lib/init/template/sqlite/files/package.json.hbs +12 -4
- package/lib/init/template/sqlite/index.js +5 -1
- package/lib/init/template/toggles/files/package.json.hbs +20 -0
- package/lib/init/template/toggles/index.js +3 -9
- package/lib/init/template/xsuaa/files/package.json.hbs +28 -0
- package/lib/init/template/xsuaa/index.js +8 -23
- package/lib/init/util/{md5Tracking.js → md5.js} +1 -1
- package/lib/init/util/merge.js +4 -9
- package/lib/init/util/{mvnArchetypeUtil.js → mvn.js} +3 -0
- package/lib/init/util/projectReader.js +25 -107
- package/lib/init/util/xml.js +56 -0
- package/lib/lint/checks.js +1 -1
- package/lib/lint/io.js +1 -1
- package/lib/{init/util/commandUtil.js → util/command.js} +4 -2
- package/lib/{init/util/fsUtil.js → util/fs.js} +2 -2
- package/npm-shrinkwrap.json +335 -2212
- package/package.json +5 -4
- package/lib/init/template/approuter/files/cds.cdsrc.json +0 -7
- package/lib/init/template/approuter/files/cds.cdsrc.json.hbs +0 -9
- package/lib/init/template/approuter/files/cds.package.json +0 -9
- package/lib/init/template/approuter/files/cds.package.json.hbs +0 -11
- package/lib/init/template/auditlog/files/dependencies.package.json +0 -5
- package/lib/init/template/enterprise-messaging/files/cds.package.json +0 -9
- package/lib/init/template/enterprise-messaging/files/cds.profile.package.json.hbs +0 -11
- package/lib/init/template/enterprise-messaging/files/cdsrc.json +0 -7
- package/lib/init/template/enterprise-messaging/files/cdsrc.json.hbs +0 -9
- package/lib/init/template/extensibility/files/cds.package.json +0 -7
- package/lib/init/template/extensibility/files/cds.package.json.hbs +0 -9
- package/lib/init/template/extensibility/files/cdsrc.json +0 -5
- package/lib/init/template/extensibility/files/cdsrc.json.hbs +0 -7
- package/lib/init/template/hana/files/java/cds.json.hbs +0 -7
- package/lib/init/template/hana/files/java/cds.profile.json.hbs +0 -12
- package/lib/init/template/hana/files/java/cds.shortcut.json.hbs +0 -5
- package/lib/init/template/hana/files/java/cds.shortcut.profile.json.hbs +0 -8
- package/lib/init/template/hana/files/nodejs/cds.json.hbs +0 -9
- package/lib/init/template/hana/files/nodejs/cds.profile.json.hbs +0 -14
- package/lib/init/template/hana/files/nodejs/cds.shortcut.json.hbs +0 -7
- package/lib/init/template/hana/files/nodejs/cds.shortcut.profile.json.hbs +0 -10
- package/lib/init/template/hana/files/nodejs/dependencies.package.json +0 -5
- package/lib/init/template/helm/chart/templates/_sapcp_helpers.tpl +0 -103
- package/lib/init/template/kibana-logging/files/cds.profile.package.json.hbs +0 -9
- package/lib/init/template/toggles/files/cds.package.json +0 -7
- package/lib/init/template/toggles/files/cds.package.json.hbs +0 -9
- package/lib/init/template/toggles/files/cdsrc.json +0 -5
- package/lib/init/template/toggles/files/cdsrc.json.hbs +0 -7
- package/lib/init/template/xsuaa/files/cds.cdsrc.json +0 -7
- package/lib/init/template/xsuaa/files/cds.cdsrc.json.hbs +0 -9
- package/lib/init/template/xsuaa/files/cds.package.json +0 -9
- package/lib/init/template/xsuaa/files/cds.package.json.hbs +0 -11
- package/lib/init/template/xsuaa/files/dependencies.package.json +0 -6
- package/lib/init/util/versionCompare.js +0 -73
- /package/lib/init/template/hana/files/{java/db → db}/package.json +0 -0
- /package/lib/init/template/hana/files/{common/src → src}/.hdiconfig +0 -0
- /package/lib/init/template/hana/files/{common/undeploy.json → undeploy.json} +0 -0
- /package/lib/init/util/{templateUtil.js → template.js} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const cds = require('../../cds')
|
|
2
|
+
const { read } = cds.utils
|
|
3
|
+
const LOG = console
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Remove the _text attributes and convert value it into array
|
|
7
|
+
input : "groupId":[{"_text":["customer"]}]
|
|
8
|
+
output: "groupId":["customer"]
|
|
9
|
+
*/
|
|
10
|
+
function _removeTextAttributes(value, parentElement) {
|
|
11
|
+
const parentKeys = Object.keys(parentElement._parent)
|
|
12
|
+
const key = parentKeys[parentKeys.length - 1]
|
|
13
|
+
const _text = parentElement._parent[key]
|
|
14
|
+
if (_text.length > 0) {
|
|
15
|
+
_text[_text.length - 1] = value
|
|
16
|
+
} else {
|
|
17
|
+
parentElement._parent[key] = value
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Parse a given string containing xml
|
|
23
|
+
* used to remove the _text object from converted json i.e. from xml-js.
|
|
24
|
+
* example: converted json has "groupId":[{"_text":["customer"]}]
|
|
25
|
+
* and after removing textAttributes (using this function): "groupId":["customer"]
|
|
26
|
+
* @param xml string to parse
|
|
27
|
+
* @returns parsed json object
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
async function parseXml(pomXmlPath) {
|
|
31
|
+
const xmljs = require('xml-js')
|
|
32
|
+
const xmljsParse = {}
|
|
33
|
+
try {
|
|
34
|
+
const xml = await read(pomXmlPath, 'utf-8')
|
|
35
|
+
xmljsParse.project = JSON.parse(xmljs.xml2json(xml, {
|
|
36
|
+
ignoreComment: true,
|
|
37
|
+
compact: true,
|
|
38
|
+
alwaysArray: true,
|
|
39
|
+
ignoreDeclaration: true,
|
|
40
|
+
attributesKey: "$",
|
|
41
|
+
trim: true,
|
|
42
|
+
nativeType: true,
|
|
43
|
+
ignoreInstruction: true,
|
|
44
|
+
ignoreCdata: true,
|
|
45
|
+
ignoreDoctype: true,
|
|
46
|
+
textFn: _removeTextAttributes
|
|
47
|
+
})).project[0]
|
|
48
|
+
return xmljsParse
|
|
49
|
+
} catch (e) {
|
|
50
|
+
// REVISIT: We shouldn't continue with errors
|
|
51
|
+
LOG.error(`Failed to read file ${pomXmlPath} - skip pom.xml data`)
|
|
52
|
+
LOG.error(e)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = { parseXml }
|
package/lib/lint/checks.js
CHANGED
|
@@ -2,7 +2,7 @@ const fs = require("fs");
|
|
|
2
2
|
const os = require("os");
|
|
3
3
|
const path = require("path");
|
|
4
4
|
const term = require("../util/term");
|
|
5
|
-
const commandUtil = require("../
|
|
5
|
+
const commandUtil = require("../util/command");
|
|
6
6
|
|
|
7
7
|
const IS_WIN = os.platform() === "win32";
|
|
8
8
|
const { URLS } = require("../init/constants");
|
package/lib/lint/io.js
CHANGED
|
@@ -2,7 +2,7 @@ const path = require("path");
|
|
|
2
2
|
const yaml = require("@sap/cds-foss")("yaml");
|
|
3
3
|
const term = require("../util/term");
|
|
4
4
|
const { read, write, exists } = require('../cds').utils;
|
|
5
|
-
const { readJSONC } = require("../
|
|
5
|
+
const { readJSONC } = require("../util/fs");
|
|
6
6
|
const JSONC = require('../util/jsonc');
|
|
7
7
|
|
|
8
8
|
module.exports = {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
// REVISIT: Consolidate with lib/util/exec.js
|
|
2
|
+
|
|
1
3
|
const cp = require('child_process');
|
|
2
4
|
const os = require('os');
|
|
3
|
-
const cds = require('
|
|
5
|
+
const cds = require('../cds');
|
|
4
6
|
const DEBUG = cds.debug('cli');
|
|
5
7
|
|
|
6
8
|
|
|
7
|
-
const { IS_WIN } = require('../constants');
|
|
9
|
+
const { IS_WIN } = require('../init/constants');
|
|
8
10
|
|
|
9
11
|
class CommandUtil {
|
|
10
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { yaml: YAML } = require('@sap/cds-foss')
|
|
2
|
-
const JSONC = require('
|
|
3
|
-
const { read, write } = require('
|
|
2
|
+
const JSONC = require('./jsonc');
|
|
3
|
+
const { read, write } = require('../cds').utils;
|
|
4
4
|
|
|
5
5
|
// REVISIT: Consider merging with template util
|
|
6
6
|
|