@sap/ux-specification 1.84.111 → 1.84.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
  3. package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
  4. package/dist/documentation/v2/v2-ListReport.html +2 -2
  5. package/dist/documentation/v2/v2-ObjectPage.html +2 -2
  6. package/dist/documentation/v2/v2-OverviewPage.html +2 -2
  7. package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
  8. package/dist/documentation/v4/v4-ListReport.html +2 -2
  9. package/dist/documentation/v4/v4-ObjectPage.html +2 -2
  10. package/dist/index-min.js +1 -1
  11. package/dist/index-min.js.map +1 -1
  12. package/dist/specification/package.json +3 -3
  13. package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts +0 -9
  14. package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts.map +1 -1
  15. package/dist/specification/src/sync/v2/generate/schemaAdaptation.js +3 -57
  16. package/dist/specification/src/sync/v2/generate/schemaAdaptation.js.map +1 -1
  17. package/dist/specification/src/sync/v2/import/importPage.d.ts +56 -0
  18. package/dist/specification/src/sync/v2/import/importPage.d.ts.map +1 -0
  19. package/dist/specification/src/sync/v2/import/importPage.js +289 -0
  20. package/dist/specification/src/sync/v2/import/importPage.js.map +1 -0
  21. package/dist/specification/src/sync/v2/utils.d.ts +26 -0
  22. package/dist/specification/src/sync/v2/utils.d.ts.map +1 -0
  23. package/dist/specification/src/sync/v2/utils.js +64 -0
  24. package/dist/specification/src/sync/v2/utils.js.map +1 -0
  25. package/dist/types/src/common/types.d.ts +1 -1
  26. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/ux-specification",
3
- "version": "1.84.111",
3
+ "version": "1.84.112",
4
4
  "displayName": "SAP Fiori tools - Specification",
5
5
  "description": "SAP Fiori tools - Specification",
