@sap/cds-dk 4.9.5 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/bin/activate.js +4 -4
- package/bin/add.js +11 -5
- package/bin/bind.js +16 -28
- package/bin/build/all.js +2 -2
- package/bin/build/index.js +12 -19
- package/bin/cds.js +16 -17
- package/bin/compile/index.js +12 -3
- package/bin/deploy/index.js +14 -14
- package/bin/deploy/to-hana.js +4 -4
- package/bin/deploy/to-sqlite.js +1 -1
- package/bin/env.js +13 -4
- package/bin/eval.js +1 -1
- package/bin/fix-redirects.js +1 -1
- package/bin/import.js +44 -179
- package/bin/repl.js +1 -1
- package/bin/watch.js +10 -15
- package/lib/bind/BindingManager.js +87 -0
- package/lib/bind/bindingResolver.js +14 -85
- package/lib/bind/bindingUtil.js +18 -11
- package/lib/bind/cfKeyProvider.js +58 -29
- package/lib/bind/kubernetesCredentialsProvider.js +44 -21
- package/lib/bind/userCdsrcJsonStorageProvider.js +12 -18
- package/lib/cds.js +13 -0
- package/lib/client/base_command.js +3 -2
- package/lib/client/extend.js +6 -7
- package/lib/client/helper/fs_helper.js +7 -8
- package/lib/client/helper/string_helper.js +6 -1
- package/lib/client/settings_manager.js +38 -45
- package/lib/compile/index.js +9 -10
- package/lib/compile/openapi/csdl2openapi.js +151 -43
- package/lib/compile/openapi/index.js +2 -2
- package/lib/compile/to-xsuaa.js +3 -2
- package/lib/import/common.js +342 -27
- package/lib/import/importapi.js +81 -13
- package/lib/import/message.js +4 -4
- package/lib/import/odata/index.js +141 -0
- package/lib/import/{utils → odata/metadataconverter}/MetadataConverter.js +2 -2
- package/lib/import/{utils → odata/metadataconverter}/MetadataConverterFactory.js +1 -1
- package/lib/import/{utils → odata/util}/MultiMap.js +0 -0
- package/lib/import/{v2parser.js → odata/v2parser.js} +405 -468
- package/lib/import/{v4parser.js → odata/v4parser.js} +311 -322
- package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Aggregation.V1.json +0 -0
- package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Authorization.V1.json +0 -0
- package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Capabilities.V1.json +0 -0
- package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Core.V1.json +0 -0
- package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Measures.V1.json +0 -0
- package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Validation.V1.json +0 -0
- package/lib/import/openapi/importOpenAPI.js +521 -0
- package/lib/import/openapi/index.js +19 -0
- package/lib/import/openapi/utilities.js +38 -0
- package/lib/index.js +1 -1
- package/lib/init/constants.js +7 -2
- package/lib/init/index.js +10 -3
- package/lib/init/template/_merging/existences.js +79 -19
- package/lib/init/template/approuter/files/mta.yaml.hbs +25 -11
- package/lib/init/template/approuter/files/package.json +1 -1
- package/lib/init/template/approuter/files/xs-app.json.hbs +7 -0
- package/lib/init/template/approuter/index.js +61 -54
- package/lib/init/template/auditlog/index.js +2 -2
- package/lib/init/template/data/index.js +2 -2
- package/lib/init/template/hana/files/mta.yaml.hbs +17 -17
- package/lib/init/template/hana/index.js +8 -4
- package/lib/init/template/helm/index.js +39 -0
- package/lib/init/template/helm/update/index.js +28 -0
- package/lib/init/template/java/index.js +7 -9
- package/lib/init/template/kibana-logging/index.js +5 -6
- package/lib/init/template/mta/index.js +4 -4
- package/lib/init/template/mtx/files/java/package.json +9 -9
- package/lib/init/template/mtx/files/mta.yaml.hbs +0 -7
- package/lib/init/template/mtx/files/xs-security.json.hbs +11 -20
- package/lib/init/template/mtx/index.js +50 -57
- package/lib/init/template/nodejs/files/package.json.hbs +2 -2
- package/lib/init/template/notebook/index.js +2 -0
- package/lib/init/template/templateBase.js +6 -4
- package/lib/init/template/xsuaa/index.js +9 -5
- package/lib/init/util/fsUtil.js +25 -10
- package/lib/init/util/logger.js +1 -1
- package/lib/init/util/mvnArchetypeUtil.js +4 -10
- package/lib/init/util/projectReader.js +16 -8
- package/lib/init/util/templateUtil.js +30 -34
- package/lib/k8s/ChartAdder.js +65 -0
- package/lib/k8s/ChartBuilder.js +186 -0
- package/lib/k8s/Context.js +71 -0
- package/lib/k8s/ImageUtil.js +21 -0
- package/lib/k8s/Model.d.ts +53 -0
- package/lib/k8s/auditlog/index.js +29 -0
- package/lib/k8s/auditlog/templates/auditlog.yaml +1 -0
- package/lib/k8s/buildModel.js +70 -0
- package/lib/k8s/connectivity/index.js +74 -0
- package/lib/k8s/connectivity/templates/connectivity-binding.yaml +9 -0
- package/lib/k8s/connectivity/templates/connectivity-proxy-info.yaml +16 -0
- package/lib/k8s/connectivity/templates/connectivity.yaml +1 -0
- package/lib/k8s/deployment/index.js +81 -0
- package/lib/k8s/deployment/subchart/Chart.yaml +6 -0
- package/lib/k8s/deployment/subchart/templates/_helpers.tpl +156 -0
- package/lib/k8s/deployment/subchart/templates/api-rule.yaml +24 -0
- package/lib/k8s/deployment/subchart/templates/deployment.yaml +110 -0
- package/lib/k8s/deployment/subchart/templates/network-policy.yaml +16 -0
- package/lib/k8s/deployment/subchart/templates/pod-disruption-budget.yaml +11 -0
- package/lib/k8s/deployment/subchart/templates/secret.yaml +10 -0
- package/lib/k8s/deployment/subchart/templates/service-binding.yaml +27 -0
- package/lib/k8s/deployment/subchart/templates/service.yaml +11 -0
- package/lib/k8s/deployment/subchart/values-lint.yaml +8 -0
- package/lib/k8s/deployment/subchart/values.schema.json +449 -0
- package/lib/k8s/deployment/subchart/values.yaml +76 -0
- package/lib/k8s/deployment/subchart-override/templates/_web_application_helpers.tpl +81 -0
- package/lib/k8s/destinations/index.js +40 -0
- package/lib/k8s/destinations/lib.js +16 -0
- package/lib/k8s/destinations/templates/destinations.yaml +1 -0
- package/lib/k8s/docker/push.js +8 -0
- package/lib/k8s/event-mesh/index.js +53 -0
- package/lib/k8s/event-mesh/lib.js +9 -0
- package/lib/k8s/event-mesh/templates/event-mesh.yaml +1 -0
- package/lib/k8s/hana-deployer/index.js +38 -0
- package/lib/k8s/hana-deployer/templates/hana-deployer-job.yaml +41 -0
- package/lib/k8s/helm/Release.js +80 -0
- package/lib/k8s/html5-apps-deployer/index.js +43 -0
- package/lib/k8s/html5-apps-deployer/templates/_html5_deployment_helpers.tpl +16 -0
- package/lib/k8s/html5-apps-deployer/templates/html5-apps-deployer-job.yaml +53 -0
- package/lib/k8s/html5-apps-repo-host/index.js +26 -0
- package/lib/k8s/html5-apps-repo-host/lib.js +16 -0
- package/lib/k8s/html5-apps-repo-host/templates/html5-apps-repo-host.yaml +1 -0
- package/lib/k8s/index.js +153 -0
- package/lib/k8s/modules.js +36 -0
- package/lib/k8s/multitenancy/index.js +24 -0
- package/lib/k8s/multitenancy/lib.js +25 -0
- package/lib/k8s/multitenancy/templates/saas-registry.yaml +19 -0
- package/lib/k8s/readProject.js +14 -0
- package/lib/k8s/resources/helm/chart/templates/NOTES.txt +11 -0
- package/lib/k8s/resources/helm/chart/templates/_deployment_helpers.tpl +221 -0
- package/lib/k8s/resources/helm/chart/templates/_helpers.tpl +167 -0
- package/lib/k8s/resources/helm/chart/templates/_sapcp_helpers.tpl +103 -0
- package/lib/k8s/util.js +186 -0
- package/lib/k8s/wrapFeature.js +55 -0
- package/lib/k8s/xsuaa/index.js +64 -0
- package/lib/k8s/xsuaa/lib.js +14 -0
- package/lib/k8s/xsuaa/templates/xsuaa.yaml +1 -0
- package/lib/util/exec.js +1 -1
- package/lib/util/write.js +1 -1
- package/lib/watch/node-watch.js +43 -14
- package/npm-shrinkwrap.json +1272 -2792
- package/package.json +5 -5
- package/lib/import/index.js +0 -235
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const os = require('os');
|
|
3
3
|
const path = require('path');
|
|
4
|
-
const { fse } = require('@sap/cds-foss');
|
|
5
4
|
|
|
6
5
|
const requireGlobal = require('./helper/dependency_helper');
|
|
7
6
|
const keytar = requireGlobal('keytar');
|
|
@@ -12,6 +11,7 @@ const Logger = require('./helper/logging');
|
|
|
12
11
|
const Question = require('./helper/question');
|
|
13
12
|
const { defaultSchema, extractSubdomain, schemaRegex } = require('./helper/url_helper');
|
|
14
13
|
const { ParamCollection, Persistence } = require('./params');
|
|
14
|
+
const { capitalize } = require('./helper/string_helper');
|
|
15
15
|
|
|
16
16
|
const CONFIG_SUBDIRS = {
|
|
17
17
|
linux: '.config',
|
|
@@ -107,7 +107,7 @@ function getKeyringAccountName(params) {
|
|
|
107
107
|
|
|
108
108
|
function logConfigPaths() {
|
|
109
109
|
Logger.debug(`Settings are stored in ${CONFIG.paths.settings}`);
|
|
110
|
-
Logger.debug(`Authentication data is stored in ${CONFIG.paths.auth} or
|
|
110
|
+
Logger.debug(`Authentication data is stored in ${CONFIG.paths.auth} (${TOKEN_STORAGE_DESC.plain}) or ${CONFIG.keyringDesignation} (${TOKEN_STORAGE_DESC.keyring})`);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
function notifyLoggedIn(params) {
|
|
@@ -133,9 +133,6 @@ class SettingsManager {
|
|
|
133
133
|
// Call with 'projectFolder' param as a resolved path.
|
|
134
134
|
static async saveSettings(params) {
|
|
135
135
|
Logger.debug(`Saving settings for project ${params.get('projectFolder')}`);
|
|
136
|
-
if (params.has('token') && ! params.has('tokenStorage')) {
|
|
137
|
-
Logger.log('Note: the authentication token is not saved by default. To save the token for later commands, please run `cds login`.');
|
|
138
|
-
}
|
|
139
136
|
|
|
140
137
|
await this._saveToFile(params.get('projectFolder'), params.toValueMap(Persistence.setting));
|
|
141
138
|
|
|
@@ -153,6 +150,8 @@ class SettingsManager {
|
|
|
153
150
|
await this._saveAuthToFile(params, params.toValueMap(Persistence.auth));
|
|
154
151
|
} else if (params.get('tokenStorage') === 'keyring') {
|
|
155
152
|
await this._saveAuthToKeyring(params, params.toValueMap(Persistence.auth));
|
|
153
|
+
} else {
|
|
154
|
+
Logger.log('Note: the authentication token is not saved by default. To save the token for later commands, please run `cds login`.');
|
|
156
155
|
}
|
|
157
156
|
}
|
|
158
157
|
|
|
@@ -160,19 +159,19 @@ class SettingsManager {
|
|
|
160
159
|
const projectFolder = getProjectFolder(params);
|
|
161
160
|
params.set('projectFolder', projectFolder);
|
|
162
161
|
|
|
163
|
-
Logger.debug(`Loading settings for project ${projectFolder}`);
|
|
164
162
|
const loadedSettings = await this._loadFromFile(projectFolder);
|
|
165
|
-
Logger.debug(`Loaded project settings: ${loadedSettings.format()}`);
|
|
163
|
+
Logger.debug(`Loaded project settings for ${params.get('projectFolder')}: ${loadedSettings.format()}`);
|
|
164
|
+
const loadedAppUrl = loadedSettings.get('appUrl');
|
|
166
165
|
|
|
167
166
|
params.mergeLower(loadedSettings);
|
|
168
167
|
|
|
169
|
-
await this.updateUrls(params, logout);
|
|
168
|
+
await this.updateUrls(params, logout, loadedAppUrl);
|
|
170
169
|
await this.checkKeytar(params, logout);
|
|
171
170
|
await this.addAuth(params, logout);
|
|
172
171
|
Logger.debug(`Effective project settings: ${params.format()}`);
|
|
173
172
|
}
|
|
174
173
|
|
|
175
|
-
static async updateUrls(params, logout) {
|
|
174
|
+
static async updateUrls(params, logout, loadedAppUrl) {
|
|
176
175
|
async function addAppUrlAndSubdomain() {
|
|
177
176
|
if (params.has('appUrl') && !schemaRegex.test(params.get('appUrl'))) {
|
|
178
177
|
params.set('appUrl', defaultSchema + params.get('appUrl'));
|
|
@@ -202,7 +201,7 @@ class SettingsManager {
|
|
|
202
201
|
}
|
|
203
202
|
}
|
|
204
203
|
function renewTokenUrl() {
|
|
205
|
-
const renewUrl = params.get('appUrl') !==
|
|
204
|
+
const renewUrl = params.get('appUrl') !== loadedAppUrl;
|
|
206
205
|
if (!params.get('tokenUrl') || renewUrl) {
|
|
207
206
|
params.set('tokenUrl', getTokenBaseUrl(params, renewUrl));
|
|
208
207
|
}
|
|
@@ -218,7 +217,7 @@ class SettingsManager {
|
|
|
218
217
|
static async checkKeytar(params, logout) {
|
|
219
218
|
if (isBas()) {
|
|
220
219
|
if (params.get('tokenStorage') === 'keyring') {
|
|
221
|
-
Logger.log(`NOTE:
|
|
220
|
+
Logger.log(`NOTE: ${capitalize(TOKEN_STORAGE_DESC.keyring)} not supported on SAP Business Application Studio. Switching to ${TOKEN_STORAGE_DESC.plain}.`);
|
|
222
221
|
params.set('tokenStorage', 'plain');
|
|
223
222
|
}
|
|
224
223
|
return;
|
|
@@ -227,11 +226,11 @@ class SettingsManager {
|
|
|
227
226
|
return;
|
|
228
227
|
}
|
|
229
228
|
if (params.get('tokenStorage') === 'keyring') {
|
|
230
|
-
throw new Error(
|
|
231
|
-
|
|
229
|
+
throw new Error(`${capitalize(TOKEN_STORAGE_DESC.keyring)} requested but keytar not installed. Run 'npm install -g keytar' or ` +
|
|
230
|
+
`switch to ${TOKEN_STORAGE_DESC.plain} by adding '--plain' (discouraged).`);
|
|
232
231
|
}
|
|
233
232
|
if (params.get('renewLogin') || logout) {
|
|
234
|
-
Logger.log(
|
|
233
|
+
Logger.log(`Disabling ${TOKEN_STORAGE_DESC.keyring} functionality: 'keytar' module not found. Run 'npm install -g keytar' to install it.`);
|
|
235
234
|
}
|
|
236
235
|
}
|
|
237
236
|
|
|
@@ -288,8 +287,6 @@ class SettingsManager {
|
|
|
288
287
|
}
|
|
289
288
|
}
|
|
290
289
|
|
|
291
|
-
Logger.debug(`Consolidating authentication data for project ${params.get('projectFolder')}`);
|
|
292
|
-
|
|
293
290
|
if (params.has('username')) {
|
|
294
291
|
if (!params.get('password') && !logout) {
|
|
295
292
|
await addPassword();
|
|
@@ -325,7 +322,7 @@ class SettingsManager {
|
|
|
325
322
|
|
|
326
323
|
fromStorage = fromStorage || allParams.get('tokenStorage');
|
|
327
324
|
if (!fromStorage) {
|
|
328
|
-
Logger.log(`
|
|
325
|
+
Logger.log(`Failed to delete authentication data: none found for ${target}`);
|
|
329
326
|
return;
|
|
330
327
|
}
|
|
331
328
|
|
|
@@ -339,13 +336,10 @@ class SettingsManager {
|
|
|
339
336
|
|
|
340
337
|
static async deleteSettingsWithoutToken(params) {
|
|
341
338
|
const projectFolder = getProjectFolder(params);
|
|
342
|
-
Logger.debug(`Deleting settings for project ${projectFolder}`);
|
|
343
339
|
await this._saveToFile(projectFolder, null);
|
|
344
340
|
}
|
|
345
341
|
|
|
346
342
|
static async deleteInvalid() {
|
|
347
|
-
Logger.log('Deleting invalid project settings');
|
|
348
|
-
|
|
349
343
|
const settingsByFolder = await this._loadFromFile(undefined);
|
|
350
344
|
const deletionFolders = [];
|
|
351
345
|
const deletionUrlsAndSubdomains = new Set();
|
|
@@ -390,29 +384,31 @@ class SettingsManager {
|
|
|
390
384
|
|
|
391
385
|
static async _saveAllSettingsToFile(paramValuesByFolder) {
|
|
392
386
|
Logger.debug(`Saving all settings to ${CONFIG.paths.settings}`);
|
|
393
|
-
await
|
|
387
|
+
await fs.promises.mkdir(path.dirname(CONFIG.paths.settings), { recursive: true })
|
|
388
|
+
await fs.promises.writeFile(CONFIG.paths.settings, JSON.stringify(paramValuesByFolder, null, 2));
|
|
394
389
|
Logger.debug('Saved settings');
|
|
395
390
|
}
|
|
396
391
|
|
|
397
392
|
static async _saveAuthToFile(params, authValues) {
|
|
398
|
-
Logger.debug(`Updating authentication data to ${CONFIG.paths.auth}`);
|
|
399
393
|
const appUrl = params.get('appUrl');
|
|
400
|
-
const location =
|
|
401
|
-
|
|
394
|
+
const location = `${TOKEN_STORAGE_DESC.plain} at ${CONFIG.paths.auth} for app URL ${appUrl}, subdomain ${params.get('subdomain')}`;
|
|
402
395
|
const allAuthValues = await this._loadAuthFromFile(undefined, undefined);
|
|
396
|
+
|
|
403
397
|
if (authValues !== null) {
|
|
404
398
|
(allAuthValues[appUrl] || (allAuthValues[appUrl] = {}))[params.get('subdomain')] = authValues;
|
|
405
|
-
await
|
|
399
|
+
await fs.promises.mkdir(path.dirname(CONFIG.paths.auth), { recursive: true })
|
|
400
|
+
await fs.promises.writeFile(CONFIG.paths.auth, JSON.stringify(allAuthValues, null, 2));
|
|
406
401
|
notifyLoggedIn(params)(`Saved authentication data to ${location}`);
|
|
407
402
|
} else if (allAuthValues[appUrl]) {
|
|
408
403
|
delete allAuthValues[appUrl][params.get('subdomain')];
|
|
409
404
|
if (Object.keys(allAuthValues[appUrl]).length === 0) {
|
|
410
405
|
delete allAuthValues[appUrl];
|
|
411
406
|
}
|
|
412
|
-
await
|
|
407
|
+
await fs.promises.mkdir(path.dirname(CONFIG.paths.auth), { recursive: true })
|
|
408
|
+
await fs.promises.writeFile(CONFIG.paths.auth, JSON.stringify(allAuthValues, null, 2));
|
|
413
409
|
Logger.log(`Deleted authentication data from ${location}`);
|
|
414
410
|
} else {
|
|
415
|
-
|
|
411
|
+
notifyLoggedIn(params)(`No authentication data to delete from ${location}`);
|
|
416
412
|
}
|
|
417
413
|
}
|
|
418
414
|
|
|
@@ -421,8 +417,7 @@ class SettingsManager {
|
|
|
421
417
|
return;
|
|
422
418
|
}
|
|
423
419
|
|
|
424
|
-
|
|
425
|
-
const location = `keyring for app URL ${params.get('appUrl')}, subdomain ${params.get('subdomain')}`;
|
|
420
|
+
const location = `${TOKEN_STORAGE_DESC.keyring} for app URL ${params.get('appUrl')}, subdomain ${params.get('subdomain')}`;
|
|
426
421
|
|
|
427
422
|
if (auth !== null) {
|
|
428
423
|
await keytar.setPassword(MTX_FULLY_QUALIFIED, getKeyringAccountName(params), JSON.stringify(auth));
|
|
@@ -437,14 +432,14 @@ class SettingsManager {
|
|
|
437
432
|
const all = !projectFolder;
|
|
438
433
|
|
|
439
434
|
if (!fs.existsSync(CONFIG.paths.settings)) {
|
|
440
|
-
Logger.debug('Settings file
|
|
435
|
+
Logger.debug('Settings file not found');
|
|
441
436
|
return emptyData(all);
|
|
442
437
|
}
|
|
443
438
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
439
|
+
let settingsByFolder
|
|
440
|
+
try {
|
|
441
|
+
settingsByFolder = JSON.parse((await fs.promises.readFile(CONFIG.paths.settings)).toString());
|
|
442
|
+
} catch (err) {
|
|
448
443
|
Logger.debug('Empty settings file');
|
|
449
444
|
return emptyData(all);
|
|
450
445
|
}
|
|
@@ -465,15 +460,15 @@ class SettingsManager {
|
|
|
465
460
|
const all = !appUrl;
|
|
466
461
|
|
|
467
462
|
if (!fs.existsSync(CONFIG.paths.auth)) {
|
|
468
|
-
Logger.debug('Authentication-data file
|
|
463
|
+
Logger.debug('Authentication-data file not found');
|
|
469
464
|
return emptyData(all);
|
|
470
465
|
}
|
|
471
466
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
Logger.debug('Empty authentication
|
|
467
|
+
let allAuth
|
|
468
|
+
try {
|
|
469
|
+
allAuth = JSON.parse((await fs.promises.readFile(CONFIG.paths.auth)).toString());
|
|
470
|
+
} catch (err) {
|
|
471
|
+
Logger.debug('Empty authentication-data file');
|
|
477
472
|
return emptyData(all);
|
|
478
473
|
}
|
|
479
474
|
|
|
@@ -482,14 +477,14 @@ class SettingsManager {
|
|
|
482
477
|
}
|
|
483
478
|
|
|
484
479
|
if (!allAuth[appUrl]) {
|
|
485
|
-
Logger.debug(`
|
|
480
|
+
Logger.debug(`File contains no authentication data for app URL ${appUrl}`);
|
|
486
481
|
return new ParamCollection();
|
|
487
482
|
}
|
|
488
483
|
|
|
489
484
|
const authForSubdomain = allAuth[appUrl][subdomain];
|
|
490
485
|
|
|
491
486
|
if (!authForSubdomain) {
|
|
492
|
-
Logger.debug(`
|
|
487
|
+
Logger.debug(`File contains no authentication data for subdomain ${subdomain} (app URL: ${appUrl})`);
|
|
493
488
|
return new ParamCollection();
|
|
494
489
|
}
|
|
495
490
|
|
|
@@ -505,12 +500,10 @@ class SettingsManager {
|
|
|
505
500
|
return new ParamCollection();
|
|
506
501
|
}
|
|
507
502
|
|
|
508
|
-
Logger.debug('Reading authentication data from keyring');
|
|
509
|
-
|
|
510
503
|
const authString = await keytar.getPassword(MTX_FULLY_QUALIFIED, getKeyringAccountName(new ParamCollection({ appUrl, subdomain })));
|
|
511
504
|
|
|
512
505
|
if (!authString) {
|
|
513
|
-
Logger.debug(
|
|
506
|
+
Logger.debug(`${capitalize(TOKEN_STORAGE_DESC.keyring)} contains no authentication data for URL ${appUrl} and subdomain '${subdomain}'`);
|
|
514
507
|
return new ParamCollection();
|
|
515
508
|
}
|
|
516
509
|
|
package/lib/compile/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
const cds = require
|
|
1
|
+
const cds = require('../cds')
|
|
2
|
+
const comp_to = cds.compile.to
|
|
3
|
+
const { defineProperty } = Object
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
'
|
|
5
|
-
'xsuaa': {enumerable:true, get:()=> require('./to-xsuaa')},
|
|
6
|
-
'openapi': {enumerable:true, get:()=> require('./openapi')},
|
|
7
|
-
'edmx-v2': {enumerable:true, value: (csn,o) => cds.compile.to.edmx(csn,{...o,flavor:'v2'}) },
|
|
8
|
-
'edmx-v4': {enumerable:true, value: (csn,o) => cds.compile.to.edmx(csn,{...o,flavor:'v4'}) },
|
|
9
|
-
'edmx-w4': {enumerable:true, value: (csn,o) => cds.compile.to.edmx(csn,{...o,flavor:'w4'}) },
|
|
10
|
-
'edmx-x4': {enumerable:true, value: (csn,o) => cds.compile.to.edmx(csn,{...o,flavor:'x4'}) },
|
|
11
|
-
})
|
|
5
|
+
'xsuaa' in comp_to || defineProperty (comp_to, 'xsuaa', {enumerable:true, get:()=> require('./to-xsuaa')})
|
|
6
|
+
'openapi' in comp_to || defineProperty (comp_to, 'openapi', {enumerable:true, get:()=> require('./openapi')})
|
|
12
7
|
|
|
8
|
+
'edmx-v2' in comp_to || defineProperty (comp_to, 'edmx-v2', {enumerable:true, value: (csn,o) => comp_to.edmx(csn,{...o,flavor:'v2'})})
|
|
9
|
+
'edmx-v4' in comp_to || defineProperty (comp_to, 'edmx-v4', {enumerable:true, value: (csn,o) => comp_to.edmx(csn,{...o,flavor:'v4'})})
|
|
10
|
+
'edmx-w4' in comp_to || defineProperty (comp_to, 'edmx-w4', {enumerable:true, value: (csn,o) => comp_to.edmx(csn,{...o,flavor:'w4'})})
|
|
11
|
+
'edmx-x4' in comp_to || defineProperty (comp_to, 'edmx-x4', {enumerable:true, value: (csn,o) => comp_to.edmx(csn,{...o,flavor:'x4'})})
|
|
13
12
|
|
|
14
13
|
module.exports = cds
|