@sap-ux/adp-tooling 0.12.16 → 0.12.18
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/base/change-utils.d.ts +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -1
- package/dist/prompts/change-inbound/index.d.ts +9 -0
- package/dist/prompts/change-inbound/index.js +45 -0
- package/dist/prompts/index.d.ts +1 -0
- package/dist/prompts/index.js +3 -1
- package/dist/translations/adp-tooling.i18n.json +18 -6
- package/dist/types.d.ts +16 -13
- package/dist/writer/changes/writers/inbound-writer.d.ts +0 -8
- package/dist/writer/changes/writers/inbound-writer.js +10 -28
- package/package.json +4 -4
|
@@ -64,7 +64,7 @@ export declare function parseStringToObject(str: string): {
|
|
|
64
64
|
* // Returns the string "nonJSONValue" because it cannot be parsed as JSON
|
|
65
65
|
* getParsedPropertyValue('nonJSONValue');
|
|
66
66
|
*/
|
|
67
|
-
export declare function getParsedPropertyValue(propertyValue:
|
|
67
|
+
export declare function getParsedPropertyValue(propertyValue: string): PropertyValueType;
|
|
68
68
|
/**
|
|
69
69
|
* Searches for a change file with a specific inbound ID within a project's change directory.
|
|
70
70
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,8 @@ export * from './base/abap';
|
|
|
7
7
|
export { generate, migrate } from './writer';
|
|
8
8
|
export { generateChange } from './writer/editors';
|
|
9
9
|
export { promptGeneratorInput, PromptDefaults } from './base/prompt';
|
|
10
|
+
export { getManifest } from './base/abap';
|
|
10
11
|
export { isCFEnvironment } from './base/cf';
|
|
12
|
+
export { getPromptsForChangeInbound, getPromptsForChangeDataSource } from './prompts';
|
|
13
|
+
export { getVariant } from './base/helper';
|
|
11
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.isCFEnvironment = exports.promptGeneratorInput = exports.generateChange = exports.migrate = exports.generate = void 0;
|
|
17
|
+
exports.getVariant = exports.getPromptsForChangeDataSource = exports.getPromptsForChangeInbound = exports.isCFEnvironment = exports.getManifest = exports.promptGeneratorInput = exports.generateChange = exports.migrate = exports.generate = void 0;
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
19
|
__exportStar(require("./prompts"), exports);
|
|
20
20
|
__exportStar(require("./preview/adp-preview"), exports);
|
|
@@ -28,6 +28,13 @@ var editors_1 = require("./writer/editors");
|
|
|
28
28
|
Object.defineProperty(exports, "generateChange", { enumerable: true, get: function () { return editors_1.generateChange; } });
|
|
29
29
|
var prompt_1 = require("./base/prompt");
|
|
30
30
|
Object.defineProperty(exports, "promptGeneratorInput", { enumerable: true, get: function () { return prompt_1.promptGeneratorInput; } });
|
|
31
|
+
var abap_1 = require("./base/abap");
|
|
32
|
+
Object.defineProperty(exports, "getManifest", { enumerable: true, get: function () { return abap_1.getManifest; } });
|
|
31
33
|
var cf_1 = require("./base/cf");
|
|
32
34
|
Object.defineProperty(exports, "isCFEnvironment", { enumerable: true, get: function () { return cf_1.isCFEnvironment; } });
|
|
35
|
+
var prompts_1 = require("./prompts");
|
|
36
|
+
Object.defineProperty(exports, "getPromptsForChangeInbound", { enumerable: true, get: function () { return prompts_1.getPromptsForChangeInbound; } });
|
|
37
|
+
Object.defineProperty(exports, "getPromptsForChangeDataSource", { enumerable: true, get: function () { return prompts_1.getPromptsForChangeDataSource; } });
|
|
38
|
+
var helper_1 = require("./base/helper");
|
|
39
|
+
Object.defineProperty(exports, "getVariant", { enumerable: true, get: function () { return helper_1.getVariant; } });
|
|
33
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { YUIQuestion } from '@sap-ux/inquirer-common';
|
|
2
|
+
import type { InboundChangeAnswers } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Gets the prompts for Inbound Change.
|
|
5
|
+
*
|
|
6
|
+
* @returns {YUIQuestion<InboundChangeAnswers>[]} The questions/prompts.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPrompts(): YUIQuestion<InboundChangeAnswers>[];
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPrompts = void 0;
|
|
4
|
+
const i18n_1 = require("../../i18n");
|
|
5
|
+
/**
|
|
6
|
+
* Gets the prompts for Inbound Change.
|
|
7
|
+
*
|
|
8
|
+
* @returns {YUIQuestion<InboundChangeAnswers>[]} The questions/prompts.
|
|
9
|
+
*/
|
|
10
|
+
function getPrompts() {
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
type: 'input',
|
|
14
|
+
name: 'title',
|
|
15
|
+
message: (0, i18n_1.t)('prompts.title'),
|
|
16
|
+
guiOptions: {
|
|
17
|
+
hint: (0, i18n_1.t)('tooltips.title')
|
|
18
|
+
},
|
|
19
|
+
validate: (value, answers) => answers.subTitle || answers.icon !== '' || value ? true : (0, i18n_1.t)('missingIconOrTitleOrSubtitle'),
|
|
20
|
+
store: false
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: 'input',
|
|
24
|
+
name: 'subtitle',
|
|
25
|
+
message: (0, i18n_1.t)('prompts.subtitle'),
|
|
26
|
+
guiOptions: {
|
|
27
|
+
hint: (0, i18n_1.t)('tooltips.subtitle')
|
|
28
|
+
},
|
|
29
|
+
validate: (value, answers) => value || answers.icon !== '' || answers.title !== '' ? true : (0, i18n_1.t)('missingIconOrTitleOrSubtitle'),
|
|
30
|
+
store: false
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'input',
|
|
34
|
+
name: 'icon',
|
|
35
|
+
message: (0, i18n_1.t)('prompts.icon'),
|
|
36
|
+
guiOptions: {
|
|
37
|
+
hint: (0, i18n_1.t)('tooltips.icon')
|
|
38
|
+
},
|
|
39
|
+
store: false,
|
|
40
|
+
validate: (value, answers) => answers.subTitle || value || answers.title !== '' ? true : (0, i18n_1.t)('missingIconOrTitleOrSubtitle')
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
exports.getPrompts = getPrompts;
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { getPrompts as getPromptsForChangeDataSource } from './change-data-source';
|
|
2
|
+
export { getPrompts as getPromptsForChangeInbound } from './change-inbound';
|
|
2
3
|
export { getPrompts as getPromptsForAddAnnotationsToOData } from './add-annotations-to-odata';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/prompts/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPromptsForAddAnnotationsToOData = exports.getPromptsForChangeDataSource = void 0;
|
|
3
|
+
exports.getPromptsForAddAnnotationsToOData = exports.getPromptsForChangeInbound = exports.getPromptsForChangeDataSource = void 0;
|
|
4
4
|
var change_data_source_1 = require("./change-data-source");
|
|
5
5
|
Object.defineProperty(exports, "getPromptsForChangeDataSource", { enumerable: true, get: function () { return change_data_source_1.getPrompts; } });
|
|
6
|
+
var change_inbound_1 = require("./change-inbound");
|
|
7
|
+
Object.defineProperty(exports, "getPromptsForChangeInbound", { enumerable: true, get: function () { return change_inbound_1.getPrompts; } });
|
|
6
8
|
var add_annotations_to_odata_1 = require("./add-annotations-to-odata");
|
|
7
9
|
Object.defineProperty(exports, "getPromptsForAddAnnotationsToOData", { enumerable: true, get: function () { return add_annotations_to_odata_1.getPrompts; } });
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -8,21 +8,33 @@
|
|
|
8
8
|
"maxAgeTooltip": "(Optional) Enter the time in seconds it takes for a cached response of the service to expire.",
|
|
9
9
|
"oDataAnnotationSourceURILabel": "OData Annotation Data Source URI",
|
|
10
10
|
"oDataAnnotationSourceURITooltip": "Server side annotations have been detected for the selected OData service. If needed, enter new annotation data source URI for the changed service",
|
|
11
|
+
"inboundId": "Inbound ID",
|
|
12
|
+
"title": "Title",
|
|
13
|
+
"subtitle": "Subtitle",
|
|
14
|
+
"icon": "Icon"
|
|
15
|
+
},
|
|
16
|
+
"tooltips": {
|
|
17
|
+
"title": "Enter title for your FLP configuration",
|
|
18
|
+
"subtitle": "Enter subtitle for your FLP configuration",
|
|
19
|
+
"icon": "Enter icon path for your FLP configuration"
|
|
20
|
+
},
|
|
21
|
+
"validators": {
|
|
22
|
+
"manifestContainsNoODataServices": "Manifest contains no OData Services.",
|
|
23
|
+
"inputCannotBeEmpty": "{{input}} cannot be empty.",
|
|
24
|
+
"inpuCannotHaveSpaces": "{{input}} cannot contain spaces.",
|
|
25
|
+
"missingIconOrTitleOrSubtitle": "At least one of Title, Subtitle and Icon should have a value.",
|
|
11
26
|
"addAnnotationOdataSourceTooltip": "Select the annotation file from your workspace",
|
|
12
27
|
"fileSelectOptionLabel": "Annotation XML",
|
|
13
28
|
"fileSelectOptionTooltip": "Select the annotation file source",
|
|
14
29
|
"filePathLabel": "Annotation File path",
|
|
15
|
-
"filePathTooltip": "Select the annotation file from your workspace"
|
|
30
|
+
"filePathTooltip": "Select the annotation file from your workspace",
|
|
31
|
+
"fileDoesNotExist": "The file doesn't exist",
|
|
32
|
+
"annotationFileAlreadyExists": "There is already an annotation file with the same name, please choose another file or rename the file and select it again"
|
|
16
33
|
},
|
|
17
34
|
"choices": {
|
|
18
35
|
"annotationFile": {
|
|
19
36
|
"selectFromWorkspace": "Select annotation file from workspace",
|
|
20
37
|
"createEmptyFile": "Create an empty annotation file"
|
|
21
38
|
}
|
|
22
|
-
},
|
|
23
|
-
"validators": {
|
|
24
|
-
"inputCannotBeEmpty": "Input cannot be empty.",
|
|
25
|
-
"fileDoesNotExist": "The file doesn't exist",
|
|
26
|
-
"annotationFileAlreadyExists": "There is already an annotation file with the same name, please choose another file or rename the file and select it again"
|
|
27
39
|
}
|
|
28
40
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -8,7 +8,12 @@ export interface DescriptorVariant {
|
|
|
8
8
|
reference: string;
|
|
9
9
|
id: string;
|
|
10
10
|
namespace: string;
|
|
11
|
-
content:
|
|
11
|
+
content: DescriptorVariantContent[];
|
|
12
|
+
}
|
|
13
|
+
export interface DescriptorVariantContent {
|
|
14
|
+
changeType: string;
|
|
15
|
+
content: Record<string, unknown>;
|
|
16
|
+
texts?: string;
|
|
12
17
|
}
|
|
13
18
|
export interface ToolsSupport {
|
|
14
19
|
id: string;
|
|
@@ -301,21 +306,19 @@ export interface DataSourceData {
|
|
|
301
306
|
dataSources: Record<string, ManifestNamespace.DataSource>;
|
|
302
307
|
answers: ChangeDataSourceAnswers;
|
|
303
308
|
}
|
|
309
|
+
export interface InboundChangeAnswers {
|
|
310
|
+
/** Title associated with the inbound navigation data. */
|
|
311
|
+
title: string;
|
|
312
|
+
/** Subtitle associated with the inbound navigation data. */
|
|
313
|
+
subTitle: string;
|
|
314
|
+
/** Icon associated with the inbound navigation data. */
|
|
315
|
+
icon: string;
|
|
316
|
+
}
|
|
304
317
|
export interface InboundData {
|
|
305
|
-
projectData: AdpProjectData;
|
|
306
|
-
timestamp: number;
|
|
307
318
|
/** Identifier for the inbound navigation data. */
|
|
308
319
|
inboundId: string;
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
title: PropertyValueType;
|
|
312
|
-
/** Subtitle associated with the inbound navigation data. */
|
|
313
|
-
subTitle: PropertyValueType;
|
|
314
|
-
/** Icon associated with the inbound navigation data. */
|
|
315
|
-
icon: PropertyValueType;
|
|
316
|
-
};
|
|
317
|
-
/** Optional flag indicating if the project is in safe mode. */
|
|
318
|
-
isInSafeMode?: boolean;
|
|
320
|
+
variant: DescriptorVariant;
|
|
321
|
+
answers: InboundChangeAnswers;
|
|
319
322
|
}
|
|
320
323
|
export interface InboundContent {
|
|
321
324
|
inboundId: string;
|
|
@@ -26,14 +26,6 @@ export declare class InboundWriter implements IWriter<InboundData> {
|
|
|
26
26
|
* @returns {void}
|
|
27
27
|
*/
|
|
28
28
|
private getEnhancedContent;
|
|
29
|
-
/**
|
|
30
|
-
* Processes the provided answers object to parse its properties into the correct format.
|
|
31
|
-
*
|
|
32
|
-
* @param {InboundData} data - An object containing raw answers for inboundId, title, subTitle, and icon.
|
|
33
|
-
* @returns {InboundData} A new answers object with properties modified
|
|
34
|
-
* to ensure they are in the correct format for use in content construction.
|
|
35
|
-
*/
|
|
36
|
-
private getModifiedData;
|
|
37
29
|
/**
|
|
38
30
|
* Writes the inbound data change to the project based on the provided data.
|
|
39
31
|
*
|
|
@@ -39,47 +39,29 @@ class InboundWriter {
|
|
|
39
39
|
* @returns {void}
|
|
40
40
|
*/
|
|
41
41
|
getEnhancedContent(data, content) {
|
|
42
|
-
const { icon, title, subTitle } = data.
|
|
42
|
+
const { icon, title, subTitle } = data.answers;
|
|
43
43
|
if (title) {
|
|
44
44
|
content.entityPropertyChange.push({
|
|
45
45
|
propertyPath: 'title',
|
|
46
46
|
operation: 'UPSERT',
|
|
47
|
-
propertyValue: title
|
|
47
|
+
propertyValue: (0, change_utils_1.getParsedPropertyValue)(title)
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
if (subTitle) {
|
|
51
51
|
content.entityPropertyChange.push({
|
|
52
52
|
propertyPath: 'subTitle',
|
|
53
53
|
operation: 'UPSERT',
|
|
54
|
-
propertyValue: subTitle
|
|
54
|
+
propertyValue: (0, change_utils_1.getParsedPropertyValue)(subTitle)
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
if (icon) {
|
|
58
58
|
content.entityPropertyChange.push({
|
|
59
59
|
propertyPath: 'icon',
|
|
60
60
|
operation: 'UPSERT',
|
|
61
|
-
propertyValue: icon
|
|
61
|
+
propertyValue: (0, change_utils_1.getParsedPropertyValue)(icon)
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
/**
|
|
66
|
-
* Processes the provided answers object to parse its properties into the correct format.
|
|
67
|
-
*
|
|
68
|
-
* @param {InboundData} data - An object containing raw answers for inboundId, title, subTitle, and icon.
|
|
69
|
-
* @returns {InboundData} A new answers object with properties modified
|
|
70
|
-
* to ensure they are in the correct format for use in content construction.
|
|
71
|
-
*/
|
|
72
|
-
getModifiedData(data) {
|
|
73
|
-
const { title, subTitle, icon } = data.flp;
|
|
74
|
-
return {
|
|
75
|
-
...data,
|
|
76
|
-
flp: {
|
|
77
|
-
title: (0, change_utils_1.getParsedPropertyValue)(title),
|
|
78
|
-
subTitle: (0, change_utils_1.getParsedPropertyValue)(subTitle),
|
|
79
|
-
icon: (0, change_utils_1.getParsedPropertyValue)(icon)
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
65
|
/**
|
|
84
66
|
* Writes the inbound data change to the project based on the provided data.
|
|
85
67
|
*
|
|
@@ -87,16 +69,16 @@ class InboundWriter {
|
|
|
87
69
|
* @returns {Promise<void>} A promise that resolves when the change writing process is completed.
|
|
88
70
|
*/
|
|
89
71
|
async write(data) {
|
|
90
|
-
const
|
|
91
|
-
const
|
|
72
|
+
const { changeWithInboundId, filePath } = (0, change_utils_1.findChangeWithInboundId)(this.projectPath, data.inboundId);
|
|
73
|
+
const timestamp = Date.now();
|
|
92
74
|
if (!changeWithInboundId) {
|
|
93
|
-
const content = this.constructContent(
|
|
94
|
-
const change = (0, change_utils_1.getChange)(data.
|
|
95
|
-
(0, change_utils_1.writeChangeToFolder)(this.projectPath, change, `id_${
|
|
75
|
+
const content = this.constructContent(data);
|
|
76
|
+
const change = (0, change_utils_1.getChange)(data.variant, timestamp, content, "appdescr_app_changeInbound" /* ChangeType.CHANGE_INBOUND */);
|
|
77
|
+
(0, change_utils_1.writeChangeToFolder)(this.projectPath, change, `id_${timestamp}_changeInbound.change`, this.fs, project_access_1.DirName.Manifest);
|
|
96
78
|
}
|
|
97
79
|
else {
|
|
98
80
|
if (changeWithInboundId.content) {
|
|
99
|
-
this.getEnhancedContent(
|
|
81
|
+
this.getEnhancedContent(data, changeWithInboundId.content);
|
|
100
82
|
}
|
|
101
83
|
(0, change_utils_1.writeChangeToFile)(filePath, changeWithInboundId, this.fs);
|
|
102
84
|
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.12.
|
|
12
|
+
"version": "0.12.18",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"prompts": "2.4.2",
|
|
33
33
|
"sanitize-filename": "1.6.3",
|
|
34
34
|
"uuid": "10.0.0",
|
|
35
|
-
"@sap-ux/axios-extension": "1.16.
|
|
36
|
-
"@sap-ux/btp-utils": "0.15.0",
|
|
35
|
+
"@sap-ux/axios-extension": "1.16.1",
|
|
37
36
|
"@sap-ux/inquirer-common": "0.4.2",
|
|
37
|
+
"@sap-ux/btp-utils": "0.15.0",
|
|
38
38
|
"@sap-ux/logger": "0.6.0",
|
|
39
39
|
"@sap-ux/project-access": "1.25.7",
|
|
40
|
-
"@sap-ux/system-access": "0.5.
|
|
40
|
+
"@sap-ux/system-access": "0.5.3",
|
|
41
41
|
"@sap-ux/ui5-config": "0.23.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|