@elliemae/pui-scripting-object 1.16.5 → 1.16.6

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.
@@ -3,7 +3,7 @@ import { IScriptingObject } from '../scriptingObject.js';
3
3
  /**
4
4
  * option name and its value
5
5
  */
6
- export declare type FieldOptions = {
6
+ export type FieldOptions = {
7
7
  /**
8
8
  * option name
9
9
  */
@@ -16,14 +16,14 @@ export declare type FieldOptions = {
16
16
  /**
17
17
  * v3 loan object
18
18
  */
19
- export declare type LoanObject = Record<string, unknown>;
19
+ export type LoanObject = Record<string, unknown>;
20
20
  export declare enum LoanLevelActions {
21
21
  UPDATE_CORRESPONDENT_BALANCE = "updateCorrespondentBalance",
22
22
  UPDATE_CORRESPONDENT_FEES = "updateCorrespondentFees",
23
23
  COPY_ITEMIZATION_TO_STATE_DISCLOSURE = "copyItemizationToStateDisclosure",
24
24
  CALCULATE_EEM_MORTGAGE = "calculateEEMMortgage"
25
25
  }
26
- declare type CommitInfo = {
26
+ type CommitInfo = {
27
27
  /**
28
28
  * cause of commit event
29
29
  */
@@ -34,181 +34,85 @@ declare type CommitInfo = {
34
34
  *
35
35
  * @returns true if precommit is allowed, false otherwise
36
36
  */
37
- export declare type LoanPreCommitListener = Listener<ILoan, CommitInfo, Record<string, unknown>, boolean>;
37
+ export type LoanPreCommitListener = Listener<ILoan, CommitInfo, Record<string, unknown>, boolean>;
38
38
  /**
39
39
  * event to notify loan precommit operation
40
40
  */
41
41
  export interface ILoanPreCommitEvent extends IEvent {
42
- /**
43
- * event name
44
- */
45
- readonly name: 'PreCommit';
46
- /**
47
- * scripting object from where the event is fired
48
- */
49
- readonly objectId: 'Loan';
50
- /**
51
- * event requires feedback from listeners
52
- */
53
- readonly requiresFeedback: true;
54
42
  /**
55
43
  * event parameters
56
44
  */
57
45
  readonly params: CommitInfo;
58
- /**
59
- * subscribe to the event
60
- */
61
- subscribe: (callback: LoanPreCommitListener) => string;
62
46
  }
63
47
  /**
64
48
  * event handler for loan commited event
65
49
  *
66
50
  */
67
- export declare type LoanCommittedListener = Listener<ILoan, CommitInfo, Record<string, unknown>, void>;
51
+ export type LoanCommittedListener = Listener<ILoan, CommitInfo, Record<string, unknown>, void>;
68
52
  /**
69
53
  * event to notify loan committed operation
70
54
  */
71
55
  export interface ILoanCommittedEvent extends IEvent {
72
- /**
73
- * event name
74
- */
75
- readonly name: 'Committed';
76
- /**
77
- * scripting object from where the event is fired
78
- */
79
- readonly objectId: 'Loan';
80
- /**
81
- * event does not require feedback from listeners
82
- */
83
- readonly requiresFeedback: false;
84
56
  /**
85
57
  * event parameters
86
58
  */
87
59
  readonly params: CommitInfo;
88
- /**
89
- * subscribe to the event
90
- */
91
- subscribe: (callback: LoanCommittedListener) => string;
92
60
  }
93
61
  /**
94
62
  * event handler for loan data change event
95
63
  */
96
- export declare type LoanChangeListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
64
+ export type LoanChangeListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
97
65
  /**
98
66
  * event to notify loan change operation
99
67
  */
100
68
  export interface ILoanChangeEvent extends IEvent {
101
- /**
102
- * event name
103
- */
104
- readonly name: 'Chanage';
105
- /**
106
- * scripting object from where the event is fired
107
- */
108
- readonly objectId: 'Loan';
109
- /**
110
- * event does not require feedback from listeners
111
- */
112
- readonly requiresFeedback: false;
113
69
  /**
114
70
  * event parameters
115
71
  */
116
72
  readonly params: Record<string, never>;
117
- /**
118
- * subscribe to the event
119
- */
120
- subscribe: (callback: LoanChangeListener) => string;
121
73
  }
122
74
  /**
123
75
  * event handler for loan sync event
124
76
  */
125
- export declare type LoanSyncListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
77
+ export type LoanSyncListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
126
78
  /**
127
79
  * event to notify loan sync operation
128
80
  */
129
81
  export interface ILoanSyncEvent extends IEvent {
130
- /**
131
- * event name
132
- */
133
- readonly name: 'Sync';
134
- /**
135
- * scripting object from where the event is fired
136
- */
137
- readonly objectId: 'Loan';
138
- /**
139
- * event does not require feedback from listeners
140
- */
141
- readonly requiresFeedback: false;
142
82
  /**
143
83
  * event parameters
144
84
  */
145
85
  readonly params: Record<string, never>;
146
- /**
147
- * subscribe to the event
148
- */
149
- subscribe: (callback: LoanSyncListener) => string;
150
86
  }
151
87
  /**
152
88
  * event handler for loan open event
153
89
  */
154
- export declare type LoanOpenListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
90
+ export type LoanOpenListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
155
91
  /**
156
92
  * event to notify loan open operation
157
93
  */
158
94
  export interface ILoanOpenEvent extends IEvent {
159
- /**
160
- * event name
161
- */
162
- readonly name: 'Open';
163
- /**
164
- * scripting object from where the event is fired
165
- */
166
- readonly objectId: 'Loan';
167
- /**
168
- * event does not require feedback from listeners
169
- */
170
- readonly requiresFeedback: false;
171
95
  /**
172
96
  * event parameters
173
97
  */
174
98
  readonly params: Record<string, never>;
175
- /**
176
- * subscribe to the event
177
- */
178
- subscribe: (callback: LoanOpenListener) => string;
179
99
  }
180
100
  /**
181
101
  * event handler for loan close event
182
102
  *
183
103
  * @returns true if loan close is allowed, false otherwise
184
104
  */
185
- export declare type LoanCloseListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
105
+ export type LoanCloseListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
186
106
  /**
187
107
  * event to notify loan close operation
188
108
  */
189
109
  export interface ILoanCloseEvent extends IEvent {
190
- /**
191
- * event name
192
- */
193
- readonly name: 'Close';
194
- /**
195
- * scripting object from where the event is fired
196
- */
197
- readonly objectId: 'Loan';
198
- /**
199
- * event does not require feedback from listeners
200
- */
201
- readonly requiresFeedback: false;
202
110
  /**
203
111
  * event parameters
204
112
  */
205
113
  readonly params: Record<string, never>;
206
- /**
207
- * subscribe to the event
208
- */
209
- subscribe: (callback: LoanCloseListener) => string;
210
114
  }
211
- declare type MilestoneInfo = {
115
+ type MilestoneInfo = {
212
116
  /**
213
117
  * milestone name
214
118
  */
@@ -217,92 +121,88 @@ declare type MilestoneInfo = {
217
121
  /**
218
122
  * event handler for loan milestone completed event
219
123
  */
220
- export declare type LoanMilestoneCompletedListener = Listener<ILoan, MilestoneInfo, Record<string, unknown>, void>;
124
+ export type LoanMilestoneCompletedListener = Listener<ILoan, MilestoneInfo, Record<string, unknown>, void>;
221
125
  /**
222
126
  * event to notify loan milestone completed operation
223
127
  */
224
128
  export interface ILoanMilestoneCompletedEvent extends IEvent {
225
- /**
226
- * event name
227
- */
228
- readonly name: 'MilestoneCompleted';
229
- /**
230
- * scripting object from where the event is fired
231
- */
232
- readonly objectId: 'Loan';
233
- /**
234
- * event does not require feedback from listeners
235
- */
236
- readonly requiresFeedback: false;
237
129
  /**
238
130
  * event parameters
239
131
  */
240
132
  readonly params: MilestoneInfo;
241
- /**
242
- * subscribe to the event
243
- */
244
- subscribe: (callback: LoanMilestoneCompletedListener) => string;
245
133
  }
246
134
  /**
247
135
  * event handler for loan pre milestone complete event
248
136
  *
249
137
  * @returns true if milestone complete is allowed, false otherwise
250
138
  */
251
- export declare type LoanPreMilestoneCompleteListener = Listener<ILoan, MilestoneInfo, Record<string, unknown>, boolean>;
139
+ export type LoanPreMilestoneCompleteListener = Listener<ILoan, MilestoneInfo, Record<string, unknown>, boolean>;
252
140
  /**
253
141
  * event to notify loan pre milestone complete operation
254
142
  */
255
143
  export interface ILoanPreMilestoneCompleteEvent extends IEvent {
256
- /**
257
- * event name
258
- */
259
- readonly name: 'PreMilestoneComplete';
260
- /**
261
- * scripting object from where the event is fired
262
- */
263
- readonly objectId: 'Loan';
264
- /**
265
- * event requires feedback from listeners
266
- */
267
- readonly requiresFeedback: true;
268
144
  /**
269
145
  * event parameters
270
146
  */
271
147
  readonly params: MilestoneInfo;
272
- /**
273
- * subscribe to the event
274
- */
275
- subscribe: (callback: LoanPreMilestoneCompleteListener) => string;
276
148
  }
277
149
  /**
278
150
  * event handler for loan application selected event
279
151
  */
280
- export declare type LoanApplicationSelectedListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
152
+ export type LoanApplicationSelectedListener = Listener<ILoan, Record<string, never>, Record<string, unknown>, void>;
281
153
  /**
282
154
  * event to notify loan application selected operation
283
155
  */
284
156
  export interface ILoanApplicationSelectedEvent extends IEvent {
285
157
  /**
286
- * event name
158
+ * event parameters
287
159
  */
288
- readonly name: 'ApplicationSelected';
160
+ readonly params: Record<string, never>;
161
+ }
162
+ /**
163
+ * events supported by Loan scripting object
164
+ */
165
+ export type LoanEvents = {
289
166
  /**
290
- * scripting object from where the event is fired
167
+ * event is fired prior to saving any pending changes to the loan.
168
+ * The guest can use this event to perform custom validation and,
169
+ * via the feedback mechanism, prevent the loan from being saved
291
170
  */
292
- readonly objectId: 'Loan';
171
+ 'loan.precommit': LoanPreCommitListener;
293
172
  /**
294
- * event does not require feedback from listeners
173
+ * event is fired after pending changes to the loan are committed
295
174
  */
296
- readonly requiresFeedback: false;
175
+ 'loan.committed': LoanCommittedListener;
297
176
  /**
298
- * event parameters
177
+ * event is fired for each change made by the user in the UI
299
178
  */
300
- readonly params: Record<string, never>;
179
+ 'loan.change': LoanChangeListener;
301
180
  /**
302
- * subscribe to the event
181
+ * event is fired after the loan is sync'ed within any saved state made outside of the user's workspace.
303
182
  */
304
- subscribe: (callback: LoanApplicationSelectedListener) => string;
305
- }
183
+ 'loan.sync': LoanSyncListener;
184
+ /**
185
+ * event is fired after the loan is opened and ready for user interaction
186
+ */
187
+ 'loan.open': LoanOpenListener;
188
+ /**
189
+ * event is fired just prior to closing the loan in the UI
190
+ */
191
+ 'loan.close': LoanCloseListener;
192
+ /**
193
+ * event is fired after a milestone is completed by the user and committed to the server
194
+ */
195
+ 'loan.milestoneCompleted': LoanMilestoneCompletedListener;
196
+ /**
197
+ * event is fired when the user attempts to complete a milestone and allows for custom validation,
198
+ * and cancellation, of the process
199
+ */
200
+ 'loan.premilestoneComplete': LoanPreMilestoneCompleteListener;
201
+ /**
202
+ * event is fired when a borrower pair changes
203
+ */
204
+ 'loan.applicationselected': LoanApplicationSelectedListener;
205
+ };
306
206
  /**
307
207
  * Methods for interacting with an open loan in the application
308
208
  */
@@ -310,39 +210,57 @@ export interface ILoan extends IScriptingObject {
310
210
  /**
311
211
  * event fired when the loan is ready to commit
312
212
  */
313
- readonly PreCommit: ILoanPreCommitEvent;
213
+ readonly PreCommit: {
214
+ new (): ILoanPreCommitEvent;
215
+ };
314
216
  /**
315
217
  * event fired when the loan is committed
316
218
  */
317
- readonly Committed: ILoanCommittedEvent;
219
+ readonly Committed: {
220
+ new (): ILoanCommittedEvent;
221
+ };
318
222
  /**
319
223
  * event fired when the loan is changed
320
224
  */
321
- readonly Change: ILoanChangeEvent;
225
+ readonly Change: {
226
+ new (): ILoanChangeEvent;
227
+ };
322
228
  /**
323
229
  * event fired when the loan is synced
324
230
  */
325
- readonly Sync: ILoanSyncEvent;
231
+ readonly Sync: {
232
+ new (): ILoanSyncEvent;
233
+ };
326
234
  /**
327
235
  * event fired when the loan is opened
328
236
  */
329
- readonly Open: ILoanOpenEvent;
237
+ readonly Open: {
238
+ new (): ILoanOpenEvent;
239
+ };
330
240
  /**
331
241
  * event fired when the loan is closed
332
242
  */
333
- readonly Close: ILoanCloseEvent;
243
+ readonly Close: {
244
+ new (): ILoanCloseEvent;
245
+ };
334
246
  /**
335
247
  * event fired when the loan milestone is completed
336
248
  */
337
- readonly MilestoneCompleted: ILoanMilestoneCompletedEvent;
249
+ readonly MilestoneCompleted: {
250
+ new (): ILoanMilestoneCompletedEvent;
251
+ };
338
252
  /**
339
253
  * event fired when the loan is ready to complete milestone
340
254
  */
341
- readonly PreMilestoneComplete: ILoanPreMilestoneCompleteEvent;
255
+ readonly PreMilestoneComplete: {
256
+ new (): ILoanPreMilestoneCompleteEvent;
257
+ };
342
258
  /**
343
259
  * event fired when the loan application is selected
344
260
  */
345
- readonly ApplicationSelected: ILoanApplicationSelectedEvent;
261
+ readonly ApplicationSelected: {
262
+ new (): ILoanApplicationSelectedEvent;
263
+ };
346
264
  /**
347
265
  * Get complete Loan object
348
266
  *
@@ -29,7 +29,7 @@ export declare enum FieldErrorType {
29
29
  /**
30
30
  * Field error object
31
31
  */
32
- export declare type FieldErrors = {
32
+ export type FieldErrors = {
33
33
  /**
34
34
  * field id
35
35
  */
@@ -46,7 +46,7 @@ export declare type FieldErrors = {
46
46
  /**
47
47
  * Return type of setField method
48
48
  */
49
- export declare type SetFieldResponse = {
49
+ export type SetFieldResponse = {
50
50
  /**
51
51
  * List of fields not meeting data, access or required rule criteria
52
52
  */
@@ -72,7 +72,7 @@ export declare enum CommitErrorStatus {
72
72
  /**
73
73
  * Error representing a commit failure
74
74
  */
75
- export declare type CommitError = Error & {
75
+ export type CommitError = Error & {
76
76
  status: CommitErrorStatus;
77
77
  /**
78
78
  * List of violated rules that failed the commit
@@ -87,7 +87,7 @@ export declare type CommitError = Error & {
87
87
  /**
88
88
  * Map of field ids to their loan contract path
89
89
  */
90
- export declare type FieldIDToContractPath = {
90
+ export type FieldIDToContractPath = {
91
91
  fieldId: string;
92
92
  contractPath: string;
93
93
  };
@@ -98,7 +98,7 @@ export interface ILoanV2 extends Omit<ILoan, 'commit' | 'setFields' | 'merge'> {
98
98
  /**
99
99
  * Commit all pending changes on the current loan
100
100
  *
101
- * @returns {Promise<CommitResponse>}
101
+ * @returns {Promise<void>}
102
102
  * @throws {Error} if operation fails due to network errors
103
103
  * @throws {CommitError} if operation fails due to business / functional rules
104
104
  *
@@ -6,32 +6,27 @@ import { IScriptingObject } from '../scriptingObject.js';
6
6
  * @param id unique id of the app that is being unloaded
7
7
  * @returns true if the module can be unloaded, false otherwise
8
8
  */
9
- export declare type ModuleUnLoadingListener = Listener<IModule, Record<string, never>, Record<string, unknown>, boolean>;
9
+ export type ModuleUnLoadingListener = Listener<IModule, Record<string, never>, Record<string, unknown>, boolean>;
10
10
  /**
11
11
  * Module unloading event
12
12
  */
13
13
  export interface IModuleUnloadingEvent extends IEvent {
14
- /**
15
- * event name
16
- */
17
- readonly name: 'Unloading';
18
- /**
19
- * scripting object from where the event was triggered
20
- */
21
- readonly objectId: 'Module';
22
- /**
23
- * response needed from event listeners
24
- */
25
- readonly requiresFeedback: true;
26
14
  /**
27
15
  * event parameters
28
16
  */
29
- readonly params: Record<string, never>;
17
+ readonly Params: Record<string, never>;
18
+ }
19
+ /**
20
+ * events that notifies the module's lifecycle
21
+ */
22
+ export type ModuleEvents = {
30
23
  /**
31
- * subscribe to the event
24
+ * event fired when the module is unloading
25
+ *
26
+ * @returns true if the module can be unloaded, false otherwise
32
27
  */
33
- subscribe: (callback: ModuleUnLoadingListener) => string;
34
- }
28
+ 'module.unloading': ModuleUnLoadingListener;
29
+ };
35
30
  /**
36
31
  * Exposes MicroApp module specific methods
37
32
  * This is an abstract interface and needs to be extended by the module
@@ -40,10 +35,10 @@ export interface IModuleUnloadingEvent extends IEvent {
40
35
  export interface IModule extends IScriptingObject {
41
36
  /**
42
37
  * event fired when the module is unloading
43
- *
44
- * @returns true if the module can be unloaded, false otherwise
45
38
  */
46
- readonly Unloading: IModuleUnloadingEvent;
39
+ readonly Unloading: {
40
+ new (): IModuleUnloadingEvent;
41
+ };
47
42
  /**
48
43
  * get microapp module-specific capabilities or settings defined by the host application. Helps to define the style and/or behavior of the module
49
44
  *
@@ -4,5 +4,11 @@ import { IScriptingObject } from '../scriptingObject.js';
4
4
  * Methods to view, modify & get notified about parent window url navigation
5
5
  */
6
6
  export interface IRoute extends IScriptingObject {
7
+ /**
8
+ * navigate to a new url
9
+ *
10
+ * @param path path to navigate to
11
+ * @param state
12
+ */
7
13
  navigate(path: To, state?: unknown): Promise<void>;
8
14
  }
@@ -8,7 +8,7 @@ declare enum ServiceSetupCategory {
8
8
  /**
9
9
  * details of a service setup
10
10
  */
11
- declare type ServiceSetup = {
11
+ type ServiceSetup = {
12
12
  /**
13
13
  * service setup id
14
14
  */
@@ -29,7 +29,7 @@ declare type ServiceSetup = {
29
29
  /**
30
30
  * options to open the service order integration
31
31
  */
32
- declare type OpenOptions = {
32
+ type OpenOptions = {
33
33
  /**
34
34
  * context of the application that is opening the service order integration
35
35
  * urn patterned string
@@ -14,7 +14,7 @@ export declare enum OriginContext {
14
14
  /**
15
15
  * transaction origination context
16
16
  */
17
- export declare type OriginDetails = {
17
+ export type OriginDetails = {
18
18
  /**
19
19
  * Temporary session token that grants authorization for a partner
20
20
  * integration to access transaction origination information via the REST API's /partner/v2/origins/:id endpoint
@@ -33,7 +33,7 @@ export declare type OriginDetails = {
33
33
  /**
34
34
  * file attachment information
35
35
  */
36
- export declare type TransactionResource = {
36
+ export type TransactionResource = {
37
37
  /**
38
38
  * unique identifier for the file attachment
39
39
  */
@@ -47,7 +47,7 @@ export declare type TransactionResource = {
47
47
  */
48
48
  mimeType: string;
49
49
  };
50
- export declare type TransactionEvent = {
50
+ export type TransactionEvent = {
51
51
  /**
52
52
  * event name
53
53
  */
@@ -68,7 +68,7 @@ export declare type TransactionEvent = {
68
68
  /**
69
69
  * details about the transaction
70
70
  */
71
- export declare type TransactionDetails = {
71
+ export type TransactionDetails = {
72
72
  /**
73
73
  * details about the transaction that is created / updated
74
74
  */
@@ -100,7 +100,7 @@ export declare type TransactionDetails = {
100
100
  /**
101
101
  * details of the transaction resource
102
102
  */
103
- export declare type ResourceDetails = {
103
+ export type ResourceDetails = {
104
104
  /**
105
105
  * resource id
106
106
  */
@@ -125,7 +125,7 @@ export declare type ResourceDetails = {
125
125
  /**
126
126
  * name of the document to be uploaded
127
127
  */
128
- export declare type ResourceOptions = {
128
+ export type ResourceOptions = {
129
129
  /**
130
130
  * name of the document
131
131
  */
@@ -3,7 +3,7 @@ import { ResourceDetails, TransactionDetails, TransactionEvent, OriginDetails, R
3
3
  /**
4
4
  * details about the transaction that is created / updated
5
5
  */
6
- export declare type TransactionInfo = {
6
+ export type TransactionInfo = {
7
7
  /**
8
8
  * unique identifier for the transaction
9
9
  */
@@ -2,7 +2,7 @@ import { IScriptingObject } from '../scriptingObject.js';
2
2
  /**
3
3
  * Transaction request object
4
4
  */
5
- export declare type TransactionRequest = {
5
+ export type TransactionRequest = {
6
6
  /**
7
7
  * The type of transaction request being templated for the subject product.
8
8
  * This must be one of the supported values for the request type that your application is configured to support,
@@ -31,7 +31,7 @@ export declare type TransactionRequest = {
31
31
  * (registered as the $.interfaceUrl property in the product configuration),
32
32
  * wherein the transaction and application objects are available for use as applicable.
33
33
  */
34
- export declare type TransactionTemplateDetails = {
34
+ export type TransactionTemplateDetails = {
35
35
  /**
36
36
  * The listed name for the transaction template - as auto-generated, or as provided
37
37
  * by the lender administrator when the template was created