@sap-ux/preview-middleware 0.26.12 → 1.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.
Files changed (196) hide show
  1. package/dist/base/cdm.d.ts +2 -2
  2. package/dist/base/cdm.js +10 -11
  3. package/dist/base/config.d.ts +1 -1
  4. package/dist/base/config.js +60 -72
  5. package/dist/base/flex.js +16 -23
  6. package/dist/base/flp.d.ts +2 -2
  7. package/dist/base/flp.js +96 -96
  8. package/dist/base/index.d.ts +3 -3
  9. package/dist/base/index.js +3 -12
  10. package/dist/base/remote-url.js +14 -24
  11. package/dist/base/test.d.ts +1 -1
  12. package/dist/base/test.js +2 -6
  13. package/dist/base/utils/cards.d.ts +1 -1
  14. package/dist/base/utils/cards.js +3 -9
  15. package/dist/client/adp/add-fragment.js +4 -4
  16. package/dist/client/adp/add-fragment.ts +2 -2
  17. package/dist/client/adp/api-handler.js +2 -2
  18. package/dist/client/adp/api-handler.ts +1 -1
  19. package/dist/client/adp/command-executor.js +3 -3
  20. package/dist/client/adp/command-executor.ts +2 -2
  21. package/dist/client/adp/controllers/AddActionFragment.controller.js +5 -5
  22. package/dist/client/adp/controllers/AddActionFragment.controller.ts +7 -7
  23. package/dist/client/adp/controllers/AddCustomFragment.controller.js +7 -7
  24. package/dist/client/adp/controllers/AddCustomFragment.controller.ts +9 -9
  25. package/dist/client/adp/controllers/AddFragment.controller.js +7 -7
  26. package/dist/client/adp/controllers/AddFragment.controller.ts +11 -11
  27. package/dist/client/adp/controllers/AddSubpage.controller.js +4 -4
  28. package/dist/client/adp/controllers/AddSubpage.controller.ts +7 -7
  29. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +7 -7
  30. package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +11 -11
  31. package/dist/client/adp/controllers/BaseDialog.controller.js +3 -3
  32. package/dist/client/adp/controllers/BaseDialog.controller.ts +6 -6
  33. package/dist/client/adp/controllers/ControllerExtension.controller.js +14 -14
  34. package/dist/client/adp/controllers/ControllerExtension.controller.ts +12 -12
  35. package/dist/client/adp/controllers/ExtensionPoint.controller.js +4 -4
  36. package/dist/client/adp/controllers/ExtensionPoint.controller.ts +5 -5
  37. package/dist/client/adp/controllers/FileExistsDialog.controller.js +2 -2
  38. package/dist/client/adp/controllers/FileExistsDialog.controller.ts +2 -2
  39. package/dist/client/adp/dialog-factory.js +2 -2
  40. package/dist/client/adp/dialog-factory.ts +16 -16
  41. package/dist/client/adp/extend-controller.js +4 -4
  42. package/dist/client/adp/extend-controller.ts +2 -2
  43. package/dist/client/adp/extension-point.js +5 -5
  44. package/dist/client/adp/extension-point.ts +4 -4
  45. package/dist/client/adp/init-dialogs.js +6 -6
  46. package/dist/client/adp/init-dialogs.ts +6 -6
  47. package/dist/client/adp/init.js +13 -13
  48. package/dist/client/adp/init.ts +9 -9
  49. package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +8 -8
  50. package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.ts +10 -10
  51. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +13 -13
  52. package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +11 -11
  53. package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +11 -11
  54. package/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +10 -10
  55. package/dist/client/adp/quick-actions/common/create-page-action.js +8 -8
  56. package/dist/client/adp/quick-actions/common/create-page-action.ts +7 -7
  57. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +6 -6
  58. package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +5 -5
  59. package/dist/client/adp/quick-actions/common/op-add-header-field.js +7 -7
  60. package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -7
  61. package/dist/client/adp/quick-actions/common/utils.ts +1 -1
  62. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +3 -3
  63. package/dist/client/adp/quick-actions/dialog-enablement-validator.ts +3 -3
  64. package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +6 -6
  65. package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.ts +5 -5
  66. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +5 -5
  67. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.ts +5 -5
  68. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +7 -7
  69. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +5 -5
  70. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +11 -11
  71. package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +6 -6
  72. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +13 -13
  73. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +7 -7
  74. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +9 -9
  75. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +6 -6
  76. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +11 -11
  77. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +6 -6
  78. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +4 -4
  79. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.ts +3 -3
  80. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +4 -4
  81. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +4 -4
  82. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +12 -12
  83. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +8 -8
  84. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +6 -6
  85. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.ts +5 -5
  86. package/dist/client/adp/quick-actions/fe-v2/registry.js +18 -18
  87. package/dist/client/adp/quick-actions/fe-v2/registry.ts +18 -18
  88. package/dist/client/adp/quick-actions/fe-v2/utils.js +4 -4
  89. package/dist/client/adp/quick-actions/fe-v2/utils.ts +2 -2
  90. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +7 -7
  91. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.ts +5 -5
  92. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +9 -9
  93. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.ts +7 -7
  94. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +6 -6
  95. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +6 -6
  96. package/dist/client/adp/quick-actions/fe-v4/create-page-action.js +11 -11
  97. package/dist/client/adp/quick-actions/fe-v4/create-page-action.ts +9 -9
  98. package/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.js +13 -13
  99. package/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.ts +11 -11
  100. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.js +16 -16
  101. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.ts +9 -9
  102. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +5 -5
  103. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.ts +4 -4
  104. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +5 -5
  105. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts +5 -5
  106. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +7 -7
  107. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +6 -6
  108. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +5 -5
  109. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts +5 -5
  110. package/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.js +8 -8
  111. package/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.ts +8 -8
  112. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +12 -12
  113. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +8 -8
  114. package/dist/client/adp/quick-actions/fe-v4/registry.js +17 -17
  115. package/dist/client/adp/quick-actions/fe-v4/registry.ts +17 -17
  116. package/dist/client/adp/quick-actions/fe-v4/utils.js +6 -6
  117. package/dist/client/adp/quick-actions/fe-v4/utils.ts +3 -3
  118. package/dist/client/adp/quick-actions/load.ts +2 -2
  119. package/dist/client/adp/quick-actions/quick-action-base.js +2 -2
  120. package/dist/client/adp/quick-actions/quick-action-base.ts +3 -3
  121. package/dist/client/adp/quick-actions/simple-quick-action-base.js +3 -3
  122. package/dist/client/adp/quick-actions/simple-quick-action-base.ts +4 -4
  123. package/dist/client/adp/quick-actions/table-quick-action-base.js +17 -17
  124. package/dist/client/adp/quick-actions/table-quick-action-base.ts +9 -9
  125. package/dist/client/adp/sync-views-utils.js +4 -4
  126. package/dist/client/adp/sync-views-utils.ts +3 -3
  127. package/dist/client/adp/utils.js +3 -3
  128. package/dist/client/adp/utils.ts +2 -2
  129. package/dist/client/cpe/additional-change-info/add-xml-additional-info.js +7 -7
  130. package/dist/client/cpe/additional-change-info/add-xml-additional-info.ts +2 -2
  131. package/dist/client/cpe/changes/flex-change.js +3 -3
  132. package/dist/client/cpe/changes/flex-change.ts +3 -3
  133. package/dist/client/cpe/changes/generic-change.js +5 -5
  134. package/dist/client/cpe/changes/generic-change.ts +4 -4
  135. package/dist/client/cpe/changes/index.js +2 -2
  136. package/dist/client/cpe/changes/index.ts +1 -1
  137. package/dist/client/cpe/changes/service.js +12 -12
  138. package/dist/client/cpe/changes/service.ts +9 -9
  139. package/dist/client/cpe/changes/validator.js +2 -2
  140. package/dist/client/cpe/changes/validator.ts +1 -1
  141. package/dist/client/cpe/communication-service.js +2 -2
  142. package/dist/client/cpe/communication-service.ts +2 -2
  143. package/dist/client/cpe/connector-service.js +3 -3
  144. package/dist/client/cpe/connector-service.ts +3 -3
  145. package/dist/client/cpe/context-menu-service.js +6 -6
  146. package/dist/client/cpe/context-menu-service.ts +6 -6
  147. package/dist/client/cpe/control-data.js +3 -3
  148. package/dist/client/cpe/control-data.ts +5 -5
  149. package/dist/client/cpe/documentation.js +4 -4
  150. package/dist/client/cpe/documentation.ts +5 -5
  151. package/dist/client/cpe/init.js +15 -15
  152. package/dist/client/cpe/init.ts +16 -16
  153. package/dist/client/cpe/odata-health/odata-health-checker.js +5 -5
  154. package/dist/client/cpe/odata-health/odata-health-checker.ts +10 -10
  155. package/dist/client/cpe/outline/editable.js +4 -4
  156. package/dist/client/cpe/outline/editable.ts +4 -4
  157. package/dist/client/cpe/outline/nodes.js +7 -7
  158. package/dist/client/cpe/outline/nodes.ts +7 -7
  159. package/dist/client/cpe/outline/service.js +3 -3
  160. package/dist/client/cpe/outline/service.ts +4 -4
  161. package/dist/client/cpe/quick-actions/quick-action-service.js +5 -5
  162. package/dist/client/cpe/quick-actions/quick-action-service.ts +10 -10
  163. package/dist/client/cpe/quick-actions/registry.js +3 -3
  164. package/dist/client/cpe/quick-actions/registry.ts +4 -4
  165. package/dist/client/cpe/quick-actions/utils.js +3 -3
  166. package/dist/client/cpe/quick-actions/utils.ts +2 -2
  167. package/dist/client/cpe/rta-service.ts +1 -1
  168. package/dist/client/cpe/selection.js +8 -8
  169. package/dist/client/cpe/selection.ts +7 -7
  170. package/dist/client/cpe/utils.js +2 -2
  171. package/dist/client/cpe/utils.ts +2 -2
  172. package/dist/client/flp/WorkspaceConnector.js +6 -6
  173. package/dist/client/flp/WorkspaceConnector.ts +4 -4
  174. package/dist/client/flp/enableFakeConnector.js +4 -4
  175. package/dist/client/flp/enableFakeConnector.ts +3 -3
  176. package/dist/client/flp/init.js +6 -6
  177. package/dist/client/flp/init.ts +5 -5
  178. package/dist/client/flp/initConnectors.js +3 -3
  179. package/dist/client/flp/initConnectors.ts +1 -1
  180. package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +397 -477
  181. package/dist/client/utils/additional-change-info.js +2 -2
  182. package/dist/client/utils/additional-change-info.ts +2 -2
  183. package/dist/client/utils/core.js +2 -2
  184. package/dist/client/utils/core.ts +1 -1
  185. package/dist/client/utils/fe-v4.js +3 -3
  186. package/dist/client/utils/fe-v4.ts +2 -2
  187. package/dist/client/utils/info-center-message.js +3 -3
  188. package/dist/client/utils/info-center-message.ts +2 -2
  189. package/dist/client/utils/version.js +2 -2
  190. package/dist/client/utils/version.ts +1 -1
  191. package/dist/index.d.ts +3 -3
  192. package/dist/index.js +2 -25
  193. package/dist/types/index.js +1 -4
  194. package/dist/ui5/middleware.d.ts +11 -1
  195. package/dist/ui5/middleware.js +13 -15
  196. package/package.json +18 -16
