@sap-ux/fiori-mcp-server 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +99 -0
  3. package/dist/constant.d.ts +5 -0
  4. package/dist/constant.js +8 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.js +7 -0
  7. package/dist/page-editor-api/api.d.ts +48 -0
  8. package/dist/page-editor-api/api.js +93 -0
  9. package/dist/page-editor-api/index.d.ts +5 -0
  10. package/dist/page-editor-api/index.js +24 -0
  11. package/dist/page-editor-api/json-helper.d.ts +11 -0
  12. package/dist/page-editor-api/json-helper.js +64 -0
  13. package/dist/page-editor-api/parser/annotations.d.ts +9 -0
  14. package/dist/page-editor-api/parser/annotations.js +13 -0
  15. package/dist/page-editor-api/parser/index.d.ts +3 -0
  16. package/dist/page-editor-api/parser/index.js +19 -0
  17. package/dist/page-editor-api/parser/model/AggregationValidator.d.ts +64 -0
  18. package/dist/page-editor-api/parser/model/AggregationValidator.js +209 -0
  19. package/dist/page-editor-api/parser/model/ArrayAggregation.d.ts +49 -0
  20. package/dist/page-editor-api/parser/model/ArrayAggregation.js +122 -0
  21. package/dist/page-editor-api/parser/model/ObjectAggregation.d.ts +374 -0
  22. package/dist/page-editor-api/parser/model/ObjectAggregation.js +802 -0
  23. package/dist/page-editor-api/parser/model/PageEditModel.d.ts +223 -0
  24. package/dist/page-editor-api/parser/model/PageEditModel.js +954 -0
  25. package/dist/page-editor-api/parser/model/PageEditProperty.d.ts +38 -0
  26. package/dist/page-editor-api/parser/model/PageEditProperty.js +49 -0
  27. package/dist/page-editor-api/parser/model/RootAggregation.d.ts +24 -0
  28. package/dist/page-editor-api/parser/model/RootAggregation.js +54 -0
  29. package/dist/page-editor-api/parser/model/actions/ActionAggregation.d.ts +34 -0
  30. package/dist/page-editor-api/parser/model/actions/ActionAggregation.js +92 -0
  31. package/dist/page-editor-api/parser/model/actions/ActionsAggregation.d.ts +96 -0
  32. package/dist/page-editor-api/parser/model/actions/ActionsAggregation.js +252 -0
  33. package/dist/page-editor-api/parser/model/actions/index.d.ts +3 -0
  34. package/dist/page-editor-api/parser/model/actions/index.js +19 -0
  35. package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectAggregation.d.ts +17 -0
  36. package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectAggregation.js +26 -0
  37. package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectsAggregation.d.ts +46 -0
  38. package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectsAggregation.js +66 -0
  39. package/dist/page-editor-api/parser/model/additionalObjects/index.d.ts +3 -0
  40. package/dist/page-editor-api/parser/model/additionalObjects/index.js +19 -0
  41. package/dist/page-editor-api/parser/model/chart/ChartAggregation.d.ts +41 -0
  42. package/dist/page-editor-api/parser/model/chart/ChartAggregation.js +94 -0
  43. package/dist/page-editor-api/parser/model/chart/index.d.ts +2 -0
  44. package/dist/page-editor-api/parser/model/chart/index.js +18 -0
  45. package/dist/page-editor-api/parser/model/fields/ConnectedFieldsAggregation.d.ts +9 -0
  46. package/dist/page-editor-api/parser/model/fields/ConnectedFieldsAggregation.js +13 -0
  47. package/dist/page-editor-api/parser/model/fields/FieldAggregation.d.ts +25 -0
  48. package/dist/page-editor-api/parser/model/fields/FieldAggregation.js +42 -0
  49. package/dist/page-editor-api/parser/model/fields/FieldsAggregation.d.ts +22 -0
  50. package/dist/page-editor-api/parser/model/fields/FieldsAggregation.js +34 -0
  51. package/dist/page-editor-api/parser/model/fields/index.d.ts +4 -0
  52. package/dist/page-editor-api/parser/model/fields/index.js +20 -0
  53. package/dist/page-editor-api/parser/model/filter-fields/FilterFieldAggregation.d.ts +39 -0
  54. package/dist/page-editor-api/parser/model/filter-fields/FilterFieldAggregation.js +94 -0
  55. package/dist/page-editor-api/parser/model/filter-fields/FilterFieldsAggregation.d.ts +36 -0
  56. package/dist/page-editor-api/parser/model/filter-fields/FilterFieldsAggregation.js +59 -0
  57. package/dist/page-editor-api/parser/model/filter-fields/index.d.ts +3 -0
  58. package/dist/page-editor-api/parser/model/filter-fields/index.js +19 -0
  59. package/dist/page-editor-api/parser/model/index.d.ts +19 -0
  60. package/dist/page-editor-api/parser/model/index.js +35 -0
  61. package/dist/page-editor-api/parser/model/macros/MacrosRoot.d.ts +48 -0
  62. package/dist/page-editor-api/parser/model/macros/MacrosRoot.js +114 -0
  63. package/dist/page-editor-api/parser/model/macros/index.d.ts +2 -0
  64. package/dist/page-editor-api/parser/model/macros/index.js +18 -0
  65. package/dist/page-editor-api/parser/model/sections/HeaderSectionsAggregation.d.ts +31 -0
  66. package/dist/page-editor-api/parser/model/sections/HeaderSectionsAggregation.js +82 -0
  67. package/dist/page-editor-api/parser/model/sections/SectionAggregation.d.ts +78 -0
  68. package/dist/page-editor-api/parser/model/sections/SectionAggregation.js +131 -0
  69. package/dist/page-editor-api/parser/model/sections/SectionsAggregation.d.ts +135 -0
  70. package/dist/page-editor-api/parser/model/sections/SectionsAggregation.js +402 -0
  71. package/dist/page-editor-api/parser/model/sections/SectionsObjectAggregation.d.ts +50 -0
  72. package/dist/page-editor-api/parser/model/sections/SectionsObjectAggregation.js +119 -0
  73. package/dist/page-editor-api/parser/model/sections/SubSectionsAggregation.d.ts +39 -0
  74. package/dist/page-editor-api/parser/model/sections/SubSectionsAggregation.js +70 -0
  75. package/dist/page-editor-api/parser/model/sections/index.d.ts +6 -0
  76. package/dist/page-editor-api/parser/model/sections/index.js +22 -0
  77. package/dist/page-editor-api/parser/model/table/ColumnAggregation.d.ts +89 -0
  78. package/dist/page-editor-api/parser/model/table/ColumnAggregation.js +175 -0
  79. package/dist/page-editor-api/parser/model/table/ColumnsAggregation.d.ts +113 -0
  80. package/dist/page-editor-api/parser/model/table/ColumnsAggregation.js +293 -0
  81. package/dist/page-editor-api/parser/model/table/TableAggregation.d.ts +13 -0
  82. package/dist/page-editor-api/parser/model/table/TableAggregation.js +21 -0
  83. package/dist/page-editor-api/parser/model/table/ToolbarAggregation.d.ts +15 -0
  84. package/dist/page-editor-api/parser/model/table/ToolbarAggregation.js +22 -0
  85. package/dist/page-editor-api/parser/model/table/index.d.ts +5 -0
  86. package/dist/page-editor-api/parser/model/table/index.js +21 -0
  87. package/dist/page-editor-api/parser/model/table/utils.d.ts +12 -0
  88. package/dist/page-editor-api/parser/model/table/utils.js +44 -0
  89. package/dist/page-editor-api/parser/model/types/annotations.d.ts +63 -0
  90. package/dist/page-editor-api/parser/model/types/annotations.js +29 -0
  91. package/dist/page-editor-api/parser/model/types/common.d.ts +13 -0
  92. package/dist/page-editor-api/parser/model/types/common.js +3 -0
  93. package/dist/page-editor-api/parser/model/types/index.d.ts +220 -0
  94. package/dist/page-editor-api/parser/model/types/index.js +149 -0
  95. package/dist/page-editor-api/parser/model/utils/annotations.d.ts +38 -0
  96. package/dist/page-editor-api/parser/model/utils/annotations.js +120 -0
  97. package/dist/page-editor-api/parser/model/utils/i18n.d.ts +33 -0
  98. package/dist/page-editor-api/parser/model/utils/i18n.js +69 -0
  99. package/dist/page-editor-api/parser/model/utils/index.d.ts +6 -0
  100. package/dist/page-editor-api/parser/model/utils/index.js +22 -0
  101. package/dist/page-editor-api/parser/model/utils/object.d.ts +25 -0
  102. package/dist/page-editor-api/parser/model/utils/object.js +68 -0
  103. package/dist/page-editor-api/parser/model/utils/sort.d.ts +31 -0
  104. package/dist/page-editor-api/parser/model/utils/sort.js +18 -0
  105. package/dist/page-editor-api/parser/model/utils/utils.d.ts +94 -0
  106. package/dist/page-editor-api/parser/model/utils/utils.js +267 -0
  107. package/dist/page-editor-api/parser/model/views/ViewAggregation.d.ts +62 -0
  108. package/dist/page-editor-api/parser/model/views/ViewAggregation.js +112 -0
  109. package/dist/page-editor-api/parser/model/views/ViewsAggregation.d.ts +54 -0
  110. package/dist/page-editor-api/parser/model/views/ViewsAggregation.js +141 -0
  111. package/dist/page-editor-api/parser/model/views/index.d.ts +3 -0
  112. package/dist/page-editor-api/parser/model/views/index.js +19 -0
  113. package/dist/page-editor-api/parser/model/visual-filters/VisualFilterAggregation.d.ts +11 -0
  114. package/dist/page-editor-api/parser/model/visual-filters/VisualFilterAggregation.js +15 -0
  115. package/dist/page-editor-api/parser/model/visual-filters/VisualFiltersAggregation.d.ts +11 -0
  116. package/dist/page-editor-api/parser/model/visual-filters/VisualFiltersAggregation.js +15 -0
  117. package/dist/page-editor-api/parser/model/visual-filters/index.d.ts +3 -0
  118. package/dist/page-editor-api/parser/model/visual-filters/index.js +19 -0
  119. package/dist/page-editor-api/parser/tree.d.ts +135 -0
  120. package/dist/page-editor-api/parser/tree.js +464 -0
  121. package/dist/page-editor-api/project.d.ts +40 -0
  122. package/dist/page-editor-api/project.js +124 -0
  123. package/dist/page-editor-api/sapuxFtfsFileIO.d.ts +84 -0
  124. package/dist/page-editor-api/sapuxFtfsFileIO.js +195 -0
  125. package/dist/server.d.ts +35 -0
  126. package/dist/server.js +120 -0
  127. package/dist/tools/execute-functionality.d.ts +19 -0
  128. package/dist/tools/execute-functionality.js +175 -0
  129. package/dist/tools/functionalities/controller-extension/index.d.ts +4 -0
  130. package/dist/tools/functionalities/controller-extension/index.js +136 -0
  131. package/dist/tools/functionalities/functionalities.d.ts +4 -0
  132. package/dist/tools/functionalities/functionalities.js +19 -0
  133. package/dist/tools/functionalities/generate-fiori-ui-app/command.d.ts +9 -0
  134. package/dist/tools/functionalities/generate-fiori-ui-app/command.js +158 -0
  135. package/dist/tools/functionalities/generate-fiori-ui-app/generate-fiori-ui-app.d.ts +4 -0
  136. package/dist/tools/functionalities/generate-fiori-ui-app/generate-fiori-ui-app.js +240 -0
  137. package/dist/tools/functionalities/generate-fiori-ui-app/index.d.ts +2 -0
  138. package/dist/tools/functionalities/generate-fiori-ui-app/index.js +7 -0
  139. package/dist/tools/functionalities/index.d.ts +2 -0
  140. package/dist/tools/functionalities/index.js +18 -0
  141. package/dist/tools/functionalities/page/add-page.d.ts +5 -0
  142. package/dist/tools/functionalities/page/add-page.js +89 -0
  143. package/dist/tools/functionalities/page/application.d.ts +212 -0
  144. package/dist/tools/functionalities/page/application.js +616 -0
  145. package/dist/tools/functionalities/page/delete-page.d.ts +4 -0
  146. package/dist/tools/functionalities/page/delete-page.js +71 -0
  147. package/dist/tools/functionalities/page/index.d.ts +3 -0
  148. package/dist/tools/functionalities/page/index.js +10 -0
  149. package/dist/tools/functionalities/page/service.d.ts +82 -0
  150. package/dist/tools/functionalities/page/service.js +114 -0
  151. package/dist/tools/functionalities/page/serviceStore.d.ts +17 -0
  152. package/dist/tools/functionalities/page/serviceStore.js +34 -0
  153. package/dist/tools/functionalities/page/types.d.ts +42 -0
  154. package/dist/tools/functionalities/page/types.js +11 -0
  155. package/dist/tools/functionalities/page/utils.d.ts +12 -0
  156. package/dist/tools/functionalities/page/utils.js +63 -0
  157. package/dist/tools/get-functionality-details.d.ts +24 -0
  158. package/dist/tools/get-functionality-details.js +142 -0
  159. package/dist/tools/index.d.ts +7 -0
  160. package/dist/tools/index.js +55 -0
  161. package/dist/tools/input-schema/execute-functionality.json +28 -0
  162. package/dist/tools/input-schema/get-functionality-details.json +24 -0
  163. package/dist/tools/input-schema/index.d.ts +5 -0
  164. package/dist/tools/input-schema/index.js +15 -0
  165. package/dist/tools/input-schema/list-fiori-apps.json +12 -0
  166. package/dist/tools/input-schema/list-functionality.json +10 -0
  167. package/dist/tools/list-fiori-apps.d.ts +10 -0
  168. package/dist/tools/list-fiori-apps.js +33 -0
  169. package/dist/tools/list-functionalities.d.ts +10 -0
  170. package/dist/tools/list-functionalities.js +145 -0
  171. package/dist/tools/output-schema/execute-functionality.json +39 -0
  172. package/dist/tools/output-schema/get-functionality-details.json +142 -0
  173. package/dist/tools/output-schema/index.d.ts +5 -0
  174. package/dist/tools/output-schema/index.js +15 -0
  175. package/dist/tools/output-schema/list-fiori-apps.json +41 -0
  176. package/dist/tools/output-schema/list-functionality.json +37 -0
  177. package/dist/tools/utils.d.ts +16 -0
  178. package/dist/tools/utils.js +74 -0
  179. package/dist/types.d.ts +170 -0
  180. package/dist/types.js +3 -0
  181. package/package.json +63 -0
