@sapui5/ts-types 1.150.1 → 1.151.0
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/package.json +1 -1
- package/types/index.d.ts +1 -0
- package/types/sap.apf.d.ts +1 -1
- package/types/sap.ca.ui.d.ts +1 -1
- package/types/sap.chart.d.ts +1 -1
- package/types/sap.collaboration.d.ts +1 -1
- package/types/sap.esh.search.ui.d.ts +410 -157
- package/types/sap.f.d.ts +1 -1
- package/types/sap.fe.ariba.d.ts +1 -1
- package/types/sap.fe.base.d.ts +2 -222
- package/types/sap.fe.controls.d.ts +1 -1
- package/types/sap.fe.core.d.ts +1 -1
- package/types/sap.fe.ina.d.ts +1 -1
- package/types/sap.fe.macros.d.ts +209 -80
- package/types/sap.fe.navigation.d.ts +3 -2
- package/types/sap.fe.placeholder.d.ts +1 -1
- package/types/sap.fe.plugins.managecache.d.ts +1 -1
- package/types/sap.fe.templates.d.ts +1 -1
- package/types/sap.fe.test.d.ts +3 -3
- package/types/sap.fe.tools.d.ts +1 -1
- package/types/sap.feedback.ui.d.ts +1 -1
- package/types/sap.gantt.d.ts +125 -1
- package/types/sap.insights.d.ts +1 -1
- package/types/sap.m.d.ts +133 -1
- package/types/sap.makit.d.ts +1 -1
- package/types/sap.me.d.ts +1 -1
- package/types/sap.ndc.d.ts +1 -1
- package/types/sap.ovp.d.ts +1 -1
- package/types/sap.rules.ui.d.ts +1 -1
- package/types/sap.sac.df.d.ts +1 -1
- package/types/sap.suite.ui.commons.d.ts +45 -1
- package/types/sap.suite.ui.generic.template.d.ts +1 -1
- package/types/sap.suite.ui.microchart.d.ts +1 -1
- package/types/sap.tnt.d.ts +178 -1
- package/types/sap.ui.codeeditor.d.ts +1 -1
- package/types/sap.ui.commons.d.ts +1 -1
- package/types/sap.ui.comp.d.ts +1 -1
- package/types/sap.ui.core.d.ts +389 -236
- package/types/sap.ui.dt.d.ts +1 -1
- package/types/sap.ui.export.d.ts +1 -1
- package/types/sap.ui.fl.d.ts +1 -1
- package/types/sap.ui.generic.app.d.ts +1 -1
- package/types/sap.ui.generic.template.d.ts +1 -1
- package/types/sap.ui.geomap.d.ts +10393 -8758
- package/types/sap.ui.integration.d.ts +31 -3
- package/types/sap.ui.joule.frontend.d.ts +710 -0
- package/types/sap.ui.layout.d.ts +1 -1
- package/types/sap.ui.mdc.d.ts +11 -8
- package/types/sap.ui.richtexteditor.d.ts +1 -1
- package/types/sap.ui.rta.d.ts +2 -2
- package/types/sap.ui.suite.d.ts +1 -1
- package/types/sap.ui.support.d.ts +1 -1
- package/types/sap.ui.table.d.ts +2 -2
- package/types/sap.ui.testrecorder.d.ts +1 -1
- package/types/sap.ui.unified.d.ts +101 -1
- package/types/sap.ui.ux3.d.ts +1 -1
- package/types/sap.ui.vbm.d.ts +1 -1
- package/types/sap.ui.vk.d.ts +1 -1
- package/types/sap.ui.vtm.d.ts +1 -1
- package/types/sap.uiext.inbox.d.ts +1 -1
- package/types/sap.ushell.d.ts +22 -2
- package/types/sap.ushell_abap.d.ts +1 -1
- package/types/sap.uxap.d.ts +1 -1
- package/types/sap.viz.d.ts +1 -1
- package/types/sap.webanalytics.core.d.ts +1 -1
- package/types/sap.zen.commons.d.ts +1 -1
- package/types/sap.zen.crosstab.d.ts +1 -1
- package/types/sap.zen.dsh.d.ts +1 -1
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
// For Library Version: 1.151.0
|
|
2
|
+
|
|
3
|
+
declare namespace sap {
|
|
4
|
+
namespace ui {
|
|
5
|
+
namespace joule {
|
|
6
|
+
/**
|
|
7
|
+
* UI5 library for integrating frontend actions with SAP Joule.
|
|
8
|
+
*
|
|
9
|
+
* This library provides a unified API for registering frontend actions with SAP Joule, automatically handling
|
|
10
|
+
* both FLP (MessageBroker) and standalone communication modes.
|
|
11
|
+
*
|
|
12
|
+
* Generic actions (describeUI, describeUIElement, setFields, executeAction) are registered automatically
|
|
13
|
+
* at library load time. Applications only need to create a JouleConnector if they have app-specific custom
|
|
14
|
+
* actions to register.
|
|
15
|
+
*
|
|
16
|
+
* @experimental As of version 1.151.
|
|
17
|
+
*/
|
|
18
|
+
namespace frontend {
|
|
19
|
+
/**
|
|
20
|
+
* Channel version used for MessageBroker communication.
|
|
21
|
+
*
|
|
22
|
+
* @experimental As of version 1.151.
|
|
23
|
+
*/
|
|
24
|
+
export const CHANNEL_VERSION: string;
|
|
25
|
+
|
|
26
|
+
namespace util {
|
|
27
|
+
/**
|
|
28
|
+
* Helper utilities for implementing frontend actions with Joule. These functions provide reusable implementations
|
|
29
|
+
* of common frontend action patterns, allowing applications to easily expose UI introspection and manipulation
|
|
30
|
+
* capabilities to Joule without implementing the underlying logic themselves.
|
|
31
|
+
*
|
|
32
|
+
* The describeUI and describeUIElement methods automatically enrich UI elements with jouleControlEnrichment
|
|
33
|
+
* metadata from control designtime files when available. This allows controls/libraries to provide Joule-specific
|
|
34
|
+
* metadata (e.g., column names for SmartTable).
|
|
35
|
+
*
|
|
36
|
+
* @experimental As of version 1.151.
|
|
37
|
+
*/
|
|
38
|
+
interface ActionHelpers {
|
|
39
|
+
/**
|
|
40
|
+
* Describes the UI by returning a hierarchical tree representation of visible UI elements.
|
|
41
|
+
*
|
|
42
|
+
* This function provides a structured view of the UI with simplified control types and hierarchical nesting
|
|
43
|
+
* (containers have their children nested, select controls have their options as children, etc.). This is
|
|
44
|
+
* useful for Joule to understand the UI structure and relationships between elements.
|
|
45
|
+
*
|
|
46
|
+
* Automatically enriches elements with jouleControlEnrichment from designtime metadata when available.
|
|
47
|
+
* Smart controls (SmartTable, SmartChart, SmartFilterBar) and their inner controls are properly captured
|
|
48
|
+
* in the hierarchy.
|
|
49
|
+
*
|
|
50
|
+
* Response structure:
|
|
51
|
+
* ```javascript
|
|
52
|
+
*
|
|
53
|
+
* [
|
|
54
|
+
* {
|
|
55
|
+
* id: String, // Unique control ID
|
|
56
|
+
* label: String, // Human-readable label
|
|
57
|
+
* type: String, // Simplified type (e.g., "smartTable", "input", "button", "form")
|
|
58
|
+
* description: String, // Optional description/tooltip
|
|
59
|
+
* value: any, // Current value of the control
|
|
60
|
+
* editable: boolean, // Whether the control is editable
|
|
61
|
+
* valueTypeHint: String, // Type hint (String, Integer, Float, Boolean, Date, Object)
|
|
62
|
+
* jouleControlEnrichment: Object, // Optional jouleControlEnrichment from designtime metadata
|
|
63
|
+
* children: Array // Nested child elements
|
|
64
|
+
* }
|
|
65
|
+
* ]
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
*
|
|
69
|
+
* Container types (form, panel, page, smartTable) will have their child controls nested in children. Group
|
|
70
|
+
* controls (selectGroup) will have selectOption children. Select controls will have selectOption children
|
|
71
|
+
* for their items.
|
|
72
|
+
*
|
|
73
|
+
*
|
|
74
|
+
* @returns Promise resolving to hierarchical array of UI elements
|
|
75
|
+
*/
|
|
76
|
+
describeUI(
|
|
77
|
+
/**
|
|
78
|
+
* Root control to start scanning from, or params object if no root control
|
|
79
|
+
*/
|
|
80
|
+
oRootControlOrParams?: sap.ui.core.Control | object,
|
|
81
|
+
/**
|
|
82
|
+
* Optional parameters (only when first param is root control)
|
|
83
|
+
*/
|
|
84
|
+
oParams?: {
|
|
85
|
+
/**
|
|
86
|
+
* Start ID of the tree. When provided, the control with this ID is used as root (only its descendants are
|
|
87
|
+
* returned).
|
|
88
|
+
*/
|
|
89
|
+
rootElementId?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Properties to include in response elements. Uses SAP GUI naming convention (mapped internally). When
|
|
92
|
+
* omitted, all properties are included.
|
|
93
|
+
*/
|
|
94
|
+
includedProperties?: string[];
|
|
95
|
+
/**
|
|
96
|
+
* Simplified type names of controls to exclude from the response (e.g., "Table", "SmartTable", "Toolbar").
|
|
97
|
+
* Case-insensitive. When omitted, nothing is excluded.
|
|
98
|
+
*/
|
|
99
|
+
excludedElementTypes?: string[];
|
|
100
|
+
}
|
|
101
|
+
): Promise<any[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Describes a specific UI element by its control ID.
|
|
104
|
+
*
|
|
105
|
+
* This function locates a control by its ID and returns a detailed description of that specific control
|
|
106
|
+
* with its children (if any). The description includes simplified types, labels, values, and hierarchical
|
|
107
|
+
* children.
|
|
108
|
+
*
|
|
109
|
+
* Automatically enriches elements with jouleControlEnrichment from designtime metadata when available.
|
|
110
|
+
*
|
|
111
|
+
* Response structure (on success):
|
|
112
|
+
* ```javascript
|
|
113
|
+
*
|
|
114
|
+
* {
|
|
115
|
+
* id: String, // Unique control ID
|
|
116
|
+
* label: String, // Human-readable label
|
|
117
|
+
* type: String, // Simplified type (e.g., "smartTable", "input", "button")
|
|
118
|
+
* description: String, // Optional description/tooltip
|
|
119
|
+
* value: any, // Current value of the control
|
|
120
|
+
* editable: boolean, // Whether the control is editable
|
|
121
|
+
* valueTypeHint: String, // Type hint (String, Integer, Float, Boolean, Date, Object)
|
|
122
|
+
* jouleControlEnrichment: Object, // Optional jouleControlEnrichment from designtime metadata
|
|
123
|
+
* children: Array // Nested child elements
|
|
124
|
+
* }
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
*
|
|
128
|
+
* Response structure (on error):
|
|
129
|
+
* ```javascript
|
|
130
|
+
*
|
|
131
|
+
* {
|
|
132
|
+
* success: false,
|
|
133
|
+
* error: String // Error message
|
|
134
|
+
* }
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
*
|
|
138
|
+
*
|
|
139
|
+
* @returns Promise resolving to UiElement object on success or error object on failure
|
|
140
|
+
*/
|
|
141
|
+
describeUIElement(
|
|
142
|
+
/**
|
|
143
|
+
* Root control for validation, or params object if no root control
|
|
144
|
+
*/
|
|
145
|
+
oRootControlOrParams?: sap.ui.core.Control | object,
|
|
146
|
+
/**
|
|
147
|
+
* Parameters (only when first param is root control)
|
|
148
|
+
*/
|
|
149
|
+
oParams?: {
|
|
150
|
+
/**
|
|
151
|
+
* Control ID to describe
|
|
152
|
+
*/
|
|
153
|
+
elementId: string;
|
|
154
|
+
}
|
|
155
|
+
): Promise<object>;
|
|
156
|
+
/**
|
|
157
|
+
* Executes a named action on a control (e.g., press a button, select an item).
|
|
158
|
+
*
|
|
159
|
+
* This function locates a control by its ID and triggers the action specified by actionName. Supported
|
|
160
|
+
* action names: - "press" - firePress() for buttons, links, menu items, tiles - "select" - fireSelect()
|
|
161
|
+
* for selectable controls - "tap" - fireTap() for legacy controls - "toggle" - toggles selected state for
|
|
162
|
+
* checkboxes/switches - "expand" - expands a collapsible control - "collapse" - collapses an expandable
|
|
163
|
+
* control
|
|
164
|
+
*
|
|
165
|
+
*
|
|
166
|
+
* @returns Result object with success/error
|
|
167
|
+
*/
|
|
168
|
+
executeAction(
|
|
169
|
+
/**
|
|
170
|
+
* Root control for validation, or params object if no root control
|
|
171
|
+
*/
|
|
172
|
+
oRootControlOrParams?: sap.ui.core.Control | object,
|
|
173
|
+
/**
|
|
174
|
+
* Parameters (only when first param is root control)
|
|
175
|
+
*/
|
|
176
|
+
oParams?: {
|
|
177
|
+
/**
|
|
178
|
+
* Control ID to execute action on
|
|
179
|
+
*/
|
|
180
|
+
elementId: string;
|
|
181
|
+
/**
|
|
182
|
+
* Name of the action to execute (e.g., "press", "select", "tap")
|
|
183
|
+
*/
|
|
184
|
+
actionName: string;
|
|
185
|
+
/**
|
|
186
|
+
* Optional parameters to pass to the action event
|
|
187
|
+
*/
|
|
188
|
+
actionParameters?: object;
|
|
189
|
+
}
|
|
190
|
+
): object;
|
|
191
|
+
/**
|
|
192
|
+
* Gets all visible UI elements from the application in a flat array.
|
|
193
|
+
*
|
|
194
|
+
* This function traverses the UI control tree starting from the specified root control and returns an array
|
|
195
|
+
* of all visible UI elements with their metadata (ID, type, value, etc.). Applications can use this in
|
|
196
|
+
* their frontend actions to expose their UI structure to Joule.
|
|
197
|
+
*
|
|
198
|
+
* Note: This method returns a flat list and does not include jouleControlEnrichment enrichment. Use describeUI()
|
|
199
|
+
* for hierarchical structure with jouleControlEnrichment support.
|
|
200
|
+
*
|
|
201
|
+
* Response structure:
|
|
202
|
+
* ```javascript
|
|
203
|
+
*
|
|
204
|
+
* [
|
|
205
|
+
* {
|
|
206
|
+
* fieldName: String, // Unique control ID
|
|
207
|
+
* type: String, // Full control type (e.g., "sap.m.Input")
|
|
208
|
+
* description: String, // Human-readable description (from label, placeholder, or tooltip)
|
|
209
|
+
* fieldValue: any, // Current value of the control
|
|
210
|
+
* valueType: String, // Type of the value (String, Integer, Float, Boolean, Date, Object)
|
|
211
|
+
* children: Array // Child elements (currently empty, reserved for future use)
|
|
212
|
+
* }
|
|
213
|
+
* ]
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
*
|
|
217
|
+
*
|
|
218
|
+
* @returns Array of UI elements
|
|
219
|
+
*/
|
|
220
|
+
getFields(
|
|
221
|
+
/**
|
|
222
|
+
* Root control to start scanning from, or params object if no root control
|
|
223
|
+
*/
|
|
224
|
+
oRootControlOrParams?: sap.ui.core.Control | object,
|
|
225
|
+
/**
|
|
226
|
+
* Optional parameters (only when first param is root control)
|
|
227
|
+
*/
|
|
228
|
+
oParams?: object
|
|
229
|
+
): any[];
|
|
230
|
+
/**
|
|
231
|
+
* Sets a field value by finding the control and updating it.
|
|
232
|
+
*
|
|
233
|
+
* This function locates a control by its ID or label and sets its value. For model-bound controls (like
|
|
234
|
+
* SmartField), it updates the underlying model binding directly. It also fires change events to notify
|
|
235
|
+
* listeners of the value change.
|
|
236
|
+
*
|
|
237
|
+
*
|
|
238
|
+
* @returns Result object with success/error
|
|
239
|
+
*/
|
|
240
|
+
setField(
|
|
241
|
+
/**
|
|
242
|
+
* Root control for searching, or params object if no root control
|
|
243
|
+
*/
|
|
244
|
+
oRootControlOrParams?: sap.ui.core.Control | object,
|
|
245
|
+
/**
|
|
246
|
+
* Parameters (only when first param is root control)
|
|
247
|
+
*/
|
|
248
|
+
oParams?: {
|
|
249
|
+
/**
|
|
250
|
+
* Control ID or label text to find
|
|
251
|
+
*/
|
|
252
|
+
fieldName: string;
|
|
253
|
+
/**
|
|
254
|
+
* Value to set
|
|
255
|
+
*/
|
|
256
|
+
fieldValue: any;
|
|
257
|
+
}
|
|
258
|
+
): object;
|
|
259
|
+
/**
|
|
260
|
+
* Sets multiple field values in a single call.
|
|
261
|
+
*
|
|
262
|
+
* This function provides a batch operation for setting multiple field values at once. It iterates through
|
|
263
|
+
* each field in the provided array and attempts to set its value using the setField method. Results are
|
|
264
|
+
* aggregated and returned with detailed information about each field's success or failure.
|
|
265
|
+
*
|
|
266
|
+
* The fields array uses variable-key dict format where each object has a single key (the field ID) mapped
|
|
267
|
+
* to its value: [{"fieldId": "fieldValue"}, ...]
|
|
268
|
+
*
|
|
269
|
+
*
|
|
270
|
+
* @returns Result object with success/error and detailed results
|
|
271
|
+
*/
|
|
272
|
+
setFields(
|
|
273
|
+
/**
|
|
274
|
+
* Root control for searching, or params object if no root control
|
|
275
|
+
*/
|
|
276
|
+
oRootControlOrParams?: sap.ui.core.Control | object,
|
|
277
|
+
/**
|
|
278
|
+
* Parameters (only when first param is root control)
|
|
279
|
+
*/
|
|
280
|
+
oParams?: {
|
|
281
|
+
/**
|
|
282
|
+
* Array of single-key objects where key is field ID and value is the field value
|
|
283
|
+
*/
|
|
284
|
+
fields: object[];
|
|
285
|
+
}
|
|
286
|
+
): object;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Factory module for creating generic frontend action definitions.
|
|
291
|
+
*
|
|
292
|
+
* This module provides a set of standard UI introspection actions that are automatically included by JouleConnector.
|
|
293
|
+
* These actions use ActionHelpers to provide consistent UI scanning and manipulation capabilities.
|
|
294
|
+
*
|
|
295
|
+
* All actions return a standardized response envelope:
|
|
296
|
+
* ```javascript
|
|
297
|
+
*
|
|
298
|
+
* {
|
|
299
|
+
* status: "success"|"error", // Overall status
|
|
300
|
+
* content: any // Raw data or {success, error/message} object
|
|
301
|
+
* }
|
|
302
|
+
* ```
|
|
303
|
+
*
|
|
304
|
+
*
|
|
305
|
+
* @experimental As of version 1.151.
|
|
306
|
+
*/
|
|
307
|
+
interface GenericActions {
|
|
308
|
+
/**
|
|
309
|
+
* Creates an array of generic frontend action definitions.
|
|
310
|
+
*
|
|
311
|
+
* The following actions are created: - com.sap.ui.unified.frontend.actions.describeUI - Describes UI as
|
|
312
|
+
* a hierarchical tree - com.sap.ui.unified.frontend.actions.describeUIElement - Describes a specific UI
|
|
313
|
+
* element by ID - com.sap.ui.unified.frontend.actions.setFields - Sets multiple field values in a single
|
|
314
|
+
* call - com.sap.ui.unified.frontend.actions.executeAction - Executes an action on a control (e.g., press
|
|
315
|
+
* a button)
|
|
316
|
+
*
|
|
317
|
+
*
|
|
318
|
+
* @returns Array of frontend action definitions.
|
|
319
|
+
*/
|
|
320
|
+
create(): object[];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Class to facilitate communication between Applications and SAP Joule via SAP Fiori Launchpad for registering
|
|
325
|
+
* frontend actions.
|
|
326
|
+
*
|
|
327
|
+
* Use this class when running in FLP environment. For a unified API that works in both FLP and standalone
|
|
328
|
+
* environments, use {@link sap.ui.joule.frontend.JouleConnector} instead.
|
|
329
|
+
*
|
|
330
|
+
* @experimental As of version 1.151.
|
|
331
|
+
*/
|
|
332
|
+
class FLPJouleBridge extends sap.ui.base.Object {
|
|
333
|
+
/**
|
|
334
|
+
* Constructor for FLPJouleBridge.
|
|
335
|
+
*/
|
|
336
|
+
constructor(
|
|
337
|
+
/**
|
|
338
|
+
* The client ID to be used when connecting to the FLP MessageBroker. Must be unique across applications.
|
|
339
|
+
*/
|
|
340
|
+
sClientId: string
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Creates a new subclass of class sap.ui.joule.frontend.FLPJouleBridge with name `sClassName` and enriches
|
|
345
|
+
* it with the information contained in `oClassInfo`.
|
|
346
|
+
*
|
|
347
|
+
* `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}.
|
|
348
|
+
*
|
|
349
|
+
*
|
|
350
|
+
* @returns Created class / constructor function
|
|
351
|
+
*/
|
|
352
|
+
static extend<T extends Record<string, unknown>>(
|
|
353
|
+
/**
|
|
354
|
+
* Name of the class being created
|
|
355
|
+
*/
|
|
356
|
+
sClassName: string,
|
|
357
|
+
/**
|
|
358
|
+
* Object literal with information about the class
|
|
359
|
+
*/
|
|
360
|
+
oClassInfo?: sap.ClassInfo<T, sap.ui.joule.frontend.FLPJouleBridge>,
|
|
361
|
+
/**
|
|
362
|
+
* Constructor function for the metadata object; if not given, it defaults to the metadata implementation
|
|
363
|
+
* used by this class
|
|
364
|
+
*/
|
|
365
|
+
FNMetaImpl?: Function
|
|
366
|
+
): Function;
|
|
367
|
+
/**
|
|
368
|
+
* Returns a metadata object for class sap.ui.joule.frontend.FLPJouleBridge.
|
|
369
|
+
*
|
|
370
|
+
*
|
|
371
|
+
* @returns Metadata object describing this class
|
|
372
|
+
*/
|
|
373
|
+
static getMetadata(): sap.ui.base.Metadata;
|
|
374
|
+
/**
|
|
375
|
+
* Disconnects the FLPJouleBridge from the MessageBroker and unsubscribes from all channels. Must be called
|
|
376
|
+
* to clean up resources when the bridge is no longer needed. It cannot be re-connected later.
|
|
377
|
+
*
|
|
378
|
+
*
|
|
379
|
+
* @returns A Promise that resolves when the bridge has been disconnected.
|
|
380
|
+
*/
|
|
381
|
+
disconnect(): Promise<void>;
|
|
382
|
+
/**
|
|
383
|
+
* Returns the client ID used by this bridge.
|
|
384
|
+
*
|
|
385
|
+
*
|
|
386
|
+
* @returns The client ID.
|
|
387
|
+
*/
|
|
388
|
+
getClientId(): string;
|
|
389
|
+
/**
|
|
390
|
+
* Checks if the bridge is currently connected.
|
|
391
|
+
*
|
|
392
|
+
*
|
|
393
|
+
* @returns True if connected, false otherwise.
|
|
394
|
+
*/
|
|
395
|
+
isConnected(): boolean;
|
|
396
|
+
/**
|
|
397
|
+
* Registers callback functions to handle frontend action requests from Joule.
|
|
398
|
+
*
|
|
399
|
+
*
|
|
400
|
+
* @returns A Promise that resolves when the callback has been registered.
|
|
401
|
+
*/
|
|
402
|
+
register(
|
|
403
|
+
/**
|
|
404
|
+
* An object containing callback functions for Joule frontend actions.
|
|
405
|
+
*/
|
|
406
|
+
oJouleCallbacks: {
|
|
407
|
+
/**
|
|
408
|
+
* Callback that returns an array of frontend actions.
|
|
409
|
+
*/
|
|
410
|
+
getFrontendActions: Function;
|
|
411
|
+
}
|
|
412
|
+
): Promise<void>;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Unified connector for SAP Joule frontend action integration.
|
|
416
|
+
*
|
|
417
|
+
* This is the main entry point for integrating frontend actions with SAP Joule. It automatically detects
|
|
418
|
+
* the runtime environment (FLP or standalone) and uses the appropriate communication mechanism.
|
|
419
|
+
*
|
|
420
|
+
* @experimental As of version 1.151.
|
|
421
|
+
*/
|
|
422
|
+
class JouleConnector extends sap.ui.base.Object {
|
|
423
|
+
/**
|
|
424
|
+
* Constructor for JouleConnector.
|
|
425
|
+
*/
|
|
426
|
+
constructor(
|
|
427
|
+
/**
|
|
428
|
+
* A unique client ID for this application's registration with Joule. This ID must be unique across all
|
|
429
|
+
* applications.
|
|
430
|
+
*/
|
|
431
|
+
sClientId: string,
|
|
432
|
+
/**
|
|
433
|
+
* Optional configuration options.
|
|
434
|
+
*/
|
|
435
|
+
oOptions?: {
|
|
436
|
+
/**
|
|
437
|
+
* Whether to auto-detect the environment. If false, you must call registerActions() manually.
|
|
438
|
+
*/
|
|
439
|
+
autoDetect?: boolean;
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Creates a new subclass of class sap.ui.joule.frontend.JouleConnector with name `sClassName` and enriches
|
|
445
|
+
* it with the information contained in `oClassInfo`.
|
|
446
|
+
*
|
|
447
|
+
* `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}.
|
|
448
|
+
*
|
|
449
|
+
*
|
|
450
|
+
* @returns Created class / constructor function
|
|
451
|
+
*/
|
|
452
|
+
static extend<T extends Record<string, unknown>>(
|
|
453
|
+
/**
|
|
454
|
+
* Name of the class being created
|
|
455
|
+
*/
|
|
456
|
+
sClassName: string,
|
|
457
|
+
/**
|
|
458
|
+
* Object literal with information about the class
|
|
459
|
+
*/
|
|
460
|
+
oClassInfo?: sap.ClassInfo<T, sap.ui.joule.frontend.JouleConnector>,
|
|
461
|
+
/**
|
|
462
|
+
* Constructor function for the metadata object; if not given, it defaults to the metadata implementation
|
|
463
|
+
* used by this class
|
|
464
|
+
*/
|
|
465
|
+
FNMetaImpl?: Function
|
|
466
|
+
): Function;
|
|
467
|
+
/**
|
|
468
|
+
* Returns a metadata object for class sap.ui.joule.frontend.JouleConnector.
|
|
469
|
+
*
|
|
470
|
+
*
|
|
471
|
+
* @returns Metadata object describing this class
|
|
472
|
+
*/
|
|
473
|
+
static getMetadata(): sap.ui.base.Metadata;
|
|
474
|
+
/**
|
|
475
|
+
* Disconnects from Joule and cleans up resources.
|
|
476
|
+
*
|
|
477
|
+
* Should be called when the application is exiting (e.g., in onExit lifecycle method).
|
|
478
|
+
*
|
|
479
|
+
*
|
|
480
|
+
* @returns A Promise that resolves when disconnection is complete.
|
|
481
|
+
*/
|
|
482
|
+
disconnect(): Promise<void>;
|
|
483
|
+
/**
|
|
484
|
+
* Returns the client ID used by this connector.
|
|
485
|
+
*
|
|
486
|
+
*
|
|
487
|
+
* @returns The client ID.
|
|
488
|
+
*/
|
|
489
|
+
getClientId(): string;
|
|
490
|
+
/**
|
|
491
|
+
* Returns the detected environment type.
|
|
492
|
+
*
|
|
493
|
+
*
|
|
494
|
+
* @returns The environment type (FLP or STANDALONE).
|
|
495
|
+
*/
|
|
496
|
+
getEnvironmentType(): sap.ui.joule.frontend.EnvironmentType;
|
|
497
|
+
/**
|
|
498
|
+
* Checks if the connector is currently connected to Joule.
|
|
499
|
+
*
|
|
500
|
+
*
|
|
501
|
+
* @returns True if connected, false otherwise.
|
|
502
|
+
*/
|
|
503
|
+
isConnected(): boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Checks if running in FLP environment.
|
|
506
|
+
*
|
|
507
|
+
*
|
|
508
|
+
* @returns True if in FLP, false otherwise.
|
|
509
|
+
*/
|
|
510
|
+
isFLP(): boolean;
|
|
511
|
+
/**
|
|
512
|
+
* Checks if running in standalone mode.
|
|
513
|
+
*
|
|
514
|
+
*
|
|
515
|
+
* @returns True if standalone, false otherwise.
|
|
516
|
+
*/
|
|
517
|
+
isStandalone(): boolean;
|
|
518
|
+
/**
|
|
519
|
+
* Registers app-specific frontend actions with Joule.
|
|
520
|
+
*
|
|
521
|
+
* Generic UI actions (describeUI, describeUIElement, setFields, executeAction) are automatically registered
|
|
522
|
+
* at library load time under a separate client ID. This method registers app-specific actions independently
|
|
523
|
+
* under the app's own client ID.
|
|
524
|
+
*
|
|
525
|
+
*
|
|
526
|
+
* @returns This instance for chaining.
|
|
527
|
+
*/
|
|
528
|
+
registerActions(
|
|
529
|
+
/**
|
|
530
|
+
* A function that returns an array of app-specific frontend action definitions. This function is called
|
|
531
|
+
* by Joule for each user prompt to get the available actions.
|
|
532
|
+
*/
|
|
533
|
+
fnGetActions?: Function
|
|
534
|
+
): sap.ui.joule.frontend.JouleConnector;
|
|
535
|
+
/**
|
|
536
|
+
* Registers an additional callback with Joule beyond frontend actions.
|
|
537
|
+
*
|
|
538
|
+
* Use this method to register callbacks for lifecycle events, context changes, chat events, or other Joule
|
|
539
|
+
* webclient interactions that are not frontend actions.
|
|
540
|
+
*
|
|
541
|
+
* Can be called before or after {@link #registerActions}. If called after, the callback is added to the
|
|
542
|
+
* already-connected bridge immediately.
|
|
543
|
+
*
|
|
544
|
+
*
|
|
545
|
+
* @returns This instance for chaining.
|
|
546
|
+
*/
|
|
547
|
+
registerCallback(
|
|
548
|
+
/**
|
|
549
|
+
* The callback name (e.g., "onContextChange", "onChatEvent"). Must not be "getFrontendActions" — use registerActions()
|
|
550
|
+
* for that.
|
|
551
|
+
*/
|
|
552
|
+
sName: string,
|
|
553
|
+
/**
|
|
554
|
+
* The callback handler function.
|
|
555
|
+
*/
|
|
556
|
+
fnHandler: Function
|
|
557
|
+
): sap.ui.joule.frontend.JouleConnector;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Connector for standalone (non-FLP) Joule integration.
|
|
561
|
+
*
|
|
562
|
+
* This class handles direct communication with the Joule webclient API when running outside of SAP Fiori
|
|
563
|
+
* Launchpad. It supports both immediate registration (when Joule is already loaded) and pre-registration
|
|
564
|
+
* (when Joule loads later).
|
|
565
|
+
*
|
|
566
|
+
* For a unified API that works in both FLP and standalone environments, use {@link sap.ui.joule.frontend.JouleConnector }
|
|
567
|
+
* instead.
|
|
568
|
+
*
|
|
569
|
+
* @experimental As of version 1.151.
|
|
570
|
+
*/
|
|
571
|
+
class StandaloneConnector extends sap.ui.base.Object {
|
|
572
|
+
/**
|
|
573
|
+
* Constructor for StandaloneConnector.
|
|
574
|
+
*/
|
|
575
|
+
constructor(
|
|
576
|
+
/**
|
|
577
|
+
* The unique client ID for registration with Joule.
|
|
578
|
+
*/
|
|
579
|
+
sClientId: string
|
|
580
|
+
);
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Creates a new subclass of class sap.ui.joule.frontend.StandaloneConnector with name `sClassName` and
|
|
584
|
+
* enriches it with the information contained in `oClassInfo`.
|
|
585
|
+
*
|
|
586
|
+
* `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}.
|
|
587
|
+
*
|
|
588
|
+
*
|
|
589
|
+
* @returns Created class / constructor function
|
|
590
|
+
*/
|
|
591
|
+
static extend<T extends Record<string, unknown>>(
|
|
592
|
+
/**
|
|
593
|
+
* Name of the class being created
|
|
594
|
+
*/
|
|
595
|
+
sClassName: string,
|
|
596
|
+
/**
|
|
597
|
+
* Object literal with information about the class
|
|
598
|
+
*/
|
|
599
|
+
oClassInfo?: sap.ClassInfo<
|
|
600
|
+
T,
|
|
601
|
+
sap.ui.joule.frontend.StandaloneConnector
|
|
602
|
+
>,
|
|
603
|
+
/**
|
|
604
|
+
* Constructor function for the metadata object; if not given, it defaults to the metadata implementation
|
|
605
|
+
* used by this class
|
|
606
|
+
*/
|
|
607
|
+
FNMetaImpl?: Function
|
|
608
|
+
): Function;
|
|
609
|
+
/**
|
|
610
|
+
* Returns a metadata object for class sap.ui.joule.frontend.StandaloneConnector.
|
|
611
|
+
*
|
|
612
|
+
*
|
|
613
|
+
* @returns Metadata object describing this class
|
|
614
|
+
*/
|
|
615
|
+
static getMetadata(): sap.ui.base.Metadata;
|
|
616
|
+
/**
|
|
617
|
+
* Disconnects from the Joule webclient and cleans up resources.
|
|
618
|
+
*
|
|
619
|
+
* @experimental As of version 1.151.
|
|
620
|
+
*/
|
|
621
|
+
disconnect(): void;
|
|
622
|
+
/**
|
|
623
|
+
* Returns the client ID used by this connector.
|
|
624
|
+
*
|
|
625
|
+
* @experimental As of version 1.151.
|
|
626
|
+
*
|
|
627
|
+
* @returns The client ID.
|
|
628
|
+
*/
|
|
629
|
+
getClientId(): string;
|
|
630
|
+
/**
|
|
631
|
+
* Checks if the connector is currently registered or pre-registered.
|
|
632
|
+
*
|
|
633
|
+
* @experimental As of version 1.151.
|
|
634
|
+
*
|
|
635
|
+
* @returns True if registered or pre-registered, false otherwise.
|
|
636
|
+
*/
|
|
637
|
+
isConnected(): boolean;
|
|
638
|
+
/**
|
|
639
|
+
* Checks if direct registration was used (vs pre-registration).
|
|
640
|
+
*
|
|
641
|
+
*
|
|
642
|
+
* @returns True if directly registered, false if pre-registered.
|
|
643
|
+
*/
|
|
644
|
+
isDirectlyRegistered(): boolean;
|
|
645
|
+
/**
|
|
646
|
+
* Registers callbacks with the Joule webclient.
|
|
647
|
+
*
|
|
648
|
+
* If the Joule webclient is already loaded, registration happens immediately. Otherwise, the callbacks
|
|
649
|
+
* are stored for pre-registration and will be picked up when the Joule webclient loads.
|
|
650
|
+
*
|
|
651
|
+
* @experimental As of version 1.151.
|
|
652
|
+
*/
|
|
653
|
+
register(
|
|
654
|
+
/**
|
|
655
|
+
* An object containing callback functions for Joule frontend actions.
|
|
656
|
+
*/
|
|
657
|
+
oJouleCallbacks: {
|
|
658
|
+
/**
|
|
659
|
+
* Callback that returns an array of frontend actions.
|
|
660
|
+
*/
|
|
661
|
+
getFrontendActions: Function;
|
|
662
|
+
}
|
|
663
|
+
): void;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Environment types for Joule integration.
|
|
667
|
+
*
|
|
668
|
+
* This enum is part of the 'sap/ui/joule/frontend/library' module export and must be accessed by the property
|
|
669
|
+
* 'EnvironmentType'.
|
|
670
|
+
*
|
|
671
|
+
* @experimental As of version 1.151.
|
|
672
|
+
*/
|
|
673
|
+
enum EnvironmentType {
|
|
674
|
+
/**
|
|
675
|
+
* Running inside SAP Fiori Launchpad (FLP). Communication with Joule uses the FLP MessageBroker.
|
|
676
|
+
*/
|
|
677
|
+
FLP = "undefined",
|
|
678
|
+
/**
|
|
679
|
+
* Running as a standalone application. Communication with Joule uses the direct webclient API.
|
|
680
|
+
*/
|
|
681
|
+
STANDALONE = "undefined",
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Message names used in Joule FLP MessageBroker communication. These values are protocol-specific and must
|
|
685
|
+
* match what Joule expects.
|
|
686
|
+
*
|
|
687
|
+
* This enum is part of the 'sap/ui/joule/frontend/library' module export and must be accessed by the property
|
|
688
|
+
* 'MessageName'.
|
|
689
|
+
*
|
|
690
|
+
* @experimental As of version 1.151.
|
|
691
|
+
*/
|
|
692
|
+
enum MessageName {}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
interface IUI5DefineDependencyNames {
|
|
698
|
+
"sap/ui/joule/frontend/FLPJouleBridge": undefined;
|
|
699
|
+
|
|
700
|
+
"sap/ui/joule/frontend/GenericActions": undefined;
|
|
701
|
+
|
|
702
|
+
"sap/ui/joule/frontend/JouleConnector": undefined;
|
|
703
|
+
|
|
704
|
+
"sap/ui/joule/frontend/library": undefined;
|
|
705
|
+
|
|
706
|
+
"sap/ui/joule/frontend/StandaloneConnector": undefined;
|
|
707
|
+
|
|
708
|
+
"sap/ui/joule/frontend/util/ActionHelpers": undefined;
|
|
709
|
+
}
|
|
710
|
+
}
|