package/dist/base/flp.js CHANGED
@@ -1,28 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlpSandbox = void 0;
4
- const mem_fs_1 = require("mem-fs");
5
- const mem_fs_editor_1 = require("mem-fs-editor");
6
- const ejs_1 = require("ejs");
7
- const express_1 = require("express");
8
- const node_path_1 = require("node:path");
9
- const project_access_1 = require("@sap-ux/project-access");
10
- const adp_tooling_1 = require("@sap-ux/adp-tooling");
11
- const btp_utils_1 = require("@sap-ux/btp-utils");
12
- const feature_toggle_1 = require("@sap-ux/feature-toggle");
13
- const flex_1 = require("./flex");
14
- const test_1 = require("./test");
15
- const config_1 = require("./config");
16
- const cdm_1 = require("./cdm");
17
- const node_fs_1 = require("node:fs");
18
- const cards_1 = require("./utils/cards");
19
- const i18n_1 = require("@sap-ux/i18n");
20
- const axios_extension_1 = require("@sap-ux/axios-extension");
1
+ import { create as createStorage } from 'mem-fs';
2
+ import { create } from 'mem-fs-editor';
3
+ import { render } from 'ejs';
4
+ import { Router as createRouter, static as serveStatic, json } from 'express';
5
+ import { dirname, join, posix } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { createRequire } from 'node:module';
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const require = createRequire(import.meta.url);
10
+ import { getWebappPath, getProjectType, findProjectRoot, FileName, createApplicationAccess } from '@sap-ux/project-access';
11
+ import { AdpPreview, loadAppVariant, readManifestFromBuildPath } from '@sap-ux/adp-tooling';
12
+ import { isAppStudio, exposePort } from '@sap-ux/btp-utils';
13
+ import { FeatureToggleAccess } from '@sap-ux/feature-toggle';
14
+ import { deleteChange, readChanges, readLocalModulePaths, stripLocalModulesFromLrepResponse, writeChange } from './flex.js';
15
+ import { generateImportList, mergeTestConfigDefaults } from './test.js';
16
+ import { getFlpConfigWithDefaults, createFlpTemplateConfig, PREVIEW_URL, isFlexConnector, createTestTemplateConfig, addApp, getAppName, sanitizeRtaConfig, CARD_GENERATOR_DEFAULT, remapResourcesForPath } from './config.js';
17
+ import { generateCdm } from './cdm.js';
18
+ import { readFileSync } from 'node:fs';
19
+ import { getIntegrationCard } from './utils/cards.js';
20
+ import { createPropertiesI18nEntries } from '@sap-ux/i18n';
21
+ import { AdaptationProjectType } from '@sap-ux/axios-extension';
21
22
  const DEFAULT_LIVERELOAD_PORT = 35729;
