@elliemae/pui-scripting-object 1.46.3 → 1.47.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.
@@ -19,8 +19,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var application_exports = {};
20
20
  __export(application_exports, {
21
21
  ApplicationExtensionType: () => ApplicationExtensionType,
22
+ FormType: () => FormType,
22
23
  LogLevels: () => LogLevels,
23
24
  ModalSize: () => ModalSize,
25
+ ModalType: () => ModalType,
24
26
  OpenMode: () => OpenMode,
25
27
  OpenType: () => OpenType
26
28
  });
@@ -52,5 +54,22 @@ var ModalSize = /* @__PURE__ */ ((ModalSize2) => {
52
54
  ModalSize2["SMALL"] = "sm";
53
55
  ModalSize2["MEDIUM"] = "md";
54
56
  ModalSize2["LARGE"] = "lg";
57
+ ModalSize2["EXTRA_LARGE"] = "xl";
55
58
  return ModalSize2;
56
59
  })(ModalSize || {});
60
+ var FormType = /* @__PURE__ */ ((FormType2) => {
61
+ FormType2["STANDARD_FORM"] = "STANDARD_FORM";
62
+ FormType2["CUSTOM_FORM"] = "CUSTOM_FORM";
63
+ return FormType2;
64
+ })(FormType || {});
65
+ var ModalType = /* @__PURE__ */ ((ModalType2) => {
66
+ ModalType2["FORM"] = "FORM";
67
+ ModalType2["TOOL"] = "TOOL";
68
+ ModalType2["DOCUMENT"] = "DOCUMENT";
69
+ ModalType2["URL"] = "URL";
70
+ ModalType2["WARNING"] = "WARNING";
71
+ ModalType2["ERROR"] = "ERROR";
72
+ ModalType2["SUCCESS"] = "SUCCESS";
73
+ ModalType2["INFO"] = "INFO";
74
+ return ModalType2;
75
+ })(ModalType || {});
@@ -3,10 +3,6 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
6
  var __copyProps = (to, from, except, desc) => {
11
7
  if (from && typeof from === "object" || typeof from === "function") {
12
8
  for (let key of __getOwnPropNames(from))
@@ -17,21 +13,4 @@ var __copyProps = (to, from, except, desc) => {
17
13
  };
18
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
15
  var module_exports = {};
20
- __export(module_exports, {
21
- DialogSize: () => DialogSize,
22
- DialogType: () => DialogType
23
- });
24
16
  module.exports = __toCommonJS(module_exports);
25
- var DialogType = /* @__PURE__ */ ((DialogType2) => {
26
- DialogType2["WARNING"] = "warning";
27
- DialogType2["ERROR"] = "error";
28
- DialogType2["SUCCESS"] = "success";
29
- DialogType2["INFO"] = "info";
30
- return DialogType2;
31
- })(DialogType || {});
32
- var DialogSize = /* @__PURE__ */ ((DialogSize2) => {
33
- DialogSize2["SMALL"] = "small";
34
- DialogSize2["MEDIUM"] = "medium";
35
- DialogSize2["LARGE"] = "large";
36
- return DialogSize2;
37
- })(DialogSize || {});
@@ -25,12 +25,31 @@ var ModalSize = /* @__PURE__ */ ((ModalSize2) => {
25
25
  ModalSize2["SMALL"] = "sm";
26
26
  ModalSize2["MEDIUM"] = "md";
27
27
  ModalSize2["LARGE"] = "lg";
28
+ ModalSize2["EXTRA_LARGE"] = "xl";
28
29
  return ModalSize2;
29
30
  })(ModalSize || {});
31
+ var FormType = /* @__PURE__ */ ((FormType2) => {
32
+ FormType2["STANDARD_FORM"] = "STANDARD_FORM";
33
+ FormType2["CUSTOM_FORM"] = "CUSTOM_FORM";
34
+ return FormType2;
35
+ })(FormType || {});
36
+ var ModalType = /* @__PURE__ */ ((ModalType2) => {
37
+ ModalType2["FORM"] = "FORM";
38
+ ModalType2["TOOL"] = "TOOL";
39
+ ModalType2["DOCUMENT"] = "DOCUMENT";
40
+ ModalType2["URL"] = "URL";
41
+ ModalType2["WARNING"] = "WARNING";
42
+ ModalType2["ERROR"] = "ERROR";
43
+ ModalType2["SUCCESS"] = "SUCCESS";
44
+ ModalType2["INFO"] = "INFO";
45
+ return ModalType2;
46
+ })(ModalType || {});
30
47
  export {
31
48
  ApplicationExtensionType,
49
+ FormType,
32
50
  LogLevels,
33
51
  ModalSize,
52
+ ModalType,
34
53
  OpenMode,
35
54
  OpenType
36
55
  };
@@ -1,17 +0,0 @@
1
- var DialogType = /* @__PURE__ */ ((DialogType2) => {
2
- DialogType2["WARNING"] = "warning";
3
- DialogType2["ERROR"] = "error";
4
- DialogType2["SUCCESS"] = "success";
5
- DialogType2["INFO"] = "info";
6
- return DialogType2;
7
- })(DialogType || {});
8
- var DialogSize = /* @__PURE__ */ ((DialogSize2) => {
9
- DialogSize2["SMALL"] = "small";
10
- DialogSize2["MEDIUM"] = "medium";
11
- DialogSize2["LARGE"] = "large";
12
- return DialogSize2;
13
- })(DialogSize || {});
14
- export {
15
- DialogSize,
16
- DialogType
17
- };
@@ -6,11 +6,29 @@ import { NavigationType } from './shared.js';
6
6
  * Log levels
7
7
  */
8
8
  export declare enum LogLevels {
9
+ /**
10
+ * debug log level
11
+ */
9
12
  DEBUG = 10,
13
+ /**
14
+ * info log level
15
+ */
10
16
  INFO = 20,
17
+ /**
18
+ * audit log level
19
+ */
11
20
  AUDIT = 30,
21
+ /**
22
+ * warning log level
23
+ */
12
24
  WARN = 40,
25
+ /**
26
+ * error log level
27
+ */
13
28
  ERROR = 50,
29
+ /**
30
+ * fatal log level
31
+ */
14
32
  FATAL = 60
15
33
  }
16
34
  /**
@@ -178,28 +196,130 @@ export declare enum ModalSize {
178
196
  /**
179
197
  * large modal
180
198
  */
181
- LARGE = "lg"
199
+ LARGE = "lg",
200
+ /**
201
+ * extra large modal
202
+ */
203
+ EXTRA_LARGE = "xl"
204
+ }
205
+ /**
206
+ * additional options for warning / success / error / info modal
207
+ */
208
+ export type ModalData = {
209
+ /**
210
+ * title of the dialog
211
+ */
212
+ title: string;
213
+ /**
214
+ * message to be displayed in the body of the dialog
215
+ */
216
+ body: string;
217
+ /**
218
+ * list of actions that are avilable to user for providing feedback.
219
+ *
220
+ * these actions are displayed as buttons in the dialog
221
+ *
222
+ * default action is 'ok'
223
+ * @example ['retry', 'cancel']
224
+ */
225
+ actions?: string[];
226
+ /**
227
+ * link to the help documentation
228
+ */
229
+ helpLink?: string;
230
+ /**
231
+ * unique id that identifies the session / transaction
232
+ */
233
+ correlationId?: string;
234
+ /**
235
+ * error code
236
+ */
237
+ code?: string;
238
+ };
239
+ /**
240
+ * type of the form
241
+ */
242
+ export declare enum FormType {
243
+ /**
244
+ * standard form
245
+ */
246
+ STANDARD_FORM = "STANDARD_FORM",
247
+ /**
248
+ * custom form
249
+ */
250
+ CUSTOM_FORM = "CUSTOM_FORM"
251
+ }
252
+ /**
253
+ * type of the modal
254
+ */
255
+ export declare enum ModalType {
256
+ /**
257
+ * modal with form
258
+ */
259
+ FORM = "FORM",
260
+ /**
261
+ * modal with tool
262
+ */
263
+ TOOL = "TOOL",
264
+ /**
265
+ * modal with document
266
+ */
267
+ DOCUMENT = "DOCUMENT",
268
+ /**
269
+ * modal that opens a URL
270
+ */
271
+ URL = "URL",
272
+ /**
273
+ * modal with warning message
274
+ */
275
+ WARNING = "WARNING",
276
+ /**
277
+ * modal with error message
278
+ */
279
+ ERROR = "ERROR",
280
+ /**
281
+ * modal with success message
282
+ */
283
+ SUCCESS = "SUCCESS",
284
+ /**
285
+ * modal with info message
286
+ */
287
+ INFO = "INFO"
182
288
  }
183
289
  /**
184
290
  * modal options
185
291
  */
186
- export type OpenModalOptions = {
292
+ export type ModalOptions = {
187
293
  /**
188
294
  * target item
295
+ *
296
+ * optional for warning / success / error / info modal
189
297
  */
190
- target: string;
298
+ target?: string;
191
299
  /**
192
- * name
300
+ * name of the form or tool
301
+ *
302
+ * optional for warning / success / error / info modal
193
303
  */
194
304
  name: string;
195
305
  /**
196
306
  * type of the modal
197
307
  */
198
- type?: string;
308
+ type: ModalType;
199
309
  /**
200
310
  * size of the modal
311
+ * @default ModalSize.EXTRA_LARGE
312
+ */
313
+ size?: ModalSize;
314
+ /**
315
+ * form type
316
+ */
317
+ formType?: FormType;
318
+ /**
319
+ * additional data to display warning / success / error / info modal
320
+ *
201
321
  */
202
- size: ModalSize;
322
+ data?: ModalData;
203
323
  };
204
324
  /**
205
325
  * capabilities exposed by the application
@@ -446,7 +566,7 @@ export interface IApplication extends IScriptingObject {
446
566
  * @param message log message
447
567
  * @param logLevel log level
448
568
  */
449
- log(message: LogMessage | string, logLevel: LogLevels): Promise<void>;
569
+ log(message: LogMessage | string, logLevel: keyof typeof LogLevels): Promise<void>;
450
570
  /**
451
571
  * navigate to a location in the application
452
572
  * @param options navigation options
@@ -474,8 +594,9 @@ export interface IApplication extends IScriptingObject {
474
594
  /**
475
595
  * open a modal
476
596
  * @param options modal properties
597
+ * @returns user selected modal action as string
477
598
  */
478
- openModal(options: OpenModalOptions): Promise<void>;
599
+ openModal(options: ModalOptions): Promise<string>;
479
600
  /**
480
601
  * Perform an action
481
602
  * @param action action name
@@ -1,64 +1,5 @@
1
1
  import { IEvent } from '../event.js';
2
2
  import { IScriptingObject } from '../scriptingObject.js';
3
- /**
4
- * type of dialog to display in the hosting application
5
- */
6
- export declare enum DialogType {
7
- WARNING = "warning",
8
- ERROR = "error",
9
- SUCCESS = "success",
10
- INFO = "info"
11
- }
12
- /**
13
- * size of the dialog to display in the hosting application
14
- */
15
- export declare enum DialogSize {
16
- SMALL = "small",
17
- MEDIUM = "medium",
18
- LARGE = "large"
19
- }
20
- /**
21
- * Options to display a dialog in the hosting application
22
- */
23
- export type DialogOptions = {
24
- /**
25
- * type of dialog to display
26
- */
27
- type: DialogType;
28
- /**
29
- * size of the dialog to display
30
- */
31
- size: DialogSize;
32
- /**
33
- * title of the dialog
34
- */
35
- title: string;
36
- /**
37
- * message to be displayed in the body of the dialog
38
- */
39
- body: string;
40
- /**
41
- * link to the help documentation
42
- */
43
- helpLink?: string;
44
- /**
45
- * unique id that identifies the session / transaction
46
- */
47
- correlationId?: string;
48
- /**
49
- * error code
50
- */
51
- code?: string;
52
- /**
53
- * list of actions that are avilable to user for providing feedback.
54
- *
55
- * these actions are displayed as buttons in the dialog
56
- *
57
- * default action is 'ok'
58
- * @example ['retry', 'cancel']
59
- */
60
- actions?: string[];
61
- };
62
3
  /**
63
4
  * MicroApp module specific parameters
64
5
  */
@@ -177,24 +118,4 @@ export interface IModule extends IScriptingObject {
177
118
  * unload the microapp module from the host application
178
119
  */
179
120
  unload(): Promise<void>;
180
- /**
181
- * open a dialog in hosting application to display an error, success or info message and related help link
182
- *
183
- * Accessibility Consideration: once the dialog is closed, caller need to set the focus back to the link or button that opened the dialog to ensure keyboard navigation works as expected
184
- * @param options data to be displayed
185
- * @returns a promise that resolves when the dialog is closed along with the user action as string (in-case sensitive). For example, 'ok', 'retry', 'cancel'
186
- * @example
187
- * ```typescript
188
- * await module.showDialog({
189
- * type: DialogType.ERROR,
190
- * size: DialogSize.MEDIUM,
191
- * message: 'CoreLogic Error',
192
- * details: 'An error occurred while processing the credit request',
193
- * helpLink: 'https://example.com/help',
194
- * correlationId: '1234567890'
195
- * code: 'CL-1001'
196
- * });
197
- * ```
198
- */
199
- showDialog(options: DialogOptions): Promise<string>;
200
121
  }