6
6
  "files": [
@@ -53,14 +53,14 @@
53
53
  "devDependencies": {
54
54
  "@sap-ux/annotation-converter": "0.10.3",
55
55
  "@sap-ux/edmx-parser": "0.8.2",
56
- "@sap/ux-specification-types": "1.84.111",
56
+ "@sap/ux-specification-types": "1.84.112",
57
57
  "@sapui5/ts-types": "latest-1.84",
58
58
  "@types/d3": "7.4.3",
59
59
  "@types/jquery": "3.5.32",
60
60
  "@ui5/flexibility-utils": "0.1.3",
61
61
  "@xml-tools/ast": "5.0.5",
62
62
  "@xml-tools/parser": "1.0.11",
63
- "axios": "1.8.4",
63
+ "axios": "1.9.0",
64
64
  "copyfiles": "2.4.1",
65
65
  "d3": "7.9.0",
66
66
  "deepmerge": "4.3.1",
@@ -7,15 +7,6 @@
7
7
  import type { Definition } from 'typescript-json-schema';
8
8
  import type { AccessorPath, ExtensionLogger, FileData, Manifest } from '@sap/ux-specification-types';
9
9
  import type { SyncRuleProvider } from '@sap/ux-specification-types/src';
10
- /**
11
- * Get the path inside the manifest to the definition of a specific page.
12
- *
13
- * @param pagePath - path to the page as described in option b) of type AccessorPath
14
- * @param toSettings - If this property is true the path to the settings object of the specified page definition is returned (this is actually the sub-object containing the most meaningful information)
15
- * @param suffix - can be used to create a path that points to an even deeper sub-object
16
- * @returns the specified path as described in option a) of type AccessorPath
17
- */
18
- export declare function getManifestPathFromPagePath(pagePath: AccessorPath, toSettings?: boolean, suffix?: AccessorPath): AccessorPath;
19
10
  /**
20
11
  * An instance of this type describes a page within an FE v2 app. It also includes all artifacts that are needed to build the schema for that page.
21
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"schemaAdaptation.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v2/generate/schemaAdaptation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAuB,MAAM,wBAAwB,CAAC;AAG9E,OAAO,KAAK,EACR,YAAY,EACZ,eAAe,EACf,QAAQ,EAER,QAAQ,EAEX,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AAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,QAAQ,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CAC1B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACvC,aAAa,EAAE,UAAU,CAAC;IAC1B,gBAAgB,EAAE,gBAAgB,CAAC;CACtC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,aAAa,EAAE,MAAM,KAAK,4BAA4B,GAAG,SAAS,CAAC;AAE5G;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC5B,QAAQ,EAAE,QAAQ,EAClB,oBAAoB,EAAE,yBAAyB,EAC/C,MAAM,CAAC,EAAE,eAAe,GACzB,UAAU,CAyEZ"}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getManifestPathFromPagePath = getManifestPathFromPagePath;
4
3
  exports.getAdaptedSchema = getAdaptedSchema;
5
4
  const common_1 = require("../../common");
6
5
  const ux_specification_types_1 = require("@sap/ux-specification-types");
7
6
  const decorators_1 = require("../../common/decoration/decorators");
8
7
  const utils_1 = require("./utils");
8
+ const utils_2 = require("../utils");
9
9
  const i18n_1 = require("../../../i18n/i18n");
10
10
  /**
11
11
  * Checks whether a schema element contains an anyOf-property. If yes, all types directly or indirectly referred by one of the
@@ -258,60 +258,6 @@ function adjustElement(generateParameters, params, syncRuleProvider, element, gl
258
258
  }
259
259
  }
260
260
  }
261
- /**
262
- * Get the path inside the manifest to the definition of a specific page.
263
- *
264
- * @param pagePath - path to the page as described in option b) of type AccessorPath
265
- * @param toSettings - If this property is true the path to the settings object of the specified page definition is returned (this is actually the sub-object containing the most meaningful information)
266
- * @param suffix - can be used to create a path that points to an even deeper sub-object
267
- * @returns the specified path as described in option a) of type AccessorPath
268
- */
269
- function getManifestPathFromPagePath(pagePath, toSettings = true, suffix = []) {
270
- const manifestPath = [ux_specification_types_1.ManifestSection.generic];
271
- pagePath.forEach(function (page) {
272
- manifestPath.push('pages');
273
- manifestPath.push(page);
274
- });
275
- if (toSettings) {
276
- manifestPath.push('component');
277
- manifestPath.push('settings');
278
- }
279
- return manifestPath.concat(suffix);
280
- }
281
- /**
282
- * Helper function to extract information from the manifest.
283
- *
284
- * @param manifest - the manifest containing the information
285
- * @param manifestPath - pointer to the object in the manifest containing the property to be checked
286
- * @param property - the property below the specified path that should be extracted. If it is faulty, no value will be extracted.
287
- * @returns - hasPath: information whether the specified path can be followed in the manifest and the target is an object (which is not null)
288
- * - value: The value of the specified property if the path can be followed and the corresponding object possesses the specified property, otherwise undefined
289
- * - parent: the not-null object found at the specified path (parent object of the property), otherwise undefined. Note that modifying the properties of this object will also change manifest.
290
- */
291
- function getManifestPropertyByPath(manifest, manifestPath, property) {
292
- let manifestSection = manifest; // Current position in the manifest when stepping down
293
- const hasPath =
294
- // Traverse down the manifest (in manifestSection) step by step along the specified path
295
- manifestPath.every(function (accessor) {
296
- if (!manifestSection ||
297
- typeof manifestSection !== 'object' ||
298
- (Array.isArray(manifestSection) && typeof accessor !== 'number')) {
299
- // In order to perform another step down our current position must be a (not-null) object.
300
- // If this is even an array we only accept numbers as accessors.
301
- // When this condition is not fulfilled, we stop stepping down.
302
- return false;
303
- }
304
- manifestSection = manifestSection[accessor]; // execute the step down
305
- return true;
306
- }) &&
307
- typeof manifestSection === 'object' &&
308
- manifestSection !== null; // Finally check whether we still have reached a not-null object
309
- return {
310
- hasPath,
311
- value: hasPath && property ? manifestSection[property] : undefined,
312
- parent: hasPath ? manifestSection : undefined
313
- };
314
- }
315
261
  /**
316
262
  * This function replicates the logic of function fnDetermineViewId in TemplateComponent of FE coding.
317
263
  * It determines the id of the view that contains one page of an FE app.
@@ -349,8 +295,8 @@ function getAdaptedSchema(pageSpec, getGenericSchemaInfo, logger) {
349
295
  if (!templateType || templateType === ux_specification_types_1.TemplateType.OverviewPageV2) {
350
296
  return; // not supported (yet)
351
297
  }
352
- const manifestPath = getManifestPathFromPagePath(pageSpec.pagePath, false);
353
- const { parent: pageDefinition } = getManifestPropertyByPath(pageSpec.manifest, manifestPath);
298
+ const manifestPath = (0, utils_2.getManifestPathFromPagePath)(pageSpec.pagePath, false);
299
+ const { parent: pageDefinition } = (0, utils_2.getManifestPropertyByPath)(pageSpec.manifest, manifestPath);
354
300
  if (!pageDefinition) {
355
301
  return; // no page definition found at the specified path
356
302
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schemaAdaptation.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/generate/schemaAdaptation.ts"],"names":[],"mappings":";;AA6VA,kEAeC;AAkHD,4CA6EC;AApiBD,yCAAmH;AACnH,wEAA6G;AAe7G,mEAAgG;AAChG,mCAA+C;AAC/C,6CAA8C;AAkB9C;;;;;;GAMG;AACH,SAAS,uBAAuB,CAAC,OAAmB,EAAE,WAAwB;IAC1E,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,YAAY;YACxC,2BAA2B,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,aAAa,CAAC,OAAmB;IACtC,OAAO,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;AACzG,CAAC;AAED;;;;;;GAMG;AACH,SAAS,2BAA2B,CAAC,OAAwC,EAAE,WAAwB;IACnG,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC9B,iDAAiD;QACjD,OAAO;IACX,CAAC;IACD,uDAAuD;IACvD,M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C;IACF,qDAAqD;IACrD,iJAAiJ;IACjJ,aAAa,CAAC,kBAAkB,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IACnF,qFAAqF;IACrF,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/C,OAAO,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * This file provides a function that generically creates the config for a page of a FE v2 app (function getConfigForPage).
3
+ * This process is also called 'import'.
4
+ * Thereby, the page specific schema for this page is heavily used. It is assumed that this schema was generated using
5
+ * the tools provided in file ../generate/schemaAdaptation.ts
6
+ * Unit tests for this class are located in test.unit.genericSchemaHandling.importPage.test.ts
7
+ */
8
+ import type { AccessorPath, CommonImportParameters } from '@sap/ux-specification-types';
9
+ /**
10
+ * An instance of this type gives type information for a property in a type from a schema of a page.
11
+ *
12
+ * @property propertyName - the name of the property
13
+ * @property propertyType - name of the global type of the property as defined in the generic schema of the page which is currently processed.
14
+ */
15
+ export type PropertyTypeInfo = {
16
+ propertyName: string;
17
+ propertyType: string;
18
+ };
19
+ /**
20
+ * An instance of this type provides empty instances for a specified property within a config of a given page type.
21
+ *
22
+ * @param propertyTypePath - a path of property specifications that leads from the root of a config to the specified property. An empty array
23
+ * indicates that an empty instance of the config itself should be returned.
24
+ * @returns a new (empty) instance for the specified property. Note: If the path is not empty the type name contained in the
25
+ * last entry of propertyTypePath will normally already provide sufficient type information to create this instance. All other information is
26
+ * only provided for completeness. If the path is empty, the type information of the instance to be created anyway must be derived from the
27
+ * type of the page currently processed.
28
+ */
29
+ export type PropertyInstanceProvider = (propertyTypePath: PropertyTypeInfo[]) => object;
30
+ /**
31
+ * An instance of this type contains the type information that is needed for creating the config for a given page type (in addition to the specific schema).
32
+ *
33
+ * @property propertyInstanceProvider - provides empty instances of the config and its child objects on demand
34
+ */
35
+ export type ImportConfigInfo = {
36
+ propertyInstanceProvider: PropertyInstanceProvider;
37
+ };
38
+ /**
39
+ * An instance of this type provides instances of ImportConfigInfo based on the FE component name for the page type to be processed.
40
+ *
41
+ * @param componentName - fully qualified name of the FE v2 component that specifies the page type
42
+ * @returns the ImportConfigInfo to be used to execute an import for any page of the specified page type
43
+ */
44
+ export type ImportConfigInfoProvider = (componentName: string) => ImportConfigInfo | undefined;
45
+ /**
46
+ * This function creates and returns a config for a page of an FE v2 app (executes the 'import').
47
+ *
48
+ * @param importParameters - required information from the app
49
+ * @param pagePath - specifies the page within the app. Note that importParameters.jsonSchema must be
50
+ * consistent with this path. That means that this schema must be the schema that is generated by getAdaptedSchema
51
+ * in schemaAdaptation.ts for this page. This function does not check this consistency.
52
+ * @param getConfigInfo - a function that can provide the ImportConfigInfo to be used for the specified page type
53
+ * @returns the (filled) config for the specified page
54
+ */
55
+ export declare function getConfigForPage(importParameters: CommonImportParameters, pagePath: AccessorPath, getConfigInfo: ImportConfigInfoProvider): object;
56
+ //# sourceMappingURL=importPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importPage.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v2/import/importPage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,YAAY,EAAkC,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAsCxH;;;;;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;CACtD,CAAC;AAiVF;;;;;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"}
@@ -0,0 +1,289 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConfigForPage = getConfigForPage;
4
+ const ux_specification_types_1 = require("@sap/ux-specification-types");
5
+ const common_1 = require("../../common");
6
+ const utils_1 = require("../utils");
7
+ /**
8
+ * This function provides the flex changes contained in the parameters passed to the import process in a way that can be more easily consumed
9
+ * by that process.
10
+ *
11
+ * @param importParameters the parameters of an import process
12
+ * @returns the flex changes contained in the import parameters in a format that can be easily consumed
13
+ */
14
+ function getChangeMapFormImportParameters(importParameters) {
15
+ const changeMap = {}; // The object to be returned, will be filled one by one
16
+ const changeStrings = importParameters.flex;
17
+ changeStrings.forEach(function (changeString) {
18
+ const deserializedChangeString = (0, common_1.parseChangeString)(changeString);
19
+ if (deserializedChangeString) {
20
+ const change = deserializedChangeString;
21
+ // Add the change to the array of changes for the target control. Thereby, create this array when this change is the first one for that control.
22
+ const changes = changeMap[change.controlId] || [];
23
+ changes.push(change);
24
+ changeMap[change.controlId] = changes;
25
+ }
26
+ });
27
+ return changeMap;
28
+ }
29
+ /* Begin: Helper functions for getConfigForPage */
30
+ /**
31
+ * This function is used to get the config representation of a manifest value or a flex change value.
32
+ * Thereby, we assume that the corresponding property in the schema has artifactType 'Manifest' or artifact type 'Flex Change'.
33
+ *
34
+ * @param value - the value contained in the manifest resp. in the flex change for the property
35
+ * @param propertyDefinition - metadata for the property to be processed (taken from the page specific schema)
36
+ * @param globalTypeDefinitions - global type definitions that may be referred from within propertyDefinition
37
+ * @param importParameters - parameters of the current import process
38
+ * @param importConfigInfo - page specific information for the import process
39
+ * @returns the value that should be added to the config
40
+ */
41
+ function getConfigRep(value, propertyDefinition, globalTypeDefinitions, importParameters, importConfigInfo) {
42
+ if (value === undefined) {
43
+ return undefined;
44
+ }
45
+ const refType = (0, common_1.getRefType)(propertyDefinition);
46
+ const refTypeDefinition = refType ? globalTypeDefinitions[refType] : undefined;
47
+ // Disabled until we implement the conversionExit feature:
48
+ /* if (propertyDefinition[SchemaTag.conversionExit]) {
49
+ // If a conversion exit has been specified for this property let it do the job
50
+ value = convertValue(true, propertyDefinition, value, fragments, logger);
51
+ if (!refTypeDefinition){
52
+ return value;
53
+ }
54
+ } */
55
+ // If propertyDefinition refers to another (global) definition, execute the logic based on this reference
56
+ if (refTypeDefinition) {
57
+ return getConfigRep(value, refTypeDefinition, globalTypeDefinitions, importParameters, importConfigInfo);
58
+ }
59
+ if (propertyDefinition.type === 'object' && propertyDefinition.properties && typeof value === 'object') {
60
+ // If the value to be transferred is an object perform the transfer recursively for each property.
61
+ // If the resulting object is empty (hasProperty is still false) return undefined
62
+ const returnObject = {};
63
+ let hasProperty = false;
64
+ for (const property in propertyDefinition.properties) {
65
+ const propDef = propertyDefinition.properties[property];
66
+ const valueForProp = getConfigRep(value[property], propDef, globalTypeDefinitions, importParameters, importConfigInfo);
67
+ if (valueForProp !== undefined) {
68
+ hasProperty = true;
69
+ returnObject[property] = valueForProp;
70
+ }
71
+ }
72
+ return hasProperty ? returnObject : undefined;
73
+ }
74
+ if (propertyDefinition.type === 'array' && !Array.isArray(value)) {
75
+ // Special logic for arrays which are represented as comma separated strings within the manifest.
76
+ // Opposite logic can be found <- To be added when export function was implemented
77
+ return typeof value === 'string' && value !== '' ? value.split(',') : undefined;
78
+ }
79
+ // If none of the above special cases applies: Simply return the value
80
+ return value;
81
+ }
82
+ /**
83
+ * This function transfers a property value from the manifest or a flex change into the config.
84
+ * Thereby, we assume that the corresponding property in the schema has artifactType 'Manifest' or artifact type 'Flex Change'.
85
+ *
86
+ * @param config - the configuration the value should be passed to
87
+ * @param importConfigInfo - page specific information for the import process
88
+ * @param propertyPath - information about the types from config root down to the parent of the property currently processed
89
+ * @param property - name of property currently processed
90
+ * @param propValue - value to be transferred from manifest or flex change
91
+ * @param propertyDefinition - metadata for the property to be processed (taken from the page specific schema)
92
+ * @param globalTypeDefinitions - global type definitions that may be referred from within propertyDefinition
93
+ * @param importParameters - parameters of the current import process
94
+ */
95
+ function transferValueToConfig(config, importConfigInfo, propertyPath, property, propValue, propertyDefinition, globalTypeDefinitions, importParameters) {
96
+ // Get the config representation of propValue (in most cases identical to propValue itself)
97
+ const targetValue = getConfigRep(propValue, propertyDefinition, globalTypeDefinitions, importParameters, importConfigInfo);
98
+ if (targetValue === undefined) {
99
+ // In some cases getConfigRep may still find out that the value needs not to be transferred -> end here
100
+ return;
101
+ }
102
+ // Now we are sure that a value has to be added to config.
103
+ // Navigate to the parent object for the property along the specified path, thereby creating empty objects
104
+ // where no object is yet available.
105
+ let settingTarget = config;
106
+ const prefixPath = [];
107
+ propertyPath.forEach(function (propertyTypeInfo) {
108
+ prefixPath.push(propertyTypeInfo);
109
+ const propertyName = propertyTypeInfo.propertyName;
110
+ // Create the object on next level if it is not yet there
111
+ settingTarget[propertyName] =
112
+ settingTarget[propertyName] || importConfigInfo.propertyInstanceProvider(prefixPath);
113
+ settingTarget = settingTarget[propertyName]; // Step down to the object on the next level
114
+ });
115
+ // Finally transfer the value
116
+ settingTarget[property] = targetValue;
117
+ }
118
+ /**
119
+ * This function is called for schema properties which are flagged as artifactType 'FlexChange'.
120
+ * The function checks whether a flex change is available for the specified property.
121
+ * If yes, it transfers the corresponding value to the given config.
122
+ *
123
+ * @param config - the potential transfer target
124
+ * @param importConfigInfo - page specific information for the import process
125
+ * @param propertyPath - information about the types from config root down to the parent of the property currently processed
126
+ * @param property - name of property currently processed
127
+ * @param propertyDefinition - metadata for the property to be processed (taken from the page specific schema)
128
+ * @param globalTypeDefinitions - global type definitions that may be referred from within propertyDefinition
129
+ * @param importParameters - parameters of the current import process
130
+ * @param changeMap - collection of applicable flex changes in a format that is easier to consume than importParameters.flex.
131
+ * Note that flex changes which are evaluated by this function are removed from the map, since we do not expect any flex change to be applicable twice.
132
+ */
133
+ function importFlexChangesToConfigProperty(config, importConfigInfo, propertyPath, property, propertyDefinition, globalTypeDefinitions, importParameters, changeMap) {
134
+ const controlId = propertyDefinition[ux_specification_types_1.SchemaTag.controlId]; // the id of the control the flex change would be applied to
135
+ const applicableChangeDefinitions = changeMap[controlId];
136
+ if (!applicableChangeDefinitions) {
137
+ // No flex changes for that control available at all -> nothing to do
138
+ return;
139
+ }
140
+ // Search whether there is a flex change for property within the list of flex changes for the relevant control
141
+ let position = -1;
142
+ const changeDefinition = applicableChangeDefinitions.find(function (changeDefinition, i) {
143
+ if (changeDefinition.content.property === property) {
144
+ position = i;
145
+ return true;
146
+ }
147
+ return false;
148
+ });
149
+ if (changeDefinition) {
150
+ // There is a change for the specified property in the specified control -> transfer it to target
151
+ transferValueToConfig(config, importConfigInfo, propertyPath, property, changeDefinition.type === 'propertyBindingChange'
152
+ ? changeDefinition.content.newBinding
153
+ : changeDefinition.content.newValue, propertyDefinition, globalTypeDefinitions, importParameters);
154
+ // As this change has already been processed, remove it from the list of all changes
155
+ if (applicableChangeDefinitions.length === 1) {
156
+ delete changeMap[controlId];
157
+ }
158
+ else {
159
+ applicableChangeDefinitions.splice(position, 1);
160
+ }
161
+ }
162
+ }
163
+ /**
164
+ * This function is called for schema properties which are flagged as artifactType 'Manifest'.
165
+ * The function checks whether a manifest entry is available for the specified property.
166
+ * If yes, it transfers the corresponding value to the given config.
167
+ *
168
+ * @param config - the potential transfer target
169
+ * @param importConfigInfo - page specific information for the import process
170
+ * @param propertyPath - information about the types from config root down to the parent of the property currently processed
171
+ * @param property - name of property currently processed
172
+ * @param propertyDefinition - metadata for the property to be processed (taken from the page specific schema)
173
+ * @param globalTypeDefinitions - global type definitions that may be referred from within propertyDefinition
174
+ * @param importParameters - parameters of the current import process
175
+ */
176
+ function importManifestToConfigProperty(config, importConfigInfo, propertyPath, property, propertyDefinition, globalTypeDefinitions, importParameters) {
177
+ const accessorSpec = propertyDefinition[ux_specification_types_1.SchemaTag.manifestPath];
178
+ let addTargetPropertyToPath; // decision whether property belongs to the full path in the manifest
179
+ let accessorPath;
180
+ if (Array.isArray(accessorSpec)) {
181
+ // default case where property is also contained in the manifest path
182
+ accessorPath = accessorSpec;
183
+ addTargetPropertyToPath = true;
184
+ }
185
+ else {
186
+ // more complex case supporting scenario in which property is a name which is only used within the config but does not occur in the manifest
187
+ // example for that would be config property 'custom' which is hard-coded in the tools logic but actually does not occur in the manifest
188
+ accessorPath = accessorSpec.path;
189
+ addTargetPropertyToPath = accessorSpec.addTargetPropertyToPath;
190
+ }
191
+ const { hasPath, value, parent } = (0, utils_1.getManifestPropertyByPath)(importParameters.manifest, accessorPath, addTargetPropertyToPath ? property : undefined);
192
+ if (!hasPath) {
193
+ return;
194
+ }
195
+ const propValue = addTargetPropertyToPath ? value : parent;
196
+ transferValueToConfig(config, importConfigInfo, propertyPath, property, propValue, propertyDefinition, globalTypeDefinitions, importParameters);
197
+ }
198
+ /**
199
+ * Type guard that checks whether a given optional instance of DefinitionOrBoolean is indeed a Definition.
200
+ *
201
+ * @param obj the instance to be tested
202
+ * @returns whether obj is indeed a (truthy) Definition
203
+ */
204
+ function isDefinition(obj) {
205
+ return obj !== null && typeof obj === 'object';
206
+ }
207
+ /**
208
+ * The task of this function is to pass values from manifest and flex changes to the given config.
209
+ * Thereby, values from all properties defined within the given Definition are processed (including child objects).
210
+ *
211
+ * @param config - the potential transfer target
212
+ * @param importConfigInfo - page specific information for the import process
213
+ * @param definition - the properties of this Definition will be processed
214
+ * @param propertyPath - the path from the root of the schema to the specified Definition
215
+ * @param globalTypeDefinitions - global type definitions that may be referred from within definition
216
+ * @param importParameters - parameters of the current import process
217
+ * @param changeMap - collection of applicable flex changes in a format that is easier to consume than importParameters.flex.
218
+ * Note that flex changes which are evaluated by this function are removed from the map, since we do not expect any flex change to be applicable twice.
219
+ */
220
+ function importDefinitionIntoConfig(config, importConfigInfo, definition, propertyPath, globalTypeDefinitions, importParameters, changeMap) {
221
+ if (!isDefinition(definition.properties)) {
222
+ return; // no properties to be processed
223
+ }
224
+ for (const property in definition.properties) {
225
+ const propertyDefinition = definition.properties[property];
226
+ if (!isDefinition(propertyDefinition)) {
227
+ continue; // ignore properties that are null or boolean (should not occur in our schemas anyway)
228
+ }
229
+ // Now propertyDefinition is actually an instance of Definition
230
+ // We distinguish three cases:
231
+ // - current property is handled by flex
232
+ // - current property can be mapped onto a manifest property (or a section within the manifest)
233
+ // - property is still complex and points to a global type which describes how the content should be processed
234
+ // Note that the inline definition of a complex type is not yet supported.
235
+ const artifactType = propertyDefinition[ux_specification_types_1.SchemaTag.artifactType];
236
+ if (artifactType === ux_specification_types_1.ArtifactType.FlexChange) {
237
+ // case 1
238
+ importFlexChangesToConfigProperty(config, importConfigInfo, propertyPath, property, propertyDefinition, globalTypeDefinitions, importParameters, changeMap);
239
+ }
240
+ else if (artifactType === ux_specification_types_1.ArtifactType.Manifest && propertyDefinition[ux_specification_types_1.SchemaTag.manifestPath]) {
241
+ // case 2
242
+ importManifestToConfigProperty(config, importConfigInfo, propertyPath, property, propertyDefinition, globalTypeDefinitions, importParameters);
243
+ }
244
+ else {
245
+ const refType = (0, common_1.getRefType)(propertyDefinition);
246
+ const refTypeDefinition = refType ? globalTypeDefinitions[refType] : undefined;
247
+ if (isDefinition(refTypeDefinition)) {
248
+ // case 3 -> Recursively step down
249
+ const nextLevelPropertyPath = propertyPath.concat([
250
+ {
251
+ propertyName: property,
252
+ propertyType: refType.split('<')[0] // Remove a potential suffix from the global type to get the type name in the generic schema
253
+ }
254
+ ]);
255
+ importDefinitionIntoConfig(config, importConfigInfo, refTypeDefinition, nextLevelPropertyPath, globalTypeDefinitions, importParameters, changeMap);
256
+ }
257
+ }
258
+ }
259
+ }
260
+ /**
261
+ * This function creates and returns a config for a page of an FE v2 app (executes the 'import').
262
+ *
263
+ * @param importParameters - required information from the app
264
+ * @param pagePath - specifies the page within the app. Note that importParameters.jsonSchema must be
265
+ * consistent with this path. That means that this schema must be the schema that is generated by getAdaptedSchema
266
+ * in schemaAdaptation.ts for this page. This function does not check this consistency.
267
+ * @param getConfigInfo - a function that can provide the ImportConfigInfo to be used for the specified page type
268
+ * @returns the (filled) config for the specified page
269
+ */
270
+ function getConfigForPage(importParameters, pagePath, getConfigInfo) {
271
+ const templateType = (0, common_1.getTemplateTypeFromManifest)(importParameters.manifest, ux_specification_types_1.FioriElementsVersion.v2, importParameters.logger);
272
+ if (!templateType || templateType === ux_specification_types_1.TemplateType.OverviewPageV2) {
273
+ return; // not supported (yet)
274
+ }
275
+ const manifestPath = (0, utils_1.getManifestPathFromPagePath)(pagePath, false);
276
+ const { parent: pageDefinition } = (0, utils_1.getManifestPropertyByPath)(importParameters.manifest, manifestPath);
277
+ const componentName = pageDefinition?.['component']?.name;
278
+ const importConfigInfo = typeof componentName === 'string' ? getConfigInfo(componentName) : undefined;
279
+ if (!importConfigInfo) {
280
+ return;
281
+ }
282
+ const changeMap = getChangeMapFormImportParameters(importParameters); // Prepare a consumable format of the flex changes
283
+ const schema = importParameters.jsonSchema;
284
+ const globalTypeDefinitions = schema.definitions;
285
+ const config = importConfigInfo.propertyInstanceProvider([]); // instantiate the empty config
286
+ importDefinitionIntoConfig(config, importConfigInfo, schema, [], globalTypeDefinitions, importParameters, changeMap); // and fill it
287
+ return config;
288
+ }
289
+ //# sourceMappingURL=importPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importPage.js","sourceRoot":"","sources":["../../../../../../src/sync/v2/import/importPage.ts"],"names":[],"mappings":";;AA8aA,4CAkCC;AAxcD,wEAA0G;AAC1G,yCAA0F;AAC1F,oCAAkF;AAYlF;;;;;;GAMG;AACH,SAAS,gCAAgC,CAAC,gBAAwC;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ACvB,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"}
@@ -0,0 +1,26 @@
1
+ import type { AccessorPath, Manifest } from '@sap/ux-specification-types';
2
+ /**
3
+ * Get the path inside the manifest to the definition of a specific page.
4
+ *
5
+ * @param pagePath - path to the page as described in option b) of type AccessorPath
6
+ * @param toSettings - If this property is true the path to the settings object of the specified page definition is returned (this is actually the sub-object containing the most meaningful information)
7
+ * @param suffix - can be used to create a path that points to an even deeper sub-object
8
+ * @returns the specified path as described in option a) of type AccessorPath
9
+ */
10
+ export declare function getManifestPathFromPagePath(pagePath: AccessorPath, toSettings?: boolean, suffix?: AccessorPath): AccessorPath;
11
+ /**
12
+ * Helper function to extract information from the manifest.
13
+ *
14
+ * @param manifest - the manifest containing the information
15
+ * @param manifestPath - pointer to the object in the manifest containing the property to be checked
16
+ * @param property - the property below the specified path that should be extracted. If it is faulty, no value will be extracted.
17
+ * @returns - hasPath: information whether the specified path can be followed in the manifest and the target is an object (which is not null)
18
+ * - value: The value of the specified property if the path can be followed and the corresponding object possesses the specified property, otherwise undefined
19
+ * - parent: the not-null object found at the specified path (parent object of the property), otherwise undefined. Note that modifying the properties of this object will also change manifest.
20
+ */
21
+ export declare function getManifestPropertyByPath(manifest: Manifest, manifestPath: AccessorPath, property?: string): {
22
+ hasPath: boolean;
23
+ value: unknown;
24
+ parent: object | undefined;
25
+ };
26
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/sync/v2/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;;;;;;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"}