22
23
  /**
23
24
  * Class handling preview of a sandbox FLP.
24
25
  */
25
- class FlpSandbox {
26
+ export class FlpSandbox {
26
27
  adp;
27
28
  manifest;
28
29
  onChangeRequest;
@@ -46,15 +47,15 @@ class FlpSandbox {
46
47
  * @param logger logger instance
47
48
  */
48
49
  constructor(config, project, utils, logger) {
49
- this.fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
50
+ this.fs = create(createStorage());
50
51
  this.logger = logger;
51
52
  this.project = project;
52
53
  this.utils = utils;
53
- this.flpConfig = (0, config_1.getFlpConfigWithDefaults)(config.flp);
54
+ this.flpConfig = getFlpConfigWithDefaults(config.flp);
54
55
  this.test = config.test;
55
- this.rta = config.editors?.rta ?? (0, config_1.sanitizeRtaConfig)(config.rta, logger); //NOSONAR
56
+ this.rta = config.editors?.rta ?? sanitizeRtaConfig(config.rta, logger); //NOSONAR
56
57
  logger.debug(`Config: ${JSON.stringify({ flp: this.flpConfig, rta: this.rta, test: this.test })}`);
57
- this.router = (0, express_1.Router)();
58
+ this.router = createRouter();
58
59
  this.cardGenerator = config.editors?.cardGenerator;
59
60
  }
60
61
  /**
@@ -74,15 +75,15 @@ class FlpSandbox {
74
75
  * @param adp optional reference to the ADP tooling
75
76
  */
76
77
  async init(manifest, componentId, resources = {}, adp) {
77
- const projectRoot = await (0, project_access_1.findProjectRoot)(process.cwd(), false, true);
78
- this.projectType = await (0, project_access_1.getProjectType)(projectRoot);
78
+ const projectRoot = await findProjectRoot(process.cwd(), false, true);
79
+ this.projectType = await getProjectType(projectRoot);
79
80
  this.createFlexHandler();
80
81
  this.flpConfig.libs ??= await this.hasLocateReuseLibsScript();
81
82
  const id = manifest['sap.app']?.id ?? '';
82
- this.templateConfig = (0, config_1.createFlpTemplateConfig)(this.flpConfig, manifest, resources);
83
+ this.templateConfig = createFlpTemplateConfig(this.flpConfig, manifest, resources);
83
84
  this.adp = adp;
84
85
  this.manifest = manifest;
85
- await (0, config_1.addApp)(this.templateConfig, manifest, {
86
+ await addApp(this.templateConfig, manifest, {
86
87
  componentId,
87
88
  target: resources[componentId ?? id] ?? this.templateConfig.basePath,
88
89
  local: '.',
@@ -158,7 +159,7 @@ class FlpSandbox {
158
159
  */
159
160
  checkDeleteConnectors(ui5VersionMajor, ui5VersionMinor, isCDN) {
160
161
  if (ui5VersionMajor === 1 && ui5VersionMinor < 84) {
161
- this.templateConfig.ui5.flex = this.templateConfig.ui5?.flex?.filter((connector) => (0, config_1.isFlexConnector)(connector));
162
+ this.templateConfig.ui5.flex = this.templateConfig.ui5?.flex?.filter((connector) => isFlexConnector(connector));
162
163
  this.logger.debug(`The Fiori Tools local connector (WorkspaceConnector) is not being used because the current UI5 version does not support it.${isCDN ? 'The Fiori Tools fake connector (FakeLrepConnector) will be used instead.' : ''} `);
163
164
  if (!isCDN) {
164
165
  this.logger.warn(`The preview with virtual endpoints does not support flex changes for the current UI5 version ${ui5VersionMajor}.${ui5VersionMinor} from npmjs. Consider using a proxy to load UI5 resources from the CDN (e.g., https://ui5.sap.com), or upgrade the UI5 version in the yaml configuration to at least 1.84.`);
@@ -168,8 +169,8 @@ class FlpSandbox {
168
169
  this.logger.debug(`The Fiori Tools local connector (WorkspaceConnector) is being used.`);
169
170
  }
170
171
  if (this.projectType === 'CAPJava' || this.projectType === 'CAPNodejs') {
171
- this.templateConfig.ui5.flex = this.templateConfig.ui5?.flex?.filter((connector) => !(0, config_1.isFlexConnector)(connector) ||
172
- ((0, config_1.isFlexConnector)(connector) && !connector.url?.startsWith('/sap/bc/lrep')));
172
+ this.templateConfig.ui5.flex = this.templateConfig.ui5?.flex?.filter((connector) => !isFlexConnector(connector) ||
173
+ (isFlexConnector(connector) && !connector.url?.startsWith('/sap/bc/lrep')));
173
174
  this.logger.debug(`The ABAP connector is not being used because the current project type is '${this.projectType}'.`);
174
175
  }
175
176
  else {
@@ -213,10 +214,10 @@ class FlpSandbox {
213
214
  developerMode: editor.developerMode === true,
214
215
  pluginScript: editor.pluginScript
215
216
  };
216
- config.features = feature_toggle_1.FeatureToggleAccess.getAllFeatureToggles();
217
+ config.features = FeatureToggleAccess.getAllFeatureToggles();
217
218
  const appId = this.manifest['sap.app']?.id ?? '';
218
- (0, config_1.remapResourcesForPath)(config, editor.path, appId);
219
- return (0, ejs_1.render)(this.getSandboxTemplate(ui5Version), config);
219
+ remapResourcesForPath(config, editor.path, appId);
220
+ return render(this.getSandboxTemplate(ui5Version), config);
220
221
  }
221
222
  /**
222
223
  * Sets application dependencies in the template configuration.
@@ -227,7 +228,7 @@ class FlpSandbox {
227
228
  async setApplicationDependencies() {
228
229
  if (this.adp) {
229
230
  await this.adp.sync();
230
- const appName = (0, config_1.getAppName)(this.manifest, this.flpConfig.intent);
231
+ const appName = getAppName(this.manifest, this.flpConfig.intent);
231
232
  this.templateConfig.apps[appName].applicationDependencies = this.adp.descriptor;
232
233
  }
233
234
  }
@@ -246,13 +247,13 @@ class FlpSandbox {
246
247
  if (scenario === 'ADAPTATION_PROJECT') {
247
248
  templatePreviewUrl = templatePreviewUrl.replace('?', `?sap-ui-layer=${rta.layer}&`);
248
249
  }
249
- const template = (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../templates/flp/editor.ejs'), 'utf-8');
250
- const features = feature_toggle_1.FeatureToggleAccess.getAllFeatureToggles();
250
+ const template = readFileSync(join(__dirname, '../../templates/flp/editor.ejs'), 'utf-8');
251
+ const features = FeatureToggleAccess.getAllFeatureToggles();
251
252
  const envPort = process.env.FIORI_TOOLS_LIVERELOAD_PORT;
252
253
  let livereloadPort = envPort ? Number.parseInt(envPort, 10) : DEFAULT_LIVERELOAD_PORT;
253
254
  livereloadPort = Number.isNaN(livereloadPort) ? DEFAULT_LIVERELOAD_PORT : livereloadPort;
254
- const envLivereloadUrl = (0, btp_utils_1.isAppStudio)() ? await (0, btp_utils_1.exposePort)(livereloadPort) : undefined;
255
- const html = (0, ejs_1.render)(template, {
255
+ const envLivereloadUrl = isAppStudio() ? await exposePort(livereloadPort) : undefined;
256
+ const html = render(template, {
256
257
  previewUrl: templatePreviewUrl,
257
258
  telemetry: !!rta.options?.telemetry,
258
259
  appName: rta.options?.appName,
@@ -278,7 +279,7 @@ class FlpSandbox {
278
279
  if (!req.query['fiori-tools-rta-mode']) {
279
280
  this.logger.debug(`Adjusting URL parameters for runtime adaptation mode. Redirecting to correct URL.`);
280
281
  const url = 'ui5-patched-router' in req
281
- ? node_path_1.posix.join(req['ui5-patched-router']?.baseUrl ?? '', previewUrl)
282
+ ? posix.join(req['ui5-patched-router']?.baseUrl ?? '', previewUrl)
282
283
  : previewUrl;
283
284
  const params = structuredClone(req.query);
284
285
  params['sap-ui-xx-viewCache'] = 'false';
@@ -298,7 +299,7 @@ class FlpSandbox {
298
299
  * @param rta runtime authoring configuration
299
300
  */
300
301
  addEditorRoutes(rta) {
301
- const cpe = (0, node_path_1.dirname)(require.resolve('@sap-ux/control-property-editor-sources'));
302
+ const cpe = dirname(require.resolve('@sap-ux/control-property-editor-sources'));
302
303
  for (const editor of rta.endpoints) {
303
304
  let previewUrl = editor.path.startsWith('/') ? editor.path : `/${editor.path}`;
304
305
  if (editor.developerMode) {
@@ -307,11 +308,11 @@ class FlpSandbox {
307
308
  this.router.get(editor.path, async (req, res) => {
308
309
  await this.editorGetHandlerDeveloperMode(req, res, rta, previewUrl);
309
310
  });
310
- let path = (0, node_path_1.dirname)(editor.path);
311
+ let path = dirname(editor.path);
311
312
  if (!path.endsWith('/')) {
312
313
  path = `${path}/`;
313
314
  }
314
- this.router.use(`${path}editor`, (0, express_1.static)(cpe));
315
+ this.router.use(`${path}editor`, serveStatic(cpe));
315
316
  }
316
317
  this.router.get(previewUrl, async (req, res) => {
317
318
  await this.editorGetHandler(req, res, rta, previewUrl, editor);
@@ -330,7 +331,7 @@ class FlpSandbox {
330
331
  // connect API (karma test runner) has no request query property
331
332
  if ('query' in req && 'redirect' in res && !req.query['sap-ui-xx-viewCache']) {
332
333
  this.logger.debug(`Adjusting URL parameters for preview. Redirecting to correct URL.`);
333
- const url = 'ui5-patched-router' in req ? node_path_1.posix.join(req['ui5-patched-router']?.baseUrl ?? '', req.path) : req.path;
334
+ const url = 'ui5-patched-router' in req ? posix.join(req['ui5-patched-router']?.baseUrl ?? '', req.path) : req.path;
334
335
  const params = structuredClone(req.query);
335
336
  params['sap-ui-xx-viewCache'] = 'false';
336
337
  const redirectUrl = new URL(`${url}?${new URLSearchParams(params)}`, 'http://localhost');
@@ -359,7 +360,7 @@ class FlpSandbox {
359
360
  this.removeFlexExtensionPointEnabled();
360
361
  }
361
362
  //for consistency reasons, we also add the baseUrl to the HTML here, although it is only used in editor mode
362
- const html = (0, ejs_1.render)(this.getSandboxTemplate(ui5Version), this.templateConfig);
363
+ const html = render(this.getSandboxTemplate(ui5Version), this.templateConfig);
363
364
  this.sendResponse(res, 'text/html', 200, html);
364
365
  }
365
366
  }
@@ -368,7 +369,7 @@ class FlpSandbox {
368
369
  */
369
370
  addStandardRoutes() {
370
371
  // register static client sources
371
- this.router.use(config_1.PREVIEW_URL.client.path, (0, express_1.static)(config_1.PREVIEW_URL.client.local));
372
+ this.router.use(PREVIEW_URL.client.path, serveStatic(PREVIEW_URL.client.local));
372
373
  // add route for the sandbox html
373
374
  this.router.get(this.flpConfig.path, async (req, res, next) => {
374
375
  await this.flpGetHandler(req, res, next);
@@ -383,7 +384,7 @@ class FlpSandbox {
383
384
  * @private
384
385
  */
385
386
  async addCardGeneratorMiddlewareRoute() {
386
- const previewGeneratorPath = this.cardGenerator?.path ?? config_1.CARD_GENERATOR_DEFAULT.previewGeneratorSandbox;
387
+ const previewGeneratorPath = this.cardGenerator?.path ?? CARD_GENERATOR_DEFAULT.previewGeneratorSandbox;
387
388
  this.logger.debug(`Add route for ${previewGeneratorPath}`);
388
389
  this.router.get(previewGeneratorPath, async (req, res, next) => {
389
390
  this.templateConfig.enableCardGenerator = !!this.cardGenerator?.path;
@@ -447,7 +448,7 @@ class FlpSandbox {
447
448
  this.logger.info(`Using sandbox template for UI5 version: ${ui5Version.major}.${ui5Version.minor}.${ui5Version.patch}${ui5Version.label ? `-${ui5Version.label}` : ''}.`);
448
449
  const filePrefix = ui5Version.major > 1 || ui5Version.label?.includes('legacy-free') ? '2' : '';
449
450
  const template = this.flpConfig.enhancedHomePage ? 'cdm' : 'sandbox';
450
- return (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, `../../templates/flp/${template}${filePrefix}.ejs`), 'utf-8');
451
+ return readFileSync(join(__dirname, `../../templates/flp/${template}${filePrefix}.ejs`), 'utf-8');
451
452
  }
452
453
  /**
453
454
  * For UI5 version 1.71 and below, the asyncHints.requests need to be removed from the template configuration
@@ -489,9 +490,9 @@ class FlpSandbox {
489
490
  for (const app of this.flpConfig.apps) {
490
491
  let manifest;
491
492
  if (app.local) {
492
- const webappPath = await (0, project_access_1.getWebappPath)(app.local, this.fs);
493
- manifest = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(webappPath, 'manifest.json'), 'utf-8'));
494
- this.router.use(app.target, (0, express_1.static)(webappPath));
493
+ const webappPath = await getWebappPath(app.local, this.fs);
494
+ manifest = JSON.parse(readFileSync(join(webappPath, 'manifest.json'), 'utf-8'));
495
+ this.router.use(app.target, serveStatic(webappPath));
495
496
  this.logger.info(`Serving additional application at ${app.target} from ${app.local}`);
496
497
  }
497
498
  else if (app.componentId) {
@@ -503,7 +504,7 @@ class FlpSandbox {
503
504
  };
504
505
  }
505
506
  if (manifest) {
506
- await (0, config_1.addApp)(this.templateConfig, manifest, app, this.logger);
507
+ await addApp(this.templateConfig, manifest, app, this.logger);
507
508
  this.logger.info(`Adding additional intent: ${app.intent?.object}-${app.intent?.action}`);
508
509
  }
509
510
  else {
@@ -517,7 +518,7 @@ class FlpSandbox {
517
518
  */
518
519
  addCDMRoute() {
519
520
  this.router.get('/cdm.json', async (_req, res) => {
520
- const json = (0, cdm_1.generateCdm)(this.templateConfig.apps);
521
+ const json = generateCdm(this.templateConfig.apps);
521
522
  this.sendResponse(res, 'application/json', 200, JSON.stringify(json));
522
523
  });
523
524
  }
@@ -528,7 +529,7 @@ class FlpSandbox {
528
529
  * @private
529
530
  */
530
531
  async flexGetHandler(res) {
531
- const changes = await (0, flex_1.readChanges)(this.project, this.logger);
532
+ const changes = await readChanges(this.project, this.logger);
532
533
  if (this.onChangeRequest) {
533
534
  for (const change of Object.values(changes)) {
534
535
  await this.onChangeRequest('read', change, this.fs, this.logger);
@@ -549,7 +550,7 @@ class FlpSandbox {
549
550
  if (this.onChangeRequest) {
550
551
  await this.onChangeRequest('write', body.change, this.fs, this.logger, body.additionalChangeInfo);
551
552
  }
552
- const { success, message } = (0, flex_1.writeChange)(body.change, this.utils.getProject().getSourcePath(), this.fs, this.logger);
553
+ const { success, message } = writeChange(body.change, this.utils.getProject().getSourcePath(), this.fs, this.logger);
553
554
  if (success) {
554
555
  this.fs.commit(() => this.sendResponse(res, 'text/plain', 200, message ?? ''));
555
556
  }
@@ -570,7 +571,7 @@ class FlpSandbox {
570
571
  */
571
572
  async flexDeleteHandler(req, res) {
572
573
  try {
573
- const { success, message } = (0, flex_1.deleteChange)(req.body, this.utils.getProject().getSourcePath(), this.logger);
574
+ const { success, message } = deleteChange(req.body, this.utils.getProject().getSourcePath(), this.logger);
574
575
  if (success) {
575
576
  this.sendResponse(res, 'text/plain', 200, message ?? '');
576
577
  }
@@ -586,8 +587,8 @@ class FlpSandbox {
586
587
  * Create required routes for flex.
587
588
  */
588
589
  createFlexHandler() {
589
- const api = `${config_1.PREVIEW_URL.api}/changes`;
590
- this.router.use(api, (0, express_1.json)());
590
+ const api = `${PREVIEW_URL.api}/changes`;
591
+ this.router.use(api, json());
591
592
  this.router.get(api, async (_req, res) => {
592
593
  await this.flexGetHandler(res);
593
594
  });
@@ -612,7 +613,7 @@ class FlpSandbox {
612
613
  basePath: this.templateConfig.basePath,
613
614
  initPath: config.init
614
615
  };
615
- const html = (0, ejs_1.render)(testsuite, templateConfig);
616
+ const html = render(testsuite, templateConfig);
616
617
  this.sendResponse(res, 'text/html', 200, html);
617
618
  }
618
619
  /**
@@ -636,7 +637,7 @@ class FlpSandbox {
636
637
  const templateConfig = {
637
638
  testPaths: testPaths
638
639
  };
639
- const js = (0, ejs_1.render)(initTemplate, templateConfig);
640
+ const js = render(initTemplate, templateConfig);
640
641
  this.sendResponse(res, 'application/javascript', 200, js);
641
642
  }
642
643
  }
@@ -656,8 +657,8 @@ class FlpSandbox {
656
657
  this.logger.warn('Skip testsuite generation. No test frameworks configured.');
657
658
  return;
658
659
  }
659
- const testsuite = (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../templates/test/testsuite.qunit.ejs'), 'utf-8');
660
- const config = (0, test_1.mergeTestConfigDefaults)(testsuiteConfig);
660
+ const testsuite = readFileSync(join(__dirname, '../../templates/test/testsuite.qunit.ejs'), 'utf-8');
661
+ const config = mergeTestConfigDefaults(testsuiteConfig);
661
662
  this.logger.debug(`Add route for ${config.path}`);
662
663
  this.router.get(config.path, async (_req, res) => {
663
664
  await this.testSuiteHtmlGetHandler(res, testsuite, config);
@@ -671,10 +672,10 @@ class FlpSandbox {
671
672
  if (testConfig.framework === 'Testsuite') {
672
673
  continue;
673
674
  }
674
- const mergedConfig = (0, test_1.mergeTestConfigDefaults)(testConfig);
675
- testPaths.push(node_path_1.posix.relative(node_path_1.posix.dirname(config.path), mergedConfig.path));
675
+ const mergedConfig = mergeTestConfigDefaults(testConfig);
676
+ testPaths.push(posix.relative(posix.dirname(config.path), mergedConfig.path));
676
677
  }
677
- const initTemplate = (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../templates/test/testsuite.qunit.js'), 'utf-8');
678
+ const initTemplate = readFileSync(join(__dirname, '../../templates/test/testsuite.qunit.js'), 'utf-8');
678
679
  this.logger.debug(`Add route for ${config.init}`);
679
680
  this.router.get(config.init, async (_req, res, next) => {
680
681
  await this.testSuiteJsGetHandler(res, next, config, initTemplate, testPaths);
@@ -715,8 +716,8 @@ class FlpSandbox {
715
716
  next();
716
717
  }
717
718
  else {
718
- const templateConfig = (0, config_1.createTestTemplateConfig)(config, id, this.templateConfig.ui5.theme);
719
- const html = (0, ejs_1.render)(htmlTemplate, templateConfig);
719
+ const templateConfig = createTestTemplateConfig(config, id, this.templateConfig.ui5.theme);
720
+ const html = render(htmlTemplate, templateConfig);
720
721
  this.sendResponse(res, 'text/html', 200, html);
721
722
  }
722
723
  }
@@ -739,8 +740,8 @@ class FlpSandbox {
739
740
  }
740
741
  else {
741
742
  const testFiles = await this.project.byGlob(config.pattern);
742
- const templateConfig = { tests: (0, test_1.generateImportList)(ns, testFiles) };
743
- const js = (0, ejs_1.render)(initTemplate, templateConfig);
743
+ const templateConfig = { tests: generateImportList(ns, testFiles) };
744
+ const js = render(initTemplate, templateConfig);
744
745
  this.sendResponse(res, 'application/javascript', 200, js);
745
746
  }
746
747
  }
@@ -752,9 +753,9 @@ class FlpSandbox {
752
753
  */
753
754
  addTestRoutes(configs, id) {
754
755
  const ns = id.replace(/\./g, '/');
755
- const htmlTemplate = (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../templates/test/qunit.ejs'), 'utf-8');
756
+ const htmlTemplate = readFileSync(join(__dirname, '../../templates/test/qunit.ejs'), 'utf-8');
756
757
  for (const testConfig of configs) {
757
- const config = (0, test_1.mergeTestConfigDefaults)(testConfig);
758
+ const config = mergeTestConfigDefaults(testConfig);
758
759
  this.logger.debug(`Add route for ${config.path}`);
759
760
  // add route for the *.qunit.html
760
761
  this.router.get(config.path, async (_req, res, next) => {
@@ -765,7 +766,7 @@ class FlpSandbox {
765
766
  continue;
766
767
  }
767
768
  // add route for the init file
768
- const initTemplate = (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../templates/test/qunit.js'), 'utf-8');
769
+ const initTemplate = readFileSync(join(__dirname, '../../templates/test/qunit.js'), 'utf-8');
769
770
  this.logger.debug(`Add route for ${config.init}`);
770
771
  this.router.get(config.init, async (_req, res, next) => {
771
772
  await this.testRunnerJsGetHandler(res, next, config, initTemplate, ns);
@@ -781,13 +782,13 @@ class FlpSandbox {
781
782
  */
782
783
  async storeCardManifestHandler(req, res) {
783
784
  try {
784
- const { floorplan, localPath, fileName = project_access_1.FileName.Manifest, manifests } = req.body;
785
+ const { floorplan, localPath, fileName = FileName.Manifest, manifests } = req.body;
785
786
  // getSourcePath() returns the webapp path directly for all project types
786
787
  const webappPath = this.utils.getProject().getSourcePath();
787
- const projectRoot = (0, node_path_1.dirname)(webappPath);
788
- const fullPath = (0, node_path_1.join)(webappPath, localPath);
789
- const filePath = fileName.endsWith('.json') ? (0, node_path_1.join)(fullPath, fileName) : `${(0, node_path_1.join)(fullPath, fileName)}.json`;
790
- const integrationCard = (0, cards_1.getIntegrationCard)(manifests);
788
+ const projectRoot = dirname(webappPath);
789
+ const fullPath = join(webappPath, localPath);
790
+ const filePath = fileName.endsWith('.json') ? join(fullPath, fileName) : `${join(fullPath, fileName)}.json`;
791
+ const integrationCard = getIntegrationCard(manifests);
791
792
  this.fs.write(filePath, JSON.stringify(integrationCard.manifest, null, 2));
792
793
  const entitySet = integrationCard.entitySet;
793
794
  const sapCardsAp = (this.manifest['sap.cards.ap'] ??= {});
@@ -802,7 +803,7 @@ class FlpSandbox {
802
803
  ]
803
804
  }
804
805
  };
805
- const appAccess = await (0, project_access_1.createApplicationAccess)(projectRoot, this.fs);
806
+ const appAccess = await createApplicationAccess(projectRoot, this.fs);
806
807
  await appAccess.updateManifestJSON(this.manifest, this.fs);
807
808
  this.fs.commit(() => this.sendResponse(res, 'text/plain', 201, `Files were updated/created`));
808
809
  }
@@ -818,9 +819,9 @@ class FlpSandbox {
818
819
  * @returns {Promise<void>} A promise that resolves when the route is added.
819
820
  */
820
821
  async addStoreCardManifestRoute() {
821
- this.router.use(config_1.CARD_GENERATOR_DEFAULT.cardsStore, (0, express_1.json)());
822
- this.logger.debug(`Add route for ${config_1.CARD_GENERATOR_DEFAULT.cardsStore}`);
823
- this.router.post(config_1.CARD_GENERATOR_DEFAULT.cardsStore, async (req, res) => {
822
+ this.router.use(CARD_GENERATOR_DEFAULT.cardsStore, json());
823
+ this.logger.debug(`Add route for ${CARD_GENERATOR_DEFAULT.cardsStore}`);
824
+ this.router.post(CARD_GENERATOR_DEFAULT.cardsStore, async (req, res) => {
824
825
  await this.storeCardManifestHandler(req, res);
825
826
  });
826
827
  }
@@ -843,7 +844,7 @@ class FlpSandbox {
843
844
  this.sendResponse(res, 'text/plain', 400, `Locale "${requestedLocale}" is not supported. Supported: ${supportedLocales.join(', ')}`);
844
845
  return;
845
846
  }
846
- const baseFilePath = (0, node_path_1.join)(webappPath, i18nPath);
847
+ const baseFilePath = join(webappPath, i18nPath);
847
848
  const filePath = requestedLocale
848
849
  ? baseFilePath.replace('.properties', `_${requestedLocale}.properties`)
849
850
  : baseFilePath;
@@ -851,7 +852,7 @@ class FlpSandbox {
851
852
  ...entry,
852
853
  annotation: entry.comment ?? entry.annotation
853
854
  }));
854
- await (0, i18n_1.createPropertiesI18nEntries)(filePath, entries);
855
+ await createPropertiesI18nEntries(filePath, entries);
855
856
  this.fs.commit(() => this.sendResponse(res, 'text/plain', 201, `i18n file updated.`));
856
857
  }
857
858
  catch (error) {
@@ -908,9 +909,9 @@ class FlpSandbox {
908
909
  * @returns {Promise<void>} A promise that resolves when the route is added.
909
910
  */
910
911
  async addStoreI18nKeysRoute() {
911
- this.router.use(config_1.CARD_GENERATOR_DEFAULT.i18nStore, (0, express_1.json)());
912
- this.logger.debug(`Add route for ${config_1.CARD_GENERATOR_DEFAULT.i18nStore}`);
913
- this.router.post(config_1.CARD_GENERATOR_DEFAULT.i18nStore, async (req, res) => {
912
+ this.router.use(CARD_GENERATOR_DEFAULT.i18nStore, json());
913
+ this.logger.debug(`Add route for ${CARD_GENERATOR_DEFAULT.i18nStore}`);
914
+ this.router.post(CARD_GENERATOR_DEFAULT.i18nStore, async (req, res) => {
914
915
  await this.storeI18nKeysHandler(req, res);
915
916
  });
916
917
  }
@@ -921,8 +922,8 @@ class FlpSandbox {
921
922
  * @throws Error in case no manifest.appdescr_variant found
922
923
  */
923
924
  async initAdp(config) {
924
- const variant = await (0, adp_tooling_1.loadAppVariant)(this.project);
925
- const adp = new adp_tooling_1.AdpPreview(config, this.project, this.utils, this.logger);
925
+ const variant = await loadAppVariant(this.project);
926
+ const adp = new AdpPreview(config, this.project, this.utils, this.logger);
926
927
  const layer = await adp.init(variant);
927
928
  // CF ADP build path mode: serve built resources directly from build output
928
929
  if ('cfBuildPath' in config) {
@@ -932,11 +933,11 @@ class FlpSandbox {
932
933
  await this.setupAdpCommonHandlers(adp);
933
934
  return;
934
935
  }
935
- configureRta(this.rta, layer, variant.id, adp.projectType === axios_extension_1.AdaptationProjectType.CLOUD_READY);
936
+ configureRta(this.rta, layer, variant.id, adp.projectType === AdaptationProjectType.CLOUD_READY);
936
937
  const descriptor = adp.descriptor;
937
938
  const { name, manifest } = descriptor;
938
939
  await this.init(manifest, name, adp.resources, adp);
939
- const localModuleState = await (0, flex_1.readLocalModulePaths)(this.project, this.logger);
940
+ const localModuleState = await readLocalModulePaths(this.project, this.logger);
940
941
  this.registerLrepFlexDataFilter(adp, localModuleState);
941
942
  this.router.use(adp.descriptor.url, adp.proxy.bind(adp));
942
943
  await this.setupAdpCommonHandlers(adp);
@@ -948,7 +949,7 @@ class FlpSandbox {
948
949
  */
949
950
  async setupAdpCommonHandlers(adp) {
950
951
  this.addOnChangeRequestHandler(adp.onChangeRequest.bind(adp));
951
- this.router.use((0, express_1.json)());
952
+ this.router.use(json());
952
953
  adp.addApis(this.router);
953
954
  // Register i18n store route for ADP projects (used by OVP bridge functions)
954
955
  await this.addStoreI18nKeysRoute();
@@ -997,7 +998,7 @@ class FlpSandbox {
997
998
  try {
998
999
  const response = await provider.get(req.url);
999
1000
  const responseData = typeof response.data === 'string' ? JSON.parse(response.data) : response.data;
1000
- const filtered = (0, flex_1.stripLocalModulesFromLrepResponse)(responseData, localModuleState, this.logger);
1001
+ const filtered = stripLocalModulesFromLrepResponse(responseData, localModuleState, this.logger);
1001
1002
  res.status(200).json(filtered);
1002
1003
  }
1003
1004
  catch (error) {
@@ -1014,13 +1015,12 @@ class FlpSandbox {
1014
1015
  * @returns the manifest
1015
1016
  */
1016
1017
  setupCfBuildMode(cfBuildPath) {
1017
- const manifest = (0, adp_tooling_1.readManifestFromBuildPath)(cfBuildPath);
1018
- this.router.use('/', (0, express_1.static)(cfBuildPath));
1018
+ const manifest = readManifestFromBuildPath(cfBuildPath);
1019
+ this.router.use('/', serveStatic(cfBuildPath));
1019
1020
  this.logger.info(`Initialized CF ADP with cfBuildPath, serving from ${cfBuildPath}`);
1020
1021
  return manifest;
1021
1022
  }
1022
1023
  }
1023
- exports.FlpSandbox = FlpSandbox;
1024
1024
  /**
1025
1025
  * Creates an attribute string that can be added to the UI5 bootstrap script of an HTML file.
1026
1026
  *
@@ -1,4 +1,4 @@
1
- export { FlpSandbox } from './flp';
2
- export { generatePreviewFiles, getPreviewPaths, sanitizeRtaConfig } from './config';
3
- export { logRemoteUrl, isRemoteConnectionsEnabled } from './remote-url';
1
+ export { FlpSandbox } from './flp.js';
2
+ export { generatePreviewFiles, getPreviewPaths, sanitizeRtaConfig } from './config.js';
3
+ export { logRemoteUrl, isRemoteConnectionsEnabled } from './remote-url.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,13 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isRemoteConnectionsEnabled = exports.logRemoteUrl = exports.sanitizeRtaConfig = exports.getPreviewPaths = exports.generatePreviewFiles = exports.FlpSandbox = void 0;
4
- var flp_1 = require("./flp");
5
- Object.defineProperty(exports, "FlpSandbox", { enumerable: true, get: function () { return flp_1.FlpSandbox; } });
6
- var config_1 = require("./config");
7
- Object.defineProperty(exports, "generatePreviewFiles", { enumerable: true, get: function () { return config_1.generatePreviewFiles; } });
8
- Object.defineProperty(exports, "getPreviewPaths", { enumerable: true, get: function () { return config_1.getPreviewPaths; } });
9
- Object.defineProperty(exports, "sanitizeRtaConfig", { enumerable: true, get: function () { return config_1.sanitizeRtaConfig; } });
10
- var remote_url_1 = require("./remote-url");
11
- Object.defineProperty(exports, "logRemoteUrl", { enumerable: true, get: function () { return remote_url_1.logRemoteUrl; } });
12
- Object.defineProperty(exports, "isRemoteConnectionsEnabled", { enumerable: true, get: function () { return remote_url_1.isRemoteConnectionsEnabled; } });
1
+ export { FlpSandbox } from './flp.js';
2
+ export { generatePreviewFiles, getPreviewPaths, sanitizeRtaConfig } from './config.js';
3
+ export { logRemoteUrl, isRemoteConnectionsEnabled } from './remote-url.js';
13
4
  //# sourceMappingURL=index.js.map
@@ -1,28 +1,18 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.logRemoteUrl = logRemoteUrl;
7
- exports.getRemoteUrl = getRemoteUrl;
8
- exports.isRemoteConnectionsEnabled = isRemoteConnectionsEnabled;
9
- exports.getPortFromArgs = getPortFromArgs;
10
- exports.getOpenPathFromArgs = getOpenPathFromArgs;
11
- const btp_utils_1 = require("@sap-ux/btp-utils");
12
- const node_os_1 = require("node:os");
13
- const bas_sdk_1 = require("@sap/bas-sdk");
14
- const qrcode_1 = __importDefault(require("qrcode"));
1
+ import { isAppStudio } from '@sap-ux/btp-utils';
2
+ import { networkInterfaces } from 'node:os';
3
+ import { devspace } from '@sap/bas-sdk';
4
+ import QRCode from 'qrcode';
15
5
  /**
16
6
  * Log remote URL for mobile device access.
17
7
  *
18
8
  * @param logger ToolsLogger instance
19
9
  */
20
- async function logRemoteUrl(logger) {
10
+ export async function logRemoteUrl(logger) {
21
11
  try {
22
12
  const remoteUrl = await getRemoteUrl(logger);
23
13
  const generateQRCode = async (text) => {
24
14
  try {
25
- const qrString = await qrcode_1.default.toString(text, { type: 'terminal', small: true });
15
+ const qrString = await QRCode.toString(text, { type: 'terminal', small: true });
26
16
  logger.info(qrString);
27
17
  }
28
18
  catch (err) {
@@ -48,9 +38,9 @@ async function logRemoteUrl(logger) {
48
38
  * @param logger ToolsLogger instance
49
39
  * @returns The remote URL or undefined if not available
50
40
  */
51
- async function getRemoteUrl(logger) {
41
+ export async function getRemoteUrl(logger) {
52
42
  try {
53
- if ((0, btp_utils_1.isAppStudio)()) {
43
+ if (isAppStudio()) {
54
44
  return await getBASRemoteUrl(logger);
55
45
  }
56
46
  else {
@@ -70,10 +60,10 @@ async function getRemoteUrl(logger) {
70
60
  */
71
61
  async function getBASRemoteUrl(logger) {
72
62
  try {
73
- const devspaceInfo = await bas_sdk_1.devspace.getDevspaceInfo();
63
+ const devspaceInfo = await devspace.getDevspaceInfo();
74
64
  if (devspaceInfo?.url) {
75
65
  const port = getPortFromArgs() ?? 8080;
76
- const baseUrl = bas_sdk_1.devspace.getAppExternalUri(`http://localhost:${port}`);
66
+ const baseUrl = devspace.getAppExternalUri(`http://localhost:${port}`);
77
67
  const devspaceUrl = baseUrl.replace(/(\/|%2F)$/, '');
78
68
  const remoteUrl = appendOpenPath(devspaceUrl, getOpenPathFromArgs());
79
69
  logger.debug(`BAS remote URL generated: ${remoteUrl}`);
@@ -119,7 +109,7 @@ function getIdeRemoteUrl(logger) {
119
109
  * @returns The network IP address
120
110
  */
121
111
  function getNetworkIP() {
122
- const interfaces = (0, node_os_1.networkInterfaces)();
112
+ const interfaces = networkInterfaces();
123
113
  // Priority order: prefer non-internal IPv4 addresses
124
114
  for (const interfaceName of Object.keys(interfaces)) {
125
115
  const networkInterface = interfaces[interfaceName];
@@ -155,7 +145,7 @@ function appendOpenPath(baseUrl, openPath) {
155
145
  *
156
146
  * @returns Whether --accept-remote-connections is present in process arguments
157
147
  */
158
- function isRemoteConnectionsEnabled() {
148
+ export function isRemoteConnectionsEnabled() {
159
149
  return process.argv.includes('--accept-remote-connections');
160
150
  }
161
151
  /**
@@ -163,7 +153,7 @@ function isRemoteConnectionsEnabled() {
163
153
  *
164
154
  * @returns The port number if found
165
155
  */
166
- function getPortFromArgs() {
156
+ export function getPortFromArgs() {
167
157
  // Check for --port argument
168
158
  const portIndex = process.argv.findIndex((arg) => arg === '--port' || arg.startsWith('--port='));
169
159
  if (portIndex !== -1) {
@@ -192,7 +182,7 @@ function getPortFromArgs() {
192
182
  *
193
183
  * @returns The path from --open or -o parameter if found
194
184
  */
195
- function getOpenPathFromArgs() {
185
+ export function getOpenPathFromArgs() {
196
186
  // Check for --open or -o argument
197
187
  const openIndex = process.argv.findIndex((arg) => arg === '--open' || arg === '-o' || arg.startsWith('--open=') || arg.startsWith('--o='));
198
188
  if (openIndex !== -1) {
@@ -1,5 +1,5 @@
1
1
  import type { Resource } from '@ui5/fs';
2
- import type { CompleteTestConfig, TestConfig } from '../types';
2
+ import type { CompleteTestConfig, TestConfig } from '../types/index.js';
3
3
  /**
4
4
  * Merge the given test configuration with the default values.
5
5
  *