@sap-ux/adp-tooling 0.19.10 → 1.0.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 (147) hide show
  1. package/dist/abap/client.d.ts +1 -1
  2. package/dist/abap/client.js +8 -13
  3. package/dist/abap/config.js +5 -8
  4. package/dist/abap/index.d.ts +3 -3
  5. package/dist/abap/index.js +3 -19
  6. package/dist/abap/provider.js +5 -8
  7. package/dist/base/abap/manifest-service.d.ts +1 -1
  8. package/dist/base/abap/manifest-service.js +9 -18
  9. package/dist/base/cf.js +8 -11
  10. package/dist/base/change-utils.d.ts +1 -1
  11. package/dist/base/change-utils.js +49 -62
  12. package/dist/base/constants/index.js +12 -15
  13. package/dist/base/credentials.d.ts +2 -2
  14. package/dist/base/credentials.js +6 -9
  15. package/dist/base/helper.d.ts +1 -1
  16. package/dist/base/helper.js +40 -57
  17. package/dist/base/project-builder.js +3 -6
  18. package/dist/base/prompt.d.ts +1 -1
  19. package/dist/base/prompt.js +19 -25
  20. package/dist/btp/api.d.ts +1 -1
  21. package/dist/btp/api.js +10 -18
  22. package/dist/btp/index.d.ts +1 -1
  23. package/dist/btp/index.js +1 -17
  24. package/dist/cf/app/discovery.d.ts +1 -1
  25. package/dist/cf/app/discovery.js +11 -18
  26. package/dist/cf/app/html5-repo.d.ts +1 -1
  27. package/dist/cf/app/html5-repo.js +24 -32
  28. package/dist/cf/app/index.d.ts +2 -2
  29. package/dist/cf/app/index.js +2 -18
  30. package/dist/cf/core/auth.d.ts +1 -1
  31. package/dist/cf/core/auth.js +4 -8
  32. package/dist/cf/core/config.d.ts +1 -1
  33. package/dist/cf/core/config.js +9 -15
  34. package/dist/cf/core/index.d.ts +2 -2
  35. package/dist/cf/core/index.js +2 -18
  36. package/dist/cf/deploy.d.ts +1 -1
  37. package/dist/cf/deploy.js +33 -44
  38. package/dist/cf/index.d.ts +6 -6
  39. package/dist/cf/index.js +6 -22
  40. package/dist/cf/project/index.d.ts +3 -3
  41. package/dist/cf/project/index.js +3 -19
  42. package/dist/cf/project/mta.d.ts +1 -1
  43. package/dist/cf/project/mta.js +23 -66
  44. package/dist/cf/project/yaml-loader.d.ts +1 -1
  45. package/dist/cf/project/yaml-loader.js +8 -16
  46. package/dist/cf/project/yaml.d.ts +2 -2
  47. package/dist/cf/project/yaml.js +28 -72
  48. package/dist/cf/services/api.d.ts +1 -1
  49. package/dist/cf/services/api.js +46 -93
  50. package/dist/cf/services/cli.d.ts +1 -1
  51. package/dist/cf/services/cli.js +31 -42
  52. package/dist/cf/services/destinations.js +12 -48
  53. package/dist/cf/services/index.d.ts +5 -5
  54. package/dist/cf/services/index.js +5 -21
  55. package/dist/cf/services/manifest.d.ts +1 -1
  56. package/dist/cf/services/manifest.js +9 -13
  57. package/dist/cf/services/ssh.js +14 -22
  58. package/dist/cf/utils/index.d.ts +1 -1
  59. package/dist/cf/utils/index.js +1 -17
  60. package/dist/cf/utils/validation.d.ts +1 -1
  61. package/dist/cf/utils/validation.js +12 -18
  62. package/dist/common/flp-parameters.d.ts +1 -1
  63. package/dist/common/flp-parameters.js +1 -4
  64. package/dist/common/index.d.ts +1 -1
  65. package/dist/common/index.js +1 -17
  66. package/dist/i18n.js +8 -16
  67. package/dist/index.d.ts +23 -23
  68. package/dist/index.js +23 -46
  69. package/dist/preview/adp-preview.d.ts +1 -1
  70. package/dist/preview/adp-preview.js +41 -39
  71. package/dist/preview/change-handler.d.ts +1 -1
  72. package/dist/preview/change-handler.js +51 -59
  73. package/dist/preview/descriptor-change-handler.d.ts +1 -1
  74. package/dist/preview/descriptor-change-handler.js +18 -21
  75. package/dist/preview/ovp-routes-handler.js +11 -13
  76. package/dist/preview/routes-handler.js +36 -71
  77. package/dist/preview/utils.d.ts +1 -1
  78. package/dist/preview/utils.js +5 -8
  79. package/dist/prompts/add-annotations-to-odata/index.d.ts +1 -1
  80. package/dist/prompts/add-annotations-to-odata/index.js +24 -26
  81. package/dist/prompts/add-component-usages/index.d.ts +1 -1
  82. package/dist/prompts/add-component-usages/index.js +41 -43
  83. package/dist/prompts/add-new-model/index.d.ts +1 -1
  84. package/dist/prompts/add-new-model/index.js +75 -80
  85. package/dist/prompts/change-data-source/index.d.ts +1 -1
  86. package/dist/prompts/change-data-source/index.js +19 -22
  87. package/dist/prompts/change-inbound/index.d.ts +1 -1
  88. package/dist/prompts/change-inbound/index.js +11 -14
  89. package/dist/prompts/index.d.ts +5 -5
  90. package/dist/prompts/index.js +5 -15
  91. package/dist/source/applications.d.ts +2 -2
  92. package/dist/source/applications.js +7 -11
  93. package/dist/source/index.d.ts +3 -3
  94. package/dist/source/index.js +3 -19
  95. package/dist/source/manifest.d.ts +1 -1
  96. package/dist/source/manifest.js +15 -25
  97. package/dist/source/systems.d.ts +1 -1
  98. package/dist/source/systems.js +20 -27
  99. package/dist/types.d.ts +1 -1
  100. package/dist/types.js +64 -17
  101. package/dist/ui5/fetch.d.ts +1 -1
  102. package/dist/ui5/fetch.js +8 -12
  103. package/dist/ui5/format.d.ts +1 -1
  104. package/dist/ui5/format.js +17 -29
  105. package/dist/ui5/index.d.ts +4 -4
  106. package/dist/ui5/index.js +4 -20
  107. package/dist/ui5/network.d.ts +1 -1
  108. package/dist/ui5/network.js +1 -4
  109. package/dist/ui5/validator.js +14 -20
  110. package/dist/ui5/version-info.d.ts +1 -1
  111. package/dist/ui5/version-info.js +25 -36
  112. package/dist/writer/cf.d.ts +1 -1
  113. package/dist/writer/cf.js +35 -43
  114. package/dist/writer/changes/writer-factory.d.ts +2 -2
  115. package/dist/writer/changes/writer-factory.js +10 -13
  116. package/dist/writer/changes/writers/annotations-writer.d.ts +1 -1
  117. package/dist/writer/changes/writers/annotations-writer.js +11 -46
  118. package/dist/writer/changes/writers/component-usages-writer.d.ts +1 -1
  119. package/dist/writer/changes/writers/component-usages-writer.js +9 -12
  120. package/dist/writer/changes/writers/data-source-writer.d.ts +1 -1
  121. package/dist/writer/changes/writers/data-source-writer.js +7 -10
  122. package/dist/writer/changes/writers/inbound-writer.d.ts +1 -1
  123. package/dist/writer/changes/writers/inbound-writer.js +10 -13
  124. package/dist/writer/changes/writers/index.d.ts +5 -5
  125. package/dist/writer/changes/writers/index.js +5 -21
  126. package/dist/writer/changes/writers/new-model-writer.d.ts +1 -1
  127. package/dist/writer/changes/writers/new-model-writer.js +16 -20
  128. package/dist/writer/editors.d.ts +1 -1
  129. package/dist/writer/editors.js +6 -9
  130. package/dist/writer/i18n/index.d.ts +1 -1
  131. package/dist/writer/i18n/index.js +13 -17
  132. package/dist/writer/i18n/key-user-translations.js +9 -14
  133. package/dist/writer/inbound-navigation.d.ts +1 -1
  134. package/dist/writer/inbound-navigation.js +18 -27
  135. package/dist/writer/index.d.ts +1 -1
  136. package/dist/writer/index.js +36 -37
  137. package/dist/writer/manifest/descriptor-content.d.ts +2 -2
  138. package/dist/writer/manifest/descriptor-content.js +9 -15
  139. package/dist/writer/manifest/index.d.ts +1 -1
  140. package/dist/writer/manifest/index.js +1 -17
  141. package/dist/writer/options.d.ts +1 -1
  142. package/dist/writer/options.js +16 -27
  143. package/dist/writer/project-utils.d.ts +1 -1
  144. package/dist/writer/project-utils.js +49 -57
  145. package/dist/writer/writer-config.d.ts +2 -2
  146. package/dist/writer/writer-config.js +25 -30
  147. package/package.json +19 -17
