@sap/ux-specification 1.96.19 → 1.96.21
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/documentation/runDocu-min.js +27 -2
- package/dist/documentation/runDocu-min.js.map +7 -0
- package/dist/documentation/styleDocu.css +32 -28
- package/dist/documentation/v2/v2-AnalyticalListPage.html +20 -8
- package/dist/documentation/v2/v2-ApplicationV2.html +20 -8
- package/dist/documentation/v2/v2-ListReport.html +20 -8
- package/dist/documentation/v2/v2-ObjectPage.html +20 -8
- package/dist/documentation/v2/v2-OverviewPage.html +20 -8
- package/dist/documentation/v4/v4-ApplicationV4.html +20 -8
- package/dist/documentation/v4/v4-FreestylePage.html +20 -8
- package/dist/documentation/v4/v4-ListReport.html +20 -8
- package/dist/documentation/v4/v4-ObjectPage.html +20 -8
- package/dist/index-min.js +123 -2
- package/dist/index-min.js.map +7 -0
- package/dist/schemas/v2/AnalyticalListPageConfig.json +12 -9
- package/dist/schemas/v2/ListReportConfig.json +133 -130
- package/dist/schemas/v2/ObjectPageConfig.json +2 -3
- package/dist/schemas/v4/ApplicationV4.json +22 -1
- package/dist/schemas/v4/FreestylePageConfig.json +3 -0
- package/dist/schemas/v4/ListReportConfig.json +7 -2
- package/dist/schemas/v4/ObjectPageConfig.json +1 -2
- package/dist/scripts/extractDocu.d.ts +1 -0
- package/dist/scripts/extractDocu.d.ts.map +1 -0
- package/dist/scripts/extractDocu.js +495 -0
- package/dist/scripts/extractDocu.js.map +1 -0
- package/dist/scripts/runDocu.d.ts +1 -0
- package/dist/scripts/runDocu.d.ts.map +1 -0
- package/dist/scripts/runDocu.js +579 -0
- package/dist/scripts/runDocu.js.map +1 -0
- package/dist/scripts/spec.d.ts +1 -0
- package/dist/scripts/spec.d.ts.map +1 -0
- package/dist/scripts/spec.js +114 -0
- package/dist/scripts/spec.js.map +1 -0
- package/dist/scripts/to-json-schema.d.ts +2 -1
- package/dist/scripts/to-json-schema.d.ts.map +1 -0
- package/dist/scripts/to-json-schema.js +132 -0
- package/dist/scripts/to-json-schema.js.map +1 -0
- package/dist/src/api.d.ts +3 -2
- package/dist/src/api.d.ts.map +1 -0
- package/dist/src/api.js +190 -0
- package/dist/src/api.js.map +1 -0
- package/dist/src/apiTypes.d.ts +20 -22
- package/dist/src/apiTypes.d.ts.map +1 -0
- package/dist/src/apiTypes.js +22 -0
- package/dist/src/apiTypes.js.map +1 -0
- package/dist/src/extensionLogger.d.ts +1 -0
- package/dist/src/extensionLogger.d.ts.map +1 -0
- package/dist/src/extensionLogger.js +39 -0
- package/dist/src/extensionLogger.js.map +1 -0
- package/dist/src/i18n/i18n.d.ts +1 -0
- package/dist/src/i18n/i18n.d.ts.map +1 -0
- package/dist/src/i18n/i18n.js +25 -0
- package/dist/src/i18n/i18n.js.map +1 -0
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +13 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/project.d.ts +3 -1
- package/dist/src/project.d.ts.map +1 -0
- package/dist/src/project.js +149 -0
- package/dist/src/project.js.map +1 -0
- package/dist/src/specification/schemaAccess.d.ts +7 -10
- package/dist/src/specification/schemaAccess.d.ts.map +1 -0
- package/dist/src/specification/schemaAccess.js +60 -0
- package/dist/src/specification/schemaAccess.js.map +1 -0
- package/dist/src/sync/common/appProvider.d.ts +5 -6
- package/dist/src/sync/common/appProvider.d.ts.map +1 -0
- package/dist/src/sync/common/appProvider.js +133 -0
- package/dist/src/sync/common/appProvider.js.map +1 -0
- package/dist/src/sync/common/decoration/control.d.ts +1 -0
- package/dist/src/sync/common/decoration/control.d.ts.map +1 -0
- package/dist/src/sync/common/decoration/control.js +211 -0
- package/dist/src/sync/common/decoration/control.js.map +1 -0
- package/dist/src/sync/common/decoration/decorators.d.ts +1 -0
- package/dist/src/sync/common/decoration/decorators.d.ts.map +1 -0
- package/dist/src/sync/common/decoration/decorators.js +45 -0
- package/dist/src/sync/common/decoration/decorators.js.map +1 -0
- package/dist/src/sync/common/decoration/factory.d.ts +2 -1
- package/dist/src/sync/common/decoration/factory.d.ts.map +1 -0
- package/dist/src/sync/common/decoration/factory.js +48 -0
- package/dist/src/sync/common/decoration/factory.js.map +1 -0
- package/dist/src/sync/common/decoration/flex.d.ts +2 -4
- package/dist/src/sync/common/decoration/flex.d.ts.map +1 -0
- package/dist/src/sync/common/decoration/flex.js +8 -0
- package/dist/src/sync/common/decoration/flex.js.map +1 -0
- package/dist/src/sync/common/decoration/index.d.ts +1 -0
- package/dist/src/sync/common/decoration/index.d.ts.map +1 -0
- package/dist/src/sync/common/decoration/index.js +9 -0
- package/dist/src/sync/common/decoration/index.js.map +1 -0
- package/dist/src/sync/common/flexUtils.d.ts +3 -4
- package/dist/src/sync/common/flexUtils.d.ts.map +1 -0
- package/dist/src/sync/common/flexUtils.js +94 -0
- package/dist/src/sync/common/flexUtils.js.map +1 -0
- package/dist/src/sync/common/generate/index.d.ts +1 -0
- package/dist/src/sync/common/generate/index.d.ts.map +1 -0
- package/dist/src/sync/common/generate/index.js +8 -0
- package/dist/src/sync/common/generate/index.js.map +1 -0
- package/dist/src/sync/common/generate/objectPage.d.ts +4 -3
- package/dist/src/sync/common/generate/objectPage.d.ts.map +1 -0
- package/dist/src/sync/common/generate/objectPage.js +378 -0
- package/dist/src/sync/common/generate/objectPage.js.map +1 -0
- package/dist/src/sync/common/generate/utils.d.ts +3 -1
- package/dist/src/sync/common/generate/utils.d.ts.map +1 -0
- package/dist/src/sync/common/generate/utils.js +487 -0
- package/dist/src/sync/common/generate/utils.js.map +1 -0
- package/dist/src/sync/common/i18n.json +23 -0
- package/dist/src/sync/common/import/utils.d.ts +1 -0
- package/dist/src/sync/common/import/utils.d.ts.map +1 -0
- package/dist/src/sync/common/import/utils.js +106 -0
- package/dist/src/sync/common/import/utils.js.map +1 -0
- package/dist/src/sync/common/importProject.d.ts +1 -0
- package/dist/src/sync/common/importProject.d.ts.map +1 -0
- package/dist/src/sync/common/importProject.js +339 -0
- package/dist/src/sync/common/importProject.js.map +1 -0
- package/dist/src/sync/common/index.d.ts +1 -0
- package/dist/src/sync/common/index.d.ts.map +1 -0
- package/dist/src/sync/common/index.js +15 -0
- package/dist/src/sync/common/index.js.map +1 -0
- package/dist/src/sync/common/types.d.ts +7 -54
- package/dist/src/sync/common/types.d.ts.map +1 -0
- package/dist/src/sync/common/types.js +175 -0
- package/dist/src/sync/common/types.js.map +1 -0
- package/dist/src/sync/common/utils.d.ts +6 -7
- package/dist/src/sync/common/utils.d.ts.map +1 -0
- package/dist/src/sync/common/utils.js +1244 -0
- package/dist/src/sync/common/utils.js.map +1 -0
- package/dist/src/sync/i18n.d.ts +1 -0
- package/dist/src/sync/i18n.d.ts.map +1 -0
- package/dist/src/sync/i18n.js +15 -0
- package/dist/src/sync/i18n.js.map +1 -0
- package/dist/src/sync/v2/application.d.ts +8 -7
- package/dist/src/sync/v2/application.d.ts.map +1 -0
- package/dist/src/sync/v2/application.js +189 -0
- package/dist/src/sync/v2/application.js.map +1 -0
- package/dist/src/sync/v2/export/controls/Action.d.ts +5 -4
- package/dist/src/sync/v2/export/controls/Action.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/Action.js +127 -0
- package/dist/src/sync/v2/export/controls/Action.js.map +1 -0
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts +4 -3
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js +73 -0
- package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -0
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.d.ts +3 -2
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js +56 -0
- package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js.map +1 -0
- package/dist/src/sync/v2/export/controls/Card.d.ts +31 -30
- package/dist/src/sync/v2/export/controls/Card.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/Card.js +655 -0
- package/dist/src/sync/v2/export/controls/Card.js.map +1 -0
- package/dist/src/sync/v2/export/controls/Field.d.ts +3 -2
- package/dist/src/sync/v2/export/controls/Field.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/Field.js +41 -0
- package/dist/src/sync/v2/export/controls/Field.js.map +1 -0
- package/dist/src/sync/v2/export/controls/FilterBar.d.ts +14 -14
- package/dist/src/sync/v2/export/controls/FilterBar.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/FilterBar.js +283 -0
- package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -0
- package/dist/src/sync/v2/export/controls/FormAction.d.ts +4 -3
- package/dist/src/sync/v2/export/controls/FormAction.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/FormAction.js +96 -0
- package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -0
- package/dist/src/sync/v2/export/controls/Fragment.d.ts +6 -5
- package/dist/src/sync/v2/export/controls/Fragment.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/Fragment.js +580 -0
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageChart.d.ts +4 -3
- package/dist/src/sync/v2/export/controls/ObjectPageChart.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageChart.js +37 -0
- package/dist/src/sync/v2/export/controls/ObjectPageChart.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.d.ts +7 -8
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js +110 -0
- package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +3 -2
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js +62 -0
- package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts +3 -2
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js +61 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +3 -2
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js +62 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageLayout.d.ts +3 -2
- package/dist/src/sync/v2/export/controls/ObjectPageLayout.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageLayout.js +59 -0
- package/dist/src/sync/v2/export/controls/ObjectPageLayout.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +14 -13
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +194 -0
- package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +17 -17
- package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js +336 -0
- package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +3 -2
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js +61 -0
- package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -0
- package/dist/src/sync/v2/export/controls/Table.d.ts +25 -24
- package/dist/src/sync/v2/export/controls/Table.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/Table.js +709 -0
- package/dist/src/sync/v2/export/controls/Table.js.map +1 -0
- package/dist/src/sync/v2/export/controls/TableColumn.d.ts +6 -6
- package/dist/src/sync/v2/export/controls/TableColumn.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/TableColumn.js +166 -0
- package/dist/src/sync/v2/export/controls/TableColumn.js.map +1 -0
- package/dist/src/sync/v2/export/controls/ToolBar.d.ts +4 -3
- package/dist/src/sync/v2/export/controls/ToolBar.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ToolBar.js +6 -0
- package/dist/src/sync/v2/export/controls/ToolBar.js.map +1 -0
- package/dist/src/sync/v2/export/controls/index.d.ts +1 -0
- package/dist/src/sync/v2/export/controls/index.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/index.js +26 -0
- package/dist/src/sync/v2/export/controls/index.js.map +1 -0
- package/dist/src/sync/v2/export/export.d.ts +2 -1
- package/dist/src/sync/v2/export/export.d.ts.map +1 -0
- package/dist/src/sync/v2/export/export.js +681 -0
- package/dist/src/sync/v2/export/export.js.map +1 -0
- package/dist/src/sync/v2/export/exportPage.d.ts +3 -1
- package/dist/src/sync/v2/export/exportPage.d.ts.map +1 -0
- package/dist/src/sync/v2/export/exportPage.js +304 -0
- package/dist/src/sync/v2/export/exportPage.js.map +1 -0
- package/dist/src/sync/v2/export/factory.d.ts +1 -0
- package/dist/src/sync/v2/export/factory.d.ts.map +1 -0
- package/dist/src/sync/v2/export/factory.js +58 -0
- package/dist/src/sync/v2/export/factory.js.map +1 -0
- package/dist/src/sync/v2/export/manifest.d.ts +3 -2
- package/dist/src/sync/v2/export/manifest.d.ts.map +1 -0
- package/dist/src/sync/v2/export/manifest.js +155 -0
- package/dist/src/sync/v2/export/manifest.js.map +1 -0
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.d.ts +7 -8
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.d.ts.map +1 -0
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js +42 -0
- package/dist/src/sync/v2/export/pages/AnalyticalListPage.js.map +1 -0
- package/dist/src/sync/v2/export/pages/ListReport.d.ts +5 -4
- package/dist/src/sync/v2/export/pages/ListReport.d.ts.map +1 -0
- package/dist/src/sync/v2/export/pages/ListReport.js +39 -0
- package/dist/src/sync/v2/export/pages/ListReport.js.map +1 -0
- package/dist/src/sync/v2/export/pages/ObjectPage.d.ts +8 -8
- package/dist/src/sync/v2/export/pages/ObjectPage.d.ts.map +1 -0
- package/dist/src/sync/v2/export/pages/ObjectPage.js +100 -0
- package/dist/src/sync/v2/export/pages/ObjectPage.js.map +1 -0
- package/dist/src/sync/v2/export/pages/OverviewPage.d.ts +8 -7
- package/dist/src/sync/v2/export/pages/OverviewPage.d.ts.map +1 -0
- package/dist/src/sync/v2/export/pages/OverviewPage.js +213 -0
- package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -0
- package/dist/src/sync/v2/export/pages/index.d.ts +1 -0
- package/dist/src/sync/v2/export/pages/index.d.ts.map +1 -0
- package/dist/src/sync/v2/export/pages/index.js +10 -0
- package/dist/src/sync/v2/export/pages/index.js.map +1 -0
- package/dist/src/sync/v2/export/view-controller-generator.d.ts +5 -5
- package/dist/src/sync/v2/export/view-controller-generator.d.ts.map +1 -0
- package/dist/src/sync/v2/export/view-controller-generator.js +140 -0
- package/dist/src/sync/v2/export/view-controller-generator.js.map +1 -0
- package/dist/src/sync/v2/generate/analyticalListReport.d.ts +2 -1
- package/dist/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -0
- package/dist/src/sync/v2/generate/analyticalListReport.js +86 -0
- package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -0
- package/dist/src/sync/v2/generate/generate.d.ts +2 -1
- package/dist/src/sync/v2/generate/generate.d.ts.map +1 -0
- package/dist/src/sync/v2/generate/generate.js +99 -0
- package/dist/src/sync/v2/generate/generate.js.map +1 -0
- package/dist/src/sync/v2/generate/index.d.ts +1 -0
- package/dist/src/sync/v2/generate/index.d.ts.map +1 -0
- package/dist/src/sync/v2/generate/index.js +14 -0
- package/dist/src/sync/v2/generate/index.js.map +1 -0
- package/dist/src/sync/v2/generate/listReport.d.ts +2 -1
- package/dist/src/sync/v2/generate/listReport.d.ts.map +1 -0
- package/dist/src/sync/v2/generate/listReport.js +124 -0
- package/dist/src/sync/v2/generate/listReport.js.map +1 -0
- package/dist/src/sync/v2/generate/objectPage.d.ts +2 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts.map +1 -0
- package/dist/src/sync/v2/generate/objectPage.js +545 -0
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -0
- package/dist/src/sync/v2/generate/overviewPage.d.ts +2 -1
- package/dist/src/sync/v2/generate/overviewPage.d.ts.map +1 -0
- package/dist/src/sync/v2/generate/overviewPage.js +70 -0
- package/dist/src/sync/v2/generate/overviewPage.js.map +1 -0
- package/dist/src/sync/v2/generate/utils.d.ts +4 -4
- package/dist/src/sync/v2/generate/utils.d.ts.map +1 -0
- package/dist/src/sync/v2/generate/utils.js +531 -0
- package/dist/src/sync/v2/generate/utils.js.map +1 -0
- package/dist/src/sync/v2/import/app/appProvider.d.ts +5 -4
- package/dist/src/sync/v2/import/app/appProvider.d.ts.map +1 -0
- package/dist/src/sync/v2/import/app/appProvider.js +136 -0
- package/dist/src/sync/v2/import/app/appProvider.js.map +1 -0
- package/dist/src/sync/v2/import/app/ovpProvider.d.ts +2 -1
- package/dist/src/sync/v2/import/app/ovpProvider.d.ts.map +1 -0
- package/dist/src/sync/v2/import/app/ovpProvider.js +32 -0
- package/dist/src/sync/v2/import/app/ovpProvider.js.map +1 -0
- package/dist/src/sync/v2/import/common/index.d.ts +7 -9
- package/dist/src/sync/v2/import/common/index.d.ts.map +1 -0
- package/dist/src/sync/v2/import/common/index.js +413 -0
- package/dist/src/sync/v2/import/common/index.js.map +1 -0
- package/dist/src/sync/v2/import/controls/table.d.ts +3 -2
- package/dist/src/sync/v2/import/controls/table.d.ts.map +1 -0
- package/dist/src/sync/v2/import/controls/table.js +33 -0
- package/dist/src/sync/v2/import/controls/table.js.map +1 -0
- package/dist/src/sync/v2/import/getPageType.d.ts +1 -0
- package/dist/src/sync/v2/import/getPageType.d.ts.map +1 -0
- package/dist/src/sync/v2/import/getPageType.js +1 -0
- package/dist/src/sync/v2/import/getPageType.js.map +1 -0
- package/dist/src/sync/v2/import/index.d.ts +1 -0
- package/dist/src/sync/v2/import/index.d.ts.map +1 -0
- package/dist/src/sync/v2/import/index.js +11 -0
- package/dist/src/sync/v2/import/index.js.map +1 -0
- package/dist/src/sync/v2/import/pages/analyticalListPage.d.ts +3 -2
- package/dist/src/sync/v2/import/pages/analyticalListPage.d.ts.map +1 -0
- package/dist/src/sync/v2/import/pages/analyticalListPage.js +128 -0
- package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -0
- package/dist/src/sync/v2/import/pages/listReport.d.ts +3 -2
- package/dist/src/sync/v2/import/pages/listReport.d.ts.map +1 -0
- package/dist/src/sync/v2/import/pages/listReport.js +156 -0
- package/dist/src/sync/v2/import/pages/listReport.js.map +1 -0
- package/dist/src/sync/v2/import/pages/objectPage.d.ts +4 -2
- package/dist/src/sync/v2/import/pages/objectPage.d.ts.map +1 -0
- package/dist/src/sync/v2/import/pages/objectPage.js +746 -0
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -0
- package/dist/src/sync/v2/import/pages/overviewPage.d.ts +3 -3
- package/dist/src/sync/v2/import/pages/overviewPage.d.ts.map +1 -0
- package/dist/src/sync/v2/import/pages/overviewPage.js +111 -0
- package/dist/src/sync/v2/import/pages/overviewPage.js.map +1 -0
- package/dist/src/sync/v2/import/utils.d.ts +6 -5
- package/dist/src/sync/v2/import/utils.d.ts.map +1 -0
- package/dist/src/sync/v2/import/utils.js +171 -0
- package/dist/src/sync/v2/import/utils.js.map +1 -0
- package/dist/src/sync/v2/types.d.ts +6 -6
- package/dist/src/sync/v2/types.d.ts.map +1 -0
- package/dist/src/sync/v2/types.js +37 -0
- package/dist/src/sync/v2/types.js.map +1 -0
- package/dist/src/sync/v4/application.d.ts +7 -7
- package/dist/src/sync/v4/application.d.ts.map +1 -0
- package/dist/src/sync/v4/application.js +164 -0
- package/dist/src/sync/v4/application.js.map +1 -0
- package/dist/src/sync/v4/export/controls/FilterBar.d.ts +5 -3
- package/dist/src/sync/v4/export/controls/FilterBar.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/FilterBar.js +24 -0
- package/dist/src/sync/v4/export/controls/FilterBar.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +5 -6
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.js +135 -0
- package/dist/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.d.ts +4 -3
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.js +54 -0
- package/dist/src/sync/v4/export/controls/ObjectPageHeader.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.d.ts +11 -10
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js +65 -0
- package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageLayout.d.ts +4 -3
- package/dist/src/sync/v4/export/controls/ObjectPageLayout.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageLayout.js +24 -0
- package/dist/src/sync/v4/export/controls/ObjectPageLayout.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageTable.d.ts +10 -9
- package/dist/src/sync/v4/export/controls/ObjectPageTable.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js +233 -0
- package/dist/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts +12 -11
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js +160 -0
- package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +7 -6
- package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.js +113 -0
- package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.js.map +1 -0
- package/dist/src/sync/v4/export/controls/Table.d.ts +28 -28
- package/dist/src/sync/v4/export/controls/Table.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/Table.js +784 -0
- package/dist/src/sync/v4/export/controls/Table.js.map +1 -0
- package/dist/src/sync/v4/export/controls/TableColumn.d.ts +21 -20
- package/dist/src/sync/v4/export/controls/TableColumn.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/TableColumn.js +310 -0
- package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ToolBar.d.ts +4 -3
- package/dist/src/sync/v4/export/controls/ToolBar.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ToolBar.js +9 -0
- package/dist/src/sync/v4/export/controls/ToolBar.js.map +1 -0
- package/dist/src/sync/v4/export/controls/ToolBarAction.d.ts +12 -11
- package/dist/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/ToolBarAction.js +214 -0
- package/dist/src/sync/v4/export/controls/ToolBarAction.js.map +1 -0
- package/dist/src/sync/v4/export/controls/index.d.ts +1 -0
- package/dist/src/sync/v4/export/controls/index.d.ts.map +1 -0
- package/dist/src/sync/v4/export/controls/index.js +18 -0
- package/dist/src/sync/v4/export/controls/index.js.map +1 -0
- package/dist/src/sync/v4/export/export.d.ts +1 -0
- package/dist/src/sync/v4/export/export.d.ts.map +1 -0
- package/dist/src/sync/v4/export/export.js +846 -0
- package/dist/src/sync/v4/export/export.js.map +1 -0
- package/dist/src/sync/v4/export/exportCustomColumn.d.ts +1 -0
- package/dist/src/sync/v4/export/exportCustomColumn.d.ts.map +1 -0
- package/dist/src/sync/v4/export/exportCustomColumn.js +49 -0
- package/dist/src/sync/v4/export/exportCustomColumn.js.map +1 -0
- package/dist/src/sync/v4/export/factory.d.ts +1 -0
- package/dist/src/sync/v4/export/factory.d.ts.map +1 -0
- package/dist/src/sync/v4/export/factory.js +44 -0
- package/dist/src/sync/v4/export/factory.js.map +1 -0
- package/dist/src/sync/v4/export/flexibleColumnLayout.d.ts +4 -2
- package/dist/src/sync/v4/export/flexibleColumnLayout.d.ts.map +1 -0
- package/dist/src/sync/v4/export/flexibleColumnLayout.js +125 -0
- package/dist/src/sync/v4/export/flexibleColumnLayout.js.map +1 -0
- package/dist/src/sync/v4/export/manifest.d.ts +3 -2
- package/dist/src/sync/v4/export/manifest.d.ts.map +1 -0
- package/dist/src/sync/v4/export/manifest.js +235 -0
- package/dist/src/sync/v4/export/manifest.js.map +1 -0
- package/dist/src/sync/v4/export/pages/FreestylePage.d.ts +1 -0
- package/dist/src/sync/v4/export/pages/FreestylePage.d.ts.map +1 -0
- package/dist/src/sync/v4/export/pages/FreestylePage.js +9 -0
- package/dist/src/sync/v4/export/pages/FreestylePage.js.map +1 -0
- package/dist/src/sync/v4/export/pages/ListReport.d.ts +7 -6
- package/dist/src/sync/v4/export/pages/ListReport.d.ts.map +1 -0
- package/dist/src/sync/v4/export/pages/ListReport.js +82 -0
- package/dist/src/sync/v4/export/pages/ListReport.js.map +1 -0
- package/dist/src/sync/v4/export/pages/ObjectPage.d.ts +5 -4
- package/dist/src/sync/v4/export/pages/ObjectPage.d.ts.map +1 -0
- package/dist/src/sync/v4/export/pages/ObjectPage.js +40 -0
- package/dist/src/sync/v4/export/pages/ObjectPage.js.map +1 -0
- package/dist/src/sync/v4/export/pages/index.d.ts +1 -0
- package/dist/src/sync/v4/export/pages/index.d.ts.map +1 -0
- package/dist/src/sync/v4/export/pages/index.js +9 -0
- package/dist/src/sync/v4/export/pages/index.js.map +1 -0
- package/dist/src/sync/v4/export/types.d.ts +2 -1
- package/dist/src/sync/v4/export/types.d.ts.map +1 -0
- package/dist/src/sync/v4/export/types.js +3 -0
- package/dist/src/sync/v4/export/types.js.map +1 -0
- package/dist/src/sync/v4/export/utils.d.ts +3 -2
- package/dist/src/sync/v4/export/utils.d.ts.map +1 -0
- package/dist/src/sync/v4/export/utils.js +43 -0
- package/dist/src/sync/v4/export/utils.js.map +1 -0
- package/dist/src/sync/v4/generate/freestylePage.d.ts +1 -0
- package/dist/src/sync/v4/generate/freestylePage.d.ts.map +1 -0
- package/dist/src/sync/v4/generate/freestylePage.js +15 -0
- package/dist/src/sync/v4/generate/freestylePage.js.map +1 -0
- package/dist/src/sync/v4/generate/generate.d.ts +2 -1
- package/dist/src/sync/v4/generate/generate.d.ts.map +1 -0
- package/dist/src/sync/v4/generate/generate.js +81 -0
- package/dist/src/sync/v4/generate/generate.js.map +1 -0
- package/dist/src/sync/v4/generate/index.d.ts +1 -0
- package/dist/src/sync/v4/generate/index.d.ts.map +1 -0
- package/dist/src/sync/v4/generate/index.js +13 -0
- package/dist/src/sync/v4/generate/index.js.map +1 -0
- package/dist/src/sync/v4/generate/listReport.d.ts +1 -0
- package/dist/src/sync/v4/generate/listReport.d.ts.map +1 -0
- package/dist/src/sync/v4/generate/listReport.js +680 -0
- package/dist/src/sync/v4/generate/listReport.js.map +1 -0
- package/dist/src/sync/v4/generate/objectPage.d.ts +1 -0
- package/dist/src/sync/v4/generate/objectPage.d.ts.map +1 -0
- package/dist/src/sync/v4/generate/objectPage.js +618 -0
- package/dist/src/sync/v4/generate/objectPage.js.map +1 -0
- package/dist/src/sync/v4/import/app/appProvider.d.ts +3 -2
- package/dist/src/sync/v4/import/app/appProvider.d.ts.map +1 -0
- package/dist/src/sync/v4/import/app/appProvider.js +10 -0
- package/dist/src/sync/v4/import/app/appProvider.js.map +1 -0
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts +11 -10
- package/dist/src/sync/v4/import/app/baseAppProvider.d.ts.map +1 -0
- package/dist/src/sync/v4/import/app/baseAppProvider.js +330 -0
- package/dist/src/sync/v4/import/app/baseAppProvider.js.map +1 -0
- package/dist/src/sync/v4/import/app/freestyleProvider.d.ts +3 -2
- package/dist/src/sync/v4/import/app/freestyleProvider.d.ts.map +1 -0
- package/dist/src/sync/v4/import/app/freestyleProvider.js +11 -0
- package/dist/src/sync/v4/import/app/freestyleProvider.js.map +1 -0
- package/dist/src/sync/v4/import/app/index.d.ts +1 -0
- package/dist/src/sync/v4/import/app/index.d.ts.map +1 -0
- package/dist/src/sync/v4/import/app/index.js +12 -0
- package/dist/src/sync/v4/import/app/index.js.map +1 -0
- package/dist/src/sync/v4/import/fragment.d.ts +2 -1
- package/dist/src/sync/v4/import/fragment.d.ts.map +1 -0
- package/dist/src/sync/v4/import/fragment.js +130 -0
- package/dist/src/sync/v4/import/fragment.js.map +1 -0
- package/dist/src/sync/v4/import/index.d.ts +1 -0
- package/dist/src/sync/v4/import/index.d.ts.map +1 -0
- package/dist/src/sync/v4/import/index.js +8 -0
- package/dist/src/sync/v4/import/index.js.map +1 -0
- package/dist/src/sync/v4/import/pages/listReport.d.ts +5 -4
- package/dist/src/sync/v4/import/pages/listReport.d.ts.map +1 -0
- package/dist/src/sync/v4/import/pages/listReport.js +287 -0
- package/dist/src/sync/v4/import/pages/listReport.js.map +1 -0
- package/dist/src/sync/v4/import/pages/objectPage.d.ts +3 -2
- package/dist/src/sync/v4/import/pages/objectPage.d.ts.map +1 -0
- package/dist/src/sync/v4/import/pages/objectPage.js +267 -0
- package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -0
- package/dist/src/sync/v4/import/utils.d.ts +2 -1
- package/dist/src/sync/v4/import/utils.d.ts.map +1 -0
- package/dist/src/sync/v4/import/utils.js +34 -0
- package/dist/src/sync/v4/import/utils.js.map +1 -0
- package/dist/src/sync/v4/types.d.ts +1 -0
- package/dist/src/sync/v4/types.d.ts.map +1 -0
- package/dist/src/sync/v4/types.js +3 -0
- package/dist/src/sync/v4/types.js.map +1 -0
- package/dist/src/sync/v4/utils/StableIdHelper.d.ts +1 -0
- package/dist/src/sync/v4/utils/StableIdHelper.d.ts.map +1 -0
- package/dist/src/sync/v4/utils/StableIdHelper.js +156 -0
- package/dist/src/sync/v4/utils/StableIdHelper.js.map +1 -0
- package/dist/src/sync/v4/utils/utils.d.ts +8 -7
- package/dist/src/sync/v4/utils/utils.d.ts.map +1 -0
- package/dist/src/sync/v4/utils/utils.js +442 -0
- package/dist/src/sync/v4/utils/utils.js.map +1 -0
- package/package.json +16 -21
- package/CHANGELOG.md +0 -411
- package/dist/documentation/runDocu-min.js.LICENSE.txt +0 -24
- package/dist/index-min.js.LICENSE.txt +0 -26
- package/dist/specification/v2/index-min.js +0 -1
- package/dist/specification/v4/index-min.js +0 -1
- package/dist/src/specification/common/Application.d.ts +0 -36
- package/dist/src/specification/common/index.d.ts +0 -5
- package/dist/src/specification/common/page.d.ts +0 -47
- package/dist/src/specification/common/types.d.ts +0 -16
- package/dist/src/specification/common/webapp/manifest/Manifest.d.ts +0 -49
- package/dist/src/specification/common/webapp/manifest/index.d.ts +0 -3
- package/dist/src/specification/common/webapp/manifest/sapOvp.d.ts +0 -375
- package/dist/src/specification/common/webapp/manifest/sapUi5.d.ts +0 -33
- package/dist/src/specification/v2/ApplicationV2.d.ts +0 -46
- package/dist/src/specification/v2/controls/Action.d.ts +0 -73
- package/dist/src/specification/v2/controls/AnalyticalListPageChart.d.ts +0 -58
- package/dist/src/specification/v2/controls/AnalyticalListPageKPI.d.ts +0 -30
- package/dist/src/specification/v2/controls/Card.d.ts +0 -657
- package/dist/src/specification/v2/controls/Facets.d.ts +0 -17
- package/dist/src/specification/v2/controls/Field.d.ts +0 -10
- package/dist/src/specification/v2/controls/FilterBar.d.ts +0 -234
- package/dist/src/specification/v2/controls/Footer.d.ts +0 -20
- package/dist/src/specification/v2/controls/ObjectPageChart.d.ts +0 -16
- package/dist/src/specification/v2/controls/ObjectPageForm.d.ts +0 -15
- package/dist/src/specification/v2/controls/ObjectPageHeader.d.ts +0 -32
- package/dist/src/specification/v2/controls/ObjectPageLayout.d.ts +0 -22
- package/dist/src/specification/v2/controls/ObjectPageSection.d.ts +0 -120
- package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +0 -186
- package/dist/src/specification/v2/controls/ObjectPageToolBar.d.ts +0 -15
- package/dist/src/specification/v2/controls/Table.d.ts +0 -482
- package/dist/src/specification/v2/controls/ToolBar.d.ts +0 -8
- package/dist/src/specification/v2/controls/index.d.ts +0 -17
- package/dist/src/specification/v2/index.d.ts +0 -5
- package/dist/src/specification/v2/page.d.ts +0 -7
- package/dist/src/specification/v2/pages/AnalyticalListPageConfig.d.ts +0 -21
- package/dist/src/specification/v2/pages/ListReportConfig.d.ts +0 -12
- package/dist/src/specification/v2/pages/ObjectPageConfig.d.ts +0 -33
- package/dist/src/specification/v2/pages/OverviewPageConfig.d.ts +0 -131
- package/dist/src/specification/v2/pages/index.d.ts +0 -4
- package/dist/src/specification/v2/webapp/index.d.ts +0 -1
- package/dist/src/specification/v2/webapp/manifest/index.d.ts +0 -2
- package/dist/src/specification/v2/webapp/manifest/sapUi.d.ts +0 -10
- package/dist/src/specification/v2/webapp/manifest/sapUi5.d.ts +0 -98
- package/dist/src/specification/v2/webapp/manifest/sapUiPageV2.d.ts +0 -31
- package/dist/src/specification/v4/ApplicationV4.d.ts +0 -31
- package/dist/src/specification/v4/controls/FilterBar.d.ts +0 -18
- package/dist/src/specification/v4/controls/ObjectPageFooter.d.ts +0 -11
- package/dist/src/specification/v4/controls/ObjectPageHeader.d.ts +0 -29
- package/dist/src/specification/v4/controls/ObjectPageHeaderSection.d.ts +0 -46
- package/dist/src/specification/v4/controls/ObjectPageLayout.d.ts +0 -14
- package/dist/src/specification/v4/controls/ObjectPageSection.d.ts +0 -98
- package/dist/src/specification/v4/controls/ObjectPageTable.d.ts +0 -106
- package/dist/src/specification/v4/controls/ObjectPageToolBar.d.ts +0 -37
- package/dist/src/specification/v4/controls/Table.d.ts +0 -339
- package/dist/src/specification/v4/controls/ToolBar.d.ts +0 -110
- package/dist/src/specification/v4/controls/index.d.ts +0 -10
- package/dist/src/specification/v4/index.d.ts +0 -5
- package/dist/src/specification/v4/page.d.ts +0 -17
- package/dist/src/specification/v4/pages/FreestylePageConfig.d.ts +0 -2
- package/dist/src/specification/v4/pages/ListReportConfig.d.ts +0 -36
- package/dist/src/specification/v4/pages/ObjectPageConfig.d.ts +0 -18
- package/dist/src/specification/v4/pages/index.d.ts +0 -3
- package/dist/src/specification/v4/webapp/index.d.ts +0 -1
- package/dist/src/specification/v4/webapp/manifest/ManifestSettings.d.ts +0 -224
- package/dist/src/specification/v4/webapp/manifest/index.d.ts +0 -4
- package/dist/src/specification/v4/webapp/manifest/sapUi5.d.ts +0 -102
- package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.d.ts +0 -83
- package/dist/src/v2.d.ts +0 -2
- package/dist/src/v4.d.ts +0 -2
- package/dist/test/test-data/flexChange/v2/stta.prod.man/index.d.ts +0 -7
- package/dist/test/test-projects/index.d.ts +0 -2
- package/dist/test/test-utils/utils.d.ts +0 -32
- package/dist/test/unit/customSections/exportV2.test.d.ts +0 -1
- package/dist/test/unit/customSections/exportV4.test.d.ts +0 -1
- package/dist/test/unit/customSections/generateFacetsSchemaV2.test.d.ts +0 -1
- package/dist/test/unit/customSections/generateFacetsSchemaV4.test.d.ts +0 -1
- package/dist/test/unit/customSections/importV2.test.d.ts +0 -1
- package/dist/test/unit/customSections/importV4.test.d.ts +0 -1
- package/dist/test/unit/export/exportALPV2.test.d.ts +0 -1
- package/dist/test/unit/export/exportALPV4.test.d.ts +0 -1
- package/dist/test/unit/export/exportAppV2.test.d.ts +0 -1
- package/dist/test/unit/export/exportAppV4.test.d.ts +0 -1
- package/dist/test/unit/export/exportFormPageV4.test.d.ts +0 -1
- package/dist/test/unit/export/exportLRPV2.test.d.ts +0 -1
- package/dist/test/unit/export/exportLRPV2CustomColumns.test.d.ts +0 -1
- package/dist/test/unit/export/exportLRPV4.test.d.ts +0 -1
- package/dist/test/unit/export/exportOVPV2.test.d.ts +0 -1
- package/dist/test/unit/export/exportObjectPageV2.test.d.ts +0 -1
- package/dist/test/unit/export/exportObjectPageV4.test.d.ts +0 -1
- package/dist/test/unit/export/flexUtils.test.d.ts +0 -1
- package/dist/test/unit/export/manifest.test.d.ts +0 -1
- package/dist/test/unit/fcl/exportV2.test.d.ts +0 -1
- package/dist/test/unit/fcl/exportV4.test.d.ts +0 -1
- package/dist/test/unit/fcl/importV2.test.d.ts +0 -1
- package/dist/test/unit/fcl/importV4.test.d.ts +0 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaALPV2.test.d.ts +0 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaALPV4.test.d.ts +0 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaFFV4.test.d.ts +0 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaFPV4.test.d.ts +0 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaLRV2.test.d.ts +0 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaLRV4.test.d.ts +0 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaOPV2.test.d.ts +0 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaOPV4.test.d.ts +0 -1
- package/dist/test/unit/generateAppSchema/generateAppSchemaOVPV2.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/generateGenericSchemaAppV2.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/generateGenericSchemaAppV4.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/generateGenericSchemaFFV4.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/generateGenericSchemaLRV2.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/generateGenericSchemaLRV4.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/generateGenericSchemaOPV2.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/generateGenericSchemaOPV4.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/generateI18nV2.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/generateI18nV4.test.d.ts +0 -1
- package/dist/test/unit/generateGenericSchema/genericSchemas.test.d.ts +0 -1
- package/dist/test/unit/import/fragment.test.d.ts +0 -1
- package/dist/test/unit/import/importALPV2.test.d.ts +0 -1
- package/dist/test/unit/import/importALPV4.test.d.ts +0 -1
- package/dist/test/unit/import/importAppV2.test.d.ts +0 -1
- package/dist/test/unit/import/importAppV4.test.d.ts +0 -1
- package/dist/test/unit/import/importFPV4.test.d.ts +0 -1
- package/dist/test/unit/import/importLRPV2.test.d.ts +0 -1
- package/dist/test/unit/import/importLRPV4.test.d.ts +0 -1
- package/dist/test/unit/import/importOPV2.test.d.ts +0 -1
- package/dist/test/unit/import/importOPV4.test.d.ts +0 -1
- package/dist/test/unit/import/importOVPV2.test.d.ts +0 -1
- package/dist/test/unit/index.test.d.ts +0 -1
- package/dist/test/unit/projects.test.d.ts +0 -1
- package/dist/test/unit/schemaAccess.test.d.ts +0 -1
- package/dist/test/unit/utils.test.d.ts +0 -1
- package/dist/test/unit/view-controller-generator.test.d.ts +0 -1
|
@@ -0,0 +1,1244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
7
|
+
const i18next_1 = __importDefault(require("i18next"));
|
|
8
|
+
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
9
|
+
const types_1 = require("./types");
|
|
10
|
+
const annotation_converter_1 = require("@sap-ux/annotation-converter");
|
|
11
|
+
const edmx_parser_1 = require("@sap-ux/edmx-parser");
|
|
12
|
+
const extensionLogger_1 = require("../../extensionLogger");
|
|
13
|
+
var TemplateType;
|
|
14
|
+
(function (TemplateType) {
|
|
15
|
+
TemplateType["ListReportObjectPageV2"] = "ListReportObjectPageV2";
|
|
16
|
+
TemplateType["ListReportObjectPageV4"] = "ListReportObjectPageV4";
|
|
17
|
+
TemplateType["OverviewPageV2"] = "OverviewPageV2";
|
|
18
|
+
TemplateType["AnalyticalListPageV2"] = "AnalyticalListPageV2";
|
|
19
|
+
TemplateType["AnalyticalListPageV4"] = "AnalyticalListPageV4";
|
|
20
|
+
TemplateType["FreestylePageV4"] = "FreestylePageV4";
|
|
21
|
+
})(TemplateType = exports.TemplateType || (exports.TemplateType = {}));
|
|
22
|
+
exports.DEFINITION_LINK_PREFIX = '#/definitions/';
|
|
23
|
+
/**
|
|
24
|
+
* Function returns annotation path for schema based on received params.
|
|
25
|
+
* @param entityTypeName - Entity type name.
|
|
26
|
+
* @param term - Annotation term.
|
|
27
|
+
* @param qualifier - Annotation qualifier.
|
|
28
|
+
* @returns Annotation path based on received params
|
|
29
|
+
*/
|
|
30
|
+
exports.createAnnotationPath = (entityTypeName, term, qualifier) => {
|
|
31
|
+
let annotationPath = `/${entityTypeName}/@${term}`;
|
|
32
|
+
if (qualifier) {
|
|
33
|
+
annotationPath += `#${qualifier}`;
|
|
34
|
+
}
|
|
35
|
+
return annotationPath;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Parses, merges, and converts a list of annotation files with aid of tools from annotation-vocabularies-tools
|
|
39
|
+
* @param annotationFiles - The list of all annotation files, in JSON format
|
|
40
|
+
* @returns the complete service information
|
|
41
|
+
*/
|
|
42
|
+
function parseAndMergeAndConvert(annotationFiles, logger) {
|
|
43
|
+
const parseResult = [];
|
|
44
|
+
let converterOutput;
|
|
45
|
+
try {
|
|
46
|
+
if (annotationFiles) {
|
|
47
|
+
annotationFiles.forEach(function (annotationData) {
|
|
48
|
+
parseResult.push(edmx_parser_1.parse(annotationData.fileContent, annotationData.dataSourceUri));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (parseResult.length > 0) {
|
|
52
|
+
converterOutput = annotation_converter_1.convert(edmx_parser_1.merge(...parseResult));
|
|
53
|
+
}
|
|
54
|
+
if (logger && (converterOutput === null || converterOutput === void 0 ? void 0 : converterOutput.diagnostics)) {
|
|
55
|
+
for (const converterMessage of converterOutput.diagnostics) {
|
|
56
|
+
extensionLogger_1.log(logger, {
|
|
57
|
+
severity: "error" /* Error */,
|
|
58
|
+
message: converterMessage.message
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
extensionLogger_1.log(logger, {
|
|
65
|
+
severity: "error" /* Error */,
|
|
66
|
+
message: i18next_1.default.t('ANNOERR')
|
|
67
|
+
}, ...error);
|
|
68
|
+
}
|
|
69
|
+
return converterOutput;
|
|
70
|
+
}
|
|
71
|
+
exports.parseAndMergeAndConvert = parseAndMergeAndConvert;
|
|
72
|
+
exports.getAnnotationPropertyValue = (annotationProperty) => (annotationProperty === null || annotationProperty === void 0 ? void 0 : annotationProperty.value) || (annotationProperty === null || annotationProperty === void 0 ? void 0 : annotationProperty.path);
|
|
73
|
+
/**
|
|
74
|
+
* Checks for Common.Label and overwrites the label from it if present
|
|
75
|
+
* @param {PropertyAnnotations} annotations - property annotations
|
|
76
|
+
* @param {EntityType} entityType - entity type
|
|
77
|
+
* @param {string} label - label, to be actualized
|
|
78
|
+
*/
|
|
79
|
+
function evaluateCommonLabel(annotations, entityType, label) {
|
|
80
|
+
var _a, _b, _c, _d;
|
|
81
|
+
if ((_a = annotations === null || annotations === void 0 ? void 0 : annotations.Common) === null || _a === void 0 ? void 0 : _a.Label) {
|
|
82
|
+
if (typeof annotations.Common.Label === 'string') {
|
|
83
|
+
label = annotations.Common.Label;
|
|
84
|
+
}
|
|
85
|
+
else if (annotations.Common.Label['type'] === 'Path') {
|
|
86
|
+
const targetProperty = entityType.resolvePath(annotations.Common.Label['path']);
|
|
87
|
+
if (targetProperty.value) {
|
|
88
|
+
label = targetProperty.value;
|
|
89
|
+
}
|
|
90
|
+
else if (typeof ((_b = targetProperty.Common) === null || _b === void 0 ? void 0 : _b.Label) === 'string') {
|
|
91
|
+
label = targetProperty.annotations.Common.Label;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (typeof ((_d = (_c = annotations.Common) === null || _c === void 0 ? void 0 : _c.Label) === null || _d === void 0 ? void 0 : _d.toString()) === 'string') {
|
|
95
|
+
label = annotations.Common.Label.toString();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return label;
|
|
99
|
+
}
|
|
100
|
+
exports.evaluateCommonLabel = evaluateCommonLabel;
|
|
101
|
+
/**
|
|
102
|
+
* Determines the label for a property path
|
|
103
|
+
* @param {PropertyPath} propertyPath - property path
|
|
104
|
+
* @param {EntityType} entityType - entity type
|
|
105
|
+
* @returns label, derived from Common.Label or from property value
|
|
106
|
+
*/
|
|
107
|
+
function getLabelForPropertyPath(propertyPath, entityType) {
|
|
108
|
+
let label = propertyPath.value;
|
|
109
|
+
if (propertyPath.$target) {
|
|
110
|
+
label = evaluateCommonLabel(propertyPath.$target.annotations, entityType, label);
|
|
111
|
+
}
|
|
112
|
+
return label;
|
|
113
|
+
}
|
|
114
|
+
exports.getLabelForPropertyPath = getLabelForPropertyPath;
|
|
115
|
+
/**
|
|
116
|
+
* Determines the label for a LineItem record
|
|
117
|
+
* @param {DataFieldAbstractType} field - Line item record
|
|
118
|
+
* @param {EntityType} entityType - entity type
|
|
119
|
+
* @returns label, derived from Common.Label or from property value
|
|
120
|
+
*/
|
|
121
|
+
function getLabelForDataField(field, entityType) {
|
|
122
|
+
var _a, _b;
|
|
123
|
+
let label, property;
|
|
124
|
+
if (field['Value']) {
|
|
125
|
+
if (typeof field['Value'] === 'string') {
|
|
126
|
+
property = entityType.entityProperties.find((ep) => ep.name === field['Value']);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
property = entityType.resolvePath(field['Value'].path);
|
|
130
|
+
if (!property) {
|
|
131
|
+
property = field['Value'].$target;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if (field['Target'] && field['Target'].$target && field['Target'].$target.Value) {
|
|
136
|
+
property = field['Target'].$target.Value.$target;
|
|
137
|
+
}
|
|
138
|
+
if ((_b = (_a = property === null || property === void 0 ? void 0 : property.annotations) === null || _a === void 0 ? void 0 : _a.Common) === null || _b === void 0 ? void 0 : _b.Label) {
|
|
139
|
+
label = evaluateCommonLabel(property.annotations, entityType, label);
|
|
140
|
+
}
|
|
141
|
+
return label;
|
|
142
|
+
}
|
|
143
|
+
exports.getLabelForDataField = getLabelForDataField;
|
|
144
|
+
/**
|
|
145
|
+
* Function to resolve the dataField label
|
|
146
|
+
* @param dataFieldLabel - Given dataField label; might be of type string, or an object in case of a path reference
|
|
147
|
+
* @param entityType - the entity type as part of the AVT ConvertedMetadata
|
|
148
|
+
* @returns undefined or the right string value
|
|
149
|
+
*/
|
|
150
|
+
function getLabel(dataFieldLabel, entityType) {
|
|
151
|
+
var _a, _b;
|
|
152
|
+
if (typeof dataFieldLabel === 'string') {
|
|
153
|
+
return dataFieldLabel;
|
|
154
|
+
}
|
|
155
|
+
else if (typeof dataFieldLabel === 'object' && dataFieldLabel.path) {
|
|
156
|
+
const property = entityType.resolvePath(dataFieldLabel.path);
|
|
157
|
+
if (!property || property.length === 0) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
const singleProperty = property[0];
|
|
162
|
+
if ((_b = (_a = singleProperty === null || singleProperty === void 0 ? void 0 : singleProperty.annotations) === null || _a === void 0 ? void 0 : _a.Common) === null || _b === void 0 ? void 0 : _b.Label) {
|
|
163
|
+
const label = dataFieldLabel;
|
|
164
|
+
return evaluateCommonLabel(singleProperty.annotations, entityType, label);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function getTitleForDataField(dataField, entityType, dataFieldLabel) {
|
|
173
|
+
const propertyCommonLabel = getLabelForDataField(dataField, entityType);
|
|
174
|
+
return (dataFieldLabel ||
|
|
175
|
+
propertyCommonLabel ||
|
|
176
|
+
(dataField.Value.$target ? dataField.Value.$target.name : dataField.Value.value || dataField.Value.path));
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Determines the description of a data field, e.g. for the column header
|
|
180
|
+
* @param dataFieldAbstract - the given record of the line item annotation
|
|
181
|
+
* @param entityType - the entity type as part of the AVT ConvertedMetadata
|
|
182
|
+
*/
|
|
183
|
+
function getDataFieldDescription(dataFieldAbstract, entityType) {
|
|
184
|
+
let title = '', propertyCommonLabel, dataField;
|
|
185
|
+
const dataFieldLabel = getLabel(dataFieldAbstract.Label, entityType);
|
|
186
|
+
switch (dataFieldAbstract.$Type) {
|
|
187
|
+
case "com.sap.vocabularies.UI.v1.DataField" /* DataField */:
|
|
188
|
+
dataField = dataFieldAbstract;
|
|
189
|
+
title = getTitleForDataField(dataField, entityType, dataFieldLabel);
|
|
190
|
+
break;
|
|
191
|
+
case "com.sap.vocabularies.UI.v1.DataFieldWithUrl" /* DataFieldWithUrl */:
|
|
192
|
+
dataField = dataFieldAbstract;
|
|
193
|
+
propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
|
|
194
|
+
title =
|
|
195
|
+
dataFieldLabel ||
|
|
196
|
+
propertyCommonLabel ||
|
|
197
|
+
(typeof dataField.Value === 'string' ? dataField.Value : dataField.Value.path);
|
|
198
|
+
break;
|
|
199
|
+
case "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* DataFieldForAnnotation */:
|
|
200
|
+
dataField = dataFieldAbstract;
|
|
201
|
+
propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
|
|
202
|
+
title = dataFieldLabel || propertyCommonLabel || dataField.Target.$target.Title || dataField.Target.value;
|
|
203
|
+
break;
|
|
204
|
+
case "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */:
|
|
205
|
+
case "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* DataFieldForIntentBasedNavigation */:
|
|
206
|
+
dataField = dataFieldAbstract;
|
|
207
|
+
if (dataFieldLabel) {
|
|
208
|
+
title = typeof dataFieldLabel === 'string' ? dataFieldLabel : dataField.Action;
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
title = dataFieldAbstract.Action;
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
214
|
+
case "com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation" /* DataFieldWithIntentBasedNavigation */:
|
|
215
|
+
dataField = dataFieldAbstract;
|
|
216
|
+
propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
|
|
217
|
+
title = propertyCommonLabel || dataField.Value.path;
|
|
218
|
+
break;
|
|
219
|
+
case "com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath" /* DataFieldWithNavigationPath */:
|
|
220
|
+
dataField = dataFieldAbstract;
|
|
221
|
+
title = getTitleForDataField(dataField, entityType, dataFieldLabel);
|
|
222
|
+
break;
|
|
223
|
+
default:
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
return title;
|
|
227
|
+
}
|
|
228
|
+
exports.getDataFieldDescription = getDataFieldDescription;
|
|
229
|
+
/**
|
|
230
|
+
* Prepare string for reference use in schema
|
|
231
|
+
* @param refInput string to be character checked and replaced
|
|
232
|
+
* @returns string with replaced characters
|
|
233
|
+
*/
|
|
234
|
+
function prepareRef(refInput) {
|
|
235
|
+
return refInput.replace('#', '::').replace(/\//g, ':2f');
|
|
236
|
+
}
|
|
237
|
+
exports.prepareRef = prepareRef;
|
|
238
|
+
/**
|
|
239
|
+
* Return the page type for a given V2 page in manifest
|
|
240
|
+
* @param name - page component name
|
|
241
|
+
*/
|
|
242
|
+
function getPageTypeV2(name) {
|
|
243
|
+
if (name) {
|
|
244
|
+
const templatePart = `${ux_specification_types_1.v2.FE_TEMPLATE_V2}.`;
|
|
245
|
+
return name.split(templatePart)[1];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
exports.getPageTypeV2 = getPageTypeV2;
|
|
249
|
+
/**
|
|
250
|
+
* Return the page type for a given V4 page in manifest
|
|
251
|
+
* @param name - page component name
|
|
252
|
+
*/
|
|
253
|
+
function getPageTypeV4(v4App) {
|
|
254
|
+
var _a;
|
|
255
|
+
if (v4App.name && v4App.name !== ux_specification_types_1.v4.FE_TEMPLATE_V4_CUSTOM_PAGE) {
|
|
256
|
+
const templatePart = `${ux_specification_types_1.v4.FE_TEMPLATE_V4}.`;
|
|
257
|
+
return v4App.name.split(templatePart)[1];
|
|
258
|
+
}
|
|
259
|
+
else if (((_a = v4App) === null || _a === void 0 ? void 0 : _a.name) === ux_specification_types_1.v4.FE_TEMPLATE_V4_CUSTOM_PAGE ||
|
|
260
|
+
v4App.viewId ||
|
|
261
|
+
v4App.viewName) {
|
|
262
|
+
return ux_specification_types_1.PageTypeV4.CustomPage;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
exports.getPageTypeV4 = getPageTypeV4;
|
|
266
|
+
function getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys = false) {
|
|
267
|
+
const termWithQualifier = `${targetAnnotation.term}#${targetAnnotation.qualifier}`;
|
|
268
|
+
return `${!keyForRelatedFacetKeys ? '@' : ''}${targetAnnotation.qualifier ? termWithQualifier : targetAnnotation.term}`;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Finds the alias for a given namespace in the references' section of the converted service metadata
|
|
272
|
+
* @param {string} namespace - complete namespace, e.g. 'com.sap.vocabularies.UI.v1'
|
|
273
|
+
* @param {ConvertedMetadata} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
|
|
274
|
+
* @returns alias for the given namespace
|
|
275
|
+
*/
|
|
276
|
+
function findAlias(namespace, oDataServiceAVT) {
|
|
277
|
+
let aliasReference = oDataServiceAVT === null || oDataServiceAVT === void 0 ? void 0 : oDataServiceAVT.references.find((reference) => {
|
|
278
|
+
return reference.namespace === namespace;
|
|
279
|
+
});
|
|
280
|
+
if (!aliasReference) {
|
|
281
|
+
aliasReference = oDataServiceAVT.references.find((reference) => {
|
|
282
|
+
return reference.alias === namespace;
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
if (!aliasReference) {
|
|
286
|
+
aliasReference = oDataServiceAVT.references.find((reference) => {
|
|
287
|
+
return (reference.alias.toUpperCase() ===
|
|
288
|
+
namespace.split('SAP__')[namespace.split('SAP__').length - 1].toUpperCase());
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
return aliasReference === null || aliasReference === void 0 ? void 0 : aliasReference.alias;
|
|
292
|
+
}
|
|
293
|
+
exports.findAlias = findAlias;
|
|
294
|
+
/**
|
|
295
|
+
* Determines the target annotation
|
|
296
|
+
* @param navigationParts - parts of the target annotation path
|
|
297
|
+
* @param entityType - entity type
|
|
298
|
+
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
299
|
+
* @returns the target annotation
|
|
300
|
+
*/
|
|
301
|
+
function determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT) {
|
|
302
|
+
var _a;
|
|
303
|
+
const lastNavigationPart = navigationParts[navigationParts.length - 1];
|
|
304
|
+
const annotation = lastNavigationPart.substring(lastNavigationPart.lastIndexOf('.') + 1, lastNavigationPart.length);
|
|
305
|
+
const alias = findAlias(lastNavigationPart.substring(0, lastNavigationPart.lastIndexOf('.')).replace('@', ''), oDataServiceAVT);
|
|
306
|
+
return (_a = entityType === null || entityType === void 0 ? void 0 : entityType.annotations[alias]) === null || _a === void 0 ? void 0 : _a[annotation];
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Adjust key by considering navigation
|
|
310
|
+
* @param key - given key
|
|
311
|
+
* @param keyForRelatedFacetKeys - construct key for 'keyForRelatedFacetKeys' property(used to define custom sections) - we should not add '@' symbol there.
|
|
312
|
+
* @param navigationParts - parts of the target annotation path
|
|
313
|
+
*/
|
|
314
|
+
function adjustKey(key, navigationParts, keyForRelatedFacetKeys) {
|
|
315
|
+
const uiClass = navigationParts[navigationParts.length - 1].split('#')[0];
|
|
316
|
+
if (uiClass.includes('.LineItem')) {
|
|
317
|
+
const pathParts = key.split('::');
|
|
318
|
+
pathParts[pathParts.length - 1] = `${!keyForRelatedFacetKeys ? '@' : ''}${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`;
|
|
319
|
+
key = pathParts.join('::');
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
key = uiClass.replace('@UI', `${!keyForRelatedFacetKeys ? '@' : ''}com.sap.vocabularies.UI.v1`);
|
|
323
|
+
}
|
|
324
|
+
return key;
|
|
325
|
+
}
|
|
326
|
+
function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
|
|
327
|
+
var _a;
|
|
328
|
+
let stopProcessing = false;
|
|
329
|
+
const navigationParts = propertyValue.split('/');
|
|
330
|
+
const navigation = navigationParts.length > 1;
|
|
331
|
+
if (navigation) {
|
|
332
|
+
entityType = (_a = entityType.resolvePath(propertyValue.substring(0, propertyValue.lastIndexOf('/')))) === null || _a === void 0 ? void 0 : _a.targetType;
|
|
333
|
+
}
|
|
334
|
+
key = adjustKey(key, navigationParts, keyForRelatedFacetKeys);
|
|
335
|
+
const targetAnnotation = determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT);
|
|
336
|
+
if (targetAnnotation) {
|
|
337
|
+
const separator = oDataVersion === ux_specification_types_1.FioriElementsVersion.v2 ? '::' : '#';
|
|
338
|
+
key = getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys).replace('#', separator);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
stopProcessing = true;
|
|
342
|
+
return { key, entityType, stopProcessing };
|
|
343
|
+
}
|
|
344
|
+
if (navigation) {
|
|
345
|
+
const navSeparator = oDataVersion === ux_specification_types_1.FioriElementsVersion.v2 ? '::' : '/';
|
|
346
|
+
navigationParts.pop();
|
|
347
|
+
const navigationIDs = [...navigationParts].join(navSeparator);
|
|
348
|
+
key = `${navigationIDs}${navSeparator}${key}`;
|
|
349
|
+
}
|
|
350
|
+
return { key, entityType, stopProcessing };
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Resolve page section(get key and label->description).
|
|
354
|
+
* @param facetDefinition - the actual annotation record
|
|
355
|
+
* @param keyForRelatedFacetKeys - construct key for 'keyForRelatedFacetKeys' property(used to define custom sections) - we should not add '@' symbol there.
|
|
356
|
+
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
357
|
+
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
358
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
359
|
+
* @returns {FacetSection} - object comprising the relevant facet information
|
|
360
|
+
*/
|
|
361
|
+
function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
|
|
362
|
+
//Take facet ID as fallback
|
|
363
|
+
const facetName = facetDefinition.fullyQualifiedName.substring(facetDefinition.fullyQualifiedName.lastIndexOf('@'));
|
|
364
|
+
let key = facetDefinition.ID ? facetDefinition.ID.toString() : facetName;
|
|
365
|
+
let entityType = sourceEntityType; //default
|
|
366
|
+
//If reference facet: overwrite with target annotation if present
|
|
367
|
+
if (facetDefinition.$Type !== "com.sap.vocabularies.UI.v1.CollectionFacet" /* CollectionFacet */ && 'Target' in facetDefinition) {
|
|
368
|
+
const propertyValue = exports.getAnnotationPropertyValue(facetDefinition.Target);
|
|
369
|
+
if (!propertyValue) {
|
|
370
|
+
extensionLogger_1.log(logger, {
|
|
371
|
+
severity: "error" /* Error */,
|
|
372
|
+
message: i18next_1.default.t('NOTARGET', { target: facetDefinition.Target })
|
|
373
|
+
});
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
const { key: newKey, entityType: newEntityType, stopProcessing } = getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion, keyForRelatedFacetKeys);
|
|
377
|
+
if (stopProcessing) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
key = newKey;
|
|
381
|
+
entityType = newEntityType;
|
|
382
|
+
}
|
|
383
|
+
key = key.replace(/\//gi, '::');
|
|
384
|
+
return key
|
|
385
|
+
? Object.assign(Object.assign(Object.assign({ key }, (facetDefinition.Label && { label: facetDefinition.Label.toString() })), (facetDefinition.ID && { ID: facetDefinition.ID.toString() })), { entityType }) : undefined;
|
|
386
|
+
}
|
|
387
|
+
exports.getSectionFacet = getSectionFacet;
|
|
388
|
+
/**
|
|
389
|
+
* Finds the alias for a given namespace in the references' section of the converted service metadata.
|
|
390
|
+
* An empty object is created if the path element does not exist yet.
|
|
391
|
+
* Exception: if an empty array is the next element of the 'path' definition, an empty array is created instead of an empty object.
|
|
392
|
+
* @param {object} manifest - manifest that is being modified during export
|
|
393
|
+
* @param {string} path - path of the property in the manifest
|
|
394
|
+
* @param {string} targetAnnotation - target annotation (optional)
|
|
395
|
+
* @param {string} targetAnnotationEncoded - target annotation in its encoded form, as used in manifest settings
|
|
396
|
+
* @param {boolean} importScenario - indicates if the function is called for the import, else it is the export
|
|
397
|
+
* @returns returns section of the manifest based on path, generates an empty object in case it does not exists
|
|
398
|
+
*/
|
|
399
|
+
exports.getManifestSectionByPathV4 = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
|
|
400
|
+
if (!path) {
|
|
401
|
+
return undefined;
|
|
402
|
+
}
|
|
403
|
+
let manifestSection = manifest;
|
|
404
|
+
const pathElements = path.split('/');
|
|
405
|
+
for (let index = 0; index < pathElements.length; index++) {
|
|
406
|
+
const element = pathElements[index];
|
|
407
|
+
if (element === '[]') {
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
const decodedElement = targetAnnotationEncoded && targetAnnotationEncoded === element
|
|
411
|
+
? targetAnnotation
|
|
412
|
+
: element.replace('??', '/');
|
|
413
|
+
//?? can be used in path functions to encode /
|
|
414
|
+
if (!manifestSection[decodedElement]) {
|
|
415
|
+
if (pathElements[index + 1] === '[]') {
|
|
416
|
+
manifestSection[decodedElement] = [];
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
manifestSection[decodedElement] = {};
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
manifestSection = manifestSection[decodedElement];
|
|
423
|
+
}
|
|
424
|
+
return manifestSection;
|
|
425
|
+
};
|
|
426
|
+
function getSchemaKeyOfLineItemRecord(lineItemRecord) {
|
|
427
|
+
let schemaKey, target, value;
|
|
428
|
+
switch (lineItemRecord.$Type) {
|
|
429
|
+
case "com.sap.vocabularies.UI.v1.DataField" /* DataField */:
|
|
430
|
+
schemaKey = exports.getAnnotationPropertyValue(lineItemRecord.Value);
|
|
431
|
+
break;
|
|
432
|
+
case "com.sap.vocabularies.UI.v1.DataFieldWithUrl" /* DataFieldWithUrl */:
|
|
433
|
+
schemaKey =
|
|
434
|
+
typeof lineItemRecord.Value === 'string'
|
|
435
|
+
? lineItemRecord.Value
|
|
436
|
+
: exports.getAnnotationPropertyValue(lineItemRecord.Value);
|
|
437
|
+
break;
|
|
438
|
+
case "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* DataFieldForAnnotation */:
|
|
439
|
+
target = lineItemRecord.Target.value;
|
|
440
|
+
if (target) {
|
|
441
|
+
schemaKey =
|
|
442
|
+
'DataFieldForAnnotation:::sTarget::' +
|
|
443
|
+
target
|
|
444
|
+
.replace('@UI', '@com.sap.vocabularies.UI.v1')
|
|
445
|
+
.replace('@Communication', '@com.sap.vocabularies.Communication.v1')
|
|
446
|
+
.replace('@Contact', '@com.sap.vocabularies.Contact.v1');
|
|
447
|
+
}
|
|
448
|
+
break;
|
|
449
|
+
case "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */:
|
|
450
|
+
if (lineItemRecord.Inline) {
|
|
451
|
+
schemaKey = `DataFieldForAction:::sAction::${prepareRef(lineItemRecord.Action)}`;
|
|
452
|
+
}
|
|
453
|
+
break;
|
|
454
|
+
case "com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation" /* DataFieldWithIntentBasedNavigation */:
|
|
455
|
+
value = exports.getAnnotationPropertyValue(lineItemRecord.Value);
|
|
456
|
+
schemaKey = `DataFieldWithIntentBasedNavigation:::sProperty::${value}:::sSemanticObject::${lineItemRecord.SemanticObject}:::sAction::${lineItemRecord.Action}`;
|
|
457
|
+
break;
|
|
458
|
+
case "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* DataFieldForIntentBasedNavigation */:
|
|
459
|
+
if (lineItemRecord.Inline) {
|
|
460
|
+
schemaKey = `DataFieldForIntentBasedNavigation:::sSemanticObject::${lineItemRecord.SemanticObject}:::sAction::${prepareRef(lineItemRecord.Action)}`;
|
|
461
|
+
}
|
|
462
|
+
break;
|
|
463
|
+
case "com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath" /* DataFieldWithNavigationPath */:
|
|
464
|
+
value = exports.getAnnotationPropertyValue(lineItemRecord.Value);
|
|
465
|
+
target = exports.getAnnotationPropertyValue(lineItemRecord.Target);
|
|
466
|
+
schemaKey = 'DataFieldWithNavigationPath:::sProperty::' + value + ':::sTarget::' + target;
|
|
467
|
+
break;
|
|
468
|
+
default:
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
return schemaKey;
|
|
472
|
+
}
|
|
473
|
+
exports.getSchemaKeyOfLineItemRecord = getSchemaKeyOfLineItemRecord;
|
|
474
|
+
/**
|
|
475
|
+
* Determines if type of given annotation term is of UIAnnotationTerm
|
|
476
|
+
* @param {string} path path in manifest
|
|
477
|
+
* @param {string} alias for a given namespace
|
|
478
|
+
* @param {EntityType} entityType - the entity type
|
|
479
|
+
* @returns UI annotation term type
|
|
480
|
+
*/
|
|
481
|
+
function getUIAnnotationTerm(path, alias, entityType) {
|
|
482
|
+
if (path.includes("com.sap.vocabularies.UI.v1.Chart" /* Chart */) || path.includes(alias + '.Chart')) {
|
|
483
|
+
return "com.sap.vocabularies.UI.v1.Chart" /* Chart */;
|
|
484
|
+
}
|
|
485
|
+
else if (path.includes("com.sap.vocabularies.UI.v1.Identification" /* Identification */) || path.includes(alias + '.Identification')) {
|
|
486
|
+
return "com.sap.vocabularies.UI.v1.Identification" /* Identification */;
|
|
487
|
+
}
|
|
488
|
+
else if ((entityType && path.includes("com.sap.vocabularies.UI.v1.LineItem" /* LineItem */)) || path.includes(alias + '.LineItem')) {
|
|
489
|
+
return "com.sap.vocabularies.UI.v1.LineItem" /* LineItem */;
|
|
490
|
+
}
|
|
491
|
+
else if (path.includes("com.sap.vocabularies.UI.v1.FieldGroup" /* FieldGroup */) || path.includes(alias + '.FieldGroup')) {
|
|
492
|
+
return "com.sap.vocabularies.UI.v1.FieldGroup" /* FieldGroup */;
|
|
493
|
+
}
|
|
494
|
+
else if (path.includes("com.sap.vocabularies.UI.v1.DataPoint" /* DataPoint */) || path.includes(alias + '.DataPoint')) {
|
|
495
|
+
return "com.sap.vocabularies.UI.v1.DataPoint" /* DataPoint */;
|
|
496
|
+
}
|
|
497
|
+
else if (path.includes("com.sap.vocabularies.UI.v1.PresentationVariant" /* PresentationVariant */) || path.includes(alias + '.PresentationVariant')) {
|
|
498
|
+
return "com.sap.vocabularies.UI.v1.PresentationVariant" /* PresentationVariant */;
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
return undefined;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Determines if type of given annotation term is of CommunicationAnnotationTerm
|
|
506
|
+
* @param {string} path path in manifest
|
|
507
|
+
* @param {string} alias for a given namespace
|
|
508
|
+
* @param {EntityType} entityType - the entity type
|
|
509
|
+
* @returns Communication annotation term type
|
|
510
|
+
*/
|
|
511
|
+
function getCommunicationAnnotationTerm(path, alias) {
|
|
512
|
+
if (path.includes('com.sap.vocabularies.Communication.v1.Contact') || path.includes(alias + '.Contact')) {
|
|
513
|
+
return "com.sap.vocabularies.Communication.v1.Contact" /* Contact */;
|
|
514
|
+
}
|
|
515
|
+
else if (path.includes('com.sap.vocabularies.Communication.v1.Address') || path.includes(alias + '.Address')) {
|
|
516
|
+
return "com.sap.vocabularies.Communication.v1.Address" /* Address */;
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
return undefined;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Determines the type of given annotation term
|
|
524
|
+
* @param {string} path path in manifest
|
|
525
|
+
* @param {string} alias for a given namespace
|
|
526
|
+
* @param {EntityType} entityType - the entity type
|
|
527
|
+
* @returns annotation term type
|
|
528
|
+
*/
|
|
529
|
+
function getAnnotationTerm(path, alias, entityType) {
|
|
530
|
+
return getUIAnnotationTerm(path, alias, entityType) || getCommunicationAnnotationTerm(path, alias);
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Evaluates the target annotation of a reference facet and actualizes the facets for the config
|
|
534
|
+
* @param {AnnotationTerm} annotationRecord - the actual annotation record
|
|
535
|
+
* @param {FacetConfigs} facets - list of facets in config format, to be updated
|
|
536
|
+
* @param {EntityType} entityType - the entity type
|
|
537
|
+
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
538
|
+
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
539
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
540
|
+
*/
|
|
541
|
+
function evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
542
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
543
|
+
const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
|
|
544
|
+
let path = section ? section.key : '';
|
|
545
|
+
const targetEntityType = section.entityType;
|
|
546
|
+
const annotationTerm = getAnnotationTerm(path, alias, entityType);
|
|
547
|
+
let annotation, targetAnnotation;
|
|
548
|
+
switch (annotationTerm) {
|
|
549
|
+
case "com.sap.vocabularies.UI.v1.Chart" /* Chart */: {
|
|
550
|
+
facets[path] = { base: types_1.FacetBase.Chart };
|
|
551
|
+
facets[path].target = (_a = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _a === void 0 ? void 0 : _a.$target;
|
|
552
|
+
facets[path].entityType = targetEntityType;
|
|
553
|
+
break;
|
|
554
|
+
}
|
|
555
|
+
case "com.sap.vocabularies.UI.v1.Identification" /* Identification */: {
|
|
556
|
+
annotation = path.split('.')[path.split('.').length - 1];
|
|
557
|
+
targetAnnotation = targetEntityType.annotations[alias][annotation];
|
|
558
|
+
facets[path] = { base: types_1.FacetBase.Identification };
|
|
559
|
+
facets[path].entityType = targetEntityType;
|
|
560
|
+
facets[path].target = targetAnnotation;
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
case "com.sap.vocabularies.UI.v1.LineItem" /* LineItem */: {
|
|
564
|
+
if (!path.includes("com.sap.vocabularies.UI.v1.LineItem" /* LineItem */) && path.includes('.LineItem')) {
|
|
565
|
+
const pathParts = path.split('::');
|
|
566
|
+
pathParts[pathParts.length - 1] = `@${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`;
|
|
567
|
+
path = pathParts.join('::');
|
|
568
|
+
}
|
|
569
|
+
facets[path] = { base: types_1.FacetBase.LineItem };
|
|
570
|
+
facets[path].target = (_b = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _b === void 0 ? void 0 : _b.$target;
|
|
571
|
+
facets[path].entityType = targetEntityType;
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
574
|
+
case "com.sap.vocabularies.UI.v1.FieldGroup" /* FieldGroup */: {
|
|
575
|
+
facets[path] = { base: types_1.FacetBase.Form };
|
|
576
|
+
facets[path].target = (_c = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _c === void 0 ? void 0 : _c.$target;
|
|
577
|
+
facets[path].entityType = targetEntityType;
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
case "com.sap.vocabularies.UI.v1.DataPoint" /* DataPoint */: {
|
|
581
|
+
facets[path] = { base: types_1.FacetBase.DataPoint };
|
|
582
|
+
facets[path].target = (_d = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _d === void 0 ? void 0 : _d.$target;
|
|
583
|
+
facets[path].entityType = targetEntityType;
|
|
584
|
+
facets[path].Label = (_e = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _e === void 0 ? void 0 : _e.$target['Title'];
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
587
|
+
case "com.sap.vocabularies.UI.v1.PresentationVariant" /* PresentationVariant */: {
|
|
588
|
+
facets[path] = { base: types_1.FacetBase.PresentationVariant };
|
|
589
|
+
facets[path].target = (_f = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _f === void 0 ? void 0 : _f.$target;
|
|
590
|
+
facets[path].entityType = targetEntityType;
|
|
591
|
+
break;
|
|
592
|
+
}
|
|
593
|
+
case "com.sap.vocabularies.Communication.v1.Contact" /* Contact */: {
|
|
594
|
+
facets[path] = { base: types_1.FacetBase.Contact };
|
|
595
|
+
facets[path].target = (_g = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _g === void 0 ? void 0 : _g.$target;
|
|
596
|
+
facets[path].entityType = targetEntityType;
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
599
|
+
case "com.sap.vocabularies.Communication.v1.Address" /* Address */: {
|
|
600
|
+
facets[path] = { base: types_1.FacetBase.Address };
|
|
601
|
+
facets[path].target = (_h = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _h === void 0 ? void 0 : _h.$target;
|
|
602
|
+
facets[path].entityType = targetEntityType;
|
|
603
|
+
break;
|
|
604
|
+
}
|
|
605
|
+
default: {
|
|
606
|
+
facets[path] = { base: types_1.FacetBase.Unknown };
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
if (facets[path]) {
|
|
610
|
+
facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies', types_1.VOCWITHSLASH)}`;
|
|
611
|
+
if (annotationRecord.Label) {
|
|
612
|
+
facets[path].Label = annotationRecord.Label;
|
|
613
|
+
}
|
|
614
|
+
// Add Facet ID
|
|
615
|
+
if (annotationRecord.ID) {
|
|
616
|
+
facets[path]['ID'] = annotationRecord.ID;
|
|
617
|
+
}
|
|
618
|
+
else if (oDataVersion === ux_specification_types_1.FioriElementsVersion.v4) {
|
|
619
|
+
extensionLogger_1.log(logger, {
|
|
620
|
+
severity: "error" /* Error */,
|
|
621
|
+
message: i18next_1.default.t('NOID4SECTION', { facet: annotationRecord.fullyQualifiedName })
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
if (section && section.entityType) {
|
|
625
|
+
facets[path].entityType = section.entityType;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Adds the information from facets to the config
|
|
631
|
+
* @param {AnnotationTerm} annotationRecord - the actual annotation record
|
|
632
|
+
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
633
|
+
* @param {string} serviceName - name of the service of the app
|
|
634
|
+
* @param {string} entityName - the entity (type) name
|
|
635
|
+
* @param {FacetConfigs} facets - list of facets in config format, to be updated
|
|
636
|
+
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
637
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
638
|
+
*/
|
|
639
|
+
function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
640
|
+
var _a;
|
|
641
|
+
const section = getSectionFacet(annotationRecord, entityType, oDataServiceAVT, logger, oDataVersion, false);
|
|
642
|
+
if (section) {
|
|
643
|
+
switch (annotationRecord.$Type) {
|
|
644
|
+
case "com.sap.vocabularies.UI.v1.ReferenceFacet" /* ReferenceFacet */: {
|
|
645
|
+
evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT, oDataVersion, logger);
|
|
646
|
+
break;
|
|
647
|
+
}
|
|
648
|
+
case "com.sap.vocabularies.UI.v1.CollectionFacet" /* CollectionFacet */: {
|
|
649
|
+
const annotationPath = `/${entityType.fullyQualifiedName}/${annotationRecord.fullyQualifiedName.split(entityType.fullyQualifiedName)[1]}`;
|
|
650
|
+
const facet = (facets[section.key] = {
|
|
651
|
+
base: types_1.FacetBase.CollectionFacet,
|
|
652
|
+
facets: {},
|
|
653
|
+
ID: section.ID,
|
|
654
|
+
annotationPath: annotationPath,
|
|
655
|
+
Label: section.label
|
|
656
|
+
});
|
|
657
|
+
(_a = annotationRecord.Facets) === null || _a === void 0 ? void 0 : _a.forEach((collectionItem) => {
|
|
658
|
+
addFacetToConfig(collectionItem, oDataServiceAVT, serviceName, entityType, facet.facets, oDataVersion, logger);
|
|
659
|
+
});
|
|
660
|
+
break;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Retrieve header facet configurations that can be used to generate ObjectPage schemas
|
|
667
|
+
* @param {QualifiedName} entityTypeName - the name of the actual entity type
|
|
668
|
+
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
669
|
+
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
670
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
671
|
+
*/
|
|
672
|
+
function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
673
|
+
const facets = {};
|
|
674
|
+
if (!entityType || !entityType.annotations) {
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
|
|
678
|
+
const facetAnnotation = alias && entityType.annotations[alias] && entityType.annotations[alias].HeaderFacets;
|
|
679
|
+
if (facetAnnotation) {
|
|
680
|
+
const lastDot = entityType.fullyQualifiedName.lastIndexOf('.');
|
|
681
|
+
const serviceName = entityType.fullyQualifiedName.substring(0, lastDot);
|
|
682
|
+
// Add facets to configuration
|
|
683
|
+
facetAnnotation.forEach((item) => {
|
|
684
|
+
addFacetToConfig(item, oDataServiceAVT, serviceName, entityType, facets, oDataVersion, logger);
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
return facets;
|
|
688
|
+
}
|
|
689
|
+
exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
|
|
690
|
+
/**
|
|
691
|
+
* Retrieve facet configurations that can be used to generate ObjectPage schemas
|
|
692
|
+
* @param {QualifiedName} entityTypeName - the name of the actual entity type
|
|
693
|
+
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
694
|
+
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
695
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
696
|
+
*/
|
|
697
|
+
function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
|
|
698
|
+
const facets = {};
|
|
699
|
+
if (!entityType || !entityType.annotations) {
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
|
|
703
|
+
const facetAnnotation = alias && entityType.annotations[alias] && entityType.annotations[alias].Facets;
|
|
704
|
+
if (facetAnnotation) {
|
|
705
|
+
const lastDot = entityType.fullyQualifiedName.lastIndexOf('.');
|
|
706
|
+
const serviceName = entityType.fullyQualifiedName.substring(0, lastDot);
|
|
707
|
+
// Add facets to configuration
|
|
708
|
+
facetAnnotation.forEach((item) => {
|
|
709
|
+
addFacetToConfig(item, oDataServiceAVT, serviceName, entityType, facets, oDataVersion, logger);
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
return facets;
|
|
713
|
+
}
|
|
714
|
+
exports.getObjectPageFacets = getObjectPageFacets;
|
|
715
|
+
/**
|
|
716
|
+
* Returns the version of Fiori elements (v2/v4) from a given manifest
|
|
717
|
+
* @param manifest - the manifest.json file
|
|
718
|
+
*/
|
|
719
|
+
function getVersionFromManifest(manifest) {
|
|
720
|
+
if (manifest[ux_specification_types_1.ManifestSection.generic] || manifest[ux_specification_types_1.ManifestSection.ovp]) {
|
|
721
|
+
return ux_specification_types_1.FioriElementsVersion.v2;
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
return ux_specification_types_1.FioriElementsVersion.v4;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
exports.getVersionFromManifest = getVersionFromManifest;
|
|
728
|
+
/**
|
|
729
|
+
* Determines the template type of a V2 app
|
|
730
|
+
* @param manifest - the manifest.json file
|
|
731
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
732
|
+
* @returns {TemplateType} the template type
|
|
733
|
+
*/
|
|
734
|
+
function determineV2Template(manifest, logger) {
|
|
735
|
+
let templateType;
|
|
736
|
+
if (manifest[ux_specification_types_1.ManifestSection.generic]) {
|
|
737
|
+
const v2Pages = manifest[ux_specification_types_1.ManifestSection.generic].pages;
|
|
738
|
+
if (!v2Pages) {
|
|
739
|
+
extensionLogger_1.log(logger, {
|
|
740
|
+
severity: "error" /* Error */,
|
|
741
|
+
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
742
|
+
location: {
|
|
743
|
+
path: types_1.MANIFESTPATH,
|
|
744
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
for (const pageKey in v2Pages) {
|
|
750
|
+
const v2Page = v2Pages[pageKey];
|
|
751
|
+
if (getPageTypeV2(v2Page.component.name) === ux_specification_types_1.PageType.AnalyticalListPage) {
|
|
752
|
+
templateType = TemplateType.AnalyticalListPageV2;
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
else if (getPageTypeV2(v2Page.component.name) === ux_specification_types_1.PageType.ListReport) {
|
|
756
|
+
templateType = TemplateType.ListReportObjectPageV2;
|
|
757
|
+
break;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
else {
|
|
762
|
+
if (!templateType) {
|
|
763
|
+
extensionLogger_1.log(logger, {
|
|
764
|
+
severity: "error" /* Error */,
|
|
765
|
+
message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.generic }),
|
|
766
|
+
location: {
|
|
767
|
+
path: types_1.MANIFESTPATH,
|
|
768
|
+
range: [ux_specification_types_1.ManifestSection.generic]
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return templateType;
|
|
774
|
+
}
|
|
775
|
+
exports.determineV2Template = determineV2Template;
|
|
776
|
+
/**
|
|
777
|
+
* Determines the template type of a V4 app
|
|
778
|
+
* @param manifest - the manifest.json file
|
|
779
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
780
|
+
* @returns {TemplateType} the template type
|
|
781
|
+
*/
|
|
782
|
+
function determineV4Template(manifest, logger) {
|
|
783
|
+
var _a, _b, _c, _d;
|
|
784
|
+
let templateType;
|
|
785
|
+
const v4Pages = manifest[ux_specification_types_1.ManifestSection.ui5].routing &&
|
|
786
|
+
manifest[ux_specification_types_1.ManifestSection.ui5].routing.targets;
|
|
787
|
+
if (!v4Pages) {
|
|
788
|
+
extensionLogger_1.log(logger, {
|
|
789
|
+
severity: "error" /* Error */,
|
|
790
|
+
message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
|
|
791
|
+
location: {
|
|
792
|
+
path: types_1.MANIFESTPATH,
|
|
793
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing']
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
for (const pageKey in v4Pages) {
|
|
799
|
+
const v4Page = v4Pages[pageKey];
|
|
800
|
+
const pageType = getPageTypeV4(v4Page);
|
|
801
|
+
if (pageType === ux_specification_types_1.PageTypeV4.AnalyticalListPage) {
|
|
802
|
+
templateType = TemplateType.AnalyticalListPageV4;
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
else if (pageType === ux_specification_types_1.PageTypeV4.ListReport) {
|
|
806
|
+
const viewPath = (_d = (_c = (_b = (_a = v4Page.options) === null || _a === void 0 ? void 0 : _a.settings) === null || _b === void 0 ? void 0 : _b.views) === null || _c === void 0 ? void 0 : _c.paths) === null || _d === void 0 ? void 0 : _d[0];
|
|
807
|
+
if (viewPath && (viewPath[ux_specification_types_1.ALPViewType.Primary] || viewPath[ux_specification_types_1.ALPViewType.Secondary])) {
|
|
808
|
+
templateType = TemplateType.AnalyticalListPageV4;
|
|
809
|
+
}
|
|
810
|
+
else {
|
|
811
|
+
templateType = TemplateType.ListReportObjectPageV4;
|
|
812
|
+
}
|
|
813
|
+
break;
|
|
814
|
+
}
|
|
815
|
+
else if (pageType === ux_specification_types_1.PageTypeV4.ObjectPage) {
|
|
816
|
+
templateType = TemplateType.ListReportObjectPageV4;
|
|
817
|
+
//fixed now for FEOP scenario, bit continue to check if LR/ALP exists
|
|
818
|
+
}
|
|
819
|
+
else if (pageType === ux_specification_types_1.PageTypeV4.CustomPage) {
|
|
820
|
+
templateType = TemplateType.FreestylePageV4;
|
|
821
|
+
break;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
if (!templateType) {
|
|
825
|
+
extensionLogger_1.log(logger, {
|
|
826
|
+
severity: "error" /* Error */,
|
|
827
|
+
message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.ui5 }),
|
|
828
|
+
location: {
|
|
829
|
+
path: types_1.MANIFESTPATH,
|
|
830
|
+
range: [ux_specification_types_1.ManifestSection.ui5, 'routing', 'targets']
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
return templateType;
|
|
835
|
+
}
|
|
836
|
+
exports.determineV4Template = determineV4Template;
|
|
837
|
+
/**
|
|
838
|
+
* Determines the template type, based on the given manifest entries of the app
|
|
839
|
+
* @param manifest - the manifest.json file
|
|
840
|
+
* @param {FioriElementsVersion} fioriElementsVersion - OData or FE version
|
|
841
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
842
|
+
* @returns {TemplateType} the template type
|
|
843
|
+
*/
|
|
844
|
+
function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
|
|
845
|
+
let templateType;
|
|
846
|
+
if (manifest[ux_specification_types_1.ManifestSection.ovp]) {
|
|
847
|
+
templateType = TemplateType.OverviewPageV2;
|
|
848
|
+
}
|
|
849
|
+
else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v2) {
|
|
850
|
+
templateType = determineV2Template(manifest, logger);
|
|
851
|
+
}
|
|
852
|
+
else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v4) {
|
|
853
|
+
templateType = determineV4Template(manifest, logger);
|
|
854
|
+
}
|
|
855
|
+
else {
|
|
856
|
+
if (!templateType) {
|
|
857
|
+
extensionLogger_1.log(logger, {
|
|
858
|
+
severity: "error" /* Error */,
|
|
859
|
+
message: i18next_1.default.t('NOFE'),
|
|
860
|
+
location: {
|
|
861
|
+
path: types_1.MANIFESTPATH
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
return templateType;
|
|
867
|
+
}
|
|
868
|
+
exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
|
|
869
|
+
/**
|
|
870
|
+
* Adds title and description to a section or header section in an app schema
|
|
871
|
+
* @param facet - intermediate facet structure comprising annotation information
|
|
872
|
+
* @param section - section in the app schema
|
|
873
|
+
* @param facetKey - key of the facet
|
|
874
|
+
*/
|
|
875
|
+
function addSectionTitleAndDescription(facet, section, facetKey) {
|
|
876
|
+
if (facet === null || facet === void 0 ? void 0 : facet.ID) {
|
|
877
|
+
section.title = types_1.FacetTitlePrefix + facet.ID;
|
|
878
|
+
}
|
|
879
|
+
else {
|
|
880
|
+
section.title = facetKey.replace(/@com.sap/g, 'com.sap');
|
|
881
|
+
}
|
|
882
|
+
// Description
|
|
883
|
+
if (facet === null || facet === void 0 ? void 0 : facet.Label) {
|
|
884
|
+
section.description = facet.Label;
|
|
885
|
+
}
|
|
886
|
+
else if (facet === null || facet === void 0 ? void 0 : facet.ID) {
|
|
887
|
+
section.description = facet.ID;
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
section.description = facetKey.substring(facetKey.lastIndexOf('.') + 1);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
894
|
+
/**
|
|
895
|
+
* Adds target title or description to a section or header section in an app schema
|
|
896
|
+
* @param facet - intermediate facet structure comprising annotation information
|
|
897
|
+
* @param section - section in the app schema
|
|
898
|
+
* @param facetKey - key of the facet
|
|
899
|
+
*/
|
|
900
|
+
function addTargetTitleAndSectionDescription(facet, section, facetKey) {
|
|
901
|
+
var _a;
|
|
902
|
+
addSectionTitleAndDescription(facet, section, facetKey);
|
|
903
|
+
if (facet === null || facet === void 0 ? void 0 : facet.Label) {
|
|
904
|
+
section.description = facet === null || facet === void 0 ? void 0 : facet.Label;
|
|
905
|
+
}
|
|
906
|
+
else if (facet === null || facet === void 0 ? void 0 : facet['Title']) {
|
|
907
|
+
section.description = facet['Title'];
|
|
908
|
+
}
|
|
909
|
+
else if ((_a = facet === null || facet === void 0 ? void 0 : facet.target) === null || _a === void 0 ? void 0 : _a['Title']) {
|
|
910
|
+
section.description = facet.target['Title'];
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
|
|
914
|
+
/**
|
|
915
|
+
* Creates a default object for a new section or subsection, and adds the ID as title if present.
|
|
916
|
+
* @param facet Facet configuration, to be analyzed
|
|
917
|
+
* @returns the new section object
|
|
918
|
+
*/
|
|
919
|
+
function createDefaultSection(appSchema, facet, facetKey) {
|
|
920
|
+
if (!facet) {
|
|
921
|
+
return undefined;
|
|
922
|
+
}
|
|
923
|
+
let section;
|
|
924
|
+
if (appSchema.definitions.ObjectPageSection) {
|
|
925
|
+
//base type in V2, with properties
|
|
926
|
+
section = JSON.parse(JSON.stringify(appSchema.definitions.ObjectPageSection));
|
|
927
|
+
}
|
|
928
|
+
else {
|
|
929
|
+
section = {
|
|
930
|
+
type: 'object',
|
|
931
|
+
properties: {},
|
|
932
|
+
additionalProperties: false
|
|
933
|
+
};
|
|
934
|
+
section[types_1.SchemaTag.isViewNode] = true;
|
|
935
|
+
}
|
|
936
|
+
section[types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
937
|
+
addSectionTitleAndDescription(facet, section, facetKey);
|
|
938
|
+
return section;
|
|
939
|
+
}
|
|
940
|
+
exports.createDefaultSection = createDefaultSection;
|
|
941
|
+
/**
|
|
942
|
+
* Retrieve page section data(so far id/key and label/description).
|
|
943
|
+
* @param {EntityType} entityType The actual entityType
|
|
944
|
+
* @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
|
|
945
|
+
* @param {ExtensionLogger} logger - Logger class for logging messages
|
|
946
|
+
* @param {FioriElementsVersion} oDataVersion - OData version
|
|
947
|
+
* @param {boolean} [checkUnresolvableFacets=false] - Check and avoid facets and sections without ID and Target.
|
|
948
|
+
* @returns {FacetSection[]} - Array of facets or sections
|
|
949
|
+
*/
|
|
950
|
+
function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, checkUnresolvableFacets = false) {
|
|
951
|
+
const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
|
|
952
|
+
let sections = [];
|
|
953
|
+
if (entityType) {
|
|
954
|
+
const facetAnnotation = alias && entityType.annotations && entityType.annotations[alias] && entityType.annotations[alias].Facets;
|
|
955
|
+
if (facetAnnotation) {
|
|
956
|
+
sections = facetAnnotation.reduce(function (result, item) {
|
|
957
|
+
if (checkUnresolvableFacets && !item['ID'] && !('Target' in item && item['Target'])) {
|
|
958
|
+
return result;
|
|
959
|
+
}
|
|
960
|
+
const section = getSectionFacet(item, entityType, oDataServiceAVT, logger, oDataVersion, true);
|
|
961
|
+
if (section) {
|
|
962
|
+
result.push(section);
|
|
963
|
+
}
|
|
964
|
+
return result;
|
|
965
|
+
}, sections);
|
|
966
|
+
}
|
|
967
|
+
return sections;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
971
|
+
/**
|
|
972
|
+
* Cleans empty sub-structures from the export result for manifest
|
|
973
|
+
* @param manifest - manifest.json part of the export result
|
|
974
|
+
* @param path - path in the manifest
|
|
975
|
+
* @param targetAnnotation - target annotation (optional, in case of sections, subsections)
|
|
976
|
+
* @param targetAnnotationEncoded - encoded version of the target annotation, as represented in the manifest
|
|
977
|
+
*/
|
|
978
|
+
exports.deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
|
|
979
|
+
if (!path) {
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
let manifestSection = manifest;
|
|
983
|
+
const pathArray = path.split('/');
|
|
984
|
+
pathArray.forEach(function (element) {
|
|
985
|
+
const decodedElement = targetAnnotationEncoded && targetAnnotationEncoded === element
|
|
986
|
+
? targetAnnotation
|
|
987
|
+
: element.replace('??', '/');
|
|
988
|
+
if (!manifestSection[decodedElement]) {
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
if (Object.keys(manifestSection[decodedElement]).length === 0) {
|
|
992
|
+
if (Array.isArray(manifestSection)) {
|
|
993
|
+
manifestSection.splice(Number(decodedElement), 1);
|
|
994
|
+
}
|
|
995
|
+
else {
|
|
996
|
+
delete manifestSection[decodedElement];
|
|
997
|
+
}
|
|
998
|
+
pathArray.pop();
|
|
999
|
+
exports.deleteEmptyStructure(manifest, pathArray.join('/'), targetAnnotation, targetAnnotationEncoded);
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
manifestSection = manifestSection && manifestSection[decodedElement];
|
|
1003
|
+
});
|
|
1004
|
+
};
|
|
1005
|
+
/**
|
|
1006
|
+
* Method which returns generic schema file name.
|
|
1007
|
+
* @param {SchemaType | PageType} schemaType Schema type or Page type.
|
|
1008
|
+
* @return {string} File name of generic schema.
|
|
1009
|
+
*/
|
|
1010
|
+
const getGenericSchemaFileName = (schemaType) => {
|
|
1011
|
+
if (schemaType === ux_specification_types_1.SchemaType.FreestylePage) {
|
|
1012
|
+
return ux_specification_types_1.PageType.CustomPage;
|
|
1013
|
+
}
|
|
1014
|
+
return `${schemaType}`;
|
|
1015
|
+
};
|
|
1016
|
+
/**
|
|
1017
|
+
* Method which returns schema file name and path depending on passed schema or page type.
|
|
1018
|
+
* @param {SchemaType | PageType} schemaType Schema type or Page type.
|
|
1019
|
+
* @param {string} [entitySet] Entity set string.
|
|
1020
|
+
* @return {SchemaFilePath} File path info.
|
|
1021
|
+
*/
|
|
1022
|
+
exports.getSchemaFilePath = (schemaType, entitySet) => {
|
|
1023
|
+
const schemaFile = {
|
|
1024
|
+
filename: '',
|
|
1025
|
+
path: ''
|
|
1026
|
+
};
|
|
1027
|
+
switch (schemaType) {
|
|
1028
|
+
// Application schema
|
|
1029
|
+
case ux_specification_types_1.SchemaType.Application: {
|
|
1030
|
+
// File name
|
|
1031
|
+
schemaFile.filename = `App`;
|
|
1032
|
+
// Full path
|
|
1033
|
+
schemaFile.path = `./${types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1034
|
+
break;
|
|
1035
|
+
}
|
|
1036
|
+
// List report and object page
|
|
1037
|
+
case ux_specification_types_1.SchemaType.ListReport:
|
|
1038
|
+
case ux_specification_types_1.SchemaType.ObjectPage: {
|
|
1039
|
+
// File name
|
|
1040
|
+
schemaFile.filename = entitySet ? `${schemaType}_${entitySet}` : getGenericSchemaFileName(schemaType);
|
|
1041
|
+
// Full path
|
|
1042
|
+
schemaFile.path = `../${types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1043
|
+
break;
|
|
1044
|
+
}
|
|
1045
|
+
// Other page configs
|
|
1046
|
+
default: {
|
|
1047
|
+
// File name
|
|
1048
|
+
schemaFile.filename = getGenericSchemaFileName(schemaType);
|
|
1049
|
+
// Full path
|
|
1050
|
+
schemaFile.path = `../${types_1.DirName.Schemas}/${schemaFile.filename}`;
|
|
1051
|
+
break;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
schemaFile.path += '.json';
|
|
1055
|
+
return schemaFile;
|
|
1056
|
+
};
|
|
1057
|
+
/**
|
|
1058
|
+
* Method which generates id of page according to passed parameters.
|
|
1059
|
+
* @param appVersion - Fiori Elements version - V2 or V4.
|
|
1060
|
+
* @param pageType - Page type.
|
|
1061
|
+
* @param entitySet - Entity Set.
|
|
1062
|
+
* @param viewId - Custom page's viewId (optional).
|
|
1063
|
+
* @returns {string} Generated page id
|
|
1064
|
+
*/
|
|
1065
|
+
function generatePageId(pageType, entitySet, viewId) {
|
|
1066
|
+
if (pageType === ux_specification_types_1.PageType.CustomPage) {
|
|
1067
|
+
const names = viewId && viewId.split('.');
|
|
1068
|
+
return names && names[names.length - 1] + 'Page';
|
|
1069
|
+
}
|
|
1070
|
+
const parts = [];
|
|
1071
|
+
parts.push(pageType);
|
|
1072
|
+
if (entitySet) {
|
|
1073
|
+
parts.push(entitySet);
|
|
1074
|
+
}
|
|
1075
|
+
return parts.join('_');
|
|
1076
|
+
}
|
|
1077
|
+
exports.generatePageId = generatePageId;
|
|
1078
|
+
function fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray) {
|
|
1079
|
+
const $ref = element.$ref;
|
|
1080
|
+
if ($ref) {
|
|
1081
|
+
const definitionKey = $ref.split(exports.DEFINITION_LINK_PREFIX)[1];
|
|
1082
|
+
if (appSchema.definitions[definitionKey]) {
|
|
1083
|
+
const controlProperty = appSchema.definitions[definitionKey]['controlProperty'];
|
|
1084
|
+
if ($ref.includes(currentConfigObject[controlProperty])) {
|
|
1085
|
+
definitionArray.push(definitionKey);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* Fills an array of next definitions from given references in the JSON schema
|
|
1092
|
+
* @param propertyDefinition - Definition of the current property in schema
|
|
1093
|
+
* @param currentConfigObject - Current object in the config JSON. Evaluated to get the right value of a controlling property,
|
|
1094
|
+
* for making the right choice in case of multiple options (anyOf)
|
|
1095
|
+
* @param appSchema - app-specific JSON schema
|
|
1096
|
+
* @returns an array of definitions to proceed with
|
|
1097
|
+
*/
|
|
1098
|
+
function fillArrayFromPropertyDefinition(propertyDefinition, currentConfigObject, appSchema) {
|
|
1099
|
+
const definitionArray = [];
|
|
1100
|
+
if (propertyDefinition.$ref) {
|
|
1101
|
+
definitionArray.push(propertyDefinition.$ref.split(exports.DEFINITION_LINK_PREFIX)[1]);
|
|
1102
|
+
}
|
|
1103
|
+
else if (propertyDefinition.anyOf) {
|
|
1104
|
+
if (currentConfigObject) {
|
|
1105
|
+
propertyDefinition.anyOf.forEach((element) => {
|
|
1106
|
+
fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray);
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
if (definitionArray.length === 0) {
|
|
1110
|
+
return undefined;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
return definitionArray;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Determines the next definition to be handled, based on the definition array.
|
|
1117
|
+
* It also creates the Metadata instance for the next definition, to subsequently access metadata like the syncRule
|
|
1118
|
+
* @param definitionArray - Array of definitions, as determined by fillArrayFromNextDefinition
|
|
1119
|
+
* @param appSchema - app-specific JSON schema
|
|
1120
|
+
* @param title - default title
|
|
1121
|
+
* @param currentConfigObject - Current object in the config JSON.
|
|
1122
|
+
* @param key - actual key
|
|
1123
|
+
* @param {MetadataInstanceInterface} factory - factory for creating metadata instances
|
|
1124
|
+
* @param pageType - page type
|
|
1125
|
+
* @param propertyDefinition - Definition of the current property in schema
|
|
1126
|
+
* @returns {NextDefinition} - Next target definition to process
|
|
1127
|
+
*/
|
|
1128
|
+
function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition) {
|
|
1129
|
+
var _a, _b, _c, _d;
|
|
1130
|
+
let nextDefinition = {
|
|
1131
|
+
configObject: undefined,
|
|
1132
|
+
targetDefinition: {},
|
|
1133
|
+
title: ''
|
|
1134
|
+
};
|
|
1135
|
+
if (definitionArray.length) {
|
|
1136
|
+
const lastDefinition = definitionArray[definitionArray.length - 1];
|
|
1137
|
+
nextDefinition.targetDefinition = appSchema['definitions'][lastDefinition];
|
|
1138
|
+
if (((_a = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _a === void 0 ? void 0 : _a['$ref']) || ((_b = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _b === void 0 ? void 0 : _b['type']) === 'array') {
|
|
1139
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1140
|
+
nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, nextDefinition.targetDefinition, key, factory, pageType);
|
|
1141
|
+
return nextDefinition;
|
|
1142
|
+
}
|
|
1143
|
+
if (definitionArray.length > 1) {
|
|
1144
|
+
definitionArray.forEach((element) => {
|
|
1145
|
+
if (element !== '') {
|
|
1146
|
+
nextDefinition.targetDefinition['properties'] = Object.assign(Object.assign({}, nextDefinition.targetDefinition['properties']), appSchema['definitions'][element]['properties']);
|
|
1147
|
+
}
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
nextDefinition.title = ((_c = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _c === void 0 ? void 0 : _c['title']) ? nextDefinition.targetDefinition['title']
|
|
1151
|
+
: title;
|
|
1152
|
+
const factoryKey = lastDefinition === null || lastDefinition === void 0 ? void 0 : lastDefinition.split('<')[0];
|
|
1153
|
+
const targetObject = currentConfigObject ? currentConfigObject : {};
|
|
1154
|
+
nextDefinition.configObject = factory.createInstance(pageType, factoryKey, targetObject, (_d = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _d === void 0 ? void 0 : _d['controlProperty']);
|
|
1155
|
+
}
|
|
1156
|
+
else {
|
|
1157
|
+
//e.g. sections ==> loop over all properties = subsections or other
|
|
1158
|
+
nextDefinition.targetDefinition = propertyDefinition;
|
|
1159
|
+
nextDefinition.title = nextDefinition.targetDefinition['title']
|
|
1160
|
+
? nextDefinition.targetDefinition['title']
|
|
1161
|
+
: key;
|
|
1162
|
+
nextDefinition.configObject = currentConfigObject;
|
|
1163
|
+
}
|
|
1164
|
+
return nextDefinition;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Recursive function to determine the next config part, next definition in the app schema and the title
|
|
1168
|
+
* @param appSchema - app-specific JSON schema
|
|
1169
|
+
* @param title - default title
|
|
1170
|
+
* @param currentConfigObject - current part of the configuration that gets traversed
|
|
1171
|
+
* @param propertyDefinition - definition of a given property in the app schema
|
|
1172
|
+
* @param key - actual key
|
|
1173
|
+
* @param {MetadataInstanceInterface} factory - factory for creating metadata instances
|
|
1174
|
+
* @param pageType - page type
|
|
1175
|
+
*/
|
|
1176
|
+
function getNextTargetDefinition(appSchema, title, currentConfigObject, propertyDefinition, key, factory, pageType) {
|
|
1177
|
+
let nextDefinition;
|
|
1178
|
+
if (propertyDefinition['type'] === 'array') {
|
|
1179
|
+
nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, propertyDefinition['items'], key, factory, pageType);
|
|
1180
|
+
return nextDefinition;
|
|
1181
|
+
}
|
|
1182
|
+
const definitionArray = fillArrayFromPropertyDefinition(propertyDefinition, currentConfigObject, appSchema);
|
|
1183
|
+
if (!definitionArray) {
|
|
1184
|
+
return undefined;
|
|
1185
|
+
}
|
|
1186
|
+
nextDefinition = determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition);
|
|
1187
|
+
return nextDefinition;
|
|
1188
|
+
}
|
|
1189
|
+
exports.getNextTargetDefinition = getNextTargetDefinition;
|
|
1190
|
+
/**
|
|
1191
|
+
* Custom array merge function called by deepmerge's merge function
|
|
1192
|
+
*
|
|
1193
|
+
* @param {*} target Target array
|
|
1194
|
+
* @param {*} source Source array
|
|
1195
|
+
* @param {*} options options object provided by deepmerge's merge function
|
|
1196
|
+
* @returns
|
|
1197
|
+
*/
|
|
1198
|
+
exports.arrayCombineMerge = (target, source, options) => {
|
|
1199
|
+
const destination = target.slice();
|
|
1200
|
+
source.forEach((item, index) => {
|
|
1201
|
+
if (typeof destination[index] === 'undefined') {
|
|
1202
|
+
destination[index] = options.cloneUnlessOtherwiseSpecified(item, options);
|
|
1203
|
+
}
|
|
1204
|
+
else if (options.isMergeableObject(item)) {
|
|
1205
|
+
destination[index] = deepmerge_1.default(target[index], item, options);
|
|
1206
|
+
}
|
|
1207
|
+
else if (target.indexOf(item) === -1) {
|
|
1208
|
+
destination.push(item);
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
return destination;
|
|
1212
|
+
};
|
|
1213
|
+
/**
|
|
1214
|
+
* Converts an enum into a CSV
|
|
1215
|
+
* @param {object} manifestSection - manifestSection where the key exists
|
|
1216
|
+
* @param {object} configPart - Property as mentioned in config file
|
|
1217
|
+
* @param {string} key - Property to be exported to manifest
|
|
1218
|
+
*/
|
|
1219
|
+
function convertEnumToCSV(manifestSection, configPart, key) {
|
|
1220
|
+
manifestSection[key] = JSON.parse(JSON.stringify(configPart[key]));
|
|
1221
|
+
// convert enum array to joined string
|
|
1222
|
+
const field = configPart[key];
|
|
1223
|
+
manifestSection[key] = field.join();
|
|
1224
|
+
}
|
|
1225
|
+
exports.convertEnumToCSV = convertEnumToCSV;
|
|
1226
|
+
/**
|
|
1227
|
+
* Converts an action ID from the internal format (schema, config) to the stable ID representation
|
|
1228
|
+
* @param actionId - the (unique) internal format of the action ID
|
|
1229
|
+
* @returns the converted action ID
|
|
1230
|
+
*/
|
|
1231
|
+
function convertActionKeyToStableId(actionId) {
|
|
1232
|
+
return (actionId.indexOf('??') > -1 ? actionId.split('??')[1] : actionId).replace(/@/g, '::');
|
|
1233
|
+
}
|
|
1234
|
+
exports.convertActionKeyToStableId = convertActionKeyToStableId;
|
|
1235
|
+
/**
|
|
1236
|
+
* Method returns definition key for passed '$ref' property by removing 'definition' prefix
|
|
1237
|
+
* @param $ref - definition reference.
|
|
1238
|
+
* @returns Definition key.
|
|
1239
|
+
*/
|
|
1240
|
+
function getDefinitionKey($ref) {
|
|
1241
|
+
return $ref.split(exports.DEFINITION_LINK_PREFIX)[1];
|
|
1242
|
+
}
|
|
1243
|
+
exports.getDefinitionKey = getDefinitionKey;
|
|
1244
|
+
//# sourceMappingURL=utils.js.map
|