@sap-ux/mockserver-config-writer 0.5.7 → 0.6.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/app-info.js
CHANGED
|
@@ -8,14 +8,13 @@ exports.getODataSources = exports.getMainServiceDataSource = void 0;
|
|
|
8
8
|
* @returns - data source entry from manifest.json, parsed
|
|
9
9
|
*/
|
|
10
10
|
function getMainServiceDataSource(manifest) {
|
|
11
|
-
var _a, _b, _c;
|
|
12
11
|
let dataSource;
|
|
13
|
-
const model =
|
|
14
|
-
const dataSourceName = manifest['sap.ui5'] &&
|
|
12
|
+
const model = manifest['sap.ovp']?.globalFilterModel || '';
|
|
13
|
+
const dataSourceName = manifest['sap.ui5'] && manifest['sap.ui5'].models?.[model]
|
|
15
14
|
? manifest['sap.ui5'].models[model].dataSource
|
|
16
15
|
: undefined;
|
|
17
16
|
if (dataSourceName) {
|
|
18
|
-
dataSource =
|
|
17
|
+
dataSource = manifest['sap.app'].dataSources?.[dataSourceName];
|
|
19
18
|
}
|
|
20
19
|
return dataSource;
|
|
21
20
|
}
|
|
@@ -28,9 +27,8 @@ exports.getMainServiceDataSource = getMainServiceDataSource;
|
|
|
28
27
|
* @returns data sources of type 'OData'
|
|
29
28
|
*/
|
|
30
29
|
function getODataSources(manifest, dataSourceType = 'OData') {
|
|
31
|
-
var _a;
|
|
32
30
|
const result = {};
|
|
33
|
-
const dataSources =
|
|
31
|
+
const dataSources = manifest['sap.app']?.dataSources || {};
|
|
34
32
|
for (const dataSource in dataSources) {
|
|
35
33
|
if (dataSources[dataSource].uri && dataSources[dataSource].type === dataSourceType) {
|
|
36
34
|
result[dataSource] = dataSources[dataSource];
|
package/dist/i18n.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -19,19 +10,17 @@ const NS = 'odata-service-writer';
|
|
|
19
10
|
/**
|
|
20
11
|
* Initialize i18next with the translations for this module.
|
|
21
12
|
*/
|
|
22
|
-
function initI18n() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
ns: [NS]
|
|
34
|
-
});
|
|
13
|
+
async function initI18n() {
|
|
14
|
+
await i18next_1.default.init({
|
|
15
|
+
resources: {
|
|
16
|
+
en: {
|
|
17
|
+
[NS]: mockserver_config_writer_i18n_json_1.default
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
lng: 'en',
|
|
21
|
+
fallbackLng: 'en',
|
|
22
|
+
defaultNS: NS,
|
|
23
|
+
ns: [NS]
|
|
35
24
|
});
|
|
36
25
|
}
|
|
37
26
|
exports.initI18n = initI18n;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.removeMockserverConfig = exports.generateMockserverConfig = void 0;
|
|
13
4
|
const mem_fs_1 = require("mem-fs");
|
|
@@ -22,15 +13,13 @@ const ui5_mock_yaml_1 = require("./ui5-mock-yaml");
|
|
|
22
13
|
* @param fs - the memfs editor instance
|
|
23
14
|
* @returns Promise<Editor> - memfs editor instance with updated files
|
|
24
15
|
*/
|
|
25
|
-
function generateMockserverConfig(basePath, data, fs) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return fs;
|
|
33
|
-
});
|
|
16
|
+
async function generateMockserverConfig(basePath, data, fs) {
|
|
17
|
+
if (!fs) {
|
|
18
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
19
|
+
}
|
|
20
|
+
(0, package_json_1.enhancePackageJson)(fs, basePath, data.packageJsonConfig);
|
|
21
|
+
await (0, ui5_mock_yaml_1.enhanceYaml)(fs, basePath, data.webappPath, data.ui5MockYamlConfig);
|
|
22
|
+
return fs;
|
|
34
23
|
}
|
|
35
24
|
exports.generateMockserverConfig = generateMockserverConfig;
|
|
36
25
|
/**
|
|
@@ -12,7 +12,7 @@ const path_1 = require("path");
|
|
|
12
12
|
function enhancePackageJson(fs, basePath, config) {
|
|
13
13
|
const packageJsonPath = (0, path_1.join)(basePath, 'package.json');
|
|
14
14
|
const packageJson = fs.readJSON(packageJsonPath);
|
|
15
|
-
enhanceDependencies(packageJson, config
|
|
15
|
+
enhanceDependencies(packageJson, config?.mockserverModule, config?.mockserverVersion);
|
|
16
16
|
enhanceScripts(fs, packageJson);
|
|
17
17
|
fs.writeJSON(packageJsonPath, packageJson);
|
|
18
18
|
}
|
|
@@ -26,7 +26,6 @@ exports.enhancePackageJson = enhancePackageJson;
|
|
|
26
26
|
* @param version - npm version string
|
|
27
27
|
*/
|
|
28
28
|
function enhanceDependencies(packageJson, mockserverModule = '@sap-ux/ui5-middleware-fe-mockserver', version = '2') {
|
|
29
|
-
var _a;
|
|
30
29
|
packageJson.devDependencies = packageJson.devDependencies || {};
|
|
31
30
|
delete packageJson.devDependencies['@sap/ux-ui5-fe-mockserver-middleware'];
|
|
32
31
|
packageJson.devDependencies[mockserverModule] = version;
|
|
@@ -34,8 +33,8 @@ function enhanceDependencies(packageJson, mockserverModule = '@sap-ux/ui5-middle
|
|
|
34
33
|
removeMockserverUi5Dependencies(packageJson);
|
|
35
34
|
}
|
|
36
35
|
else {
|
|
37
|
-
packageJson.ui5
|
|
38
|
-
|
|
36
|
+
packageJson.ui5 ||= {};
|
|
37
|
+
packageJson.ui5.dependencies ||= [];
|
|
39
38
|
const ui5Dependencies = packageJson.ui5.dependencies.filter((dep) => dep !== '@sap/ux-ui5-fe-mockserver-middleware');
|
|
40
39
|
if (!ui5Dependencies.includes(mockserverModule)) {
|
|
41
40
|
ui5Dependencies.push(mockserverModule);
|
|
@@ -50,10 +49,11 @@ function enhanceDependencies(packageJson, mockserverModule = '@sap-ux/ui5-middle
|
|
|
50
49
|
* @param packageJson - path to package.json
|
|
51
50
|
*/
|
|
52
51
|
function enhanceScripts(fs, packageJson) {
|
|
53
|
-
|
|
54
|
-
packageJson.scripts || (packageJson.scripts = {});
|
|
52
|
+
packageJson.scripts ||= {};
|
|
55
53
|
packageJson.scripts['start-mock'] =
|
|
56
|
-
|
|
54
|
+
copyStartScript(packageJson.scripts.start) ??
|
|
55
|
+
packageJson.scripts['start-mock'] ??
|
|
56
|
+
`fiori run --config ./ui5-mock.yaml --open "/"`;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Return a copy of package.json's 'start' script with added or replaced config pointing to ui5-mock.yaml.
|
|
@@ -84,16 +84,15 @@ function copyStartScript(startScript) {
|
|
|
84
84
|
* @returns - true: @ui/cli higher version 2; false: @ui/cli
|
|
85
85
|
*/
|
|
86
86
|
function isUi5CliHigherTwo(devDependencies) {
|
|
87
|
-
var _a;
|
|
88
87
|
let isHigherTwo = false;
|
|
89
88
|
try {
|
|
90
89
|
const versionString = devDependencies['@ui5/cli'];
|
|
91
90
|
if (typeof versionString === 'string') {
|
|
92
|
-
const majorVersion = parseInt(
|
|
91
|
+
const majorVersion = parseInt(versionString.split('.')[0].match(/\d+/)?.[0] || '0', 10);
|
|
93
92
|
isHigherTwo = majorVersion > 2 ? true : false;
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
|
-
catch
|
|
95
|
+
catch {
|
|
97
96
|
// if something went wrong we don't have @ui/cli > version 2
|
|
98
97
|
}
|
|
99
98
|
return isHigherTwo;
|
|
@@ -126,9 +125,8 @@ function replaceConfig(startScript, configStartIndex) {
|
|
|
126
125
|
* @param packageJson - parsed package.json content
|
|
127
126
|
*/
|
|
128
127
|
function removeMockserverUi5Dependencies(packageJson) {
|
|
129
|
-
var _a;
|
|
130
128
|
const removeModules = new Set(['@sap/ux-ui5-fe-mockserver-middleware', '@sap-ux/ui5-middleware-fe-mockserver']);
|
|
131
|
-
if (
|
|
129
|
+
if (packageJson.ui5?.dependencies && Array.isArray(packageJson.ui5.dependencies)) {
|
|
132
130
|
packageJson.ui5.dependencies = packageJson.ui5.dependencies.filter((d) => !removeModules.has(d));
|
|
133
131
|
if (packageJson.ui5.dependencies.length === 0) {
|
|
134
132
|
delete packageJson.ui5.dependencies;
|
|
@@ -145,15 +143,14 @@ function removeMockserverUi5Dependencies(packageJson) {
|
|
|
145
143
|
* @param basePath - path to application root, where package.json is
|
|
146
144
|
*/
|
|
147
145
|
function removeFromPackageJson(fs, basePath) {
|
|
148
|
-
var _a, _b, _c;
|
|
149
146
|
const packageJsonPath = (0, path_1.join)(basePath, 'package.json');
|
|
150
147
|
const packageJson = fs.readJSON(packageJsonPath);
|
|
151
|
-
|
|
148
|
+
delete packageJson.scripts?.['start-mock'];
|
|
152
149
|
if (packageJson.scripts && Object.keys(packageJson.scripts).length === 0) {
|
|
153
150
|
delete packageJson.scripts;
|
|
154
151
|
}
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
delete packageJson.devDependencies?.['@sap/ux-ui5-fe-mockserver-middleware'];
|
|
153
|
+
delete packageJson.devDependencies?.['@sap-ux/ui5-middleware-fe-mockserver'];
|
|
157
154
|
if (packageJson.devDependencies && Object.keys(packageJson.devDependencies).length === 0) {
|
|
158
155
|
delete packageJson.devDependencies;
|
|
159
156
|
}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.removeUi5MockYaml = exports.enhanceYaml = void 0;
|
|
13
4
|
const path_1 = require("path");
|
|
@@ -33,32 +24,26 @@ const app_info_1 = require("../app-info");
|
|
|
33
24
|
* @param webappPath - path to webapp folder, where manifest.json is
|
|
34
25
|
* @param config - optional config passed in by consumer
|
|
35
26
|
*/
|
|
36
|
-
function enhanceYaml(fs, basePath, webappPath, config) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
? yield generateUi5MockYamlBasedOnUi5Yaml(fs, basePath, mockserverPath, annotationsConfig)
|
|
57
|
-
: yield generateNewUi5MockYamlConfig(((_b = manifest['sap.app']) === null || _b === void 0 ? void 0 : _b.id) || '', mockserverPath, annotationsConfig);
|
|
58
|
-
}
|
|
59
|
-
const yaml = mockConfig.toString();
|
|
60
|
-
fs.write(ui5MockYamlPath, yaml);
|
|
61
|
-
});
|
|
27
|
+
async function enhanceYaml(fs, basePath, webappPath, config) {
|
|
28
|
+
const ui5MockYamlPath = (0, path_1.join)(basePath, 'ui5-mock.yaml');
|
|
29
|
+
let mockConfig;
|
|
30
|
+
const manifest = fs.readJSON((0, path_1.join)(webappPath, 'manifest.json'));
|
|
31
|
+
const mockserverPath = config?.path || (0, app_info_1.getMainServiceDataSource)(manifest)?.uri;
|
|
32
|
+
const annotationSource = Object.values((0, app_info_1.getODataSources)(manifest, 'ODataAnnotation'));
|
|
33
|
+
const annotationsConfig = annotationSource.map((annotation) => ({
|
|
34
|
+
localPath: `./webapp/${annotation.settings?.localUri}`,
|
|
35
|
+
urlPath: annotation.uri
|
|
36
|
+
}));
|
|
37
|
+
if (fs.exists(ui5MockYamlPath)) {
|
|
38
|
+
mockConfig = await updateUi5MockYamlConfig(fs, ui5MockYamlPath, mockserverPath, annotationsConfig);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
mockConfig = fs.exists((0, path_1.join)(basePath, 'ui5.yaml'))
|
|
42
|
+
? await generateUi5MockYamlBasedOnUi5Yaml(fs, basePath, mockserverPath, annotationsConfig)
|
|
43
|
+
: await generateNewUi5MockYamlConfig(manifest['sap.app']?.id || '', mockserverPath, annotationsConfig);
|
|
44
|
+
}
|
|
45
|
+
const yaml = mockConfig.toString();
|
|
46
|
+
fs.write(ui5MockYamlPath, yaml);
|
|
62
47
|
}
|
|
63
48
|
exports.enhanceYaml = enhanceYaml;
|
|
64
49
|
/**
|
|
@@ -71,12 +56,10 @@ exports.enhanceYaml = enhanceYaml;
|
|
|
71
56
|
* @param annotationsConfig - optional annotations config to add to mockserver middleware
|
|
72
57
|
* @returns {*} {Promise<UI5Config>} - Update Yaml Doc
|
|
73
58
|
*/
|
|
74
|
-
function updateUi5MockYamlConfig(fs, ui5MockYamlPath, path, annotationsConfig) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return existingUi5MockYamlConfig;
|
|
79
|
-
});
|
|
59
|
+
async function updateUi5MockYamlConfig(fs, ui5MockYamlPath, path, annotationsConfig) {
|
|
60
|
+
const existingUi5MockYamlConfig = await ui5_config_1.UI5Config.newInstance(fs.read(ui5MockYamlPath));
|
|
61
|
+
existingUi5MockYamlConfig.updateCustomMiddleware(await getNewMockserverMiddleware(path, annotationsConfig));
|
|
62
|
+
return existingUi5MockYamlConfig;
|
|
80
63
|
}
|
|
81
64
|
/**
|
|
82
65
|
* Create a new ui5-mock.yaml based on existing ui5.yaml.
|
|
@@ -87,12 +70,10 @@ function updateUi5MockYamlConfig(fs, ui5MockYamlPath, path, annotationsConfig) {
|
|
|
87
70
|
* @param annotationsConfig - optional annotations config to add to mockserver middleware
|
|
88
71
|
* @returns {*} {Promise<UI5Config>} - Update Yaml Doc
|
|
89
72
|
*/
|
|
90
|
-
function generateUi5MockYamlBasedOnUi5Yaml(fs, basePath, path, annotationsConfig) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return ui5MockYamlConfig;
|
|
95
|
-
});
|
|
73
|
+
async function generateUi5MockYamlBasedOnUi5Yaml(fs, basePath, path, annotationsConfig) {
|
|
74
|
+
const ui5MockYamlConfig = await ui5_config_1.UI5Config.newInstance(fs.read((0, path_1.join)(basePath, 'ui5.yaml')));
|
|
75
|
+
ui5MockYamlConfig.updateCustomMiddleware(await getNewMockserverMiddleware(path, annotationsConfig));
|
|
76
|
+
return ui5MockYamlConfig;
|
|
96
77
|
}
|
|
97
78
|
/**
|
|
98
79
|
* Create fresh ui5-mock.yaml configuration which can be stringified and written.
|
|
@@ -102,16 +83,14 @@ function generateUi5MockYamlBasedOnUi5Yaml(fs, basePath, path, annotationsConfig
|
|
|
102
83
|
* @param annotationsConfig - optional annotations config to add to mockserver middleware
|
|
103
84
|
* @returns {*} {Promise<UI5Config>} - Update Yaml Doc
|
|
104
85
|
*/
|
|
105
|
-
function generateNewUi5MockYamlConfig(appId, path, annotationsConfig) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return ui5MockYaml;
|
|
114
|
-
});
|
|
86
|
+
async function generateNewUi5MockYamlConfig(appId, path, annotationsConfig) {
|
|
87
|
+
const ui5MockYaml = await ui5_config_1.UI5Config.newInstance('# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json\n\nspecVersion: "2.5"');
|
|
88
|
+
ui5MockYaml.setMetadata({ name: appId });
|
|
89
|
+
ui5MockYaml.setType('application');
|
|
90
|
+
ui5MockYaml.addFioriToolsProxydMiddleware({ ui5: {} });
|
|
91
|
+
ui5MockYaml.addFioriToolsAppReloadMiddleware();
|
|
92
|
+
ui5MockYaml.addMockServerMiddleware(path, annotationsConfig);
|
|
93
|
+
return ui5MockYaml;
|
|
115
94
|
}
|
|
116
95
|
/**
|
|
117
96
|
* Return new mockserver middleware.
|
|
@@ -120,16 +99,14 @@ function generateNewUi5MockYamlConfig(appId, path, annotationsConfig) {
|
|
|
120
99
|
* @param annotationsConfig - optional annotations config to add to mockserver middleware
|
|
121
100
|
* @returns - mockserver middleware
|
|
122
101
|
*/
|
|
123
|
-
function getNewMockserverMiddleware(path, annotationsConfig) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return mockserverMiddleware;
|
|
132
|
-
});
|
|
102
|
+
async function getNewMockserverMiddleware(path, annotationsConfig) {
|
|
103
|
+
const ui5MockYaml = await ui5_config_1.UI5Config.newInstance('');
|
|
104
|
+
ui5MockYaml.addMockServerMiddleware(path, annotationsConfig);
|
|
105
|
+
const mockserverMiddleware = ui5MockYaml.findCustomMiddleware('sap-fe-mockserver');
|
|
106
|
+
if (!mockserverMiddleware) {
|
|
107
|
+
throw Error('Could not create new mockserver config');
|
|
108
|
+
}
|
|
109
|
+
return mockserverMiddleware;
|
|
133
110
|
}
|
|
134
111
|
/**
|
|
135
112
|
* Delete ui5-mock.yaml file from mem-fs.
|
package/dist/prompt/index.js
CHANGED
|
@@ -15,22 +15,21 @@ const __1 = require("..");
|
|
|
15
15
|
* @returns - array of questions that serves as input for prompt module
|
|
16
16
|
*/
|
|
17
17
|
function getMockserverConfigQuestions(params) {
|
|
18
|
-
var _a, _b;
|
|
19
18
|
const question = {
|
|
20
19
|
name: 'path',
|
|
21
20
|
message: (0, __1.t)('questions.pathToMock')
|
|
22
21
|
};
|
|
23
|
-
if (params
|
|
22
|
+
if (params?.webappPath) {
|
|
24
23
|
const fs = params.fs || (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
25
24
|
const manifest = JSON.parse(fs.read((0, path_1.join)(params.webappPath, 'manifest.json')));
|
|
26
|
-
const mainDataSourceUri = (
|
|
25
|
+
const mainDataSourceUri = (0, app_info_1.getMainServiceDataSource)(manifest)?.uri || '';
|
|
27
26
|
const oDataSources = (0, app_info_1.getODataSources)(manifest);
|
|
28
27
|
const choices = [];
|
|
29
28
|
for (const dsName in oDataSources) {
|
|
30
29
|
choices.push({
|
|
31
30
|
title: `${dsName}: ${oDataSources[dsName].uri}`,
|
|
32
31
|
value: oDataSources[dsName].uri,
|
|
33
|
-
description:
|
|
32
|
+
description: oDataSources[dsName].settings?.odataVersion || undefined
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
35
|
if (choices.length > 0) {
|
|
@@ -39,7 +38,7 @@ function getMockserverConfigQuestions(params) {
|
|
|
39
38
|
question.initial = choices.findIndex((c) => c.value === mainDataSourceUri);
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
|
-
question.type
|
|
41
|
+
question.type ||= 'text';
|
|
43
42
|
return [question];
|
|
44
43
|
}
|
|
45
44
|
exports.getMockserverConfigQuestions = getMockserverConfigQuestions;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/mockserver-config-writer",
|
|
3
3
|
"description": "Add or update configuration for SAP Fiori tools mockserver",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"i18next": "20.6.1",
|
|
23
23
|
"mem-fs": "2.1.0",
|
|
24
24
|
"mem-fs-editor": "9.4.0",
|
|
25
|
-
"@sap-ux/ui5-config": "0.
|
|
25
|
+
"@sap-ux/ui5-config": "0.23.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/mem-fs": "1.1.2",
|
|
29
29
|
"@types/mem-fs-editor": "7.0.1",
|
|
30
30
|
"@types/prompts": "2.4.4",
|
|
31
31
|
"prompts": "2.4.2",
|
|
32
|
-
"@sap-ux/project-access": "1.
|
|
32
|
+
"@sap-ux/project-access": "1.23.0"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=18.x"
|