@@ -1,15 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfig = getConfig;
4
- exports.getUi5Config = getUi5Config;
5
- exports.getCfConfig = getCfConfig;
6
- const node_path_1 = require("node:path");
7
- const axios_extension_1 = require("@sap-ux/axios-extension");
8
- const ui5_1 = require("../ui5");
9
- const abap_1 = require("../abap");
10
- const types_1 = require("../types");
11
- const i18n_1 = require("../i18n");
12
- const source_1 = require("../source");
1
+ import { join } from 'node:path';
2
+ import { AdaptationProjectType } from '@sap-ux/axios-extension';
3
+ import { getFormattedVersion, getLatestVersion, getMinUI5VersionForManifest, getOfficialBaseUI5VersionUrl, getVersionToBeUsed, shouldSetMinUI5Version } from '../ui5/index.js';
4
+ import { getProviderConfig } from '../abap/index.js';
5
+ import { AppRouterType, FlexLayer } from '../types.js';
6
+ import { t } from '../i18n.js';
7
+ import { getSupportedProject } from '../source/index.js';
13
8
  /**
14
9
  * Generates the configuration object for the Adaptation Project.
15
10
  *
@@ -23,16 +18,16 @@ const source_1 = require("../source");
23
18
  * @param {ToolsLogger} options.logger - The logger for debugging and error logging.
24
19
  * @returns {Promise<AdpWriterConfig>} A promise that resolves to the generated ADP writer configuration.
25
20
  */
