@elliemae/pui-scripting-object 1.28.0 → 1.29.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.
@@ -18,9 +18,23 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var loan_exports = {};
20
20
  __export(loan_exports, {
21
- LoanLevelActions: () => LoanLevelActions
21
+ LoanLevelActions: () => LoanLevelActions,
22
+ RecordActions: () => RecordActions,
23
+ RecordViewType: () => RecordViewType
22
24
  });
23
25
  module.exports = __toCommonJS(loan_exports);
26
+ var RecordActions = /* @__PURE__ */ ((RecordActions2) => {
27
+ RecordActions2["ADD"] = "add";
28
+ RecordActions2["UPDATE"] = "update";
29
+ RecordActions2["DELETE"] = "delete";
30
+ RecordActions2["REPLACE"] = "replace";
31
+ return RecordActions2;
32
+ })(RecordActions || {});
33
+ var RecordViewType = /* @__PURE__ */ ((RecordViewType2) => {
34
+ RecordViewType2["ID"] = "id";
35
+ RecordViewType2["ENTITY"] = "entity";
36
+ return RecordViewType2;
37
+ })(RecordViewType || {});
24
38
  var LoanLevelActions = /* @__PURE__ */ ((LoanLevelActions2) => {
25
39
  LoanLevelActions2["UPDATE_CORRESPONDENT_BALANCE"] = "updateCorrespondentBalance";
26
40
  LoanLevelActions2["UPDATE_CORRESPONDENT_FEES"] = "updateCorrespondentFees";
@@ -1,3 +1,15 @@
1
+ var RecordActions = /* @__PURE__ */ ((RecordActions2) => {
2
+ RecordActions2["ADD"] = "add";
3
+ RecordActions2["UPDATE"] = "update";
4
+ RecordActions2["DELETE"] = "delete";
5
+ RecordActions2["REPLACE"] = "replace";
6
+ return RecordActions2;
7
+ })(RecordActions || {});
8
+ var RecordViewType = /* @__PURE__ */ ((RecordViewType2) => {
9
+ RecordViewType2["ID"] = "id";
10
+ RecordViewType2["ENTITY"] = "entity";
11
+ return RecordViewType2;
12
+ })(RecordViewType || {});
1
13
  var LoanLevelActions = /* @__PURE__ */ ((LoanLevelActions2) => {
2
14
  LoanLevelActions2["UPDATE_CORRESPONDENT_BALANCE"] = "updateCorrespondentBalance";
3
15
  LoanLevelActions2["UPDATE_CORRESPONDENT_FEES"] = "updateCorrespondentFees";
@@ -6,5 +18,7 @@ var LoanLevelActions = /* @__PURE__ */ ((LoanLevelActions2) => {
6
18
  return LoanLevelActions2;
7
19
  })(LoanLevelActions || {});
8
20
  export {
9
- LoanLevelActions
21
+ LoanLevelActions,
22
+ RecordActions,
23
+ RecordViewType
10
24
  };
@@ -37,6 +37,62 @@ export type CurrentApplicationOptions = {
37
37
  */
38
38
  borrowerPairId: string;
39
39
  };
40
+ /**
41
+ * loan record actions
42
+ */
43
+ export declare enum RecordActions {
44
+ /**
45
+ * add record action
46
+ */
47
+ ADD = "add",
48
+ /**
49
+ * update record action
50
+ */
51
+ UPDATE = "update",
52
+ /**
53
+ * delete record action
54
+ */
55
+ DELETE = "delete",
56
+ /**
57
+ * replace record action
58
+ */
59
+ REPLACE = "replace"
60
+ }
61
+ /**
62
+ * loan record view types
63
+ */
64
+ export declare enum RecordViewType {
65
+ /**
66
+ * id view type
67
+ */
68
+ ID = "id",
69
+ /**
70
+ * entity view type
71
+ */
72
+ ENTITY = "entity"
73
+ }
74
+ export type LoanRecord = unknown;
75
+ /**
76
+ * options for updating records
77
+ */
78
+ export type RecordOptions = {
79
+ /**
80
+ * operation to be performed on record
81
+ */
82
+ action: RecordActions;
83
+ /**
84
+ * loan v3 contract path
85
+ */
86
+ contractPath: string;
87
+ /**
88
+ * records to be updated
89
+ */
90
+ data: Array<LoanRecord>;
91
+ /**
92
+ * record view type
93
+ */
94
+ view: RecordViewType;
95
+ };
40
96
  /**
41
97
  * v3 loan object
42
98
  */
@@ -290,11 +346,12 @@ export interface ILoan extends IScriptingObject {
290
346
  getCurrentApplication(): Promise<Record<string, string>>;
291
347
  /**
292
348
  * Update data for current application
293
- * @param options
349
+ * @param options {CurrentApplicationOptions} options for setting current application
294
350
  */
295
351
  setCurrentApplication(options: CurrentApplicationOptions): Promise<void>;
296
352
  /**
297
353
  * Execute loan level action, this is specific to v3 stateful implementation
354
+ * @param type {LoanLevelActions} type of action to be executed
298
355
  */
299
356
  execAction(type: LoanLevelActions): Promise<LoanObject>;
300
357
  /**
@@ -302,6 +359,16 @@ export interface ILoan extends IScriptingObject {
302
359
  * @param name collection template name
303
360
  */
304
361
  getCollection(name: string): Promise<Record<string, string>>;
362
+ /**
363
+ * get snapshot of loan object
364
+ */
305
365
  getLockSnapshot(): Promise<Record<string, string>>;
366
+ /**
367
+ * insert, delete, update, replace different loand record types.
368
+ * scope includes log and non-log record types
369
+ * @param options {RecordOptions} options for updating records
370
+ * @returns array of record ids or loan view entity
371
+ */
372
+ updateRecords(options: RecordOptions): Promise<Array<string> | Array<unknown>>;
306
373
  }
307
374
  export {};
@@ -11,15 +11,14 @@ import { IScriptingObject } from '../scriptingObject.js';
11
11
  export interface IMemStorage extends IScriptingObject {
12
12
  /**
13
13
  * set a value in memory for given key
14
- * @param clientId unique identifier assigned to the microapp
15
14
  * @param key unique key to store the value
16
15
  * @param value value to be stored. value should be JSON serializable
17
16
  */
18
- set(clientId: string, key: string, value: unknown): Promise<void>;
17
+ set(key: string, value: unknown): Promise<void>;
19
18
  /**
20
19
  * get a value from memory for given key and microapp id
21
20
  * @param key unique key to retrieve the value
22
21
  * @returns value stored in memory
23
22
  */
24
- get(clientId: string, key: string): Promise<unknown>;
23
+ get(key: string): Promise<unknown>;
25
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-scripting-object",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
4
4
  "description": "Typescript defintions for Scripting Objects",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/cjs/index.js",