@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
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getManifestPathFromPagePath = getManifestPathFromPagePath;
4
+ exports.getManifestPropertyByPath = getManifestPropertyByPath;
5
+ /**
6
+ * This file contains helper functions for generic schema handling.
7
+ * The functionality is implicitly tested by the more complex unit-tests for generic schema generation and generic import in test-folder unit/genericSchemaHandling.
8
+ */
9
+ const ux_specification_types_1 = require("@sap/ux-specification-types");
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
+ function getManifestPathFromPagePath(pagePath, toSettings = true, suffix = []) {
19
+ const manifestPath = [ux_specification_types_1.ManifestSection.generic];
20
+ pagePath.forEach(function (page) {
21
+ manifestPath.push('pages');
22
+ manifestPath.push(page);
23
+ });
24
+ if (toSettings) {
25
+ manifestPath.push('component');
26
+ manifestPath.push('settings');
27
+ }
28
+ return manifestPath.concat(suffix);
29
+ }
30
+ /**
31
+ * Helper function to extract information from the manifest.
32
+ *
33
+ * @param manifest - the manifest containing the information
34
+ * @param manifestPath - pointer to the object in the manifest containing the property to be checked
35
+ * @param property - the property below the specified path that should be extracted. If it is faulty, no value will be extracted.
36
+ * @returns - hasPath: information whether the specified path can be followed in the manifest and the target is an object (which is not null)
37
+ * - value: The value of the specified property if the path can be followed and the corresponding object possesses the specified property, otherwise undefined
38
+ * - 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.
39
+ */
40
+ function getManifestPropertyByPath(manifest, manifestPath, property) {
41
+ let manifestSection = manifest; // Current position in the manifest when stepping down
42
+ const hasPath =
43
+ // Traverse down the manifest (in manifestSection) step by step along the specified path
44
+ manifestPath.every(function (accessor) {
45
+ if (!manifestSection ||
46
+ typeof manifestSection !== 'object' ||
47
+ (Array.isArray(manifestSection) && typeof accessor !== 'number')) {
48
+ // In order to perform another step down our current position must be a (not-null) object.
49
+ // If this is even an array we only accept numbers as accessors.
50
+ // When this condition is not fulfilled, we stop stepping down.
51
+ return false;
52
+ }
53
+ manifestSection = manifestSection[accessor]; // execute the step down
54
+ return true;
55
+ }) &&
56
+ typeof manifestSection === 'object' &&
57
+ manifestSection !== null; // Finally check whether we still have reached a not-null object
58
+ return {
59
+ hasPath,
60
+ value: hasPath && property ? manifestSection[property] : undefined,
61
+ parent: hasPath ? manifestSection : undefined
62
+ };
63
+ }
64
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/sync/v2/utils.ts"],"names":[],"mappings":";;AAeA,kEAeC;AAYD,8DA6BC;AAvED;;;GAGG;AACH,wEAA8D;AAG9D;;;;;;;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,CAAC,eAAe,CAAC,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,EAClE,CAAC;YACC,0FAA0F;YAC1F,gEAAgE;YAChE,+DAA+D;YAC/D,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,eAAe,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,wBAAwB;QACrE,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;QACF,OAAO,eAAe,KAAK,QAAQ;QACnC,eAAe,KAAK,IAAI,CAAC,CAAC,gEAAgE;IAC9F,OAAO;QACH,OAAO;QACP,KAAK,EAAE,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAClE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAE,eAA0B,CAAC,CAAC,CAAC,SAAS;KAC5D,CAAC;AACN,CAAC"}
@@ -244,7 +244,7 @@ export interface ReferenceAdaptationInfo extends AdaptationInfo {
244
244
  * a) Describe a 'manifest path' (i.e. a path from manifest root to an property or a section within the manifest)
245
245
  * b) Describe a 'page path' (i.e. a path under the sap.ui.generic.app-element of the manifest of a FE v2 app)
246
246
  * In case b) every second accessor element has fixed name 'pages'. This fixed string will be left out in page paths (but not in manifest paths containing it).
247
- * Function getManifestPathFromPagePath in file schemaAdaptation.ts can be used to build a manifest path out of a page path
247
+ * Function getManifestPathFromPagePath in file v2.utils.ts can be used to build a manifest path out of a page path
248
248
  */
249
249
  export type AccessorPath = (string | number)[];
250
250
  /**
package/package.json CHANGED
@@ -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",