@@ -0,0 +1,13 @@
1
+ import type { ArtifactType } from '@sap/ux-specification/dist/types/src';
2
+ import type { Range } from '@sap-ux/text-document-utils';
3
+ export interface Location {
4
+ fileUri: string;
5
+ range: Range;
6
+ relative?: boolean;
7
+ type?: ArtifactType;
8
+ }
9
+ export interface AllowedMoveRange {
10
+ from: number;
11
+ to: number;
12
+ }
13
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1,220 @@
1
+ import type { ArtifactType } from '@sap/ux-specification/dist/types/src';
2
+ import { v2 } from '@sap/ux-specification/dist/types/src';
3
+ import type { JSONSchema4 } from 'json-schema';
4
+ import type { I18nBundle } from '@sap-ux/i18n';
5
+ import type { AllowedMoveRange, Location } from './common';
6
+ import type { UIDialogsContext, UINode } from './annotations';
7
+ export * from './annotations';
8
+ export * from './common';
9
+ export declare const DATA_FIELD_ACTION = "DataFieldForAction";
10
+ export declare const DATA_FIELD_FOR_INTENT_BASED_NAVIGATION = "DataFieldForIntentBasedNavigation";
11
+ export declare const DATA_FIELD_FOR_ACTION_GROUP = "DataFieldForActionGroup";
12
+ export declare const ANNOTATION_TYPES_SEPARATOR = "::";
13
+ export declare const CUSTOM_VIEW_PREFIX = "customView(";
14
+ export interface PageData {
15
+ [key: string]: unknown;
16
+ }
17
+ export declare enum AggregationCreationForm {
18
+ AnalyticalChart = "AnalyticalChart",
19
+ AnalyticalChartView = "AnalyticalChartView",
20
+ ChartSection = "ChartSection",
21
+ CustomAction = "CustomAction",
22
+ CustomSection = "CustomSection",
23
+ CustomColumn = "CustomColumn",
24
+ CustomColumnV4 = "CustomColumnV4",
25
+ CustomViewV4 = "CustomViewV4",
26
+ DataPointSection = "DataPointSection",
27
+ Generic = "Generic",
28
+ MacrosChart = "MacrosChart",
29
+ MacrosFilterBar = "MacrosFilterBar",
30
+ MacrosTable = "MacrosTable",
31
+ NativeAction = "NativeAction",
32
+ NativeNavigation = "NativeNavigation",
33
+ NativeBasicColumn = "Basic",
34
+ NativeChartColumn = "Chart",
35
+ NativeContactColumn = "Contact",
36
+ NativeContactField = "NativeContactField",
37
+ NativeConnectedFields = "NativeConnectedFields",
38
+ NativeField = "NativeField",
39
+ NativeFilterFields = "NativeFilterFields",
40
+ NativeVisualFilters = "NativeVisualFilters",
41
+ NativeGroupSection = "NativeGroupSection",
42
+ NativeIdentification = "NativeIdentification",
43
+ NativeRatingColumn = "Rating",
44
+ NativeProgressColumn = "Progress",
45
+ NativeSection = "NativeSection",
46
+ NativeTableSection = "NativeTableSection",
47
+ ProgressSection = "ProgressSection",
48
+ RatingSection = "RatingSection",
49
+ TableView = "TableView",
50
+ CustomSubSection = "CustomSubSection",
51
+ CustomHeaderSection = "CustomHeaderSection",
52
+ CustomFilterField = "CustomFilterField"
53
+ }
54
+ export declare const CUSTOM_AGGREGATION_FORMS: AggregationCreationForm[];
55
+ export declare const enum TableColumnExtensionType {
56
+ ResponsiveTableColumnsExtension = "ResponsiveTableColumnsExtension",
57
+ AnalyticalTableColumnsExtension = "AnalyticalTableColumnsExtension",
58
+ TreeTableColumnsExtension = "TreeTableColumnsExtension",
59
+ GridTableColumnsExtension = "GridTableColumnsExtension"
60
+ }
61
+ export declare const TABLE_TYPE_EXTENSION_MAP: Map<v2.TableTypeV2, TableColumnExtensionType>;
62
+ export declare const ANNOTATION_CREATION_FORM = "annotation";
63
+ export declare const SCHEMA_CREATION_FORM = "schema";
64
+ export declare const EXTERNAL_CREATION_FORM = "external";
65
+ export declare const FacetTitlePrefix = "Facet ID: ";
66
+ export type CreationFormKind = typeof ANNOTATION_CREATION_FORM | typeof SCHEMA_CREATION_FORM | typeof EXTERNAL_CREATION_FORM;
67
+ export interface CreationFormOptions {
68
+ name: AggregationCreationForm;
69
+ kind: CreationFormKind;
70
+ /**
71
+ * i18n key for the title
72
+ */
73
+ title: string;
74
+ tooltip?: string;
75
+ disabled: boolean;
76
+ /**
77
+ * Title when form disabled
78
+ */
79
+ disabledTitle?: string;
80
+ visualizationIcon?: string;
81
+ aggregationName?: string;
82
+ buttonText?: string;
83
+ buttonId?: string;
84
+ }
85
+ export declare const EXTENSION_TABLE_TYPE_MAP: Map<TableColumnExtensionType, v2.TableTypeV2>;
86
+ export declare enum PropertiesType {
87
+ Flat = 0,
88
+ AnyOf = 1
89
+ }
90
+ export declare enum SortingOptions {
91
+ Enabled = "Enabled",
92
+ Excluded = "Excluded",
93
+ Readonly = "Readonly"
94
+ }
95
+ export declare enum AggregationType {
96
+ Object = "Object",
97
+ Array = "Array"
98
+ }
99
+ export declare enum AggregationActions {
100
+ Delete = "Delete",
101
+ OpenSource = "OpenSource",
102
+ Edit = "Edit"
103
+ }
104
+ export interface AggregationSubAction {
105
+ id: string;
106
+ text: string;
107
+ }
108
+ export interface SupportedAggregationAction {
109
+ type: AggregationActions;
110
+ disabled?: boolean;
111
+ title?: string;
112
+ subActions?: AggregationSubAction[];
113
+ }
114
+ export type SupportedAggregationActions = Array<SupportedAggregationAction | AggregationActions>;
115
+ export declare enum AggregationSortBy {
116
+ ViewNode = "ViewNode"
117
+ }
118
+ export declare enum PendingChange {
119
+ Creation = "Creation",
120
+ MoveDnD = "MoveDnD",
121
+ MoveButton = "MoveButton"
122
+ }
123
+ interface ModelParserDefinitions {
124
+ [key: string]: JSONSchema4;
125
+ }
126
+ export interface ParserContext {
127
+ filePath?: string;
128
+ }
129
+ type ModelParserMethod<T> = (aggregation: T, currentNode: JSONSchema4, currentAnnotationNode: UINode | undefined, name: string | undefined, path: PropertyPath, parserContext: ParserContext) => void;
130
+ export interface ModelParserParams<T> {
131
+ parse: ModelParserMethod<T>;
132
+ definitions: ModelParserDefinitions;
133
+ annotations?: PageAnnotations;
134
+ }
135
+ export interface AllowedDropAggregation {
136
+ path: PropertyPath;
137
+ range?: AllowedMoveRange[];
138
+ }
139
+ export type PropertyPath = Array<string | number>;
140
+ export declare enum ValidationState {
141
+ Valid = 0,
142
+ Invalid = 1,
143
+ Skipped = 2,
144
+ ReadOnly = 3
145
+ }
146
+ export interface PageAnnotations {
147
+ nodes: UINode[];
148
+ dynamicNodes: {
149
+ [nodeId: string]: UINode;
150
+ };
151
+ dialogsContext?: UIDialogsContext;
152
+ errorMessage?: string;
153
+ }
154
+ export declare enum PropertyMessageType {
155
+ /**
156
+ * Reports an error.
157
+ */
158
+ Error = "error",
159
+ /**
160
+ * Reports a warning.
161
+ */
162
+ Warning = "warning",
163
+ /**
164
+ * Reports an information.
165
+ */
166
+ Info = "info"
167
+ }
168
+ export interface PropertyMessage {
169
+ type?: PropertyMessageType;
170
+ text: string;
171
+ dialogText?: string;
172
+ location?: Location;
173
+ deletable?: boolean;
174
+ preventMessagePropagation?: boolean;
175
+ }
176
+ export interface SettingOption {
177
+ schema: JSONSchema4;
178
+ value?: unknown;
179
+ pattern?: string;
180
+ description?: string;
181
+ state?: ValidationState;
182
+ isAtomic?: boolean;
183
+ i18nClassification?: string;
184
+ name: string;
185
+ freeText?: boolean;
186
+ artifactType?: ArtifactType;
187
+ required?: boolean;
188
+ minimum?: number;
189
+ messages?: PropertyMessage[];
190
+ locations?: Location[];
191
+ disabled?: boolean;
192
+ displayName?: string;
193
+ }
194
+ export interface CustomNodeAnnotationTarget {
195
+ control: string;
196
+ customSectionKey?: string;
197
+ navProperty?: string;
198
+ qualifier?: string;
199
+ }
200
+ export declare const SAP_ANNOTATION_NAMESPACE = "@com.sap.vocabularies.UI.v1";
201
+ export declare const TRANSLATION_BUNDLE_APP = "app";
202
+ export declare const TRANSLATION_BUNDLE_ANNOTATION = "annotation";
203
+ export declare const TRANSLATION_BUNDLE_SERVICE = "service";
204
+ export declare const TRANSLATION_BUNDLE_UI5 = "ui5";
205
+ export interface TranslationBundles {
206
+ [TRANSLATION_BUNDLE_APP]: I18nBundle;
207
+ [TRANSLATION_BUNDLE_ANNOTATION]: I18nBundle;
208
+ [TRANSLATION_BUNDLE_UI5]: I18nBundle;
209
+ [TRANSLATION_BUNDLE_SERVICE]: I18nBundle;
210
+ }
211
+ export type TranslationBundleKeys = typeof TRANSLATION_BUNDLE_APP | typeof TRANSLATION_BUNDLE_ANNOTATION | typeof TRANSLATION_BUNDLE_SERVICE | typeof TRANSLATION_BUNDLE_UI5;
212
+ export declare enum AggregationNodeType {
213
+ customAction = "customAction",
214
+ customColumn = "customColumn",
215
+ customSection = "customSection",
216
+ customFilterField = "customFilterField",
217
+ rootNode = "rootNode",
218
+ views = "views"
219
+ }
220
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.AggregationNodeType = exports.TRANSLATION_BUNDLE_UI5 = exports.TRANSLATION_BUNDLE_SERVICE = exports.TRANSLATION_BUNDLE_ANNOTATION = exports.TRANSLATION_BUNDLE_APP = exports.SAP_ANNOTATION_NAMESPACE = exports.PropertyMessageType = exports.ValidationState = exports.PendingChange = exports.AggregationSortBy = exports.AggregationActions = exports.AggregationType = exports.SortingOptions = exports.PropertiesType = exports.EXTENSION_TABLE_TYPE_MAP = exports.FacetTitlePrefix = exports.EXTERNAL_CREATION_FORM = exports.SCHEMA_CREATION_FORM = exports.ANNOTATION_CREATION_FORM = exports.TABLE_TYPE_EXTENSION_MAP = exports.CUSTOM_AGGREGATION_FORMS = exports.AggregationCreationForm = exports.CUSTOM_VIEW_PREFIX = exports.ANNOTATION_TYPES_SEPARATOR = exports.DATA_FIELD_FOR_ACTION_GROUP = exports.DATA_FIELD_FOR_INTENT_BASED_NAVIGATION = exports.DATA_FIELD_ACTION = void 0;
18
+ const src_1 = require("@sap/ux-specification/dist/types/src");
19
+ __exportStar(require("./annotations"), exports);
20
+ __exportStar(require("./common"), exports);
21
+ exports.DATA_FIELD_ACTION = 'DataFieldForAction';
22
+ exports.DATA_FIELD_FOR_INTENT_BASED_NAVIGATION = 'DataFieldForIntentBasedNavigation';
23
+ exports.DATA_FIELD_FOR_ACTION_GROUP = 'DataFieldForActionGroup';
24
+ exports.ANNOTATION_TYPES_SEPARATOR = '::';
25
+ exports.CUSTOM_VIEW_PREFIX = 'customView(';
26
+ var AggregationCreationForm;
27
+ (function (AggregationCreationForm) {
28
+ AggregationCreationForm["AnalyticalChart"] = "AnalyticalChart";
29
+ AggregationCreationForm["AnalyticalChartView"] = "AnalyticalChartView";
30
+ AggregationCreationForm["ChartSection"] = "ChartSection";
31
+ AggregationCreationForm["CustomAction"] = "CustomAction";
32
+ AggregationCreationForm["CustomSection"] = "CustomSection";
33
+ AggregationCreationForm["CustomColumn"] = "CustomColumn";
34
+ AggregationCreationForm["CustomColumnV4"] = "CustomColumnV4";
35
+ AggregationCreationForm["CustomViewV4"] = "CustomViewV4";
36
+ AggregationCreationForm["DataPointSection"] = "DataPointSection";
37
+ AggregationCreationForm["Generic"] = "Generic";
38
+ AggregationCreationForm["MacrosChart"] = "MacrosChart";
39
+ AggregationCreationForm["MacrosFilterBar"] = "MacrosFilterBar";
40
+ AggregationCreationForm["MacrosTable"] = "MacrosTable";
41
+ AggregationCreationForm["NativeAction"] = "NativeAction";
42
+ AggregationCreationForm["NativeNavigation"] = "NativeNavigation";
43
+ AggregationCreationForm["NativeBasicColumn"] = "Basic";
44
+ AggregationCreationForm["NativeChartColumn"] = "Chart";
45
+ AggregationCreationForm["NativeContactColumn"] = "Contact";
46
+ AggregationCreationForm["NativeContactField"] = "NativeContactField";
47
+ AggregationCreationForm["NativeConnectedFields"] = "NativeConnectedFields";
48
+ AggregationCreationForm["NativeField"] = "NativeField";
49
+ AggregationCreationForm["NativeFilterFields"] = "NativeFilterFields";
50
+ AggregationCreationForm["NativeVisualFilters"] = "NativeVisualFilters";
51
+ AggregationCreationForm["NativeGroupSection"] = "NativeGroupSection";
52
+ AggregationCreationForm["NativeIdentification"] = "NativeIdentification";
53
+ AggregationCreationForm["NativeRatingColumn"] = "Rating";
54
+ AggregationCreationForm["NativeProgressColumn"] = "Progress";
55
+ AggregationCreationForm["NativeSection"] = "NativeSection";
56
+ AggregationCreationForm["NativeTableSection"] = "NativeTableSection";
57
+ AggregationCreationForm["ProgressSection"] = "ProgressSection";
58
+ AggregationCreationForm["RatingSection"] = "RatingSection";
59
+ AggregationCreationForm["TableView"] = "TableView";
60
+ AggregationCreationForm["CustomSubSection"] = "CustomSubSection";
61
+ AggregationCreationForm["CustomHeaderSection"] = "CustomHeaderSection";
62
+ AggregationCreationForm["CustomFilterField"] = "CustomFilterField";
63
+ })(AggregationCreationForm || (exports.AggregationCreationForm = AggregationCreationForm = {}));
64
+ exports.CUSTOM_AGGREGATION_FORMS = [
65
+ AggregationCreationForm.Generic,
66
+ AggregationCreationForm.CustomSection,
67
+ AggregationCreationForm.CustomColumn
68
+ ];
69
+ exports.TABLE_TYPE_EXTENSION_MAP = new Map([
70
+ [src_1.v2.TableTypeV2.ResponsiveTable, "ResponsiveTableColumnsExtension" /* TableColumnExtensionType.ResponsiveTableColumnsExtension */],
71
+ [src_1.v2.TableTypeV2.GridTable, "GridTableColumnsExtension" /* TableColumnExtensionType.GridTableColumnsExtension */],
72
+ [src_1.v2.TableTypeV2.AnalyticalTable, "AnalyticalTableColumnsExtension" /* TableColumnExtensionType.AnalyticalTableColumnsExtension */],
73
+ [src_1.v2.TableTypeV2.TreeTable, "TreeTableColumnsExtension" /* TableColumnExtensionType.TreeTableColumnsExtension */]
74
+ ]);
75
+ exports.ANNOTATION_CREATION_FORM = 'annotation';
76
+ exports.SCHEMA_CREATION_FORM = 'schema';
77
+ exports.EXTERNAL_CREATION_FORM = 'external';
78
+ exports.FacetTitlePrefix = 'Facet ID: ';
79
+ // Inverted map of TABLE_TYPE_EXTENSION_MAP
80
+ exports.EXTENSION_TABLE_TYPE_MAP = new Map([...exports.TABLE_TYPE_EXTENSION_MAP.entries()].map(([key, value]) => [value, key]));
81
+ var PropertiesType;
82
+ (function (PropertiesType) {
83
+ PropertiesType[PropertiesType["Flat"] = 0] = "Flat";
84
+ PropertiesType[PropertiesType["AnyOf"] = 1] = "AnyOf";
85
+ })(PropertiesType || (exports.PropertiesType = PropertiesType = {}));
86
+ var SortingOptions;
87
+ (function (SortingOptions) {
88
+ SortingOptions["Enabled"] = "Enabled";
89
+ SortingOptions["Excluded"] = "Excluded";
90
+ SortingOptions["Readonly"] = "Readonly";
91
+ })(SortingOptions || (exports.SortingOptions = SortingOptions = {}));
92
+ var AggregationType;
93
+ (function (AggregationType) {
94
+ AggregationType["Object"] = "Object";
95
+ AggregationType["Array"] = "Array";
96
+ })(AggregationType || (exports.AggregationType = AggregationType = {}));
97
+ var AggregationActions;
98
+ (function (AggregationActions) {
99
+ AggregationActions["Delete"] = "Delete";
100
+ AggregationActions["OpenSource"] = "OpenSource";
101
+ AggregationActions["Edit"] = "Edit";
102
+ })(AggregationActions || (exports.AggregationActions = AggregationActions = {}));
103
+ var AggregationSortBy;
104
+ (function (AggregationSortBy) {
105
+ AggregationSortBy["ViewNode"] = "ViewNode";
106
+ })(AggregationSortBy || (exports.AggregationSortBy = AggregationSortBy = {}));
107
+ var PendingChange;
108
+ (function (PendingChange) {
109
+ PendingChange["Creation"] = "Creation";
110
+ PendingChange["MoveDnD"] = "MoveDnD";
111
+ PendingChange["MoveButton"] = "MoveButton";
112
+ })(PendingChange || (exports.PendingChange = PendingChange = {}));
113
+ var ValidationState;
114
+ (function (ValidationState) {
115
+ ValidationState[ValidationState["Valid"] = 0] = "Valid";
116
+ ValidationState[ValidationState["Invalid"] = 1] = "Invalid";
117
+ ValidationState[ValidationState["Skipped"] = 2] = "Skipped";
118
+ ValidationState[ValidationState["ReadOnly"] = 3] = "ReadOnly";
119
+ })(ValidationState || (exports.ValidationState = ValidationState = {}));
120
+ var PropertyMessageType;
121
+ (function (PropertyMessageType) {
122
+ /**
123
+ * Reports an error.
124
+ */
125
+ PropertyMessageType["Error"] = "error";
126
+ /**
127
+ * Reports a warning.
128
+ */
129
+ PropertyMessageType["Warning"] = "warning";
130
+ /**
131
+ * Reports an information.
132
+ */
133
+ PropertyMessageType["Info"] = "info";
134
+ })(PropertyMessageType || (exports.PropertyMessageType = PropertyMessageType = {}));
135
+ exports.SAP_ANNOTATION_NAMESPACE = '@com.sap.vocabularies.UI.v1';
136
+ exports.TRANSLATION_BUNDLE_APP = 'app';
137
+ exports.TRANSLATION_BUNDLE_ANNOTATION = 'annotation';
138
+ exports.TRANSLATION_BUNDLE_SERVICE = 'service';
139
+ exports.TRANSLATION_BUNDLE_UI5 = 'ui5';
140
+ var AggregationNodeType;
141
+ (function (AggregationNodeType) {
142
+ AggregationNodeType["customAction"] = "customAction";
143
+ AggregationNodeType["customColumn"] = "customColumn";
144
+ AggregationNodeType["customSection"] = "customSection";
145
+ AggregationNodeType["customFilterField"] = "customFilterField";
146
+ AggregationNodeType["rootNode"] = "rootNode";
147
+ AggregationNodeType["views"] = "views";
148
+ })(AggregationNodeType || (exports.AggregationNodeType = AggregationNodeType = {}));
149
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,38 @@
1
+ import { type PageAnnotations, type UINode, type Location } from '../types';
2
+ /**
3
+ * Retrieves a `UINode` from the given annotations by its hierarchical node ID.
4
+ *
5
+ * @param annotations The annotations object containing nodes.
6
+ * @param id The hierarchical node ID to search for.
7
+ * @returns The matching `UINode` if found, otherwise `undefined`.
8
+ */
9
+ export declare function getAnnotationNodeById(annotations: PageAnnotations, id: number[]): UINode | undefined;
10
+ /**
11
+ * Returns all locations for the given node.
12
+ *
13
+ * @param node
14
+ * @returns
15
+ */
16
+ export declare function getNodeLocations(node: UINode): Location[];
17
+ /**
18
+ * Finds a `UINode` within a tree of nodes that matches the given annotation path.
19
+ *
20
+ * @param annotationPath - The annotation path to match.
21
+ * @param nodes - The list of nodes to search within.
22
+ * @param shallow - If true, only searches the top-level nodes.
23
+ * @param lookUpIndex - Optional index hint to optimize search order.
24
+ * @returns The matching node if found, otherwise `undefined`.
25
+ */
26
+ export declare function nodeMatcher(annotationPath: string, nodes: UINode[], shallow?: boolean, lookUpIndex?: number): UINode | undefined;
27
+ /**
28
+ * Method finds matching node using passed schema annotation path and tree object nested nodes and full nodes.
29
+ *
30
+ * @param schemaAnnotationPath Annotation path from schema to look up in annotation nodes.
31
+ * @param annotationNodes Full annotation nodes tree.
32
+ * @param childAnnotationNodes Current level's annotation nodes - mainly nested nodes are used to look up, but there is special cases when nodes are not on same level as schema.
33
+ * @param nodeAnnotationPath Current annotation node path.
34
+ * @param index Node index to look.
35
+ * @returns Matching annotation node.
36
+ */
37
+ export declare function getMatchingNode(schemaAnnotationPath: string, annotationNodes: UINode[], childAnnotationNodes: UINode[], nodeAnnotationPath?: string, index?: number): UINode | undefined;
38
+ //# sourceMappingURL=annotations.d.ts.map
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAnnotationNodeById = getAnnotationNodeById;
4
+ exports.getNodeLocations = getNodeLocations;
5
+ exports.nodeMatcher = nodeMatcher;
6
+ exports.getMatchingNode = getMatchingNode;
7
+ const types_1 = require("../types");
8
+ const annotations_1 = require("../../annotations");
9
+ // terms of special parent child relations generated by specification
10
+ // (parent child relations in specification which are not found in anno libs ui nodes)
11
+ const SPECIAL_CHILD_NODES = new Map();
12
+ SPECIAL_CHILD_NODES.set('com.sap.vocabularies.UI.v1.HeaderInfo', new Set(['com.sap.vocabularies.UI.v1.HeaderFacets', 'com.sap.vocabularies.UI.v1.Identification']));
13
+ const GENERIC_ACTION_TERMS = ['com.sap.vocabularies.UI.v1.DeleteHidden', 'com.sap.vocabularies.UI.v1.UpdateHidden'];
14
+ const stripTarget = (annotationPath) => (annotationPath || '').split('/@').pop() || '';
15
+ /**
16
+ * Retrieves a `UINode` from the given annotations by its hierarchical node ID.
17
+ *
18
+ * @param annotations The annotations object containing nodes.
19
+ * @param id The hierarchical node ID to search for.
20
+ * @returns The matching `UINode` if found, otherwise `undefined`.
21
+ */
22
+ function getAnnotationNodeById(annotations, id) {
23
+ let node = annotations.nodes.find((node) => node?.nodeId && node.nodeId[0] === id[0]);
24
+ for (let i = 1; i < id.length; i++) {
25
+ if (node && (0, annotations_1.isTooComplex)(node)) {
26
+ return node;
27
+ }
28
+ node = node?.subnodes.find((node) => node.nodeId[i] === id[i]);
29
+ }
30
+ return node;
31
+ }
32
+ /**
33
+ * Returns all locations for the given node.
34
+ *
35
+ * @param node
36
+ * @returns
37
+ */
38
+ function getNodeLocations(node) {
39
+ if ((0, annotations_1.isTooComplex)(node)) {
40
+ return node.tooComplexLocations ?? [];
41
+ }
42
+ if (node.location) {
43
+ return [node.location];
44
+ }
45
+ return [];
46
+ }
47
+ /**
48
+ * Finds a `UINode` within a tree of nodes that matches the given annotation path.
49
+ *
50
+ * @param annotationPath - The annotation path to match.
51
+ * @param nodes - The list of nodes to search within.
52
+ * @param shallow - If true, only searches the top-level nodes.
53
+ * @param lookUpIndex - Optional index hint to optimize search order.
54
+ * @returns The matching node if found, otherwise `undefined`.
55
+ */
56
+ function nodeMatcher(annotationPath, nodes, shallow, lookUpIndex) {
57
+ const indexes = getNodeMatcherIndexes(nodes, lookUpIndex);
58
+ for (const index of indexes) {
59
+ const element = nodes[index];
60
+ const adjustedAnnotationPath = element.annotationPath
61
+ .split('/')
62
+ .map((segment, i) => (i === 1 ? segment.split('.').slice(-1)[0] ?? segment : segment))
63
+ .join('/');
64
+ if (annotationPath === element.annotationPath || annotationPath === adjustedAnnotationPath) {
65
+ return element;
66
+ }
67
+ else if (!shallow && !(0, annotations_1.isTooComplex)(element) && element.subnodes.length > 0) {
68
+ const result = nodeMatcher(annotationPath, element.subnodes, undefined, lookUpIndex);
69
+ if (result) {
70
+ return result;
71
+ }
72
+ }
73
+ }
74
+ }
75
+ /**
76
+ * Method finds matching node using passed schema annotation path and tree object nested nodes and full nodes.
77
+ *
78
+ * @param schemaAnnotationPath Annotation path from schema to look up in annotation nodes.
79
+ * @param annotationNodes Full annotation nodes tree.
80
+ * @param childAnnotationNodes Current level's annotation nodes - mainly nested nodes are used to look up, but there is special cases when nodes are not on same level as schema.
81
+ * @param nodeAnnotationPath Current annotation node path.
82
+ * @param index Node index to look.
83
+ * @returns Matching annotation node.
84
+ */
85
+ function getMatchingNode(schemaAnnotationPath, annotationNodes, childAnnotationNodes, nodeAnnotationPath, index) {
86
+ const schemaAnnotationPathTerm = stripTarget(schemaAnnotationPath);
87
+ let matchedNode = nodeMatcher(schemaAnnotationPath, childAnnotationNodes, undefined, index);
88
+ // Special matching of generic action nodes
89
+ if (!matchedNode && GENERIC_ACTION_TERMS.includes(schemaAnnotationPathTerm)) {
90
+ const genericActionsNode = annotationNodes.find((node) => node.nodeType === types_1.UI_NODE_TYPE_GENERIC_ACTIONS);
91
+ matchedNode = genericActionsNode?.subnodes.find((node) => node.annotationPath === schemaAnnotationPath);
92
+ }
93
+ if (!matchedNode && SPECIAL_CHILD_NODES.get(stripTarget(nodeAnnotationPath))?.has(schemaAnnotationPathTerm)) {
94
+ matchedNode = nodeMatcher(schemaAnnotationPath, annotationNodes, true, index);
95
+ }
96
+ return matchedNode;
97
+ }
98
+ /**
99
+ * Method prepares array with indexes to loop through.
100
+ * If index is passed as param, then we need place it first.
101
+ * It is used for cases when nodes can have same path, but different order indexes.
102
+ *
103
+ * @param nodes Nodes to loop.
104
+ * @param index Index to place as very first.
105
+ * @returns Array of index to loop.
106
+ */
107
+ function getNodeMatcherIndexes(nodes, index) {
108
+ const indexes = [];
109
+ if (index !== undefined && nodes.length > index) {
110
+ // Place passed index as first
111
+ indexes.push(index);
112
+ }
113
+ for (let i = 0; i < nodes.length; i++) {
114
+ if (i !== index) {
115
+ indexes.push(i);
116
+ }
117
+ }
118
+ return indexes;
119
+ }
120
+ //# sourceMappingURL=annotations.js.map
@@ -0,0 +1,33 @@
1
+ import type { I18nBundle } from '@sap-ux/i18n';
2
+ import type { ProjectType } from '@sap-ux/project-access';
3
+ import type { TranslationBundles, TranslationBundleKeys } from '../types';
4
+ import type { ObjectAggregation } from '../ObjectAggregation';
5
+ /**
6
+ * Method extracts i18n binding and returns key of i18n entry.
7
+ *
8
+ * @param input - Binding value.
9
+ * @param resolveAnnotationBinding - Check if method should resolve syntax annotation based i18n binding.
10
+ * @param forceKeyExtraction - Optional parameter to force key extraction in case of {{key}} format.
11
+ * @returns I18n entry key or undefined if input does not matches i18n binding pattern.
12
+ */
13
+ export declare const extractI18nKey: (input?: string, resolveAnnotationBinding?: boolean, forceKeyExtraction?: boolean) => string | undefined;
14
+ /**
15
+ * Method to resolve passed i18n binding value into value from i18n bundle.
16
+ *
17
+ * @param value Binding value like `{i18n>key}`.
18
+ * @param i18nBundle I18n bundle data.
19
+ * @returns Resolved value from i18n bundle.
20
+ */
21
+ export declare const resolveI18nValue: (value: string, i18nBundle?: I18nBundle) => string | undefined;
22
+ /**
23
+ * Method returns name of i18n bundle depending on passed project type and entity.
24
+ *
25
+ * @param isCustom Is custom extension.
26
+ * @param isViewNode Is visible node.
27
+ * @param isAnnotation Node has mapping to annotation.
28
+ * @param projectType Project type.
29
+ * @returns I18n bundle name.
30
+ */
31
+ export declare const getI18nBundleName: (isCustom?: boolean, isViewNode?: boolean, isAnnotation?: boolean, projectType?: ProjectType) => TranslationBundleKeys;
32
+ export declare const getRelevantI18nBundle: (aggregation: ObjectAggregation, bundle?: TranslationBundles, projectType?: ProjectType) => I18nBundle | undefined;
33
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRelevantI18nBundle = exports.getI18nBundleName = exports.resolveI18nValue = exports.extractI18nKey = void 0;
4
+ const types_1 = require("../types");
5
+ const I18N_BINDING_PREFIX = 'i18n';
6
+ /**
7
+ * Method extracts i18n binding and returns key of i18n entry.
8
+ *
9
+ * @param input - Binding value.
10
+ * @param resolveAnnotationBinding - Check if method should resolve syntax annotation based i18n binding.
11
+ * @param forceKeyExtraction - Optional parameter to force key extraction in case of {{key}} format.
12
+ * @returns I18n entry key or undefined if input does not matches i18n binding pattern.
13
+ */
14
+ const extractI18nKey = (input = '', resolveAnnotationBinding = false, forceKeyExtraction) => {
15
+ if (/^{{[^\\{}:]+}}$/.exec(input) && (!resolveAnnotationBinding || forceKeyExtraction)) {
16
+ return input.toString().substring(2, input.length - 2);
17
+ }
18
+ const prefixRegex = resolveAnnotationBinding
19
+ ? `(${I18N_BINDING_PREFIX}|@${I18N_BINDING_PREFIX})`
20
+ : `${I18N_BINDING_PREFIX}`;
21
+ const mathIndex = resolveAnnotationBinding ? 2 : 1;
22
+ const i18nMatch = new RegExp(`^{${prefixRegex}>([^\\{}:]+)}$`).exec(input);
23
+ return i18nMatch ? i18nMatch[mathIndex] : undefined;
24
+ };
25
+ exports.extractI18nKey = extractI18nKey;
26
+ /**
27
+ * Method to resolve passed i18n binding value into value from i18n bundle.
28
+ *
29
+ * @param value Binding value like `{i18n>key}`.
30
+ * @param i18nBundle I18n bundle data.
31
+ * @returns Resolved value from i18n bundle.
32
+ */
33
+ const resolveI18nValue = (value, i18nBundle = {}) => {
34
+ const key = (0, exports.extractI18nKey)(value, true, true);
35
+ if (key) {
36
+ const entries = i18nBundle[key];
37
+ if (entries?.length > 0) {
38
+ return entries[0].value?.value;
39
+ }
40
+ }
41
+ };
42
+ exports.resolveI18nValue = resolveI18nValue;
43
+ /**
44
+ * Method returns name of i18n bundle depending on passed project type and entity.
45
+ *
46
+ * @param isCustom Is custom extension.
47
+ * @param isViewNode Is visible node.
48
+ * @param isAnnotation Node has mapping to annotation.
49
+ * @param projectType Project type.
50
+ * @returns I18n bundle name.
51
+ */
52
+ const getI18nBundleName = (isCustom, isViewNode, isAnnotation, projectType = 'EDMXBackend') => {
53
+ if (['CAPJava', 'CAPNodejs'].includes(projectType) && !isCustom && isViewNode) {
54
+ // CAP project - for non custom view nodes like fields, sections, columns we need use translation from service bundle
55
+ return types_1.TRANSLATION_BUNDLE_SERVICE;
56
+ }
57
+ if (isAnnotation) {
58
+ return types_1.TRANSLATION_BUNDLE_ANNOTATION;
59
+ }
60
+ return types_1.TRANSLATION_BUNDLE_UI5;
61
+ };
62
+ exports.getI18nBundleName = getI18nBundleName;
63
+ const getRelevantI18nBundle = (aggregation, bundle, projectType) => {
64
+ return bundle
65
+ ? bundle[(0, exports.getI18nBundleName)(aggregation.custom, aggregation.isViewNode, !!aggregation.annotationNodeId, projectType)]
66
+ : {};
67
+ };
68
+ exports.getRelevantI18nBundle = getRelevantI18nBundle;
69
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1,6 @@
1
+ export * from './annotations';
2
+ export * from './i18n';
3
+ export * from './object';
4
+ export * from './sort';
5
+ export * from './utils';
6
+ //# sourceMappingURL=index.d.ts.map