@elliemae/pui-app-sdk 5.21.0-beta.7 → 5.21.0-beta.8

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.
@@ -28,23 +28,19 @@ class AppraisalService extends import_microfe_common.ScriptingObject {
28
28
  #creditScore;
29
29
  Close = new import_microfe_common.Event({
30
30
  name: "Close",
31
- requiresFeedback: false,
32
- so: this
31
+ objectId: import_pui_scripting_object.ScriptingObjectNames.Module
33
32
  });
34
33
  Unloading = new import_microfe_common.Event({
35
34
  name: "Unloading",
36
- requiresFeedback: false,
37
- so: this
35
+ objectId: import_pui_scripting_object.ScriptingObjectNames.Module
38
36
  });
39
37
  onPreCommit = new import_microfe_common.Event({
40
38
  name: "onPreCommit",
41
- requiresFeedback: true,
42
- so: this
39
+ objectId: import_pui_scripting_object.ScriptingObjectNames.Module
43
40
  });
44
41
  onSaved = new import_microfe_common.Event({
45
42
  name: "onSaved",
46
- requiresFeedback: false,
47
- so: this
43
+ objectId: import_pui_scripting_object.ScriptingObjectNames.Module
48
44
  });
49
45
  constructor({
50
46
  loanId,
@@ -21,6 +21,7 @@ __export(global_exports, {
21
21
  Global: () => Global
22
22
  });
23
23
  module.exports = __toCommonJS(global_exports);
24
+ var import_pui_scripting_object = require("@elliemae/pui-scripting-object");
24
25
  var import_microfe_common = require("@elliemae/microfe-common");
25
26
  class Global extends import_microfe_common.ScriptingObject {
26
27
  #data = /* @__PURE__ */ new Map();
@@ -29,8 +30,7 @@ class Global extends import_microfe_common.ScriptingObject {
29
30
  }
30
31
  Change = new import_microfe_common.Event({
31
32
  name: "Change",
32
- requiresFeedback: false,
33
- so: this
33
+ objectId: import_pui_scripting_object.ScriptingObjectNames.Global
34
34
  });
35
35
  set = (key, value) => {
36
36
  this.#data.set(key, value);
@@ -43,72 +43,65 @@ class Loan extends import_pui_app_bridge.ScriptingObject {
43
43
  }
44
44
  ApplicationSelected = new import_pui_app_bridge.Event({
45
45
  name: "applicationselected",
46
- requiresFeedback: false,
47
- so: this
46
+ objectId: "loan"
48
47
  });
49
48
  Close = new import_pui_app_bridge.Event({
50
49
  name: "close",
51
- requiresFeedback: false,
52
- so: this
50
+ objectId: "loan"
53
51
  });
54
52
  Change = new import_pui_app_bridge.Event({
55
53
  name: "change",
56
- requiresFeedback: false,
57
- so: this
54
+ objectId: "loan"
58
55
  });
59
56
  Committed = new import_pui_app_bridge.Event({
60
57
  name: "committed",
61
- requiresFeedback: false,
62
- so: this
58
+ objectId: "loan"
63
59
  });
64
60
  EditModeChange = new import_pui_app_bridge.Event({
65
61
  name: "editmodechange",
66
- requiresFeedback: false,
67
- so: this
62
+ objectId: "loan"
68
63
  });
69
64
  MilestoneCompleted = new import_pui_app_bridge.Event({
70
65
  name: "milestonecompleted",
71
- requiresFeedback: false,
72
- so: this
66
+ objectId: "loan"
73
67
  });
74
68
  Open = new import_pui_app_bridge.Event({
75
69
  name: "open",
76
- requiresFeedback: false,
77
- so: this
70
+ objectId: "loan"
78
71
  });
79
72
  PreCommit = new import_pui_app_bridge.Event({
80
73
  name: "precommit",
81
- requiresFeedback: true,
82
- so: this
74
+ objectId: "loan"
83
75
  });
84
76
  PreMilestoneComplete = new import_pui_app_bridge.Event({
85
77
  name: "premilestonecomplete",
86
- requiresFeedback: true,
87
- so: this
78
+ objectId: "loan"
88
79
  });
89
80
  Sync = new import_pui_app_bridge.Event({
90
81
  name: "sync",
91
- requiresFeedback: false,
92
- so: this
82
+ objectId: "loan"
93
83
  });
94
- all() {
84
+ all = () => {
95
85
  this.#log("loan.all");
96
86
  return Promise.resolve(this.#loanData);
97
- }
98
- applyLock(fieldId, lock) {
87
+ };
88
+ applyLock = (fieldId, lock) => {
99
89
  this.#log(`loan.applyLock: fieldId: ${fieldId}, lock: ${String(lock)}`);
100
90
  return Promise.resolve();
101
- }
102
- calculate() {
91
+ };
92
+ calculate = () => {
103
93
  this.#log("loan.calculate");
104
94
  return Promise.resolve(this.#loanData);
105
- }
106
- async commit() {
95
+ };
96
+ commit = async () => {
107
97
  this.#log("loan.commit");
108
98
  const feedBack = await this.#appBridge.dispatchEvent({
109
99
  event: this.PreCommit,
110
100
  eventParams: {
111
101
  id: this.#loanData.id
102
+ },
103
+ eventOptions: {
104
+ timeout: 1e3
112
105
  }
113
106
  });
114
107
  this.#log(`loan.precommit:event:feedback: ${JSON.stringify(feedBack)}`);
@@ -118,8 +111,8 @@ class Loan extends import_pui_app_bridge.ScriptingObject {
118
111
  this.#log("loan.commit:failed");
119
112
  }
120
113
  return this.#loanData.id;
121
- }
122
- execAction(type, params) {
114
+ };
115
+ execAction = (type, params) => {
123
116
  this.#log(
124
117
  `loan.execAction: type: ${type}, params: ${JSON.stringify(params)}`
125
118
  );
@@ -127,8 +120,8 @@ class Loan extends import_pui_app_bridge.ScriptingObject {
127
120
  status: "success",
128
121
  message: "Action executed successfully"
129
122
  });
130
- }
131
- getCollection(name) {
123
+ };
124
+ getCollection = (name) => {
132
125
  this.#log(`loan.getCollection: name: ${name}`);
133
126
  return Promise.resolve({
134
127
  name,
@@ -139,20 +132,20 @@ class Loan extends import_pui_app_bridge.ScriptingObject {
139
132
  this.#log(`loan.getCollection.removeAt: index: ${index}`);
140
133
  }
141
134
  });
142
- }
143
- getCurrentApplication() {
135
+ };
136
+ getCurrentApplication = () => {
144
137
  this.#log("loan.getCurrentApplication");
145
138
  return Promise.resolve({
146
139
  ...this.#loanData,
147
140
  index: 0,
148
141
  legacyId: "legacy-id"
149
142
  });
150
- }
151
- getField(id) {
143
+ };
144
+ getField = (id) => {
152
145
  this.#log(`loan.getField: id: ${id}`);
153
146
  return Promise.resolve(this.#loanData.name);
154
- }
155
- getFieldOptions(param) {
147
+ };
148
+ getFieldOptions = (param) => {
156
149
  this.#log(`loan.getFieldOptions: param: ${JSON.stringify(param)}`);
157
150
  return Promise.resolve({
158
151
  fieldId: [
@@ -170,38 +163,38 @@ class Loan extends import_pui_app_bridge.ScriptingObject {
170
163
  }
171
164
  ]
172
165
  });
173
- }
174
- getFields(ids) {
166
+ };
167
+ getFields = (ids) => {
175
168
  this.#log(`loan.getFields: ids: ${JSON.stringify(ids)}`);
176
169
  const fields = ids.reduce((acc, id) => {
177
170
  acc[id] = this.#loanData.name;
178
171
  return acc;
179
172
  }, {});
180
173
  return Promise.resolve(fields);
181
- }
182
- isReadOnly() {
174
+ };
175
+ isReadOnly = () => {
183
176
  this.#log("loan.isReadOnly");
184
177
  return Promise.resolve(false);
185
- }
186
- merge() {
178
+ };
179
+ merge = () => {
187
180
  this.#log("loan.merge");
188
181
  return Promise.resolve();
189
- }
190
- setCurrentApplication(options) {
182
+ };
183
+ setCurrentApplication = (options) => {
191
184
  this.#log(
192
185
  `loan.setCurrentApplication: options: ${JSON.stringify(options)}`
193
186
  );
194
187
  return Promise.resolve();
195
- }
196
- setEditMode(options) {
188
+ };
189
+ setEditMode = (options) => {
197
190
  this.#log(`loan.setEditMode: options: ${JSON.stringify(options)}`);
198
191
  return Promise.resolve();
199
- }
200
- setFields(fields) {
192
+ };
193
+ setFields = (fields) => {
201
194
  this.#log(`loan.setFields: fields: ${JSON.stringify(fields)}`);
202
195
  Object.keys(fields).forEach((key) => {
203
196
  const field = fields[key];
204
197
  });
205
198
  return Promise.resolve();
206
- }
199
+ };
207
200
  }
@@ -7,23 +7,19 @@ class AppraisalService extends ScriptingObject {
7
7
  #creditScore;
8
8
  Close = new Event({
9
9
  name: "Close",
10
- requiresFeedback: false,
11
- so: this
10
+ objectId: ScriptingObjectNames.Module
12
11
  });
13
12
  Unloading = new Event({
14
13
  name: "Unloading",
15
- requiresFeedback: false,
16
- so: this
14
+ objectId: ScriptingObjectNames.Module
17
15
  });
18
16
  onPreCommit = new Event({
19
17
  name: "onPreCommit",
20
- requiresFeedback: true,
21
- so: this
18
+ objectId: ScriptingObjectNames.Module
22
19
  });
23
20
  onSaved = new Event({
24
21
  name: "onSaved",
25
- requiresFeedback: false,
26
- so: this
22
+ objectId: ScriptingObjectNames.Module
27
23
  });
28
24
  constructor({
29
25
  loanId,
@@ -1,3 +1,6 @@
1
+ import {
2
+ ScriptingObjectNames
3
+ } from "@elliemae/pui-scripting-object";
1
4
  import { ScriptingObject, Event } from "@elliemae/microfe-common";
2
5
  class Global extends ScriptingObject {
3
6
  #data = /* @__PURE__ */ new Map();
@@ -6,8 +9,7 @@ class Global extends ScriptingObject {
6
9
  }
7
10
  Change = new Event({
8
11
  name: "Change",
9
- requiresFeedback: false,
10
- so: this
12
+ objectId: ScriptingObjectNames.Global
11
13
  });
12
14
  set = (key, value) => {
13
15
  this.#data.set(key, value);
@@ -20,72 +20,65 @@ class Loan extends ScriptingObject {
20
20
  }
21
21
  ApplicationSelected = new Event({
22
22
  name: "applicationselected",
23
- requiresFeedback: false,
24
- so: this
23
+ objectId: "loan"
25
24
  });
26
25
  Close = new Event({
27
26
  name: "close",
28
- requiresFeedback: false,
29
- so: this
27
+ objectId: "loan"
30
28
  });
31
29
  Change = new Event({
32
30
  name: "change",
33
- requiresFeedback: false,
34
- so: this
31
+ objectId: "loan"
35
32
  });
36
33
  Committed = new Event({
37
34
  name: "committed",
38
- requiresFeedback: false,
39
- so: this
35
+ objectId: "loan"
40
36
  });
41
37
  EditModeChange = new Event({
42
38
  name: "editmodechange",
43
- requiresFeedback: false,
44
- so: this
39
+ objectId: "loan"
45
40
  });
46
41
  MilestoneCompleted = new Event({
47
42
  name: "milestonecompleted",
48
- requiresFeedback: false,
49
- so: this
43
+ objectId: "loan"
50
44
  });
51
45
  Open = new Event({
52
46
  name: "open",
53
- requiresFeedback: false,
54
- so: this
47
+ objectId: "loan"
55
48
  });
56
49
  PreCommit = new Event({
57
50
  name: "precommit",
58
- requiresFeedback: true,
59
- so: this
51
+ objectId: "loan"
60
52
  });
61
53
  PreMilestoneComplete = new Event({
62
54
  name: "premilestonecomplete",
63
- requiresFeedback: true,
64
- so: this
55
+ objectId: "loan"
65
56
  });
66
57
  Sync = new Event({
67
58
  name: "sync",
68
- requiresFeedback: false,
69
- so: this
59
+ objectId: "loan"
70
60
  });
71
- all() {
61
+ all = () => {
72
62
  this.#log("loan.all");
73
63
  return Promise.resolve(this.#loanData);
74
- }
75
- applyLock(fieldId, lock) {
64
+ };
65
+ applyLock = (fieldId, lock) => {
76
66
  this.#log(`loan.applyLock: fieldId: ${fieldId}, lock: ${String(lock)}`);
77
67
  return Promise.resolve();
78
- }
79
- calculate() {
68
+ };
69
+ calculate = () => {
80
70
  this.#log("loan.calculate");
81
71
  return Promise.resolve(this.#loanData);
82
- }
83
- async commit() {
72
+ };
73
+ commit = async () => {
84
74
  this.#log("loan.commit");
85
75
  const feedBack = await this.#appBridge.dispatchEvent({
86
76
  event: this.PreCommit,
87
77
  eventParams: {
88
78
  id: this.#loanData.id
79
+ },
80
+ eventOptions: {
81
+ timeout: 1e3
89
82
  }
90
83
  });
91
84
  this.#log(`loan.precommit:event:feedback: ${JSON.stringify(feedBack)}`);
@@ -95,8 +88,8 @@ class Loan extends ScriptingObject {
95
88
  this.#log("loan.commit:failed");
96
89
  }
97
90
  return this.#loanData.id;
98
- }
99
- execAction(type, params) {
91
+ };
92
+ execAction = (type, params) => {
100
93
  this.#log(
101
94
  `loan.execAction: type: ${type}, params: ${JSON.stringify(params)}`
102
95
  );
@@ -104,8 +97,8 @@ class Loan extends ScriptingObject {
104
97
  status: "success",
105
98
  message: "Action executed successfully"
106
99
  });
107
- }
108
- getCollection(name) {
100
+ };
101
+ getCollection = (name) => {
109
102
  this.#log(`loan.getCollection: name: ${name}`);
110
103
  return Promise.resolve({
111
104
  name,
@@ -116,20 +109,20 @@ class Loan extends ScriptingObject {
116
109
  this.#log(`loan.getCollection.removeAt: index: ${index}`);
117
110
  }
118
111
  });
119
- }
120
- getCurrentApplication() {
112
+ };
113
+ getCurrentApplication = () => {
121
114
  this.#log("loan.getCurrentApplication");
122
115
  return Promise.resolve({
123
116
  ...this.#loanData,
124
117
  index: 0,
125
118
  legacyId: "legacy-id"
126
119
  });
127
- }
128
- getField(id) {
120
+ };
121
+ getField = (id) => {
129
122
  this.#log(`loan.getField: id: ${id}`);
130
123
  return Promise.resolve(this.#loanData.name);
131
- }
132
- getFieldOptions(param) {
124
+ };
125
+ getFieldOptions = (param) => {
133
126
  this.#log(`loan.getFieldOptions: param: ${JSON.stringify(param)}`);
134
127
  return Promise.resolve({
135
128
  fieldId: [
@@ -147,40 +140,40 @@ class Loan extends ScriptingObject {
147
140
  }
148
141
  ]
149
142
  });
150
- }
151
- getFields(ids) {
143
+ };
144
+ getFields = (ids) => {
152
145
  this.#log(`loan.getFields: ids: ${JSON.stringify(ids)}`);
153
146
  const fields = ids.reduce((acc, id) => {
154
147
  acc[id] = this.#loanData.name;
155
148
  return acc;
156
149
  }, {});
157
150
  return Promise.resolve(fields);
158
- }
159
- isReadOnly() {
151
+ };
152
+ isReadOnly = () => {
160
153
  this.#log("loan.isReadOnly");
161
154
  return Promise.resolve(false);
162
- }
163
- merge() {
155
+ };
156
+ merge = () => {
164
157
  this.#log("loan.merge");
165
158
  return Promise.resolve();
166
- }
167
- setCurrentApplication(options) {
159
+ };
160
+ setCurrentApplication = (options) => {
168
161
  this.#log(
169
162
  `loan.setCurrentApplication: options: ${JSON.stringify(options)}`
170
163
  );
171
164
  return Promise.resolve();
172
- }
173
- setEditMode(options) {
165
+ };
166
+ setEditMode = (options) => {
174
167
  this.#log(`loan.setEditMode: options: ${JSON.stringify(options)}`);
175
168
  return Promise.resolve();
176
- }
177
- setFields(fields) {
169
+ };
170
+ setFields = (fields) => {
178
171
  this.#log(`loan.setFields: fields: ${JSON.stringify(fields)}`);
179
172
  Object.keys(fields).forEach((key) => {
180
173
  const field = fields[key];
181
174
  });
182
175
  return Promise.resolve();
183
- }
176
+ };
184
177
  }
185
178
  export {
186
179
  Loan
@@ -13,19 +13,19 @@ export declare class Loan extends ScriptingObject implements ILoan {
13
13
  readonly PreCommit: Event<Events>;
14
14
  readonly PreMilestoneComplete: Event<Events>;
15
15
  readonly Sync: Event<Events>;
16
- all(): Promise<LoanObject>;
17
- applyLock(fieldId: string, lock: boolean): Promise<void>;
18
- calculate(): Promise<LoanObject>;
19
- commit(): Promise<string>;
20
- execAction(type: LoanLevelActions, params?: Record<string, unknown>): Promise<ActionResponse>;
21
- getCollection(name: LoanCollection): Promise<LoanCollectionObject>;
22
- getCurrentApplication(): Promise<ApplicationInfo>;
23
- getField(id: string): Promise<string>;
24
- getFieldOptions(param: FieldOptionsParam): Promise<Record<string, FieldOptions[]>>;
25
- getFields(ids: string[]): Promise<Record<string, string>>;
26
- isReadOnly(): Promise<boolean>;
27
- merge(): Promise<void>;
28
- setCurrentApplication(options: CurrentApplicationOptions): Promise<void>;
29
- setEditMode(options: EditModeOptions): Promise<void>;
30
- setFields(fields: Record<string, string>): Promise<void>;
16
+ all: () => Promise<LoanObject>;
17
+ applyLock: (fieldId: string, lock: boolean) => Promise<void>;
18
+ calculate: () => Promise<LoanObject>;
19
+ commit: () => Promise<string>;
20
+ execAction: (type: LoanLevelActions, params?: Record<string, unknown>) => Promise<ActionResponse>;
21
+ getCollection: (name: LoanCollection) => Promise<LoanCollectionObject>;
22
+ getCurrentApplication: () => Promise<ApplicationInfo>;
23
+ getField: (id: string) => Promise<string>;
24
+ getFieldOptions: (param: FieldOptionsParam) => Promise<Record<string, FieldOptions[]>>;
25
+ getFields: (ids: string[]) => Promise<Record<string, string>>;
26
+ isReadOnly: () => Promise<boolean>;
27
+ merge: () => Promise<void>;
28
+ setCurrentApplication: (options: CurrentApplicationOptions) => Promise<void>;
29
+ setEditMode: (options: EditModeOptions) => Promise<void>;
30
+ setFields: (fields: Record<string, string>) => Promise<void>;
31
31
  }