26
- async function getConfig(options) {
21
+ export async function getConfig(options) {
27
22
  const { configAnswers, attributeAnswers, layer, logger, packageJson, provider, publicVersions, systemVersion, manifest, projectType, toolsId, keyUserChanges } = options;
28
23
  const ato = await provider.getAtoInfo();
29
24
  const operationsType = ato.operationsType ?? 'P';
30
- const target = await (0, abap_1.getProviderConfig)(configAnswers.system, logger);
25
+ const target = await getProviderConfig(configAnswers.system, logger);
31
26
  const isCloudSystem = await provider.isAbapCloud();
32
- const isCustomerBase = layer === "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */;
27
+ const isCustomerBase = layer === FlexLayer.CUSTOMER_BASE;
33
28
  const ui5Version = isCloudSystem
34
- ? (0, ui5_1.getLatestVersion)(publicVersions)
35
- : (0, ui5_1.getVersionToBeUsed)(attributeAnswers.ui5Version, isCustomerBase, publicVersions);
29
+ ? getLatestVersion(publicVersions)
30
+ : getVersionToBeUsed(attributeAnswers.ui5Version, isCustomerBase, publicVersions);
36
31
  const { namespace, title, enableTypeScript } = attributeAnswers;
37
32
  const { application: { id, bspName }, fioriId, ach } = configAnswers;
38
33
  const app = {
@@ -44,8 +39,8 @@ async function getConfig(options) {
44
39
  ach,
45
40
  fioriId
46
41
  };
47
- const supportedProject = await (0, source_1.getSupportedProject)(provider);
48
- if (projectType === axios_extension_1.AdaptationProjectType.CLOUD_READY) {
42
+ const supportedProject = await getSupportedProject(provider);
43
+ if (projectType === AdaptationProjectType.CLOUD_READY) {
49
44
  const lrep = provider.getLayeredRepository();
50
45
  const { activeLanguages: languages } = await lrep.getSystemInfo();
51
46
  Object.assign(app, {
@@ -85,12 +80,12 @@ async function getConfig(options) {
85
80
  * @param {string | undefined} systemVersion - The SAPUI5 version detected on the target system.
86
81
  * @returns {AdpWriterConfig['ui5']} An object containing the required UI5 configuration for the writer config.
87
82
  */
88
- function getUi5Config(ui5Version, publicVersions, systemVersion) {
83
+ export function getUi5Config(ui5Version, publicVersions, systemVersion) {
89
84
  return {
90
- minVersion: (0, ui5_1.getMinUI5VersionForManifest)(publicVersions, systemVersion),
91
- version: (0, ui5_1.getFormattedVersion)(ui5Version),
92
- frameworkUrl: (0, ui5_1.getOfficialBaseUI5VersionUrl)(ui5Version),
93
- shouldSetMinVersion: (0, ui5_1.shouldSetMinUI5Version)(systemVersion)
85
+ minVersion: getMinUI5VersionForManifest(publicVersions, systemVersion),
86
+ version: getFormattedVersion(ui5Version),
87
+ frameworkUrl: getOfficialBaseUI5VersionUrl(ui5Version),
88
+ shouldSetMinVersion: shouldSetMinUI5Version(systemVersion)
94
89
  };
95
90
  }
96
91
  /**
@@ -99,12 +94,12 @@ function getUi5Config(ui5Version, publicVersions, systemVersion) {
99
94
  * @param {CreateCfConfigParams} params - The configuration parameters containing batch objects.
100
95
  * @returns {CfAdpWriterConfig} The CF configuration.
101
96
  */
102
- function getCfConfig(params) {
97
+ export function getCfConfig(params) {
103
98
  const baseApp = params.cfServicesAnswers.baseApp;
104
99
  if (!baseApp) {
105
- throw new Error((0, i18n_1.t)('errors.baseAppRequired'));
100
+ throw new Error(t('errors.baseAppRequired'));
106
101
  }
107
- const ui5Version = (0, ui5_1.getLatestVersion)(params.publicVersions);
102
+ const ui5Version = getLatestVersion(params.publicVersions);
108
103
  return {
109
104
  app: {
110
105
  id: baseApp.appId,
@@ -119,7 +114,7 @@ function getCfConfig(params) {
119
114
  org: params.cfConfig.org,
120
115
  space: params.cfConfig.space,
121
116
  html5RepoRuntimeGuid: params.html5RepoRuntimeGuid,
122
- approuter: params.cfServicesAnswers.approuter ?? types_1.AppRouterType.MANAGED,
117
+ approuter: params.cfServicesAnswers.approuter ?? AppRouterType.MANAGED,
123
118
  businessService: params.cfServicesAnswers.businessService ?? '',
124
119
  businessSolutionName: params.cfServicesAnswers.businessSolutionName,
125
120
  serviceInstanceGuid: params.serviceInstanceGuid,
@@ -131,7 +126,7 @@ function getCfConfig(params) {
131
126
  project: {
132
127
  name: params.attributeAnswers.projectName,
133
128
  path: params.projectPath,
134
- folder: (0, node_path_1.join)(params.projectPath, params.attributeAnswers.projectName)
129
+ folder: join(params.projectPath, params.attributeAnswers.projectName)
135
130
  },
136
131
  customConfig: {
137
132
  adp: {
@@ -146,7 +141,7 @@ function getCfConfig(params) {
146
141
  version: ui5Version
147
142
  },
148
143
  options: {
149
- addStandaloneApprouter: params.cfServicesAnswers.approuter === types_1.AppRouterType.STANDALONE
144
+ addStandaloneApprouter: params.cfServicesAnswers.approuter === AppRouterType.STANDALONE
150
145
  }
151
146
  };
152
147
  }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/adp-tooling",
3
3
  "description": "Tooling for UI5 adaptation projects",
4
+ "type": "module",
4
5
  "repository": {
5
6
  "type": "git",
6
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -9,7 +10,7 @@
9
10
  "bugs": {
10
11
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
11
12
  },
12
- "version": "0.19.10",
13
+ "version": "1.0.0",
13
14
  "license": "Apache-2.0",
14
15
  "author": "@SAP/ux-tools-team",
15
16
  "main": "dist/index.js",
@@ -36,21 +37,22 @@
36
37
  "prompts": "2.4.2",
37
38
  "sanitize-filename": "1.6.4",
38
39
  "uuid": "11.1.1",
39
- "@sap-ux/axios-extension": "1.26.1",
40
- "@sap-ux/btp-utils": "1.2.1",
41
- "@sap-ux/i18n": "0.4.0",
42
- "@sap-ux/inquirer-common": "0.13.5",
43
- "@sap-ux/logger": "0.9.0",
44
- "@sap-ux/nodejs-utils": "0.3.2",
45
- "@sap-ux/odata-service-writer": "0.32.2",
46
- "@sap-ux/project-access": "1.38.1",
47
- "@sap-ux/project-input-validator": "0.7.2",
48
- "@sap-ux/store": "1.6.1",
49
- "@sap-ux/system-access": "0.8.2",
50
- "@sap-ux/ui5-config": "0.31.1",
51
- "@sap-ux/ui5-info": "0.14.0"
40
+ "@sap-ux/axios-extension": "2.0.0",
41
+ "@sap-ux/btp-utils": "2.0.0",
42
+ "@sap-ux/i18n": "1.0.0",
43
+ "@sap-ux/inquirer-common": "1.0.0",
44
+ "@sap-ux/logger": "1.0.0",
45
+ "@sap-ux/nodejs-utils": "1.0.0",
46
+ "@sap-ux/odata-service-writer": "1.0.0",
47
+ "@sap-ux/project-access": "2.0.0",
48
+ "@sap-ux/project-input-validator": "1.0.0",
49
+ "@sap-ux/store": "2.0.0",
50
+ "@sap-ux/system-access": "1.0.0",
51
+ "@sap-ux/ui5-config": "1.0.0",
52
+ "@sap-ux/ui5-info": "1.0.0"
52
53
  },
53
54
  "devDependencies": {
55
+ "@jest/globals": "30.3.0",
54
56
  "@types/adm-zip": "0.5.8",
55
57
  "@types/ejs": "3.1.5",
56
58
  "@types/express": "4.17.21",
@@ -68,7 +70,7 @@
68
70
  "nock": "14.0.11",
69
71
  "rimraf": "6.1.3",
70
72
  "supertest": "7.2.2",
71
- "@sap-ux/store": "1.6.1"
73
+ "@sap-ux/store": "2.0.0"
72
74
  },
73
75
  "engines": {
74
76
  "node": ">=22.x"
@@ -80,8 +82,8 @@
80
82
  "format": "prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",
81
83
  "lint": "eslint",
82
84
  "lint:fix": "eslint --fix",
83
- "test": "cross-env FIORI_TOOLS_DISABLE_SECURE_STORE=true jest --ci --forceExit --detectOpenHandles --colors --testPathPatterns=test/unit",
84
- "test-u": "cross-env FIORI_TOOLS_DISABLE_SECURE_STORE=true jest --ci --forceExit --detectOpenHandles --colors -u",
85
+ "test": "cross-env FIORI_TOOLS_DISABLE_SECURE_STORE=true NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors --testPathPatterns=test/unit",
86
+ "test-u": "cross-env NODE_OPTIONS='--experimental-vm-modules' FIORI_TOOLS_DISABLE_SECURE_STORE=true jest --ci --forceExit --detectOpenHandles --colors -u",
85
87
  "link": "pnpm link --global",
86
88
  "unlink": "pnpm unlink --global"
87
89
  }