@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.
- package/dist/abap/client.d.ts +1 -1
- package/dist/abap/client.js +8 -13
- package/dist/abap/config.js +5 -8
- package/dist/abap/index.d.ts +3 -3
- package/dist/abap/index.js +3 -19
- package/dist/abap/provider.js +5 -8
- package/dist/base/abap/manifest-service.d.ts +1 -1
- package/dist/base/abap/manifest-service.js +9 -18
- package/dist/base/cf.js +8 -11
- package/dist/base/change-utils.d.ts +1 -1
- package/dist/base/change-utils.js +49 -62
- package/dist/base/constants/index.js +12 -15
- package/dist/base/credentials.d.ts +2 -2
- package/dist/base/credentials.js +6 -9
- package/dist/base/helper.d.ts +1 -1
- package/dist/base/helper.js +40 -57
- package/dist/base/project-builder.js +3 -6
- package/dist/base/prompt.d.ts +1 -1
- package/dist/base/prompt.js +19 -25
- package/dist/btp/api.d.ts +1 -1
- package/dist/btp/api.js +10 -18
- package/dist/btp/index.d.ts +1 -1
- package/dist/btp/index.js +1 -17
- package/dist/cf/app/discovery.d.ts +1 -1
- package/dist/cf/app/discovery.js +11 -18
- package/dist/cf/app/html5-repo.d.ts +1 -1
- package/dist/cf/app/html5-repo.js +24 -32
- package/dist/cf/app/index.d.ts +2 -2
- package/dist/cf/app/index.js +2 -18
- package/dist/cf/core/auth.d.ts +1 -1
- package/dist/cf/core/auth.js +4 -8
- package/dist/cf/core/config.d.ts +1 -1
- package/dist/cf/core/config.js +9 -15
- package/dist/cf/core/index.d.ts +2 -2
- package/dist/cf/core/index.js +2 -18
- package/dist/cf/deploy.d.ts +1 -1
- package/dist/cf/deploy.js +33 -44
- package/dist/cf/index.d.ts +6 -6
- package/dist/cf/index.js +6 -22
- package/dist/cf/project/index.d.ts +3 -3
- package/dist/cf/project/index.js +3 -19
- package/dist/cf/project/mta.d.ts +1 -1
- package/dist/cf/project/mta.js +23 -66
- package/dist/cf/project/yaml-loader.d.ts +1 -1
- package/dist/cf/project/yaml-loader.js +8 -16
- package/dist/cf/project/yaml.d.ts +2 -2
- package/dist/cf/project/yaml.js +28 -72
- package/dist/cf/services/api.d.ts +1 -1
- package/dist/cf/services/api.js +46 -93
- package/dist/cf/services/cli.d.ts +1 -1
- package/dist/cf/services/cli.js +31 -42
- package/dist/cf/services/destinations.js +12 -48
- package/dist/cf/services/index.d.ts +5 -5
- package/dist/cf/services/index.js +5 -21
- package/dist/cf/services/manifest.d.ts +1 -1
- package/dist/cf/services/manifest.js +9 -13
- package/dist/cf/services/ssh.js +14 -22
- package/dist/cf/utils/index.d.ts +1 -1
- package/dist/cf/utils/index.js +1 -17
- package/dist/cf/utils/validation.d.ts +1 -1
- package/dist/cf/utils/validation.js +12 -18
- package/dist/common/flp-parameters.d.ts +1 -1
- package/dist/common/flp-parameters.js +1 -4
- package/dist/common/index.d.ts +1 -1
- package/dist/common/index.js +1 -17
- package/dist/i18n.js +8 -16
- package/dist/index.d.ts +23 -23
- package/dist/index.js +23 -46
- package/dist/preview/adp-preview.d.ts +1 -1
- package/dist/preview/adp-preview.js +41 -39
- package/dist/preview/change-handler.d.ts +1 -1
- package/dist/preview/change-handler.js +51 -59
- package/dist/preview/descriptor-change-handler.d.ts +1 -1
- package/dist/preview/descriptor-change-handler.js +18 -21
- package/dist/preview/ovp-routes-handler.js +11 -13
- package/dist/preview/routes-handler.js +36 -71
- package/dist/preview/utils.d.ts +1 -1
- package/dist/preview/utils.js +5 -8
- package/dist/prompts/add-annotations-to-odata/index.d.ts +1 -1
- package/dist/prompts/add-annotations-to-odata/index.js +24 -26
- package/dist/prompts/add-component-usages/index.d.ts +1 -1
- package/dist/prompts/add-component-usages/index.js +41 -43
- package/dist/prompts/add-new-model/index.d.ts +1 -1
- package/dist/prompts/add-new-model/index.js +75 -80
- package/dist/prompts/change-data-source/index.d.ts +1 -1
- package/dist/prompts/change-data-source/index.js +19 -22
- package/dist/prompts/change-inbound/index.d.ts +1 -1
- package/dist/prompts/change-inbound/index.js +11 -14
- package/dist/prompts/index.d.ts +5 -5
- package/dist/prompts/index.js +5 -15
- package/dist/source/applications.d.ts +2 -2
- package/dist/source/applications.js +7 -11
- package/dist/source/index.d.ts +3 -3
- package/dist/source/index.js +3 -19
- package/dist/source/manifest.d.ts +1 -1
- package/dist/source/manifest.js +15 -25
- package/dist/source/systems.d.ts +1 -1
- package/dist/source/systems.js +20 -27
- package/dist/types.d.ts +1 -1
- package/dist/types.js +64 -17
- package/dist/ui5/fetch.d.ts +1 -1
- package/dist/ui5/fetch.js +8 -12
- package/dist/ui5/format.d.ts +1 -1
- package/dist/ui5/format.js +17 -29
- package/dist/ui5/index.d.ts +4 -4
- package/dist/ui5/index.js +4 -20
- package/dist/ui5/network.d.ts +1 -1
- package/dist/ui5/network.js +1 -4
- package/dist/ui5/validator.js +14 -20
- package/dist/ui5/version-info.d.ts +1 -1
- package/dist/ui5/version-info.js +25 -36
- package/dist/writer/cf.d.ts +1 -1
- package/dist/writer/cf.js +35 -43
- package/dist/writer/changes/writer-factory.d.ts +2 -2
- package/dist/writer/changes/writer-factory.js +10 -13
- package/dist/writer/changes/writers/annotations-writer.d.ts +1 -1
- package/dist/writer/changes/writers/annotations-writer.js +11 -46
- package/dist/writer/changes/writers/component-usages-writer.d.ts +1 -1
- package/dist/writer/changes/writers/component-usages-writer.js +9 -12
- package/dist/writer/changes/writers/data-source-writer.d.ts +1 -1
- package/dist/writer/changes/writers/data-source-writer.js +7 -10
- package/dist/writer/changes/writers/inbound-writer.d.ts +1 -1
- package/dist/writer/changes/writers/inbound-writer.js +10 -13
- package/dist/writer/changes/writers/index.d.ts +5 -5
- package/dist/writer/changes/writers/index.js +5 -21
- package/dist/writer/changes/writers/new-model-writer.d.ts +1 -1
- package/dist/writer/changes/writers/new-model-writer.js +16 -20
- package/dist/writer/editors.d.ts +1 -1
- package/dist/writer/editors.js +6 -9
- package/dist/writer/i18n/index.d.ts +1 -1
- package/dist/writer/i18n/index.js +13 -17
- package/dist/writer/i18n/key-user-translations.js +9 -14
- package/dist/writer/inbound-navigation.d.ts +1 -1
- package/dist/writer/inbound-navigation.js +18 -27
- package/dist/writer/index.d.ts +1 -1
- package/dist/writer/index.js +36 -37
- package/dist/writer/manifest/descriptor-content.d.ts +2 -2
- package/dist/writer/manifest/descriptor-content.js +9 -15
- package/dist/writer/manifest/index.d.ts +1 -1
- package/dist/writer/manifest/index.js +1 -17
- package/dist/writer/options.d.ts +1 -1
- package/dist/writer/options.js +16 -27
- package/dist/writer/project-utils.d.ts +1 -1
- package/dist/writer/project-utils.js +49 -57
- package/dist/writer/writer-config.d.ts +2 -2
- package/dist/writer/writer-config.js +25 -30
- package/package.json +19 -17
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isAppSupported = isAppSupported;
|
|
4
|
-
exports.loadApps = loadApps;
|
|
5
|
-
const i18n_1 = require("../i18n");
|
|
6
|
-
const systems_1 = require("./systems");
|
|
1
|
+
import { t } from '../i18n.js';
|
|
2
|
+
import { SupportedProject } from './systems.js';
|
|
7
3
|
const ONPREM_APP_FIELDS_LIST = [
|
|
8
4
|
'sap.app/id',
|
|
9
5
|
'sap.app/ach',
|
|
@@ -83,12 +79,12 @@ const toSourceApplication = (app) => ({
|
|
|
83
79
|
* @param {ToolsLogger} logger - Optional logger for debugging purposes.
|
|
84
80
|
* @returns {Promise<boolean>} True if supported, otherwise throws an error.
|
|
85
81
|
*/
|
|
86
|
-
async function isAppSupported(provider, id, logger) {
|
|
82
|
+
export async function isAppSupported(provider, id, logger) {
|
|
87
83
|
const appIndex = provider.getAppIndex();
|
|
88
84
|
const isSupported = await appIndex.getIsManiFirstSupported(id);
|
|
89
85
|
if (!isSupported) {
|
|
90
86
|
logger?.debug(`Application '${id}' is not supported by Adaptation Project`);
|
|
91
|
-
throw new Error(
|
|
87
|
+
throw new Error(t('validators.appDoesNotSupportManifest'));
|
|
92
88
|
}
|
|
93
89
|
return true;
|
|
94
90
|
}
|
|
@@ -105,7 +101,7 @@ async function isAppSupported(provider, id, logger) {
|
|
|
105
101
|
* in case the {@link isCustomerBase} flag is set to true. In case the {@link supportedProject} is NOT set
|
|
106
102
|
* we return an empty array.
|
|
107
103
|
*/
|
|
108
|
-
async function loadApps(provider, isCustomerBase, supportedProject) {
|
|
104
|
+
export async function loadApps(provider, isCustomerBase, supportedProject) {
|
|
109
105
|
if (!supportedProject) {
|
|
110
106
|
return [];
|
|
111
107
|
}
|
|
@@ -126,11 +122,11 @@ async function loadApps(provider, isCustomerBase, supportedProject) {
|
|
|
126
122
|
* @returns {UI5AppFilter[]} The array of filters dermined by the supported ADP projects from the system.
|
|
127
123
|
*/
|
|
128
124
|
function getAppFilters(isCustomerBase, supportedProject) {
|
|
129
|
-
if (supportedProject ===
|
|
125
|
+
if (supportedProject === SupportedProject.CLOUD_READY) {
|
|
130
126
|
return [CLOUD_ONLY_APPS_FILTER];
|
|
131
127
|
}
|
|
132
128
|
const displayAllAppsFilters = [APPS_WITH_DESCR_FILTER, ...(isCustomerBase ? [APPS_WITH_VARIANT_DESCR_FILTER] : [])];
|
|
133
|
-
if (supportedProject ===
|
|
129
|
+
if (supportedProject === SupportedProject.CLOUD_READY_AND_ON_PREM) {
|
|
134
130
|
// In case of a mixed system we want to also include the cloudDevAdaptationStatus property
|
|
135
131
|
// for each application result in the list. The property is available as a column for all apps
|
|
136
132
|
// due to the nature of the system - mixed, so we are safe no error 400 will occur like
|
package/dist/source/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './applications';
|
|
2
|
-
export * from './manifest';
|
|
3
|
-
export * from './systems';
|
|
1
|
+
export * from './applications.js';
|
|
2
|
+
export * from './manifest.js';
|
|
3
|
+
export * from './systems.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/source/index.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./applications"), exports);
|
|
18
|
-
__exportStar(require("./manifest"), exports);
|
|
19
|
-
__exportStar(require("./systems"), exports);
|
|
1
|
+
export * from './applications.js';
|
|
2
|
+
export * from './manifest.js';
|
|
3
|
+
export * from './systems.js';
|
|
20
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
2
|
import type { Manifest } from '@sap-ux/project-access';
|
|
3
3
|
import type { AbapServiceProvider } from '@sap-ux/axios-extension';
|
|
4
|
-
import { ApplicationType } from '../types';
|
|
4
|
+
import { ApplicationType } from '../types.js';
|
|
5
5
|
/**
|
|
6
6
|
* Evaluates whether the application described by the manifest is a SAP Fiori Elements version 4 application.
|
|
7
7
|
*
|
package/dist/source/manifest.js
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.SourceManifest = void 0;
|
|
4
|
-
exports.isV4Application = isV4Application;
|
|
5
|
-
exports.getFioriId = getFioriId;
|
|
6
|
-
exports.getAch = getAch;
|
|
7
|
-
exports.getApplicationType = getApplicationType;
|
|
8
|
-
exports.isSupportedAppTypeForAdp = isSupportedAppTypeForAdp;
|
|
9
|
-
exports.isSyncLoadedView = isSyncLoadedView;
|
|
10
|
-
const i18n_1 = require("../i18n");
|
|
11
|
-
const types_1 = require("../types");
|
|
1
|
+
import { t } from '../i18n.js';
|
|
2
|
+
import { ApplicationType } from '../types.js';
|
|
12
3
|
/**
|
|
13
4
|
* Evaluates whether the application described by the manifest is a SAP Fiori Elements version 4 application.
|
|
14
5
|
*
|
|
15
6
|
* @param {Manifest} manifest - The application manifest to evaluate.
|
|
16
7
|
* @returns {boolean} True if the application uses SAP Fiori Elements version 4 libraries.
|
|
17
8
|
*/
|
|
18
|
-
function isV4Application(manifest) {
|
|
9
|
+
export function isV4Application(manifest) {
|
|
19
10
|
return !!manifest?.['sap.ui5']?.dependencies?.libs?.['sap.fe.templates'];
|
|
20
11
|
}
|
|
21
12
|
/**
|
|
@@ -24,7 +15,7 @@ function isV4Application(manifest) {
|
|
|
24
15
|
* @param {Manifest | undefined} manifest - The manager responsible for fetching and handling the application manifest.
|
|
25
16
|
* @returns {Promise<string>} The Fiori registration IDs as a string if available, otherwise an empty string.
|
|
26
17
|
*/
|
|
27
|
-
function getFioriId(manifest) {
|
|
18
|
+
export function getFioriId(manifest) {
|
|
28
19
|
return manifest?.['sap.fiori']?.registrationIds?.toString() ?? '';
|
|
29
20
|
}
|
|
30
21
|
/**
|
|
@@ -33,7 +24,7 @@ function getFioriId(manifest) {
|
|
|
33
24
|
* @param {Manifest | undefined} manifest - The manager responsible for fetching and handling the application manifest.
|
|
34
25
|
* @returns {Promise<string>} The ACH code as a string if available, otherwise an empty string.
|
|
35
26
|
*/
|
|
36
|
-
function getAch(manifest) {
|
|
27
|
+
export function getAch(manifest) {
|
|
37
28
|
return manifest?.['sap.app']?.ach?.toString() ?? '';
|
|
38
29
|
}
|
|
39
30
|
/**
|
|
@@ -50,19 +41,19 @@ function getAch(manifest) {
|
|
|
50
41
|
* - If none of these conditions are met, the function defaults to categorizing the application as Free Style.
|
|
51
42
|
* - If the manifest is empty, it returns None.
|
|
52
43
|
*/
|
|
53
|
-
function getApplicationType(manifest) {
|
|
44
|
+
export function getApplicationType(manifest) {
|
|
54
45
|
if (!manifest || Object.keys(manifest).length === 0) {
|
|
55
|
-
return
|
|
46
|
+
return ApplicationType.NONE;
|
|
56
47
|
}
|
|
57
48
|
if (manifest['sap.ovp']) {
|
|
58
|
-
return
|
|
49
|
+
return ApplicationType.FIORI_ELEMENTS_OVP;
|
|
59
50
|
}
|
|
60
51
|
const isSmartTemplate = !!manifest['sap.ui.generic.app'];
|
|
61
52
|
const hasSmartTemplateId = manifest['sap.app']?.sourceTemplate?.id?.toLowerCase() === 'ui5template.smarttemplate';
|
|
62
53
|
if (hasSmartTemplateId || isSmartTemplate) {
|
|
63
|
-
return
|
|
54
|
+
return ApplicationType.FIORI_ELEMENTS;
|
|
64
55
|
}
|
|
65
|
-
return
|
|
56
|
+
return ApplicationType.FREE_STYLE;
|
|
66
57
|
}
|
|
67
58
|
/**
|
|
68
59
|
* Checks if the application type is supported for ADAPTATION PROJECT.
|
|
@@ -70,8 +61,8 @@ function getApplicationType(manifest) {
|
|
|
70
61
|
* @param {ApplicationType} appType - The application type to check.
|
|
71
62
|
* @returns {boolean} True if the application type is supported for ADAPTATION PROJECT, false otherwise.
|
|
72
63
|
*/
|
|
73
|
-
function isSupportedAppTypeForAdp(appType) {
|
|
74
|
-
return [
|
|
64
|
+
export function isSupportedAppTypeForAdp(appType) {
|
|
65
|
+
return [ApplicationType.FIORI_ELEMENTS, ApplicationType.FIORI_ELEMENTS_OVP, ApplicationType.FREE_STYLE].includes(appType);
|
|
75
66
|
}
|
|
76
67
|
/**
|
|
77
68
|
* Checks if views are loaded synchronously or asynchronously in the UI5 settings of the manifest.
|
|
@@ -80,7 +71,7 @@ function isSupportedAppTypeForAdp(appType) {
|
|
|
80
71
|
* @param {Manifest['sap.ui5']} ui5Settings - The UI5 settings part of the manifest.
|
|
81
72
|
* @returns {boolean} Boolean if views are loaded synchronously or asynchronously.
|
|
82
73
|
*/
|
|
83
|
-
function isSyncLoadedView(ui5Settings) {
|
|
74
|
+
export function isSyncLoadedView(ui5Settings) {
|
|
84
75
|
if (ui5Settings?.rootView) {
|
|
85
76
|
const rootView = ui5Settings?.rootView;
|
|
86
77
|
return !rootView.async;
|
|
@@ -94,7 +85,7 @@ function isSyncLoadedView(ui5Settings) {
|
|
|
94
85
|
* Service class for handling operations related to application manifests.
|
|
95
86
|
* Manifest and URL are lazily loaded and stored internally.
|
|
96
87
|
*/
|
|
97
|
-
class SourceManifest {
|
|
88
|
+
export class SourceManifest {
|
|
98
89
|
provider;
|
|
99
90
|
appId;
|
|
100
91
|
logger;
|
|
@@ -153,7 +144,7 @@ class SourceManifest {
|
|
|
153
144
|
const url = appInfo?.manifestUrl ?? appInfo?.manifest ?? '';
|
|
154
145
|
if (!url) {
|
|
155
146
|
this.logger?.debug(`Manifest URL for app '${this.appId}' was not found!`);
|
|
156
|
-
throw new Error(
|
|
147
|
+
throw new Error(t('validators.appDoesNotSupportManifest'));
|
|
157
148
|
}
|
|
158
149
|
return url;
|
|
159
150
|
}
|
|
@@ -179,5 +170,4 @@ class SourceManifest {
|
|
|
179
170
|
}
|
|
180
171
|
}
|
|
181
172
|
}
|
|
182
|
-
exports.SourceManifest = SourceManifest;
|
|
183
173
|
//# sourceMappingURL=manifest.js.map
|
package/dist/source/systems.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
2
|
import type { BackendSystem } from '@sap-ux/store';
|
|
3
|
-
import type { Endpoint } from '../types';
|
|
3
|
+
import type { Endpoint } from '../types.js';
|
|
4
4
|
import { type AbapServiceProvider } from '@sap-ux/axios-extension';
|
|
5
5
|
export declare enum SupportedProject {
|
|
6
6
|
ON_PREM = "onPremise",
|
package/dist/source/systems.js
CHANGED
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const store_1 = require("@sap-ux/store");
|
|
7
|
-
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
8
|
-
const axios_extension_1 = require("@sap-ux/axios-extension");
|
|
9
|
-
const i18n_1 = require("../i18n");
|
|
10
|
-
var SupportedProject;
|
|
1
|
+
import { getService, SystemType } from '@sap-ux/store';
|
|
2
|
+
import { isAppStudio, listDestinations } from '@sap-ux/btp-utils';
|
|
3
|
+
import { AdaptationProjectType, isAxiosError } from '@sap-ux/axios-extension';
|
|
4
|
+
import { t } from '../i18n.js';
|
|
5
|
+
export var SupportedProject;
|
|
11
6
|
(function (SupportedProject) {
|
|
12
7
|
SupportedProject["ON_PREM"] = "onPremise";
|
|
13
8
|
SupportedProject["CLOUD_READY"] = "cloudReady";
|
|
14
9
|
SupportedProject["CLOUD_READY_AND_ON_PREM"] = "cloudReadyAndOnPrem";
|
|
15
|
-
})(SupportedProject || (
|
|
10
|
+
})(SupportedProject || (SupportedProject = {}));
|
|
16
11
|
/**
|
|
17
12
|
* Gets the supported project types for the system. A system can support cloudReady, onPremise or both types of project.
|
|
18
13
|
*
|
|
19
14
|
* @param provider - The ABAP service provider.
|
|
20
15
|
* @returns {Promise<SupportedProject>} The supported project types.
|
|
21
16
|
*/
|
|
22
|
-
async function getSupportedProject(provider) {
|
|
17
|
+
export async function getSupportedProject(provider) {
|
|
23
18
|
try {
|
|
24
19
|
const layerdRepositoryService = provider.getLayeredRepository();
|
|
25
20
|
const { adaptationProjectTypes } = await layerdRepositoryService.getSystemInfo();
|
|
26
|
-
const hasCloudReady = adaptationProjectTypes?.includes(
|
|
27
|
-
const hasOnPrem = adaptationProjectTypes?.includes(
|
|
21
|
+
const hasCloudReady = adaptationProjectTypes?.includes(AdaptationProjectType.CLOUD_READY);
|
|
22
|
+
const hasOnPrem = adaptationProjectTypes?.includes(AdaptationProjectType.ON_PREMISE);
|
|
28
23
|
if (hasCloudReady && hasOnPrem) {
|
|
29
24
|
return SupportedProject.CLOUD_READY_AND_ON_PREM;
|
|
30
25
|
}
|
|
@@ -37,12 +32,12 @@ async function getSupportedProject(provider) {
|
|
|
37
32
|
}
|
|
38
33
|
catch (error) {
|
|
39
34
|
// Handle the case where the API is not available and continue to standard onPremise flow.
|
|
40
|
-
if (
|
|
35
|
+
if (isAxiosError(error) && [404, 405].includes(error.response?.status ?? 0)) {
|
|
41
36
|
return SupportedProject.ON_PREM;
|
|
42
37
|
}
|
|
43
38
|
throw error;
|
|
44
39
|
}
|
|
45
|
-
throw new Error(
|
|
40
|
+
throw new Error(t('error.projectTypeNotProvided'));
|
|
46
41
|
}
|
|
47
42
|
/**
|
|
48
43
|
* Retrieves the names of all stored systems, sorted alphabetically.
|
|
@@ -50,7 +45,7 @@ async function getSupportedProject(provider) {
|
|
|
50
45
|
* @param {Endpoint[]} systems - Array of system systems.
|
|
51
46
|
* @returns {string[]} An array of endpoint names as strings in sorted order.
|
|
52
47
|
*/
|
|
53
|
-
function getEndpointNames(systems) {
|
|
48
|
+
export function getEndpointNames(systems) {
|
|
54
49
|
return systems
|
|
55
50
|
.map((endpoint) => endpoint.Name)
|
|
56
51
|
.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase(), 'en', { sensitivity: 'base' }));
|
|
@@ -61,7 +56,7 @@ function getEndpointNames(systems) {
|
|
|
61
56
|
* @param {BackendSystem} system - The backend system to transform.
|
|
62
57
|
* @returns {Endpoint} The transformed endpoint object.
|
|
63
58
|
*/
|
|
64
|
-
const transformBackendSystem = (system) => ({
|
|
59
|
+
export const transformBackendSystem = (system) => ({
|
|
65
60
|
Name: system.name,
|
|
66
61
|
Url: system.url,
|
|
67
62
|
Client: system.client,
|
|
@@ -74,12 +69,11 @@ const transformBackendSystem = (system) => ({
|
|
|
74
69
|
password: system.password
|
|
75
70
|
}
|
|
76
71
|
});
|
|
77
|
-
exports.transformBackendSystem = transformBackendSystem;
|
|
78
72
|
/**
|
|
79
73
|
* Service class to manage and retrieve information about system systems,
|
|
80
74
|
* including their names, authentication requirements, and specific details.
|
|
81
75
|
*/
|
|
82
|
-
class SystemLookup {
|
|
76
|
+
export class SystemLookup {
|
|
83
77
|
logger;
|
|
84
78
|
systems;
|
|
85
79
|
/**
|
|
@@ -110,18 +104,18 @@ class SystemLookup {
|
|
|
110
104
|
async loadSystems() {
|
|
111
105
|
try {
|
|
112
106
|
let endpoints = [];
|
|
113
|
-
if (
|
|
114
|
-
const destinations = await
|
|
107
|
+
if (isAppStudio()) {
|
|
108
|
+
const destinations = await listDestinations({
|
|
115
109
|
stripS4HCApiHosts: true
|
|
116
110
|
});
|
|
117
111
|
endpoints = Object.values(destinations).filter((dest) => dest.WebIDEUsage?.includes('dev_abap'));
|
|
118
112
|
}
|
|
119
113
|
else {
|
|
120
|
-
const systemStore = await
|
|
114
|
+
const systemStore = await getService({
|
|
121
115
|
entityName: 'system'
|
|
122
116
|
});
|
|
123
117
|
const backendSystems = await systemStore?.getAll();
|
|
124
|
-
endpoints = backendSystems.filter((system) => system.name !== undefined).map(
|
|
118
|
+
endpoints = backendSystems.filter((system) => system.name !== undefined).map(transformBackendSystem);
|
|
125
119
|
}
|
|
126
120
|
return endpoints;
|
|
127
121
|
}
|
|
@@ -153,18 +147,17 @@ class SystemLookup {
|
|
|
153
147
|
*/
|
|
154
148
|
async getSystemRequiresAuth(system) {
|
|
155
149
|
const found = await this.getSystemByName(system);
|
|
156
|
-
if (
|
|
150
|
+
if (isAppStudio()) {
|
|
157
151
|
return found?.Authentication === 'NoAuthentication';
|
|
158
152
|
}
|
|
159
153
|
else {
|
|
160
154
|
if (!found) {
|
|
161
155
|
return true;
|
|
162
156
|
}
|
|
163
|
-
const isOnPrem = found.SystemType ===
|
|
157
|
+
const isOnPrem = found.SystemType === SystemType.AbapOnPrem;
|
|
164
158
|
const hasMissingCredentials = !found.Credentials?.username || !found.Credentials?.password;
|
|
165
159
|
return isOnPrem && hasMissingCredentials;
|
|
166
160
|
}
|
|
167
161
|
}
|
|
168
162
|
}
|
|
169
|
-
exports.SystemLookup = SystemLookup;
|
|
170
163
|
//# sourceMappingURL=systems.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { Destination } from '@sap-ux/btp-utils';
|
|
|
7
7
|
import type { YUIQuestion } from '@sap-ux/inquirer-common';
|
|
8
8
|
import type AdmZip from 'adm-zip';
|
|
9
9
|
import type { ToolsLogger } from '@sap-ux/logger';
|
|
10
|
-
import type { SupportedProject } from './source';
|
|
10
|
+
import type { SupportedProject } from './source/index.js';
|
|
11
11
|
export type DataSources = Record<string, ManifestNamespace.DataSource>;
|
|
12
12
|
/**
|
|
13
13
|
* Common interface for manifest services (ABAP and CF).
|
package/dist/types.js
CHANGED
|
@@ -1,14 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cfServicesPromptNames = exports.AppRouterType = exports.ChangeTypeMap = exports.ServiceType = exports.ApplicationType = void 0;
|
|
4
|
-
var ApplicationType;
|
|
1
|
+
export var ApplicationType;
|
|
5
2
|
(function (ApplicationType) {
|
|
6
3
|
ApplicationType["FIORI_ELEMENTS"] = "FioriElements";
|
|
7
4
|
ApplicationType["FIORI_ELEMENTS_OVP"] = "FioriElementsOVP";
|
|
8
5
|
ApplicationType["FREE_STYLE"] = "FreeStyle";
|
|
9
6
|
ApplicationType["NONE"] = "";
|
|
10
|
-
})(ApplicationType || (
|
|
11
|
-
|
|
7
|
+
})(ApplicationType || (ApplicationType = {}));
|
|
8
|
+
export var TemplateFileName;
|
|
9
|
+
(function (TemplateFileName) {
|
|
10
|
+
TemplateFileName["Fragment"] = "fragment.xml";
|
|
11
|
+
TemplateFileName["Controller"] = "controller.ejs";
|
|
12
|
+
TemplateFileName["TSController"] = "ts-controller.ejs";
|
|
13
|
+
TemplateFileName["Annotation"] = "annotation.xml";
|
|
14
|
+
})(TemplateFileName || (TemplateFileName = {}));
|
|
15
|
+
export var FlexLayer;
|
|
16
|
+
(function (FlexLayer) {
|
|
17
|
+
FlexLayer["CUSTOMER_BASE"] = "CUSTOMER_BASE";
|
|
18
|
+
FlexLayer["VENDOR"] = "VENDOR";
|
|
19
|
+
})(FlexLayer || (FlexLayer = {}));
|
|
20
|
+
export var NamespacePrefix;
|
|
21
|
+
(function (NamespacePrefix) {
|
|
22
|
+
NamespacePrefix["CUSTOMER"] = "customer.";
|
|
23
|
+
NamespacePrefix["EMPTY"] = "";
|
|
24
|
+
})(NamespacePrefix || (NamespacePrefix = {}));
|
|
25
|
+
export var HttpStatusCodes;
|
|
26
|
+
(function (HttpStatusCodes) {
|
|
27
|
+
HttpStatusCodes[HttpStatusCodes["OK"] = 200] = "OK";
|
|
28
|
+
HttpStatusCodes[HttpStatusCodes["CREATED"] = 201] = "CREATED";
|
|
29
|
+
HttpStatusCodes[HttpStatusCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
30
|
+
HttpStatusCodes[HttpStatusCodes["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
31
|
+
HttpStatusCodes[HttpStatusCodes["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
32
|
+
HttpStatusCodes[HttpStatusCodes["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
33
|
+
HttpStatusCodes[HttpStatusCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
34
|
+
HttpStatusCodes[HttpStatusCodes["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
35
|
+
HttpStatusCodes[HttpStatusCodes["CONFLICT"] = 409] = "CONFLICT";
|
|
36
|
+
HttpStatusCodes[HttpStatusCodes["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
37
|
+
HttpStatusCodes[HttpStatusCodes["NOT_IMPLEMETED"] = 501] = "NOT_IMPLEMETED";
|
|
38
|
+
HttpStatusCodes[HttpStatusCodes["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
39
|
+
})(HttpStatusCodes || (HttpStatusCodes = {}));
|
|
40
|
+
/**
|
|
41
|
+
* Enumerates the types of changes that can be made, each representing a specific kind of modification.
|
|
42
|
+
*/
|
|
43
|
+
export var ChangeType;
|
|
44
|
+
(function (ChangeType) {
|
|
45
|
+
ChangeType["ADD_NEW_MODEL"] = "appdescr_ui5_addNewModel";
|
|
46
|
+
ChangeType["ADD_NEW_DATA_SOURCE"] = "appdescr_app_addNewDataSource";
|
|
47
|
+
ChangeType["ADD_ANNOTATIONS_TO_ODATA"] = "appdescr_app_addAnnotationsToOData";
|
|
48
|
+
ChangeType["CHANGE_DATA_SOURCE"] = "appdescr_app_changeDataSource";
|
|
49
|
+
ChangeType["ADD_COMPONENT_USAGES"] = "appdescr_ui5_addComponentUsages";
|
|
50
|
+
ChangeType["ADD_LIBRARY_REFERENCE"] = "appdescr_ui5_addLibraries";
|
|
51
|
+
ChangeType["CHANGE_INBOUND"] = "appdescr_app_changeInbound";
|
|
52
|
+
})(ChangeType || (ChangeType = {}));
|
|
53
|
+
export const ServiceType = {
|
|
12
54
|
ODATA_V2: 'OData v2',
|
|
13
55
|
ODATA_V4: 'OData v4',
|
|
14
56
|
HTTP: 'HTTP'
|
|
@@ -16,27 +58,32 @@ exports.ServiceType = {
|
|
|
16
58
|
/**
|
|
17
59
|
* A mapping of ChangeType values to their respective change names.
|
|
18
60
|
*/
|
|
19
|
-
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
61
|
+
export const ChangeTypeMap = {
|
|
62
|
+
[ChangeType.ADD_NEW_MODEL]: 'addNewModel',
|
|
63
|
+
[ChangeType.ADD_NEW_DATA_SOURCE]: 'addNewDataSource',
|
|
64
|
+
[ChangeType.ADD_ANNOTATIONS_TO_ODATA]: 'addAnnotationsToOData',
|
|
65
|
+
[ChangeType.CHANGE_DATA_SOURCE]: 'changeDataSource',
|
|
66
|
+
[ChangeType.ADD_COMPONENT_USAGES]: 'addComponentUsages',
|
|
67
|
+
[ChangeType.ADD_LIBRARY_REFERENCE]: 'addLibraries',
|
|
68
|
+
[ChangeType.CHANGE_INBOUND]: 'changeInbound'
|
|
27
69
|
};
|
|
28
|
-
|
|
70
|
+
export var AnnotationFileSelectType;
|
|
71
|
+
(function (AnnotationFileSelectType) {
|
|
72
|
+
AnnotationFileSelectType[AnnotationFileSelectType["ExistingFile"] = 1] = "ExistingFile";
|
|
73
|
+
AnnotationFileSelectType[AnnotationFileSelectType["NewEmptyFile"] = 2] = "NewEmptyFile";
|
|
74
|
+
})(AnnotationFileSelectType || (AnnotationFileSelectType = {}));
|
|
75
|
+
export const AppRouterType = {
|
|
29
76
|
MANAGED: 'Managed HTML5 Application Runtime',
|
|
30
77
|
STANDALONE: 'Standalone HTML5 Application Runtime'
|
|
31
78
|
};
|
|
32
79
|
/**
|
|
33
80
|
* CF services (application sources) prompts
|
|
34
81
|
*/
|
|
35
|
-
var cfServicesPromptNames;
|
|
82
|
+
export var cfServicesPromptNames;
|
|
36
83
|
(function (cfServicesPromptNames) {
|
|
37
84
|
cfServicesPromptNames["approuter"] = "approuter";
|
|
38
85
|
cfServicesPromptNames["businessService"] = "businessService";
|
|
39
86
|
cfServicesPromptNames["businessSolutionName"] = "businessSolutionName";
|
|
40
87
|
cfServicesPromptNames["baseApp"] = "baseApp";
|
|
41
|
-
})(cfServicesPromptNames || (
|
|
88
|
+
})(cfServicesPromptNames || (cfServicesPromptNames = {}));
|
|
42
89
|
//# sourceMappingURL=types.js.map
|
package/dist/ui5/fetch.d.ts
CHANGED
package/dist/ui5/fetch.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.fetchPublicVersions = fetchPublicVersions;
|
|
4
|
-
exports.fetchInternalVersions = fetchInternalVersions;
|
|
5
|
-
const format_1 = require("./format");
|
|
6
|
-
const constants_1 = require("../base/constants");
|
|
1
|
+
import { buildFallbackMap } from './format.js';
|
|
2
|
+
import { UI5_VERSIONS_CDN_URL, UI5_VERSIONS_NEO_CDN_URL, LATEST_VERSION } from '../base/constants/index.js';
|
|
7
3
|
/**
|
|
8
4
|
* Fetches public UI5 version data from the SAP CDN.
|
|
9
5
|
*
|
|
@@ -11,9 +7,9 @@ const constants_1 = require("../base/constants");
|
|
|
11
7
|
* @returns {Promise<UI5Version>} A promise that resolves to the UI5 version data object if request completes.
|
|
12
8
|
* Otherwise, returns fallback ui5 versions.
|
|
13
9
|
*/
|
|
14
|
-
async function fetchPublicVersions(logger) {
|
|
10
|
+
export async function fetchPublicVersions(logger) {
|
|
15
11
|
try {
|
|
16
|
-
const response = await fetch(
|
|
12
|
+
const response = await fetch(UI5_VERSIONS_CDN_URL);
|
|
17
13
|
if (!response.ok) {
|
|
18
14
|
throw new Error(`Failed to fetch public UI5 versions. Status: ${response.status}`);
|
|
19
15
|
}
|
|
@@ -21,7 +17,7 @@ async function fetchPublicVersions(logger) {
|
|
|
21
17
|
}
|
|
22
18
|
catch (e) {
|
|
23
19
|
logger?.warn('[ui5-info] Falling back to built-in UI5 version list: ' + (e instanceof Error ? e.message : String(e)));
|
|
24
|
-
return
|
|
20
|
+
return buildFallbackMap();
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
23
|
/**
|
|
@@ -30,12 +26,12 @@ async function fetchPublicVersions(logger) {
|
|
|
30
26
|
* @param {string} latestVersion - The latest public UI5 version.
|
|
31
27
|
* @returns {Promise<string[]>} A promise that resolves to an array of formatted internal version strings.
|
|
32
28
|
*/
|
|
33
|
-
async function fetchInternalVersions(latestVersion) {
|
|
34
|
-
const response = await fetch(
|
|
29
|
+
export async function fetchInternalVersions(latestVersion) {
|
|
30
|
+
const response = await fetch(UI5_VERSIONS_NEO_CDN_URL);
|
|
35
31
|
const data = await response.json();
|
|
36
32
|
return data?.routes?.map((route) => {
|
|
37
33
|
return route.target.version === latestVersion
|
|
38
|
-
? `${route.target.version} ${
|
|
34
|
+
? `${route.target.version} ${LATEST_VERSION}`
|
|
39
35
|
: route.target.version;
|
|
40
36
|
});
|
|
41
37
|
}
|
package/dist/ui5/format.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UI5Version } from '../types';
|
|
1
|
+
import type { UI5Version } from '../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Gets the official base URL for SAP UI5 resources based on the version information.
|
|
4
4
|
* If the version includes 'snapshot', it returns a preview URL; otherwise, it returns the main SAP UI5 CDN URL.
|
package/dist/ui5/format.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getOfficialBaseUI5VersionUrl = getOfficialBaseUI5VersionUrl;
|
|
4
|
-
exports.getFormattedVersion = getFormattedVersion;
|
|
5
|
-
exports.buildSystemVersionLabel = buildSystemVersionLabel;
|
|
6
|
-
exports.removeBracketsFromVersion = removeBracketsFromVersion;
|
|
7
|
-
exports.removeMicroPart = removeMicroPart;
|
|
8
|
-
exports.formatUi5Version = formatUi5Version;
|
|
9
|
-
exports.addSnapshot = addSnapshot;
|
|
10
|
-
exports.parseUI5Version = parseUI5Version;
|
|
11
|
-
exports.isFeatureSupportedVersion = isFeatureSupportedVersion;
|
|
12
|
-
exports.buildFallbackMap = buildFallbackMap;
|
|
13
|
-
const ui5_info_1 = require("@sap-ux/ui5-info");
|
|
14
|
-
const constants_1 = require("../base/constants");
|
|
1
|
+
import { supportedUi5VersionFallbacks } from '@sap-ux/ui5-info';
|
|
2
|
+
import { CURRENT_SYSTEM_VERSION, SNAPSHOT_CDN_URL, UI5_CDN_URL } from '../base/constants/index.js';
|
|
15
3
|
/**
|
|
16
4
|
* Gets the official base URL for SAP UI5 resources based on the version information.
|
|
17
5
|
* If the version includes 'snapshot', it returns a preview URL; otherwise, it returns the main SAP UI5 CDN URL.
|
|
@@ -19,11 +7,11 @@ const constants_1 = require("../base/constants");
|
|
|
19
7
|
* @param {string} version - The UI5 version string, which may include qualifiers like 'snapshot'.
|
|
20
8
|
* @returns {string} The base URL for UI5 resources appropriate to the specified version.
|
|
21
9
|
*/
|
|
22
|
-
function getOfficialBaseUI5VersionUrl(version) {
|
|
10
|
+
export function getOfficialBaseUI5VersionUrl(version) {
|
|
23
11
|
if (version.toLowerCase().includes('snapshot')) {
|
|
24
|
-
return
|
|
12
|
+
return SNAPSHOT_CDN_URL;
|
|
25
13
|
}
|
|
26
|
-
return
|
|
14
|
+
return UI5_CDN_URL;
|
|
27
15
|
}
|
|
28
16
|
/**
|
|
29
17
|
* Formats a UI5 version string by removing extraneous information and adjusting the format of snapshot versions.
|
|
@@ -32,7 +20,7 @@ function getOfficialBaseUI5VersionUrl(version) {
|
|
|
32
20
|
* @param {string} version - The original version string which may include additional descriptors like 'snapshot'.
|
|
33
21
|
* @returns {string} A cleaned-up and, if applicable, restructured version string.
|
|
34
22
|
*/
|
|
35
|
-
function getFormattedVersion(version) {
|
|
23
|
+
export function getFormattedVersion(version) {
|
|
36
24
|
version = removeBracketsFromVersion(version);
|
|
37
25
|
return version.toLowerCase().includes('-snapshot') ? `snapshot-${removeMicroPart(version)}` : version;
|
|
38
26
|
}
|
|
@@ -44,8 +32,8 @@ function getFormattedVersion(version) {
|
|
|
44
32
|
* @param {string} latestLabel - The label for the latest version if applicable.
|
|
45
33
|
* @returns {string} The constructed version string.
|
|
46
34
|
*/
|
|
47
|
-
function buildSystemVersionLabel(formattedVersion, snapshotLabel, latestLabel) {
|
|
48
|
-
return `${formattedVersion}${snapshotLabel} ${
|
|
35
|
+
export function buildSystemVersionLabel(formattedVersion, snapshotLabel, latestLabel) {
|
|
36
|
+
return `${formattedVersion}${snapshotLabel} ${CURRENT_SYSTEM_VERSION}${latestLabel}`;
|
|
49
37
|
}
|
|
50
38
|
/**
|
|
51
39
|
* Removes parenthetical information from a version string, typically used to clean up annotations such as "(latest)".
|
|
@@ -53,7 +41,7 @@ function buildSystemVersionLabel(formattedVersion, snapshotLabel, latestLabel) {
|
|
|
53
41
|
* @param {string} version - The version string which may include parenthetical information.
|
|
54
42
|
* @returns {string} The version string without the parenthetical content.
|
|
55
43
|
*/
|
|
56
|
-
function removeBracketsFromVersion(version) {
|
|
44
|
+
export function removeBracketsFromVersion(version) {
|
|
57
45
|
if (version.indexOf('(') !== -1) {
|
|
58
46
|
const versionParts = version.split('(');
|
|
59
47
|
return versionParts[0].trim();
|
|
@@ -67,7 +55,7 @@ function removeBracketsFromVersion(version) {
|
|
|
67
55
|
* @param {string} version - The full version string that may include major, minor, and micro version numbers.
|
|
68
56
|
* @returns {string} The version string consisting of only the major and minor version numbers.
|
|
69
57
|
*/
|
|
70
|
-
function removeMicroPart(version) {
|
|
58
|
+
export function removeMicroPart(version) {
|
|
71
59
|
const versionParts = version.split('.');
|
|
72
60
|
return `${versionParts[0]}.${versionParts[1]}`;
|
|
73
61
|
}
|
|
@@ -85,7 +73,7 @@ function removeMicroPart(version) {
|
|
|
85
73
|
* formatUi5Version('1.95.0'); // returns '1.95.0'
|
|
86
74
|
* ```
|
|
87
75
|
*/
|
|
88
|
-
function formatUi5Version(version) {
|
|
76
|
+
export function formatUi5Version(version) {
|
|
89
77
|
const versionParts = version.split('.');
|
|
90
78
|
return `${versionParts[0]}.${versionParts[1]}.${versionParts[2].toLowerCase().replace('-snapshot', '')}`;
|
|
91
79
|
}
|
|
@@ -98,7 +86,7 @@ function formatUi5Version(version) {
|
|
|
98
86
|
* @param {string} latestVersion - The most recently released version string, used for comparison.
|
|
99
87
|
* @returns {string} The '-snapshot' suffix if applicable; otherwise, an empty string.
|
|
100
88
|
*/
|
|
101
|
-
function addSnapshot(version, latestVersion) {
|
|
89
|
+
export function addSnapshot(version, latestVersion) {
|
|
102
90
|
const versionParts = version.split('.');
|
|
103
91
|
return (versionParts[3] || version.toLowerCase().includes('-snapshot')) &&
|
|
104
92
|
formatUi5Version(version) !== latestVersion
|
|
@@ -111,7 +99,7 @@ function addSnapshot(version, latestVersion) {
|
|
|
111
99
|
* @param {string} version the UI5 version to parse
|
|
112
100
|
* @returns The major, the minor and the patch version, e.g. 1.86.11
|
|
113
101
|
*/
|
|
114
|
-
function parseUI5Version(version) {
|
|
102
|
+
export function parseUI5Version(version) {
|
|
115
103
|
const versionParts = version ? version.replace(/snapshot-untested|snapshot-|snapshot/, '').split('.') : [];
|
|
116
104
|
const major = Number.parseInt(versionParts[0], 10);
|
|
117
105
|
const minor = Number.parseInt(versionParts[1], 10);
|
|
@@ -127,7 +115,7 @@ function parseUI5Version(version) {
|
|
|
127
115
|
* @param {string} [version] - The current version string of the application; if not provided, the feature is assumed unsupported.
|
|
128
116
|
* @returns {boolean} - Returns true if the current version supports the feature, false otherwise.
|
|
129
117
|
*/
|
|
130
|
-
function isFeatureSupportedVersion(featureVersion, version) {
|
|
118
|
+
export function isFeatureSupportedVersion(featureVersion, version) {
|
|
131
119
|
if (!version || !featureVersion) {
|
|
132
120
|
return false;
|
|
133
121
|
}
|
|
@@ -163,9 +151,9 @@ function toVersionDetail(entry) {
|
|
|
163
151
|
*
|
|
164
152
|
* @returns {UI5Version} An object whose keys are the version strings (e.g. `"1.135.0"`).
|
|
165
153
|
*/
|
|
166
|
-
function buildFallbackMap() {
|
|
167
|
-
const latest = toVersionDetail(
|
|
168
|
-
return
|
|
154
|
+
export function buildFallbackMap() {
|
|
155
|
+
const latest = toVersionDetail(supportedUi5VersionFallbacks[0]);
|
|
156
|
+
return supportedUi5VersionFallbacks.reduce((acc, entry) => {
|
|
169
157
|
acc[entry.version] = toVersionDetail(entry);
|
|
170
158
|
return acc;
|
|
171
159
|
}, { latest });
|
package/dist/ui5/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './version-info';
|
|
2
|
-
export * from './format';
|
|
3
|
-
export * from './fetch';
|
|
4
|
-
export * from './validator';
|
|
1
|
+
export * from './version-info.js';
|
|
2
|
+
export * from './format.js';
|
|
3
|
+
export * from './fetch.js';
|
|
4
|
+
export * from './validator.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|