@elliemae/pui-scripting-object 1.8.0 → 1.9.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/dist/cjs/events.js +16 -0
- package/dist/cjs/index.js +16 -15
- package/dist/cjs/{analytics.js → objects/analytics.js} +0 -0
- package/dist/cjs/{application.js → objects/application.js} +0 -0
- package/dist/cjs/{auth.js → objects/auth.js} +0 -0
- package/dist/cjs/{form.js → objects/form.js} +0 -0
- package/dist/cjs/{global.js → objects/global.js} +0 -0
- package/dist/cjs/{http.js → objects/http.js} +0 -0
- package/dist/cjs/{loan.js → objects/loan.js} +0 -0
- package/dist/cjs/{loanv2.js → objects/loanv2.js} +0 -0
- package/dist/cjs/objects/memStorage.js +16 -0
- package/dist/cjs/{module.js → objects/module.js} +0 -0
- package/dist/cjs/{route.js → objects/route.js} +0 -0
- package/dist/cjs/{session.js → objects/session.js} +0 -0
- package/dist/cjs/{transaction.js → objects/transaction.js} +12 -0
- package/dist/cjs/objects/transactionTemplate.js +16 -0
- package/dist/cjs/{userAccessRights.js → objects/userAccessRights.js} +0 -0
- package/dist/cjs/{view.js → objects/view.js} +0 -0
- package/dist/esm/{analytics.js → events.js} +0 -0
- package/dist/esm/index.js +16 -15
- package/dist/esm/{form.js → objects/analytics.js} +0 -0
- package/dist/esm/{application.js → objects/application.js} +0 -0
- package/dist/esm/{auth.js → objects/auth.js} +0 -0
- package/dist/esm/{global.js → objects/form.js} +0 -0
- package/dist/esm/{http.js → objects/global.js} +0 -0
- package/dist/esm/{route.js → objects/http.js} +0 -0
- package/dist/esm/{loan.js → objects/loan.js} +0 -0
- package/dist/esm/{loanv2.js → objects/loanv2.js} +0 -0
- package/dist/esm/{session.js → objects/memStorage.js} +0 -0
- package/dist/esm/{module.js → objects/module.js} +0 -0
- package/dist/esm/{transaction.js → objects/route.js} +0 -0
- package/dist/esm/{transactiontemplate.js → objects/session.js} +0 -0
- package/dist/esm/objects/transaction.js +8 -0
- package/dist/esm/{userAccessRights.js → objects/transactionTemplate.js} +0 -0
- package/dist/esm/{view.js → objects/userAccessRights.js} +0 -0
- package/dist/esm/objects/view.js +0 -0
- package/dist/types/events.d.ts +7 -0
- package/dist/types/index.d.ts +17 -15
- package/dist/types/{analytics.d.ts → objects/analytics.d.ts} +6 -0
- package/dist/types/{application.d.ts → objects/application.d.ts} +92 -2
- package/dist/types/objects/auth.d.ts +105 -0
- package/dist/types/objects/form.d.ts +47 -0
- package/dist/types/objects/global.d.ts +47 -0
- package/dist/types/objects/http.d.ts +52 -0
- package/dist/types/{loan.d.ts → objects/loan.d.ts} +75 -11
- package/dist/types/{loanv2.d.ts → objects/loanv2.d.ts} +33 -0
- package/dist/types/objects/memStorage.d.ts +26 -0
- package/dist/types/objects/module.d.ts +55 -0
- package/dist/types/{route.d.ts → objects/route.d.ts} +1 -1
- package/dist/types/{session.d.ts → objects/session.d.ts} +1 -1
- package/dist/types/objects/transaction.d.ts +295 -0
- package/dist/types/objects/transactionTemplate.d.ts +76 -0
- package/dist/types/{userAccessRights.d.ts → objects/userAccessRights.d.ts} +3 -0
- package/dist/types/{view.d.ts → objects/view.d.ts} +20 -18
- package/dist/types/scriptingObjectTypes.d.ts +18 -12
- package/package.json +2 -2
- package/dist/cjs/transactiontemplate.js +0 -16
- package/dist/types/auth.d.ts +0 -43
- package/dist/types/form.d.ts +0 -10
- package/dist/types/global.d.ts +0 -5
- package/dist/types/http.d.ts +0 -7
- package/dist/types/module.d.ts +0 -16
- package/dist/types/transaction.d.ts +0 -53
- package/dist/types/transactiontemplate.d.ts +0 -12
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides methods to make call-outs to to external systems via HTTPS.
|
|
3
|
+
* By exposing this object from the host, it ensures that the call will bear the "Origin" header of the host application.
|
|
4
|
+
* This is critical for situations where the guest's code is running in a strict-mode sandbox (where the "allowSameOrigin" flag is false).
|
|
5
|
+
*/
|
|
6
|
+
export interface IHttp {
|
|
7
|
+
/**
|
|
8
|
+
* get http request
|
|
9
|
+
*
|
|
10
|
+
* @param url url to make the call to
|
|
11
|
+
* @param headersOrAccessToken http headers object or access token to be used for the call
|
|
12
|
+
* @returns http response object
|
|
13
|
+
* @throws error if the http call fails with non 2xx status code
|
|
14
|
+
*/
|
|
15
|
+
get(url: string, headersOrAccessToken?: HeadersInit | string): Promise<Response>;
|
|
16
|
+
/**
|
|
17
|
+
* post http request
|
|
18
|
+
*
|
|
19
|
+
* @param url url to make the call to
|
|
20
|
+
* @param headersOrAccessToken http headers object or access token to be used for the call
|
|
21
|
+
* @returns http response object
|
|
22
|
+
* @throws error if the http call fails with non 2xx status code
|
|
23
|
+
*/
|
|
24
|
+
post(url: string, content: string | Record<string, string>, headersOrAccessToken?: HeadersInit | string): Promise<Response>;
|
|
25
|
+
/**
|
|
26
|
+
* patch http request
|
|
27
|
+
*
|
|
28
|
+
* @param url url to make the call to
|
|
29
|
+
* @param headersOrAccessToken http headers object or access token to be used for the call
|
|
30
|
+
* @returns http response object
|
|
31
|
+
* @throws error if the http call fails with non 2xx status code
|
|
32
|
+
*/
|
|
33
|
+
patch(url: string, content: string | Record<string, string>, headersOrAccessToken?: HeadersInit | string): Promise<Response>;
|
|
34
|
+
/**
|
|
35
|
+
* put http request
|
|
36
|
+
*
|
|
37
|
+
* @param url url to make the call to
|
|
38
|
+
* @param headersOrAccessToken http headers object or access token to be used for the call
|
|
39
|
+
* @returns http response object
|
|
40
|
+
* @throws error if the http call fails with non 2xx status code
|
|
41
|
+
*/
|
|
42
|
+
put(url: string, content: string | Record<string, string>, headersOrAccessToken?: HeadersInit | string): Promise<Response>;
|
|
43
|
+
/**
|
|
44
|
+
* delete http request
|
|
45
|
+
*
|
|
46
|
+
* @param url url to make the call to
|
|
47
|
+
* @param headersOrAccessToken http headers object or access token to be used for the call
|
|
48
|
+
* @returns http response object
|
|
49
|
+
* @throws error if the http call fails with non 2xx status code
|
|
50
|
+
*/
|
|
51
|
+
delete(url: string, headersOrAccessToken?: HeadersInit | string): Promise<Response>;
|
|
52
|
+
}
|
|
@@ -11,6 +11,9 @@ export declare type FieldOptions = {
|
|
|
11
11
|
*/
|
|
12
12
|
value: string;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* v3 loan object
|
|
16
|
+
*/
|
|
14
17
|
export declare type LoanObject = Record<string, any>;
|
|
15
18
|
export declare enum LoanLevelActions {
|
|
16
19
|
UPDATE_CORRESPONDENT_BALANCE = "updateCorrespondentBalance",
|
|
@@ -19,11 +22,11 @@ export declare enum LoanLevelActions {
|
|
|
19
22
|
CALCULATE_EEM_MORTGAGE = "calculateEEMMortgage"
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
|
-
*
|
|
25
|
+
* Methods for interacting with an open loan in the application
|
|
23
26
|
*/
|
|
24
27
|
export interface ILoan {
|
|
25
28
|
/**
|
|
26
|
-
* Get
|
|
29
|
+
* Get complete Loan object
|
|
27
30
|
*
|
|
28
31
|
* @returns v3 Loan Object
|
|
29
32
|
*
|
|
@@ -46,6 +49,12 @@ export interface ILoan {
|
|
|
46
49
|
* | all | ✔ | ✔ | ✔ | ✖️ |
|
|
47
50
|
*/
|
|
48
51
|
commit(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* get value of the given field id
|
|
54
|
+
*
|
|
55
|
+
* @param id field id
|
|
56
|
+
* @returns field value
|
|
57
|
+
*/
|
|
49
58
|
getField(id: string): Promise<string>;
|
|
50
59
|
/**
|
|
51
60
|
* get options for list of fields
|
|
@@ -135,38 +144,93 @@ export interface ILoan {
|
|
|
135
144
|
getLockSnapshot(): Promise<Record<string, string>>;
|
|
136
145
|
}
|
|
137
146
|
/**
|
|
138
|
-
*
|
|
147
|
+
* event handler for loan precommit event
|
|
148
|
+
*
|
|
149
|
+
* @param cause cause of precommit event
|
|
150
|
+
* @returns true if precommit is allowed, false otherwise
|
|
139
151
|
*/
|
|
140
152
|
export declare type LoanPreCommitListener = (cause: string) => boolean;
|
|
141
153
|
/**
|
|
142
|
-
*
|
|
154
|
+
* event handler for loan commited event
|
|
155
|
+
*
|
|
156
|
+
* @param cause cause of commit event
|
|
143
157
|
*/
|
|
144
158
|
export declare type LoanCommittedListener = (cause: string) => void;
|
|
145
159
|
/**
|
|
146
|
-
*
|
|
160
|
+
* event handler for loan data change event
|
|
147
161
|
*/
|
|
148
162
|
export declare type LoanChangeListener = () => void;
|
|
149
163
|
/**
|
|
150
|
-
*
|
|
164
|
+
* event handler for loan sync event
|
|
151
165
|
*/
|
|
152
166
|
export declare type LoanSyncListener = () => void;
|
|
153
167
|
/**
|
|
154
|
-
*
|
|
168
|
+
* event handler for loan open event
|
|
155
169
|
*/
|
|
156
170
|
export declare type LoanOpenListener = () => void;
|
|
157
171
|
/**
|
|
158
|
-
*
|
|
172
|
+
* event handler for loan close event
|
|
173
|
+
*
|
|
174
|
+
* @returns true if loan close is allowed, false otherwise
|
|
159
175
|
*/
|
|
160
176
|
export declare type LoanCloseListener = () => boolean;
|
|
161
177
|
/**
|
|
162
|
-
*
|
|
178
|
+
* event handler for loan milestone completed event
|
|
179
|
+
*
|
|
180
|
+
* @param name milestone name
|
|
163
181
|
*/
|
|
164
182
|
export declare type LoanMilestoneCompletedListener = (name: string) => void;
|
|
165
183
|
/**
|
|
166
|
-
*
|
|
184
|
+
* event handler for loan pre milestone complete event
|
|
185
|
+
*
|
|
186
|
+
* @returns true if milestone complete is allowed, false otherwise
|
|
167
187
|
*/
|
|
168
188
|
export declare type LoanPreMilestoneCompleteListener = (name: string) => boolean;
|
|
169
189
|
/**
|
|
170
|
-
*
|
|
190
|
+
* event handler for loan application selected event
|
|
171
191
|
*/
|
|
172
192
|
export declare type LoanApplicationSelectedListener = () => void;
|
|
193
|
+
/**
|
|
194
|
+
* events supported by Loan scripting object
|
|
195
|
+
*/
|
|
196
|
+
export declare type LoanEvents = {
|
|
197
|
+
/**
|
|
198
|
+
* event is fired prior to saving any pending changes to the loan.
|
|
199
|
+
* The guest can use this event to perform custom validation and,
|
|
200
|
+
* via the feedback mechanism, prevent the loan from being saved
|
|
201
|
+
*/
|
|
202
|
+
'loan.precommit': LoanPreCommitListener;
|
|
203
|
+
/**
|
|
204
|
+
* event is fired after pending changes to the loan are committed
|
|
205
|
+
*/
|
|
206
|
+
'loan.committed': LoanCommittedListener;
|
|
207
|
+
/**
|
|
208
|
+
* event is fired for each change made by the user in the UI
|
|
209
|
+
*/
|
|
210
|
+
'loan.change': LoanChangeListener;
|
|
211
|
+
/**
|
|
212
|
+
* event is fired after the loan is sync'ed within any saved state made outside of the user's workspace.
|
|
213
|
+
*/
|
|
214
|
+
'loan.sync': LoanSyncListener;
|
|
215
|
+
/**
|
|
216
|
+
* event is fired after the loan is opened and ready for user interaction
|
|
217
|
+
*/
|
|
218
|
+
'loan.open': LoanOpenListener;
|
|
219
|
+
/**
|
|
220
|
+
* event is fired just prior to closing the loan in the UI
|
|
221
|
+
*/
|
|
222
|
+
'loan.close': LoanCloseListener;
|
|
223
|
+
/**
|
|
224
|
+
* event is fired after a milestone is completed by the user and committed to the server
|
|
225
|
+
*/
|
|
226
|
+
'loan.milestoneCompleted': LoanMilestoneCompletedListener;
|
|
227
|
+
/**
|
|
228
|
+
* event is fired when the user attempts to complete a milestone and allows for custom validation,
|
|
229
|
+
* and cancellation, of the process
|
|
230
|
+
*/
|
|
231
|
+
'loan.premilestoneComplete': LoanPreMilestoneCompleteListener;
|
|
232
|
+
/**
|
|
233
|
+
* event is fired when a borrower pair changes
|
|
234
|
+
*/
|
|
235
|
+
'loan.applicationselected': LoanApplicationSelectedListener;
|
|
236
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ILoan, LoanObject } from './loan.js';
|
|
2
|
+
/**
|
|
3
|
+
* Types of field errors
|
|
4
|
+
*/
|
|
2
5
|
export declare enum FieldErrorType {
|
|
3
6
|
/**
|
|
4
7
|
* access related violations
|
|
@@ -23,20 +26,47 @@ export declare enum FieldErrorType {
|
|
|
23
26
|
*/
|
|
24
27
|
CONFLICT = "conflict"
|
|
25
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Field error object
|
|
31
|
+
*/
|
|
26
32
|
export declare type FieldErrors = {
|
|
33
|
+
/**
|
|
34
|
+
* field id
|
|
35
|
+
*/
|
|
27
36
|
id: string;
|
|
37
|
+
/**
|
|
38
|
+
* field error type
|
|
39
|
+
*/
|
|
28
40
|
type: FieldErrorType;
|
|
41
|
+
/**
|
|
42
|
+
* error description
|
|
43
|
+
*/
|
|
29
44
|
description: string;
|
|
30
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Return type of setField method
|
|
48
|
+
*/
|
|
31
49
|
export declare type SetFieldResponse = {
|
|
32
50
|
/**
|
|
33
51
|
* List of fields not meeting data, access or required rule criteria
|
|
34
52
|
*/
|
|
35
53
|
errors: FieldErrors[];
|
|
36
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* Types of commit errors
|
|
57
|
+
*/
|
|
37
58
|
export declare enum CommitErrorStatus {
|
|
59
|
+
/**
|
|
60
|
+
* Commit failed due to fields
|
|
61
|
+
*/
|
|
38
62
|
FIELDERROR = "field_error",
|
|
63
|
+
/**
|
|
64
|
+
* Commit failed due to invalid lock or read only loan status
|
|
65
|
+
*/
|
|
39
66
|
LOCK_INVALID_OR_REMOVED = "lock_invalid_or_removed",
|
|
67
|
+
/**
|
|
68
|
+
* Commit failed due to invalid workspace state
|
|
69
|
+
*/
|
|
40
70
|
WORKSPACE_READ_ONLY = "workspace_read_only"
|
|
41
71
|
}
|
|
42
72
|
/**
|
|
@@ -54,6 +84,9 @@ export declare type CommitError = Error & {
|
|
|
54
84
|
fieldErrors: FieldErrors[];
|
|
55
85
|
};
|
|
56
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* Map of field ids to their loan contract path
|
|
89
|
+
*/
|
|
57
90
|
export declare type FieldIDToContractPath = {
|
|
58
91
|
fieldId: string;
|
|
59
92
|
contractPath: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get or set values in host application javascript memory
|
|
3
|
+
* values stored in memory are not persisted across sessions
|
|
4
|
+
*
|
|
5
|
+
* Host application implemeting this scripting object ensures,
|
|
6
|
+
* there are no collisions with keys from other microapp guest applications
|
|
7
|
+
* that means, two microapps can use same key to store different values. Thier values will not collide.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export interface IMemStorage {
|
|
11
|
+
/**
|
|
12
|
+
* set a value in memory for given key
|
|
13
|
+
*
|
|
14
|
+
* @param clientId unique identifier assigned to the microapp
|
|
15
|
+
* @param key unique key to store the value
|
|
16
|
+
* @param value value to be stored. value should be JSON serializable
|
|
17
|
+
*/
|
|
18
|
+
set(clientId: string, key: string, value: any): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* get a value from memory for given key and microapp id
|
|
21
|
+
*
|
|
22
|
+
* @param key unique key to retrieve the value
|
|
23
|
+
* @returns value stored in memory
|
|
24
|
+
*/
|
|
25
|
+
get(clientId: string, key: string): Promise<any>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare enum LogLevel {
|
|
2
|
+
TRACE = "TRACE",
|
|
3
|
+
DEBUG = "DEBUG",
|
|
4
|
+
INFO = "INFO",
|
|
5
|
+
AUDIT = "AUDIT",
|
|
6
|
+
WARN = "WARN",
|
|
7
|
+
ERROR = "ERROR",
|
|
8
|
+
FATAL = "FATAL"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Methods to bootstraps feature modules
|
|
12
|
+
*/
|
|
13
|
+
export interface IModule {
|
|
14
|
+
/**
|
|
15
|
+
* get module-specific JavaScript object that can be used to communicate additional capabilities to the module
|
|
16
|
+
*
|
|
17
|
+
* @returns key-value pairs of module-specific JavaScript objects
|
|
18
|
+
*/
|
|
19
|
+
getCapabilities(): Promise<Record<string, string>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get startup parameters for the module
|
|
22
|
+
*
|
|
23
|
+
* @returns startup parameters as key-value pairs
|
|
24
|
+
*/
|
|
25
|
+
getParameters(): Promise<Record<string, string>>;
|
|
26
|
+
/**
|
|
27
|
+
* unload the module from the host application
|
|
28
|
+
*/
|
|
29
|
+
unload(): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* log a message to host application's logs
|
|
32
|
+
*
|
|
33
|
+
* @param message message to log
|
|
34
|
+
* @param logLevel level of the log message
|
|
35
|
+
*/
|
|
36
|
+
log(message: string, logLevel: LogLevel): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* event handler that handles module unload event
|
|
40
|
+
*
|
|
41
|
+
* @param id unique id of the module that is being unloaded
|
|
42
|
+
* @returns true if the module can be unloaded, false otherwise
|
|
43
|
+
*/
|
|
44
|
+
export declare type ModuleUnLoadingListener = (id: string) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* events that notifies the module's lifecycle
|
|
47
|
+
*/
|
|
48
|
+
export declare type ModuleEvents = {
|
|
49
|
+
/**
|
|
50
|
+
* event fired when the module is unloading
|
|
51
|
+
*
|
|
52
|
+
* @returns true if the module can be unloaded, false otherwise
|
|
53
|
+
*/
|
|
54
|
+
'module.unloading': ModuleUnLoadingListener;
|
|
55
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { To } from 'history';
|
|
2
2
|
/**
|
|
3
|
-
* Methods
|
|
3
|
+
* Methods to view, modify & get notified about parent window url navigation
|
|
4
4
|
*/
|
|
5
5
|
export interface IRoute {
|
|
6
6
|
navigate(path: To, state?: any): Promise<void>;
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* user type context
|
|
3
|
+
*/
|
|
4
|
+
export declare enum OriginContext {
|
|
5
|
+
/**
|
|
6
|
+
* user interface is being presented to a user in a lending enterprise
|
|
7
|
+
*/
|
|
8
|
+
LENDER = "lender",
|
|
9
|
+
/**
|
|
10
|
+
* user interface is being presented to a consumer/borrower
|
|
11
|
+
*/
|
|
12
|
+
CONSUMER = "consumer"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* transaction origination context
|
|
16
|
+
*/
|
|
17
|
+
export declare type OriginInfo = {
|
|
18
|
+
/**
|
|
19
|
+
* Temporary session token that grants authorization for a partner
|
|
20
|
+
* integration to access transaction origination information via the REST API's /partner/v2/origins/:id endpoint
|
|
21
|
+
*/
|
|
22
|
+
partnerAccessToken: string;
|
|
23
|
+
/**
|
|
24
|
+
* Unique identifier for the transaction origination information snapshot accessible
|
|
25
|
+
* via the REST API's /partner/v2/origins/:id endpoint
|
|
26
|
+
*/
|
|
27
|
+
id: string;
|
|
28
|
+
/**
|
|
29
|
+
* Unique identifier for the transaction in whose context the
|
|
30
|
+
* partner integrations user-interface is being launched.
|
|
31
|
+
* This is only available in the situation where your integration
|
|
32
|
+
* is being launched in the context of an existing transaction,
|
|
33
|
+
* and can be used to decide the appropriate view to display to users
|
|
34
|
+
*/
|
|
35
|
+
transactionId?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The user type in whose context your integration is being launched
|
|
38
|
+
*/
|
|
39
|
+
context: OriginContext;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* details about the transaction that is created / updated
|
|
43
|
+
*/
|
|
44
|
+
export declare type TransactionInfo = {
|
|
45
|
+
/**
|
|
46
|
+
* unique identifier for the transaction
|
|
47
|
+
*/
|
|
48
|
+
id: string | null;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* file attachment information
|
|
52
|
+
*/
|
|
53
|
+
export declare type TransactionResource = {
|
|
54
|
+
/**
|
|
55
|
+
* unique identifier for the file attachment
|
|
56
|
+
*/
|
|
57
|
+
id: string;
|
|
58
|
+
/**
|
|
59
|
+
* name of the file attachment
|
|
60
|
+
*/
|
|
61
|
+
name: string;
|
|
62
|
+
/**
|
|
63
|
+
* mime type of the file attachment
|
|
64
|
+
*/
|
|
65
|
+
mimeType: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* information about the transaction to be initiated
|
|
69
|
+
*/
|
|
70
|
+
export declare type TransactionOptions = {
|
|
71
|
+
request: {
|
|
72
|
+
/**
|
|
73
|
+
* The type of transaction request being initiated for the subject product.
|
|
74
|
+
* This must be one of the supported values for the request type that your application
|
|
75
|
+
* is configured to support - based on which its data entitlements are scoped.
|
|
76
|
+
*/
|
|
77
|
+
type: string;
|
|
78
|
+
/**
|
|
79
|
+
* The specific set of selectable options that apply to the specific
|
|
80
|
+
* type of transaction request, as modeled by your application
|
|
81
|
+
*/
|
|
82
|
+
options?: Record<string, string | boolean | number>;
|
|
83
|
+
/**
|
|
84
|
+
* The collection of file attachments - referred to as resource objects in the
|
|
85
|
+
* EPC API - to be attached to the transaction request.
|
|
86
|
+
* The id, name, and mimeType attribute needed for each resource object
|
|
87
|
+
* in the collection can be created in one of two ways:
|
|
88
|
+
* Your application utilized the transaction.createResource method to build a custom file upload experience, and the user invoked this functionality and uploaded a file from their local drive.
|
|
89
|
+
* Your application utilized the application.performAction("getAvailableResources") method to launch the host application's file explorer, and the user invoked this functionality and attached a file[s] from the host application.
|
|
90
|
+
* Once the resource objects are collected from these methods,
|
|
91
|
+
* be sure to echo them back to the EPC platform when creating a transaction!
|
|
92
|
+
*/
|
|
93
|
+
resources: Array<TransactionResource>;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* resource name to be uploaded
|
|
98
|
+
*/
|
|
99
|
+
export declare type TransactionResourceFile = {
|
|
100
|
+
/**
|
|
101
|
+
* name of the file
|
|
102
|
+
*/
|
|
103
|
+
name: string;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* response object of createResource method
|
|
107
|
+
*/
|
|
108
|
+
export declare type TransactionResourceResponse = {
|
|
109
|
+
/**
|
|
110
|
+
* resource id
|
|
111
|
+
*/
|
|
112
|
+
id: string;
|
|
113
|
+
/**
|
|
114
|
+
* urn of the target upload location
|
|
115
|
+
*/
|
|
116
|
+
respository: string;
|
|
117
|
+
/**
|
|
118
|
+
* name of the resource
|
|
119
|
+
*/
|
|
120
|
+
name: string;
|
|
121
|
+
/**
|
|
122
|
+
* url to stream the resource
|
|
123
|
+
*/
|
|
124
|
+
location: string;
|
|
125
|
+
/**
|
|
126
|
+
* authorization header to upload the resource
|
|
127
|
+
*/
|
|
128
|
+
authorizationHeader: string;
|
|
129
|
+
};
|
|
130
|
+
export declare type TransactionEvent = {
|
|
131
|
+
/**
|
|
132
|
+
* event name
|
|
133
|
+
*/
|
|
134
|
+
text: string;
|
|
135
|
+
/**
|
|
136
|
+
* urn representing the event type
|
|
137
|
+
*/
|
|
138
|
+
type: string;
|
|
139
|
+
/**
|
|
140
|
+
* comments related to event
|
|
141
|
+
*/
|
|
142
|
+
comments: string;
|
|
143
|
+
/**
|
|
144
|
+
* list of file attachments related to event
|
|
145
|
+
*/
|
|
146
|
+
resources: Array<TransactionResource>;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Provides your applications lender/borrower-facing view with the necessary handles to model your application's
|
|
150
|
+
* transactional interaction with the EPC platform.
|
|
151
|
+
* Allows access to an interactive session's origination context,
|
|
152
|
+
* create a new transaction,
|
|
153
|
+
* update an existing transaction,
|
|
154
|
+
* create events/messages for a transaction, and more.
|
|
155
|
+
*/
|
|
156
|
+
export interface ITransaction {
|
|
157
|
+
/**
|
|
158
|
+
* Provide the necessary information for your application's user-interface to:
|
|
159
|
+
* Access transaction origination information and bootstrap its user interaction
|
|
160
|
+
* Know if it was launched in the context of an existing transaction, so it can present the relevant view
|
|
161
|
+
*
|
|
162
|
+
* @returns transaction origination information
|
|
163
|
+
*/
|
|
164
|
+
getOrigin(): Promise<OriginInfo>;
|
|
165
|
+
/**
|
|
166
|
+
* Refresh your application's transaction origination context - if your current one expires.
|
|
167
|
+
* This method returns a new originId and partnerAccessToken - which your application back-end can use to retrieve a refreshed transaction origin:
|
|
168
|
+
* A fresh snapshot of the loan data your application is entitled to receive in a transaction origin
|
|
169
|
+
* A a fresh snapshot of the user's credential set configured by their Administrator for use with your application
|
|
170
|
+
*
|
|
171
|
+
* @returns transaction origination information
|
|
172
|
+
*/
|
|
173
|
+
refreshOrigin(): Promise<OriginInfo>;
|
|
174
|
+
/**
|
|
175
|
+
* Allow Lenders to use your integration to upload files from their
|
|
176
|
+
* local drive as an attachment to a new transaction.
|
|
177
|
+
* This method returns a URL and authorization token,
|
|
178
|
+
* which are to be used to stream the selected file as binary content to the EPC platform
|
|
179
|
+
*
|
|
180
|
+
* @param options details of the resource to be uploaded
|
|
181
|
+
* @returns location and authorization header to upload the resource
|
|
182
|
+
*/
|
|
183
|
+
createResource(options: TransactionResourceFile): Promise<TransactionResourceResponse>;
|
|
184
|
+
/**
|
|
185
|
+
* initiate a new transaction with your integration
|
|
186
|
+
*
|
|
187
|
+
* @param options details of the transaction to be initiated
|
|
188
|
+
* @returns transaction id
|
|
189
|
+
*/
|
|
190
|
+
create(options: TransactionOptions): Promise<TransactionInfo>;
|
|
191
|
+
/**
|
|
192
|
+
* Set the transaction in whose context you want to invoke methods that operate on an existing transaction.
|
|
193
|
+
* The subject transaction must be one that was created for the current loan and EPC product.
|
|
194
|
+
* The methods that currently fall into this category are:
|
|
195
|
+
* transaction.update
|
|
196
|
+
* transaction.createEvent
|
|
197
|
+
*
|
|
198
|
+
* Although integrations are free to set the transactional context they are operating in,
|
|
199
|
+
* which may be necessary when providing views that allow users to switch between
|
|
200
|
+
* and perform actions on multiple transactions, the host application implicitly
|
|
201
|
+
* alters the transactional context in certain scenarios:
|
|
202
|
+
*
|
|
203
|
+
* Implicit transaction context setting!
|
|
204
|
+
* If your integration is launched by a user in the context of an existing transaction,
|
|
205
|
+
* such as from the services page on Loan Officer Connect, the document icon
|
|
206
|
+
* on the services side-nav in Encompass Desktop or when returning to a
|
|
207
|
+
* loan application in Consumer Connect, the transactional context is implicitly set to said transaction
|
|
208
|
+
* Every time a new transaction is created during a user's interaction with your integration,
|
|
209
|
+
* the context is set to the last created transaction
|
|
210
|
+
* If the integration was initially launched in the context of an existing transaction,
|
|
211
|
+
* transaction.getOrigin will always return the original transactionId the integration was launched
|
|
212
|
+
* in the context of, no matter how many times the transaction is set in the current interaction.
|
|
213
|
+
* You can leverage this to track the initial transaction context for a user interaction
|
|
214
|
+
*
|
|
215
|
+
* The current transactional context that your integration is operating in can be queried using the transaction.get method.
|
|
216
|
+
*
|
|
217
|
+
* @param options transaction details
|
|
218
|
+
* @returns transaction that has been set
|
|
219
|
+
*/
|
|
220
|
+
set(options: TransactionInfo): Promise<TransactionInfo>;
|
|
221
|
+
/**
|
|
222
|
+
* Retrieve the transaction in whose context your integration is operating in, utilized by methods that operate on an existing transaction.
|
|
223
|
+
* The methods that currently fall into this category are:
|
|
224
|
+
* transaction.update
|
|
225
|
+
* transaction.createEvent
|
|
226
|
+
* Although integrations are free to set the transactional context they are operating in
|
|
227
|
+
* (using the transaction.set method) , which may be necessary when providing views that
|
|
228
|
+
* allow users to switch between and perform actions on multiple transactions,
|
|
229
|
+
* the host application implicitly alters the transactional context in certain scenarios:
|
|
230
|
+
*
|
|
231
|
+
* Implicit transaction context setting!
|
|
232
|
+
* If your integration is launched by a user in the context of an existing transaction,
|
|
233
|
+
* such as from the services page on Loan Officer Connect, the document icon on the services
|
|
234
|
+
* side-nav in Encompass Desktop or on a loan application in Consumer Connect is set to said transaction.
|
|
235
|
+
* Every time a new transaction is created during a user's interaction with your integration,
|
|
236
|
+
* the context is set to the last created transaction.
|
|
237
|
+
* If the integration was initially launched in the context of an existing transaction,
|
|
238
|
+
* the transaction.getOrigin method will always return the original transactionId the integration was launched
|
|
239
|
+
* in the context of, no matter how many times the transaction is set in the current interaction.
|
|
240
|
+
* You can leverage this to track the initial transaction context for a user interaction
|
|
241
|
+
*
|
|
242
|
+
* The current transactional context your integration operates in can be queried using the transaction.get method
|
|
243
|
+
*
|
|
244
|
+
* @returns transaction id details
|
|
245
|
+
*/
|
|
246
|
+
get(): Promise<TransactionInfo>;
|
|
247
|
+
/**
|
|
248
|
+
* Allow Lenders to update an existing transaction by attaching new resources or updating
|
|
249
|
+
* the request options associated with the transaction.
|
|
250
|
+
* A transaction update will trigger an updated webhook event on the urn:elli:epc:transaction REST resource,
|
|
251
|
+
* indicating an updated transaction request is ready for your application to retrieve.
|
|
252
|
+
* The updated transaction request will contain:
|
|
253
|
+
* An updated options object, if set in this method
|
|
254
|
+
* An updated resources array, with the resources set in this method appended to the previously attached set
|
|
255
|
+
* By default, a fresh snapshot of the loan data your application is entitled to receive in the transaction request
|
|
256
|
+
* By default, a fresh snapshot of the user's credential set configured by their Administrator for use with your application
|
|
257
|
+
*
|
|
258
|
+
* Request type immutability
|
|
259
|
+
* The type for a lender initiated transaction request can not be updated once created.
|
|
260
|
+
* If you need to support the ability for a lender to change the request type for a transaction they have initiated,
|
|
261
|
+
* the initial transaction must be canceled via a transaction response status update (using the REST API),
|
|
262
|
+
* and the lender must initiate a new transaction request with the updated type
|
|
263
|
+
*
|
|
264
|
+
* @param options transaction details
|
|
265
|
+
* @returns transaction id
|
|
266
|
+
*/
|
|
267
|
+
update(options: TransactionOptions): Promise<TransactionInfo>;
|
|
268
|
+
/**
|
|
269
|
+
* Allow Lenders to initiate an event/message for the subject transaction with your integration
|
|
270
|
+
*
|
|
271
|
+
* @param options details of the event/message to be initiated
|
|
272
|
+
* @returns transaction event id
|
|
273
|
+
*/
|
|
274
|
+
createEvent(options: TransactionEvent): Promise<TransactionInfo>;
|
|
275
|
+
/**
|
|
276
|
+
* Navigate your users back to where they left off in the host Encompass application,
|
|
277
|
+
* after they are done interacting with your application's user-interface
|
|
278
|
+
*/
|
|
279
|
+
close(): Promise<void>;
|
|
280
|
+
/**
|
|
281
|
+
* Navigate your users back to where they left off in the host Encompass application,
|
|
282
|
+
* after they have canceled an interaction with your application's user-interface without having
|
|
283
|
+
* initiated a transaction request (or any other related task) that they were working on.
|
|
284
|
+
* This signals a cancelation outcome to the host Encompass application -
|
|
285
|
+
* how this is handled by the host upon user navigation can vary across applications
|
|
286
|
+
*/
|
|
287
|
+
cancel(): Promise<void>;
|
|
288
|
+
/**
|
|
289
|
+
* Navigate your users back to where they left off in the host Encompass application,
|
|
290
|
+
* after their has been an error (application error or workflow error) on your integrations user-interface.
|
|
291
|
+
* This signals an error outcome to the host Encompass application -
|
|
292
|
+
* how this is handled by the host upon user navigation can vary across applications
|
|
293
|
+
*/
|
|
294
|
+
error(): Promise<void>;
|
|
295
|
+
}
|