@sap/ux-specification 1.71.134 → 1.71.135
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/CHANGELOG.md +24 -0
- package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
- package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
- package/dist/documentation/v2/v2-ListReport.html +2 -2
- package/dist/documentation/v2/v2-ObjectPage.html +2 -2
- package/dist/documentation/v2/v2-OverviewPage.html +2 -2
- package/dist/index-min.js +2 -2
- package/dist/index-min.js.map +2 -2
- package/dist/schemas/v2/ApplicationV2.json +2 -1
- package/dist/specification/package.json +3 -3
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts +5 -2
- package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js +27 -17
- package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
- package/dist/specification/src/sync/v2/import/importPage.d.ts +2 -1
- package/dist/specification/src/sync/v2/import/importPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/import/importPage.js +4 -5
- package/dist/specification/src/sync/v2/import/importPage.js.map +1 -1
- package/dist/specification/src/sync/v2/utils.d.ts +26 -1
- package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/utils.js +46 -0
- package/dist/specification/src/sync/v2/utils.js.map +1 -1
- package/dist/types/src/common/Application.d.ts +3 -0
- package/dist/types/src/common/Application.d.ts.map +1 -1
- package/dist/types/src/common/types.d.ts +51 -2
- package/dist/types/src/common/types.d.ts.map +1 -1
- package/dist/types/src/common/types.js +2 -1
- package/dist/types/src/common/types.js.map +1 -1
- package/dist/types/src/v2/application.d.ts +1 -1
- package/package.json +3 -3
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"flexibleColumnLayout": {
|
|
33
33
|
"$ref": "#/definitions/FlexibleColumnLayout",
|
|
34
|
-
"description": "The flexible column layout allows users to see more details on the page, and to expand and collapse the screen areas.
|
|
34
|
+
"description": "The flexible column layout allows users to see more details on the page, and to expand and collapse the screen areas."
|
|
35
35
|
},
|
|
36
36
|
"title": {
|
|
37
37
|
"description": "Defines the title for the application.",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"additionalProperties": false
|
|
57
57
|
},
|
|
58
58
|
"FlexibleColumnLayout": {
|
|
59
|
+
"descriptionSrcURL": "https://ui5.sap.com/sdk/#/topic/e762257125b34513b0859faa1610b09e",
|
|
59
60
|
"type": "object",
|
|
60
61
|
"properties": {
|
|
61
62
|
"defaultTwoColumnLayoutType": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/ux-specification",
|
|
3
|
-
"version": "1.71.
|
|
3
|
+
"version": "1.71.135",
|
|
4
4
|
"displayName": "SAP Fiori tools - Specification",
|
|
5
5
|
"description": "SAP Fiori tools - Specification",
|
|
6
6
|
"files": [
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"main": "dist/index-min.js",
|
|
12
12
|
"engines": {
|
|
13
|
-
"node": ">=
|
|
13
|
+
"node": ">=20.0.0 <21.0.0 || >=22.0.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0",
|
|
14
14
|
"yarn": ">=1.22.19 < 2"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@sap-ux/annotation-converter": "0.10.3",
|
|
54
54
|
"@sap-ux/edmx-parser": "0.8.2",
|
|
55
|
-
"@sap/ux-specification-types": "1.71.
|
|
55
|
+
"@sap/ux-specification-types": "1.71.135",
|
|
56
56
|
"@types/d3": "7.4.3",
|
|
57
57
|
"@types/jquery": "3.5.32",
|
|
58
58
|
"@ui5/flexibility-utils": "0.1.3",
|
|
@@ -6,16 +6,18 @@
|
|
|
6
6
|
* Moreover, it is assumed that the config was originally created by ../import/importPage.ts and then modified (e.g. by Fiori Tools) based on the page specific schema.
|
|
7
7
|
* Unit tests for this class are located in test.unit.genericSchemaHandling.exportPageGeneric.test.ts.
|
|
8
8
|
*/
|
|
9
|
-
import type { ExtensionLogger, FileData, FileDataResult, Manifest } from '@sap/ux-specification-types';
|
|
9
|
+
import type { ConversionExitProvider, ExtensionLogger, FileData, FileDataResult, Manifest } from '@sap/ux-specification-types';
|
|
10
10
|
import { ChangeIndicator } from '@sap/ux-specification-types';
|
|
11
11
|
import type { Definition } from 'typescript-json-schema';
|
|
12
12
|
/**
|
|
13
13
|
* An instance of this type collects all information needed for function exportPage.
|
|
14
14
|
*
|
|
15
15
|
* @property appId - id of the app. Note that this should not be taken from the manifest, since the manifest may still contain a placeholder.
|
|
16
|
-
* @property config - the config to be exported
|
|
16
|
+
* @property config - the config to be exported. Note: This instance has the same structure as the config returned by function getConfigForPage in importPage.ts.
|
|
17
|
+
* However, the instance has gone through a process of serialization and deserialization, so that it does not contain the corresponding type information.
|
|
17
18
|
* @property manifest - manifest of the FE v2 app
|
|
18
19
|
* @property jsonSchema - the page specific schema for config
|
|
20
|
+
* @property conversionExitProvider - provider for conversion exits assigned in jsonSchema
|
|
19
21
|
* @property fragments - fragments in status before the export has started
|
|
20
22
|
* @property logger - used for logging any problems that occur during the export
|
|
21
23
|
*/
|
|
@@ -24,6 +26,7 @@ export type ExportPageInParameters = {
|
|
|
24
26
|
config: object;
|
|
25
27
|
manifest: Manifest;
|
|
26
28
|
jsonSchema: Definition;
|
|
29
|
+
conversionExitProvider?: ConversionExitProvider;
|
|
27
30
|
fragments?: FileData[];
|
|
28
31
|
logger?: ExtensionLogger;
|
|
29
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportPageGeneric.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v2/export/exportPageGeneric.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAGR,eAA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AE/B,CAAC;AA6UF;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,sBAAsB,GAAG,iBAAiB,CA4BlF"}
|
|
@@ -9,6 +9,7 @@ const common_1 = require("../../common");
|
|
|
9
9
|
* Thereby, we assume that such a property always corresponds to a control property (with same name) that can be changed via a flex change
|
|
10
10
|
* The function will derive the information about the flex change that should be created (or the information that no flex change is needed)
|
|
11
11
|
* for this property and add it to the list.
|
|
12
|
+
* Note: Currently we assume that conversion exits are only used for manifest based properties. Hence, no extra logic for conversion exits is needed here.
|
|
12
13
|
*
|
|
13
14
|
* @param propertyDefinition - definition of the property in the page specific schema
|
|
14
15
|
* @param value - the value for the property according to the config object that is currently exported
|
|
@@ -17,7 +18,6 @@ const common_1 = require("../../common");
|
|
|
17
18
|
*/
|
|
18
19
|
function addFlexChangeInfoToList(propertyDefinition, value, propertyName, flexList) {
|
|
19
20
|
const newValue = value === undefined ? null : value; // special logic for control properties which are not changed by flex
|
|
20
|
-
// TODO: Add conversion exit logic
|
|
21
21
|
const isBinding = typeof newValue === 'string' && newValue.startsWith('{');
|
|
22
22
|
flexList.push({
|
|
23
23
|
controlId: propertyDefinition[ux_specification_types_1.SchemaTag.controlId],
|
|
@@ -35,10 +35,14 @@ function addFlexChangeInfoToList(propertyDefinition, value, propertyName, flexLi
|
|
|
35
35
|
* @param value - the value for the property in the config currently processed (undefined if the property is not present in the config)
|
|
36
36
|
* @param oldValue - current value for the property in the manifest (resp. undefined if the property is not in the current manifest)
|
|
37
37
|
* @param propertyDefinition - definition of the property in the current schema
|
|
38
|
-
* @param
|
|
38
|
+
* @param globalInfoForExport - global information valid for the export process
|
|
39
39
|
* @returns the value for the property in the modified manifest, resp. undefined when the property should be removed from the manifest.
|
|
40
40
|
*/
|
|
41
|
-
function getValueForManifest(value, oldValue, propertyDefinition,
|
|
41
|
+
function getValueForManifest(value, oldValue, propertyDefinition, globalInfoForExport) {
|
|
42
|
+
if (propertyDefinition[ux_specification_types_1.SchemaTag.conversionExit]) {
|
|
43
|
+
// When a conversion exit has been defined for the property, let it do the job
|
|
44
|
+
return (0, utils_1.executeConversionExit)(false, globalInfoForExport.conversionExitProvider, propertyDefinition, value, globalInfoForExport.fragments, oldValue);
|
|
45
|
+
}
|
|
42
46
|
// Special logic for string arrays. Note that the opposite logic is implemented in function getConfigRep in import.importPage.ts
|
|
43
47
|
if (propertyDefinition.type === 'array' && propertyDefinition.items?.['type'] === 'string') {
|
|
44
48
|
if (!Array.isArray(value) || value.length === 0) {
|
|
@@ -63,10 +67,11 @@ function getValueForManifest(value, oldValue, propertyDefinition, globalTypeDefi
|
|
|
63
67
|
continue; // ignore properties defined as boolean (should not appear in our schemas anyway)
|
|
64
68
|
}
|
|
65
69
|
const refType = (0, common_1.getRefType)(childPropertyDefinition);
|
|
66
|
-
childPropertyDefinition =
|
|
70
|
+
childPropertyDefinition =
|
|
71
|
+
(refType && globalInfoForExport.globalTypeDefinitions[refType]) || childPropertyDefinition;
|
|
67
72
|
const oldChildValue = returnObject[childProperty];
|
|
68
73
|
hasOldValueDefinedChildProperty = hasOldValueDefinedChildProperty || oldChildValue !== undefined;
|
|
69
|
-
const newChildValue = getValueForManifest(value ? value[childProperty] : undefined, oldChildValue, childPropertyDefinition,
|
|
74
|
+
const newChildValue = getValueForManifest(value ? value[childProperty] : undefined, oldChildValue, childPropertyDefinition, globalInfoForExport);
|
|
70
75
|
if (newChildValue === undefined) {
|
|
71
76
|
delete returnObject[childProperty];
|
|
72
77
|
}
|
|
@@ -141,9 +146,9 @@ function isEmpty(obj) {
|
|
|
141
146
|
* In the later case the property should (normally) be removed from the manifest.
|
|
142
147
|
* @param target - the results of the export to be updated
|
|
143
148
|
* @param propertyDefinition - definition of the property in the page specific schema
|
|
144
|
-
* @param
|
|
149
|
+
* @param globalInfoForExport - global information valid for the export process
|
|
145
150
|
*/
|
|
146
|
-
function applyManifestChange(fullManifestPath, value, target, propertyDefinition,
|
|
151
|
+
function applyManifestChange(fullManifestPath, value, target, propertyDefinition, globalInfoForExport) {
|
|
147
152
|
let manifestSection = target.manifest; // will be used to step down in the hierarchy of the manifest to the parent of the target property
|
|
148
153
|
const lengthToParent = fullManifestPath.length - 1;
|
|
149
154
|
const finalProperty = fullManifestPath[lengthToParent]; // name of the property which should be updated
|
|
@@ -164,7 +169,7 @@ function applyManifestChange(fullManifestPath, value, target, propertyDefinition
|
|
|
164
169
|
});
|
|
165
170
|
// If the length of backPath is lengthToParent the parent object already exists in the manifest (and is an object). So we (potentially) have an old value for the target property
|
|
166
171
|
const oldValue = backPath.length === lengthToParent ? manifestSection[finalProperty] : undefined;
|
|
167
|
-
const newValue = getValueForManifest(value, oldValue, propertyDefinition,
|
|
172
|
+
const newValue = getValueForManifest(value, oldValue, propertyDefinition, globalInfoForExport);
|
|
168
173
|
if (!isDifferent(newValue, oldValue)) {
|
|
169
174
|
return; // nothing to do
|
|
170
175
|
}
|
|
@@ -205,9 +210,9 @@ function applyManifestChange(fullManifestPath, value, target, propertyDefinition
|
|
|
205
210
|
* @param target - the results of the export to be updated
|
|
206
211
|
* @param property - name of the property to be handled
|
|
207
212
|
* @param propertyDefinition - definition of the property in the page specific schema
|
|
208
|
-
* @param
|
|
213
|
+
* @param globalInfoForExport - global information valid for the export process
|
|
209
214
|
*/
|
|
210
|
-
function transferConfigPropertyToExportResults(source, target, property, propertyDefinition,
|
|
215
|
+
function transferConfigPropertyToExportResults(source, target, property, propertyDefinition, globalInfoForExport) {
|
|
211
216
|
const sourcePart = source?.[property];
|
|
212
217
|
const artifactType = propertyDefinition[ux_specification_types_1.SchemaTag.artifactType];
|
|
213
218
|
// We distinguish three cases:
|
|
@@ -235,14 +240,14 @@ function transferConfigPropertyToExportResults(source, target, property, propert
|
|
|
235
240
|
manifestPath = manifestPath.concat([property]);
|
|
236
241
|
}
|
|
237
242
|
}
|
|
238
|
-
applyManifestChange(manifestPath, sourcePart, target, propertyDefinition,
|
|
243
|
+
applyManifestChange(manifestPath, sourcePart, target, propertyDefinition, globalInfoForExport);
|
|
239
244
|
}
|
|
240
245
|
else {
|
|
241
246
|
// Note: inline type definitions currently not supported
|
|
242
247
|
const refType = (0, common_1.getRefType)(propertyDefinition);
|
|
243
|
-
const refTypeDefinition = refType ? globalTypeDefinitions[refType] : undefined;
|
|
248
|
+
const refTypeDefinition = refType ? globalInfoForExport.globalTypeDefinitions[refType] : undefined;
|
|
244
249
|
if ((0, utils_1.isDefinition)(refTypeDefinition)) {
|
|
245
|
-
transferConfigToExportResults(sourcePart, target, refTypeDefinition,
|
|
250
|
+
transferConfigToExportResults(sourcePart, target, refTypeDefinition, globalInfoForExport);
|
|
246
251
|
}
|
|
247
252
|
}
|
|
248
253
|
}
|
|
@@ -258,9 +263,9 @@ function transferConfigPropertyToExportResults(source, target, property, propert
|
|
|
258
263
|
* @param source - the section of the config to be transferred
|
|
259
264
|
* @param target - the results of the export to be updated
|
|
260
265
|
* @param definition - schema element describing the section of the config currently processed
|
|
261
|
-
* @param
|
|
266
|
+
* @param globalInfoForExport - global information valid for the export process
|
|
262
267
|
*/
|
|
263
|
-
function transferConfigToExportResults(source, target, definition,
|
|
268
|
+
function transferConfigToExportResults(source, target, definition, globalInfoForExport) {
|
|
264
269
|
const properties = definition.properties || {};
|
|
265
270
|
// Perform the update for all available properties
|
|
266
271
|
for (const property in properties) {
|
|
@@ -268,7 +273,7 @@ function transferConfigToExportResults(source, target, definition, globalTypeDef
|
|
|
268
273
|
const propertyDefinition = definition.properties[property];
|
|
269
274
|
if ((0, utils_1.isDefinition)(propertyDefinition)) {
|
|
270
275
|
// ignore properties that are null or boolean (should not occur in our schemas anyway)
|
|
271
|
-
transferConfigPropertyToExportResults(source, target, property, propertyDefinition,
|
|
276
|
+
transferConfigPropertyToExportResults(source, target, property, propertyDefinition, globalInfoForExport);
|
|
272
277
|
}
|
|
273
278
|
}
|
|
274
279
|
}
|
|
@@ -293,6 +298,11 @@ function exportPage(inParameters) {
|
|
|
293
298
|
};
|
|
294
299
|
return result;
|
|
295
300
|
});
|
|
301
|
+
const globalInfoForExport = {
|
|
302
|
+
globalTypeDefinitions,
|
|
303
|
+
conversionExitProvider: inParameters.conversionExitProvider,
|
|
304
|
+
fragments: fragmentResults
|
|
305
|
+
};
|
|
296
306
|
// TODO: Check whether property 'views' needs to be initialized as well
|
|
297
307
|
const returnObject = {
|
|
298
308
|
manifest: structuredClone(inParameters.manifest),
|
|
@@ -301,7 +311,7 @@ function exportPage(inParameters) {
|
|
|
301
311
|
fragments: fragmentResults
|
|
302
312
|
};
|
|
303
313
|
// Adapt returnObject according to the state of the config. This is driven by the page specific schema.
|
|
304
|
-
transferConfigToExportResults(config, returnObject, inParameters.jsonSchema,
|
|
314
|
+
transferConfigToExportResults(config, returnObject, inParameters.jsonSchema, globalInfoForExport);
|
|
305
315
|
return returnObject;
|
|
306
316
|
}
|
|
307
317
|
//# sourceMappingURL=exportPageGeneric.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportPageGeneric.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/export/exportPageGeneric.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"exportPageGeneric.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/export/exportPageGeneric.ts"],"names":[],"mappings":";;AAoaA,gCA4BC;AA/aD,wEAAuF;AAEvF,oCAA+D;AAC/D,yCAA0C;AAwE1C;;;;;;;;;;;GAWG;AACH,SAAS,uBAAuB,CAC5B,kBAA8B,EAC9B,KAAc,EACd,YAAoB,EACpB,QAAoB;IAEpB,MAAM,QAAQ,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qEAAqE;IAC1H,MAAM,SAAS,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC3E,QAAQ,CAAC,IAAI,CAAC;QACV,SAAS,EAAE,kBAAkB,CAAC,kCAAS,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CAAC;QAC7G,CAAC;IACL,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAAC,YAAoC;IAC3D,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IACnC,MAAM,qBAAqB,GAAG,YAAY,CAAC,UAAU,CAAC,WAA4C,CAAC;IAEnG,uFAAuF;IACvF,MAAM,eAAe,GAAG,CAAC,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,QAAQ;QACzE,MAAM,MAAM,GAAmB;YAC3B,GAAG,QAAQ;YACX,eAAe,EAAE,wCAAe,CAAC,QAAQ;SAC5C,CAAC;QACF,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,MAAM,mBAAmB,GAAG;QACxB,qBAAqB;QACrB,sBAAsB,EAAE,YAAY,CAAC,sBAAsB;QAC3D,SAAS,EAAE,eAAe;KAC7B,CAAC;IAEF,uEAAuE;IACvE,MAAM,YAAY,GAAG;QACjB,QAAQ,EAAE,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC;QAChD,uBAAuB,EAAE,wCAAe,CAAC,QAAQ;QACjD,QAAQ,EAAE,EAAgB;QAC1B,SAAS,EAAE,eAAe;KAC7B,CAAC;IACF,uGAAuG;IACvG,6BAA6B,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;IAClG,OAAO,YAAY,CAAC;AACxB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* the tools provided in file ../generate/schemaAdaptation.ts.
|
|
6
6
|
* Unit tests for this class are located in test.unit.genericSchemaHandling.importPage.test.ts.
|
|
7
7
|
*/
|
|
8
|
-
import type { AccessorPath, CommonImportParameters } from '@sap/ux-specification-types';
|
|
8
|
+
import type { AccessorPath, CommonImportParameters, ConversionExitProvider } from '@sap/ux-specification-types';
|
|
9
9
|
/**
|
|
10
10
|
* An instance of this type gives type information for a property in a type from a schema of a page.
|
|
11
11
|
*
|
|
@@ -34,6 +34,7 @@ export type PropertyInstanceProvider = (propertyTypePath: PropertyTypeInfo[]) =>
|
|
|
34
34
|
*/
|
|
35
35
|
export type ImportConfigInfo = {
|
|
36
36
|
propertyInstanceProvider: PropertyInstanceProvider;
|
|
37
|
+
conversionExitProvider?: ConversionExitProvider;
|
|
37
38
|
};
|
|
38
39
|
/**
|
|
39
40
|
* An instance of this type provides instances of ImportConfigInfo based on the FE component name for the page type to be processed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importPage.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v2/import/importPage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"importPage.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v2/import/importPage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACR,YAAY,EAGZ,sBAAsB,EACtB,sBAAsB,EACzB,MAAM,6BAA6B,CAAC;AAsCrC;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,MAAM,CAAC;AAExF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACnD,CAAC;AA8UF;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,aAAa,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAAS,CAAC;AAE/F;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC5B,gBAAgB,EAAE,sBAAsB,EACxC,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,wBAAwB,GACxC,MAAM,CA8BR"}
|
|
@@ -44,14 +44,13 @@ function getConfigRep(value, propertyDefinition, globalTypeDefinitions, importPa
|
|
|
44
44
|
}
|
|
45
45
|
const refType = (0, common_1.getRefType)(propertyDefinition);
|
|
46
46
|
const refTypeDefinition = refType ? globalTypeDefinitions[refType] : undefined;
|
|
47
|
-
|
|
48
|
-
/* if (propertyDefinition[SchemaTag.conversionExit]) {
|
|
47
|
+
if (propertyDefinition[ux_specification_types_1.SchemaTag.conversionExit]) {
|
|
49
48
|
// If a conversion exit has been specified for this property let it do the job
|
|
50
|
-
value =
|
|
51
|
-
if (!refTypeDefinition){
|
|
49
|
+
value = (0, utils_1.executeConversionExit)(true, importConfigInfo.conversionExitProvider, propertyDefinition, value, importParameters.fragments, undefined, importParameters.logger);
|
|
50
|
+
if (!refTypeDefinition) {
|
|
52
51
|
return value;
|
|
53
52
|
}
|
|
54
|
-
}
|
|
53
|
+
}
|
|
55
54
|
// If propertyDefinition refers to another (global) definition, execute the logic based on this reference
|
|
56
55
|
if (refTypeDefinition) {
|
|
57
56
|
return getConfigRep(value, refTypeDefinition, globalTypeDefinitions, importParameters, importConfigInfo);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importPage.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/import/importPage.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"importPage.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/import/importPage.ts"],"names":[],"mappings":";;AAkbA,4CAkCC;AAtcD,wEAA0G;AAC1G,yCAA0F;AAC1F,oCAAuH;AAYvH;;;;;;GAMG;AACH,SAAS,gCAAgC,CAAC,gBAAwC;IAC9E,MAAM,SAAS,GAAc,EAAE,CAAC,CAAC,uDAAuD;IACxF,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC;IAC5C,aAAa,CAAC,OAAO,CAAC,UAAU,YAAY;QACxC,MAAM,wBAAwB,GAAG,IAAA,0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ACzB,6CAAoB,CAAC,EAAE,EACvB,gBAAgB,CAAC,MAAM,CAC1B,CAAC;IACF,IAAI,CAAC,YAAY,IAAI,YAAY,KAAK,qCAAY,CAAC,cAAc,EAAE,CAAC;QAChE,OAAO,CAAC,sBAAsB;IAClC,CAAC;IACD,MAAM,YAAY,GAAG,IAAA,mCAA2B,EAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAClE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,iCAAyB,EAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACtG,MAAM,aAAa,GAAG,cAAc,EAAE,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC;IAC1D,MAAM,gBAAgB,GAAG,OAAO,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpB,OAAO;IACX,CAAC;IACD,MAAM,SAAS,GAAG,gCAAgC,CAAC,gBAAgB,CAAC,CAAC,CAAC,kDAAkD;IACxH,MAAM,MAAM,GAAG,gBAAgB,CAAC,UAAwB,CAAC;IACzD,MAAM,qBAAqB,GAAG,MAAM,CAAC,WAA4C,CAAC;IAClF,MAAM,MAAM,GAAG,gBAAgB,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAAC,+BAA+B;IAC7F,0BAA0B,CACtB,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,EAAE,EACF,qBAAqB,EACrB,gBAAgB,EAChB,SAAS,CACZ,CAAC,CAAC,cAAc;IACjB,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccessorPath, Manifest } from '@sap/ux-specification-types';
|
|
1
|
+
import type { AccessorPath, ConversionExitProvider, ExtensionLogger, FileData, Manifest } from '@sap/ux-specification-types';
|
|
2
2
|
import type { Definition, DefinitionOrBoolean } from 'typescript-json-schema';
|
|
3
3
|
/**
|
|
4
4
|
* Get the path inside the manifest to the definition of a specific page.
|
|
@@ -31,4 +31,29 @@ export declare function getManifestPropertyByPath(manifest: Manifest, manifestPa
|
|
|
31
31
|
* @returns whether obj is indeed a (truthy) Definition
|
|
32
32
|
*/
|
|
33
33
|
export declare function isDefinition(obj: DefinitionOrBoolean | undefined): obj is Definition;
|
|
34
|
+
/**
|
|
35
|
+
* This function should be used to add a conversion exit to the definition of a property in an app specific schema.
|
|
36
|
+
* The function can be called within the implementation of function elementAdapter as part of the SyncRule of a manifest based property.
|
|
37
|
+
*
|
|
38
|
+
* @param element - the definition of the property to which the conversion exit should be added
|
|
39
|
+
* @param conversionExit - the name of the conversion exit. Note that the ConversionExitProviders being used by the generic import and export processes must be able
|
|
40
|
+
* to find the implementations of the conversion exits by this name.
|
|
41
|
+
* @param params - parameters that should be passed to the conversion exit functions when they are called by the generic import and export processes.
|
|
42
|
+
* Note that the format of this value must be in sync with the format expected by the conversion exit implementation.
|
|
43
|
+
*/
|
|
44
|
+
export declare function addConversionExit(element: Definition, conversionExit: string, params?: unknown): void;
|
|
45
|
+
/**
|
|
46
|
+
* This function is called by the generic import and export processes in order to perform a value conversion for a property for which a conversion exit has been assigned in the page specific schema.
|
|
47
|
+
* It executes the specified conversion exit.
|
|
48
|
+
*
|
|
49
|
+
* @param isDirectionAppToConfig - flag indicating whether the conversion is from app to config or vice versa
|
|
50
|
+
* @param conversionExitProvider - should be able to provide the implementation of the conversion exit specified in the property definition
|
|
51
|
+
* @param propertyDefinition - the definition of the property in the page specific schema. This function will only be called when it contains an assignment of a conversion exit which should have been added by addConversionExit.
|
|
52
|
+
* @param value - the value to be converted
|
|
53
|
+
* @param fragments - the fragments of the app. In the configToApp case the entries are actually of type FileDataResult and the function may also modify the list.
|
|
54
|
+
* @param oldValue - the old value of the property in the manifest. Only relevant in the configToApp case.
|
|
55
|
+
* @param logger - may be used to log messages during the conversion. Only relevant in the appToConfig case.
|
|
56
|
+
* @returns the converted value
|
|
57
|
+
*/
|
|
58
|
+
export declare function executeConversionExit(isDirectionAppToConfig: boolean, conversionExitProvider: ConversionExitProvider | undefined, propertyDefinition: Definition, value: unknown, fragments?: FileData[], oldValue?: unknown, logger?: ExtensionLogger): unknown;
|
|
34
59
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/sync/v2/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/sync/v2/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACR,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,QAAQ,EAER,QAAQ,EACX,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE9E;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACvC,QAAQ,EAAE,YAAY,EACtB,UAAU,GAAE,OAAc,EAC1B,MAAM,GAAE,YAAiB,GAC1B,YAAY,CAWd;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACrC,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,QAAQ,CAAC,EAAE,MAAM,GAClB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAyBlE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,mBAAmB,GAAG,SAAS,GAAG,GAAG,IAAI,UAAU,CAEpF;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAQrG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACjC,sBAAsB,EAAE,OAAO,EAC/B,sBAAsB,EAAE,sBAAsB,GAAG,SAAS,EAC1D,kBAAkB,EAAE,UAAU,EAC9B,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,QAAQ,EAAE,EACtB,QAAQ,CAAC,EAAE,OAAO,EAClB,MAAM,CAAC,EAAE,eAAe,GACzB,OAAO,CAiBT"}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getManifestPathFromPagePath = getManifestPathFromPagePath;
|
|
4
4
|
exports.getManifestPropertyByPath = getManifestPropertyByPath;
|
|
5
5
|
exports.isDefinition = isDefinition;
|
|
6
|
+
exports.addConversionExit = addConversionExit;
|
|
7
|
+
exports.executeConversionExit = executeConversionExit;
|
|
6
8
|
/**
|
|
7
9
|
* @file This file contains helper functions for generic schema handling.
|
|
8
10
|
* The functionality is implicitly tested by the more complex unit-tests for generic schema generation and generic import in test-folder unit/genericSchemaHandling.
|
|
@@ -71,4 +73,48 @@ function getManifestPropertyByPath(manifest, manifestPath, property) {
|
|
|
71
73
|
function isDefinition(obj) {
|
|
72
74
|
return obj !== null && typeof obj === 'object';
|
|
73
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* This function should be used to add a conversion exit to the definition of a property in an app specific schema.
|
|
78
|
+
* The function can be called within the implementation of function elementAdapter as part of the SyncRule of a manifest based property.
|
|
79
|
+
*
|
|
80
|
+
* @param element - the definition of the property to which the conversion exit should be added
|
|
81
|
+
* @param conversionExit - the name of the conversion exit. Note that the ConversionExitProviders being used by the generic import and export processes must be able
|
|
82
|
+
* to find the implementations of the conversion exits by this name.
|
|
83
|
+
* @param params - parameters that should be passed to the conversion exit functions when they are called by the generic import and export processes.
|
|
84
|
+
* Note that the format of this value must be in sync with the format expected by the conversion exit implementation.
|
|
85
|
+
*/
|
|
86
|
+
function addConversionExit(element, conversionExit, params) {
|
|
87
|
+
const conversionExitDef = {
|
|
88
|
+
name: conversionExit
|
|
89
|
+
};
|
|
90
|
+
if (params !== undefined) {
|
|
91
|
+
conversionExitDef['params'] = params;
|
|
92
|
+
}
|
|
93
|
+
element[ux_specification_types_1.SchemaTag.conversionExit] = conversionExitDef;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* This function is called by the generic import and export processes in order to perform a value conversion for a property for which a conversion exit has been assigned in the page specific schema.
|
|
97
|
+
* It executes the specified conversion exit.
|
|
98
|
+
*
|
|
99
|
+
* @param isDirectionAppToConfig - flag indicating whether the conversion is from app to config or vice versa
|
|
100
|
+
* @param conversionExitProvider - should be able to provide the implementation of the conversion exit specified in the property definition
|
|
101
|
+
* @param propertyDefinition - the definition of the property in the page specific schema. This function will only be called when it contains an assignment of a conversion exit which should have been added by addConversionExit.
|
|
102
|
+
* @param value - the value to be converted
|
|
103
|
+
* @param fragments - the fragments of the app. In the configToApp case the entries are actually of type FileDataResult and the function may also modify the list.
|
|
104
|
+
* @param oldValue - the old value of the property in the manifest. Only relevant in the configToApp case.
|
|
105
|
+
* @param logger - may be used to log messages during the conversion. Only relevant in the appToConfig case.
|
|
106
|
+
* @returns the converted value
|
|
107
|
+
*/
|
|
108
|
+
function executeConversionExit(isDirectionAppToConfig, conversionExitProvider, propertyDefinition, value, fragments, oldValue, logger) {
|
|
109
|
+
const conversionExitDef = propertyDefinition[ux_specification_types_1.SchemaTag.conversionExit];
|
|
110
|
+
const conversionExitName = conversionExitDef?.['name'];
|
|
111
|
+
const conversionExit = conversionExitProvider ? conversionExitProvider(conversionExitName) : undefined;
|
|
112
|
+
if (!conversionExit) {
|
|
113
|
+
return value; // should not happen, as all conversion exits added to the schema should also have implementations in the ConversionExitProvider. Just added for robustness.
|
|
114
|
+
}
|
|
115
|
+
const conversionExitParams = conversionExitDef['params'];
|
|
116
|
+
return isDirectionAppToConfig
|
|
117
|
+
? conversionExit.appToConfig(value, conversionExitParams, fragments ?? [], propertyDefinition, logger)
|
|
118
|
+
: conversionExit.configToApp(value, conversionExitParams, (fragments ?? []), propertyDefinition, oldValue);
|
|
119
|
+
}
|
|
74
120
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/sync/v2/utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/sync/v2/utils.ts"],"names":[],"mappings":";;AAuBA,kEAeC;AAYD,8DA6BC;AAQD,oCAEC;AAYD,8CAQC;AAeD,sDAyBC;AArJD;;;GAGG;AACH,wEAAyE;AAWzE;;;;;;;GAOG;AACH,SAAgB,2BAA2B,CACvC,QAAsB,EACtB,aAAsB,IAAI,EAC1B,SAAuB,EAAE;IAEzB,MAAM,YAAY,GAAG,CAAC,wCAAe,CAAC,OAAO,CAAiB,CAAC;IAC/D,QAAQ,CAAC,OAAO,CAAC,UAAU,IAAI;QAC3B,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3B,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IACH,IAAI,UAAU,EAAE,CAAC;QACb,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/B,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,yBAAyB,CACrC,QAAkB,EAClB,YAA0B,EAC1B,QAAiB;IAEjB,IAAI,eAAe,GAAY,QAAQ,CAAC,CAAC,sDAAsD;IAC/F,MAAM,OAAO;IACT,wFAAwF;IACxF,YAAY,CAAC,KAAK,CAAC,UAAU,QAAQ;QACjC,IACI,CAAC,eAAe;YAChB,OAAO,eAAe,KAAK,QAAQ;YACnC,CAAC,KAAK,CAAC,OAAO,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BAAkB,GAAG,iBAAiB,EAAE,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,sBAAsB,CAAC,CAAC,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,IAAI,CAAC,cAAc,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,CAAC,4JAA4J;IAC9K,CAAC;IACD,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACzD,OAAO,sBAAsB;QACzB,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,EAAE,oBAAoB,EAAE,SAAS,IAAI,EAAE,EAAE,kBAAkB,EAAE,MAAM,CAAC;QACtG,CAAC,CAAC,cAAc,CAAC,WAAW,CACtB,KAAK,EACL,oBAAoB,EACpB,CAAC,SAAS,IAAI,EAAE,CAAqB,EACrC,kBAAkB,EAClB,QAAQ,CACX,CAAC;AACZ,CAAC"}
|
|
@@ -40,6 +40,9 @@ export declare enum CloudDevAdaptationStatus {
|
|
|
40
40
|
Deprecated = "deprecated",
|
|
41
41
|
Obsolete = "obsolete"
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* @descriptionSrcURL https://ui5.sap.com/sdk/#/topic/e762257125b34513b0859faa1610b09e
|
|
45
|
+
*/
|
|
43
46
|
export interface FlexibleColumnLayout {
|
|
44
47
|
defaultTwoColumnLayoutType?: FlexibleColumnLayoutType;
|
|
45
48
|
defaultThreeColumnLayoutType?: FlexibleColumnLayoutType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../../../../types/src/common/Application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,KAAK,IAAI,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,oBAAY,2BAA2B;IACnC,UAAU,eAAe;CAC5B;AACD,MAAM,WAAW,gCAAgC;IAC7C;;OAEG;IACH,OAAO,EAAE,2BAA2B,CAAC;CACxC;AAED,oBAAY,4BAA4B;IACpC,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;CACpB;AAED,oBAAY,qBAAqB;IAC7B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;CAC1B;AAED,MAAM,WAAW,WAAW;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,oBAAY,gCAAgC;IACxC,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;CACpC;AAED;;GAEG;AACH,oBAAY,wBAAwB;IAChC,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,QAAQ,aAAa;CACxB;AAED,MAAM,WAAW,oBAAoB;IACjC,0BAA0B,CAAC,EAAE,wBAAwB,CAAC;IACtD,4BAA4B,CAAC,EAAE,wBAAwB,CAAC;CAC3D;AAED,MAAM,WAAW,iBAAiB;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACvD"}
|
|
1
|
+
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../../../../types/src/common/Application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAA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
|
1
1
|
import type { EntityType } from '@sap-ux/vocabularies-types';
|
|
2
2
|
import type { Definition } from 'typescript-json-schema';
|
|
3
3
|
import type { Manifest } from './webapp/manifest';
|
|
4
|
-
import type { GenerateAppSchemaParameters } from '../apiTypes';
|
|
4
|
+
import type { ExtensionLogger, GenerateAppSchemaParameters } from '../apiTypes';
|
|
5
5
|
export declare enum FlexibleColumnLayoutType {
|
|
6
6
|
OneColumn = "OneColumn",
|
|
7
7
|
TwoColumnsBeginExpanded = "TwoColumnsBeginExpanded",
|
|
@@ -280,6 +280,54 @@ export type ProcessingRule = {
|
|
|
280
280
|
additionalPropertiesAdaptation?: AdaptationInfo;
|
|
281
281
|
itemsAdaptation?: AdaptationInfo;
|
|
282
282
|
};
|
|
283
|
+
/**
|
|
284
|
+
* An instance of this type is needed when the representation of a property value in the property editor differs from the representation of the same property in the manifest
|
|
285
|
+
* In this case this instance provides two conversion functions responsible for mapping the manifest representation to the config representation (used in the property editor) and vice versa.
|
|
286
|
+
* The corresponding functions will be called by the generic import resp. export process via function executeConversionExit in specification/src/sync/v2/utils.ts.
|
|
287
|
+
* Note that there is one conversion which is already implemented in the generic import/export process itself: The conversion of arrays of strings which are represented as comma separated strings in the manifest.
|
|
288
|
+
* Moreover, note that currently no such conversion is supported for flex based properties.
|
|
289
|
+
* Instances of this type need to be made accessible to the generic import/export process via an instance of ConversionExitProvider which is passed to the generic import/export process.
|
|
290
|
+
* Moreover, the conversion exit must be registered in the schema definition of the property in the app specific schema via function addConversionExit in specification/src/sync/v2/utils.ts.
|
|
291
|
+
*
|
|
292
|
+
* @property appToConfig - function to convert the value from the manifest representation to the config representation
|
|
293
|
+
* @property configToApp - function to convert the value from the config representation to the manifest representation
|
|
294
|
+
*/
|
|
295
|
+
export type ConversionExit = {
|
|
296
|
+
/**
|
|
297
|
+
* Converts a value from the manifest representation to the config representation. Called within the generic import process (getConfigForPage).
|
|
298
|
+
*
|
|
299
|
+
* @param appValue - the value of the property in the manifest. Note that the function will NOT be called when the value is not present in the manifest
|
|
300
|
+
* @param parameters - parameters that have been added to the conversion exit definition in the schema definition of the property in the app specific schema when calling addConversionExit
|
|
301
|
+
* @param fragments - the fragments valid for the app
|
|
302
|
+
* @param definition - the definition of the property in the app specific schema
|
|
303
|
+
* @param logger - if present can be used to log information about unexpected manifest values
|
|
304
|
+
* @returns the representation of the (value for the) property in the config
|
|
305
|
+
*/
|
|
306
|
+
appToConfig: (appValue: unknown, parameters: unknown, fragments: FileData[], definition: Definition, logger?: ExtensionLogger) => unknown;
|
|
307
|
+
/**
|
|
308
|
+
* Converts a value from the config representation to the manifest representation. Called within the generic export process (exportPage).
|
|
309
|
+
*
|
|
310
|
+
* @param configValue - the value of the property in the config. Currently this is also called when the value is undefined.
|
|
311
|
+
* Probably all implementations will return undefined in this case as well.
|
|
312
|
+
* -> Maybe modified in future such that the generic functionality already handles this case.
|
|
313
|
+
* @param parameters - parameters that have been added to the conversion exit definition in the schema definition of the property in the app specific schema when calling addConversionExit
|
|
314
|
+
* @param fragments - the fragments valid for the app. As a side-effect this function may also update the list or entries of the list, thereby also setting the changeIndicator-flag accordingly.
|
|
315
|
+
* @param definition - the definition of the property in the app specific schema
|
|
316
|
+
* @param oldAppValue - the current value of the property in the manifest. This value can be used in case there is more than one value in the manifest having the same representation in the config (because they are logically equivalent).
|
|
317
|
+
* In this case the function may return a value that is 'as equal as possible' to the old manifest value while still logically representing the previous manifest value.
|
|
318
|
+
* However, note that if such cases there will be scenarios where an undo only recreates the previous state logically, but not in the exact same representation (restriction due to the current implementation of undo/redo).
|
|
319
|
+
* @returns the representation of the (value for the) property in the manifest
|
|
320
|
+
*/
|
|
321
|
+
configToApp: (configValue: unknown, parameters: unknown, fragments: FileDataResult[], definition: Definition, oldAppValue: unknown) => unknown;
|
|
322
|
+
};
|
|
323
|
+
/**
|
|
324
|
+
* An instance of this type should be able to return a the ConversionExits for the conversion exit names used in the page specific schemas of one page type.
|
|
325
|
+
* The instances will be made available to the generic import/export functions (getConfigForPage, exportPage).
|
|
326
|
+
*
|
|
327
|
+
* @param conversionExitName - the name of the conversion exit as passed to addConversionExit when the conversion exit was registered in the app specific schema.
|
|
328
|
+
* @returns the implementation of the conversion exit
|
|
329
|
+
*/
|
|
330
|
+
export type ConversionExitProvider = (conversionExitName: string) => ConversionExit | undefined;
|
|
283
331
|
/**
|
|
284
332
|
* An instance of this type determines the way a certain section from the generic schema will be processed when translating it to the specific schema.
|
|
285
333
|
*
|
|
@@ -535,7 +583,8 @@ export declare enum PropertyName {
|
|
|
535
583
|
* @property artifactType - type of the artifact, possible values from enum ArtifactType
|
|
536
584
|
* @property controlId - id of the UI5 control, for flex changes
|
|
537
585
|
* @property controlType - type of the UI5 control, for flex changes
|
|
538
|
-
* @property conversionExit -
|
|
586
|
+
* @property conversionExit - reference to a conversion exit that transforms values between their manifest representation and their config representation.
|
|
587
|
+
* Structure of the content is defined in function addConversionExit and evaluated in function executeConversionExit in specification/src/sync/v2/utils.ts.
|
|
539
588
|
* @property dataType - EDM data type
|
|
540
589
|
* @property deletable - indicates whether it is allowed to delete a view node (default: false)
|
|
541
590
|
* @property descriptionSrcURL - URL to the description of the artifact in sap.help.com
|