@sap-ux/create 0.8.78 → 0.8.80

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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addAnnotationsToOdataCommand = addAnnotationsToOdataCommand;
4
4
  const adp_tooling_1 = require("@sap-ux/adp-tooling");
5
+ const odata_service_writer_1 = require("@sap-ux/odata-service-writer");
5
6
  const tracing_1 = require("../../tracing");
6
7
  const common_1 = require("../../common");
7
8
  const validation_1 = require("../../validation/validation");
@@ -35,13 +36,21 @@ async function addAnnotationsToOdata(basePath, simulate, yamlPath) {
35
36
  await (0, validation_1.validateAdpProject)(basePath);
36
37
  const variant = (0, adp_tooling_1.getVariant)(basePath);
37
38
  const adpConfig = await (0, adp_tooling_1.getAdpConfig)(basePath, yamlPath);
38
- const dataSources = await (0, adp_tooling_1.getManifestDataSources)(variant.reference, adpConfig, logger);
39
+ const manifestService = await adp_tooling_1.ManifestService.initMergedManifest(basePath, variant, adpConfig, logger);
40
+ const dataSources = manifestService.getManifestDataSources();
39
41
  const answers = await (0, common_1.promptYUIQuestions)((0, adp_tooling_1.getPromptsForAddAnnotationsToOData)(basePath, dataSources), false);
42
+ let namespaces = [];
43
+ if (!answers.filePath) {
44
+ const metadata = await manifestService.getDataSourceMetadata(answers.id);
45
+ namespaces = (0, odata_service_writer_1.getAnnotationNamespaces)({ metadata });
46
+ }
40
47
  const fs = await (0, adp_tooling_1.generateChange)(basePath, "appdescr_app_addAnnotationsToOData" /* ChangeType.ADD_ANNOTATIONS_TO_ODATA */, {
41
48
  variant,
42
49
  annotation: {
43
50
  dataSource: answers.id,
44
- filePath: answers.filePath
51
+ filePath: answers.filePath,
52
+ namespaces,
53
+ serviceUrl: dataSources[answers.id].uri
45
54
  }
46
55
  });
47
56
  if (!simulate) {
@@ -55,7 +64,7 @@ async function addAnnotationsToOdata(basePath, simulate, yamlPath) {
55
64
  logger.error(error.message);
56
65
  if (error.response?.status === 401 && loginAttempts) {
57
66
  loginAttempts--;
58
- logger.error(`Authentication failed. Please check your credentials. Login attempts left: ${loginAttempts}`);
67
+ logger.error(`Authentication failed. Please check your credentials. Login attempts left: ${loginAttempts + 1}`);
59
68
  await addAnnotationsToOdata(basePath, simulate, yamlPath);
60
69
  return;
61
70
  }
@@ -35,7 +35,8 @@ async function changeDataSource(basePath, simulate, yamlPath) {
35
35
  await (0, validation_1.validateAdpProject)(basePath);
36
36
  const variant = (0, adp_tooling_1.getVariant)(basePath);
37
37
  const adpConfig = await (0, adp_tooling_1.getAdpConfig)(basePath, yamlPath);
38
- const dataSources = await (0, adp_tooling_1.getManifestDataSources)(variant.reference, adpConfig, logger);
38
+ const manifestService = await adp_tooling_1.ManifestService.initBaseManifest(variant.reference, adpConfig, logger);
39
+ const dataSources = manifestService.getManifestDataSources();
39
40
  const answers = await (0, common_1.promptYUIQuestions)((0, adp_tooling_1.getPromptsForChangeDataSource)(dataSources), false);
40
41
  const fs = await (0, adp_tooling_1.generateChange)(basePath, "appdescr_app_changeDataSource" /* ChangeType.CHANGE_DATA_SOURCE */, {
41
42
  variant,
@@ -53,7 +54,7 @@ async function changeDataSource(basePath, simulate, yamlPath) {
53
54
  logger.error(error.message);
54
55
  if (error.response?.status === 401 && loginAttempts) {
55
56
  loginAttempts--;
56
- logger.error(`Authentication failed. Please check your credentials. Login attempts left: ${loginAttempts}`);
57
+ logger.error(`Authentication failed. Please check your credentials. Login attempts left: ${loginAttempts + 1}`);
57
58
  await changeDataSource(basePath, simulate, yamlPath);
58
59
  return;
59
60
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/create",
3
3
  "description": "SAP Fiori tools module to add or remove features",
4
- "version": "0.8.78",
4
+ "version": "0.8.80",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,19 +30,20 @@
30
30
  "mem-fs": "2.1.0",
31
31
  "mem-fs-editor": "9.4.0",
32
32
  "prompts": "2.4.2",
33
- "@sap-ux/abap-deploy-config-inquirer": "1.0.20",
34
- "@sap-ux/adp-tooling": "0.12.76",
35
- "@sap-ux/abap-deploy-config-writer": "0.0.59",
36
- "@sap-ux/app-config-writer": "0.4.52",
37
- "@sap-ux/cap-config-writer": "0.7.57",
38
- "@sap-ux/cards-editor-config-writer": "0.4.6",
39
- "@sap-ux/inquirer-common": "0.5.0",
33
+ "@sap-ux/abap-deploy-config-inquirer": "1.0.22",
34
+ "@sap-ux/abap-deploy-config-writer": "0.0.61",
35
+ "@sap-ux/adp-tooling": "0.12.78",
36
+ "@sap-ux/app-config-writer": "0.4.54",
37
+ "@sap-ux/cap-config-writer": "0.7.58",
38
+ "@sap-ux/cards-editor-config-writer": "0.4.7",
39
+ "@sap-ux/inquirer-common": "0.5.1",
40
40
  "@sap-ux/logger": "0.6.0",
41
- "@sap-ux/mockserver-config-writer": "0.6.6",
42
- "@sap-ux/preview-middleware": "0.16.118",
43
- "@sap-ux/system-access": "0.5.17",
44
- "@sap-ux/project-access": "1.28.6",
45
- "@sap-ux/ui5-config": "0.25.1"
41
+ "@sap-ux/mockserver-config-writer": "0.6.7",
42
+ "@sap-ux/odata-service-writer": "0.23.3",
43
+ "@sap-ux/preview-middleware": "0.16.120",
44
+ "@sap-ux/project-access": "1.28.7",
45
+ "@sap-ux/system-access": "0.5.18",
46
+ "@sap-ux/ui5-config": "0.25.2"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@types/diff": "5.0.9",
@@ -50,7 +51,7 @@
50
51
  "@types/mem-fs": "1.1.2",
51
52
  "@types/mem-fs-editor": "7.0.1",
52
53
  "@types/prompts": "2.4.4",
53
- "@sap-ux/inquirer-common": "0.5.0",
54
+ "@sap-ux/inquirer-common": "0.5.1",
54
55
  "@sap-ux/store": "0.9.3"
55
56
  },
56
57
  "scripts": {