@elliemae/pui-scripting-object 1.7.0 → 1.8.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.
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var analytics_exports = {};
16
+ module.exports = __toCommonJS(analytics_exports);
package/dist/cjs/index.js CHANGED
@@ -28,3 +28,6 @@ __reExport(lib_exports, require("./session.js"), module.exports);
28
28
  __reExport(lib_exports, require("./transaction.js"), module.exports);
29
29
  __reExport(lib_exports, require("./transactiontemplate.js"), module.exports);
30
30
  __reExport(lib_exports, require("./userAccessRights.js"), module.exports);
31
+ __reExport(lib_exports, require("./route.js"), module.exports);
32
+ __reExport(lib_exports, require("./view.js"), module.exports);
33
+ __reExport(lib_exports, require("./analytics.js"), module.exports);
@@ -18,11 +18,21 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var loanv2_exports = {};
20
20
  __export(loanv2_exports, {
21
+ CommitErrorStatus: () => CommitErrorStatus,
21
22
  FieldErrorType: () => FieldErrorType
22
23
  });
23
24
  module.exports = __toCommonJS(loanv2_exports);
24
25
  var FieldErrorType = /* @__PURE__ */ ((FieldErrorType2) => {
25
26
  FieldErrorType2["ACCESS"] = "access";
26
27
  FieldErrorType2["VALUE"] = "value";
28
+ FieldErrorType2["SERIALIZATION"] = "serialization";
29
+ FieldErrorType2["DATA"] = "data";
30
+ FieldErrorType2["CONFLICT"] = "conflict";
27
31
  return FieldErrorType2;
28
32
  })(FieldErrorType || {});
33
+ var CommitErrorStatus = /* @__PURE__ */ ((CommitErrorStatus2) => {
34
+ CommitErrorStatus2["FIELDERROR"] = "field_error";
35
+ CommitErrorStatus2["LOCK_INVALID_OR_REMOVED"] = "lock_invalid_or_removed";
36
+ CommitErrorStatus2["WORKSPACE_READ_ONLY"] = "workspace_read_only";
37
+ return CommitErrorStatus2;
38
+ })(CommitErrorStatus || {});
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var route_exports = {};
16
+ module.exports = __toCommonJS(route_exports);
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var scriptingObjectTypes_exports = {};
16
+ module.exports = __toCommonJS(scriptingObjectTypes_exports);
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var view_exports = {};
16
+ module.exports = __toCommonJS(view_exports);
File without changes
package/dist/esm/index.js CHANGED
@@ -11,3 +11,6 @@ export * from "./session.js";
11
11
  export * from "./transaction.js";
12
12
  export * from "./transactiontemplate.js";
13
13
  export * from "./userAccessRights.js";
14
+ export * from "./route.js";
15
+ export * from "./view.js";
16
+ export * from "./analytics.js";
@@ -1,8 +1,18 @@
1
1
  var FieldErrorType = /* @__PURE__ */ ((FieldErrorType2) => {
2
2
  FieldErrorType2["ACCESS"] = "access";
3
3
  FieldErrorType2["VALUE"] = "value";
4
+ FieldErrorType2["SERIALIZATION"] = "serialization";
5
+ FieldErrorType2["DATA"] = "data";
6
+ FieldErrorType2["CONFLICT"] = "conflict";
4
7
  return FieldErrorType2;
5
8
  })(FieldErrorType || {});
9
+ var CommitErrorStatus = /* @__PURE__ */ ((CommitErrorStatus2) => {
10
+ CommitErrorStatus2["FIELDERROR"] = "field_error";
11
+ CommitErrorStatus2["LOCK_INVALID_OR_REMOVED"] = "lock_invalid_or_removed";
12
+ CommitErrorStatus2["WORKSPACE_READ_ONLY"] = "workspace_read_only";
13
+ return CommitErrorStatus2;
14
+ })(CommitErrorStatus || {});
6
15
  export {
16
+ CommitErrorStatus,
7
17
  FieldErrorType
8
18
  };
File without changes
File without changes
File without changes
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Business analytics event to be sent
3
+ */
4
+ export declare type BAEvent = {
5
+ event: string;
6
+ [key: string]: string;
7
+ };
8
+ /**
9
+ * Methods and events to send and receive business analytics events
10
+ */
11
+ export interface IAnalytics {
12
+ /**
13
+ * send business analytics event
14
+ *
15
+ * @param event business event to be sent
16
+ */
17
+ sendBAEvent(event: BAEvent): void;
18
+ }
@@ -97,6 +97,12 @@ export interface IApplication {
97
97
  * @param options Print options
98
98
  */
99
99
  print(options: PrintOptions): Promise<void>;
100
+ /**
101
+ * show error message to user
102
+ *
103
+ * @param message error message to display
104
+ */
105
+ showError(message: string): Promise<void>;
100
106
  }
101
107
  export declare type AppLoginListener = () => void;
102
108
  export declare type AppActionCompletedListener = (name: string) => void;
@@ -11,3 +11,7 @@ export * from './session.js';
11
11
  export * from './transaction.js';
12
12
  export * from './transactiontemplate.js';
13
13
  export * from './userAccessRights.js';
14
+ export * from './route.js';
15
+ export * from './view.js';
16
+ export * from './analytics.js';
17
+ export type { ScriptingObjectTypes } from './scriptingObjectTypes.js';
@@ -1,17 +1,30 @@
1
1
  import { ILoan, LoanObject } from './loan.js';
2
2
  export declare enum FieldErrorType {
3
3
  /**
4
- * access related error
4
+ * access related violations
5
5
  */
6
6
  ACCESS = "access",
7
7
  /**
8
- * errors related to Field Data Entry Rules violation of the Active Ruleset
8
+ * Violation of a field data entry rule.
9
+ * Thrown only when value gets applied to the loan and will remain until user fixes the value
9
10
  */
10
- VALUE = "value"
11
+ VALUE = "value",
12
+ /**
13
+ * Error during de\serialization of the field value
14
+ */
15
+ SERIALIZATION = "serialization",
16
+ /**
17
+ * Error due to invalid data like valid RuleActionType is not implemented
18
+ */
19
+ DATA = "data",
20
+ /**
21
+ * Error due to invalid user data based on current state of the loan
22
+ * This does not get applied to the loan
23
+ */
24
+ CONFLICT = "conflict"
11
25
  }
12
26
  export declare type FieldErrors = {
13
27
  id: string;
14
- contractPath: string;
15
28
  type: FieldErrorType;
16
29
  description: string;
17
30
  };
@@ -21,6 +34,30 @@ export declare type SetFieldResponse = {
21
34
  */
22
35
  errors: FieldErrors[];
23
36
  };
37
+ export declare enum CommitErrorStatus {
38
+ FIELDERROR = "field_error",
39
+ LOCK_INVALID_OR_REMOVED = "lock_invalid_or_removed",
40
+ WORKSPACE_READ_ONLY = "workspace_read_only"
41
+ }
42
+ /**
43
+ * Error representing a commit failure
44
+ */
45
+ export declare type CommitError = Error & {
46
+ status: CommitErrorStatus;
47
+ /**
48
+ * List of violated rules that failed the commit
49
+ */
50
+ ruleViolations: {
51
+ /**
52
+ * fields not meeting various field rules
53
+ */
54
+ fieldErrors: FieldErrors[];
55
+ };
56
+ };
57
+ export declare type FieldIDToContractPath = {
58
+ fieldId: string;
59
+ contractPath: string;
60
+ };
24
61
  /**
25
62
  * All operations on a loan are stateful. This means loan changes are not committed until the loan.commit is called
26
63
  */
@@ -28,15 +65,24 @@ export interface ILoanV2 extends Omit<ILoan, 'commit' | 'setFields' | 'merge'> {
28
65
  /**
29
66
  * Commit all pending changes on the current loan
30
67
  *
31
- * @returns v3 Loan Object
32
- * @throws {Error} if the loan is not in a valid state or if there are business rule violations
68
+ * @returns {Promise<CommitResponse>}
69
+ * @throws {Error} if operation fails due to network errors
70
+ * @throws {CommitError} if operation fails due to business / functional rules
33
71
  *
34
72
  * #### Product Compatibility:
35
73
  * | | Encompass | Encompass Web | TPO | Consumer Connect |
36
74
  * :-----:|:-----: |:-----: |:-----: |:-----: |
37
75
  * | commit | ✖️ | ✖️ | ✖️ | ✖️ |
38
76
  */
39
- commit(): Promise<LoanObject>;
77
+ commit(): Promise<void>;
78
+ /**
79
+ * Get the contract path for the given field ids
80
+ *
81
+ * @param fieldIds list of field ids for which loan contract path is required
82
+ * @returns list of field ids and their loan contract paths
83
+ * @throws {Error} if operation fails due to network errors
84
+ */
85
+ getContractPath(fieldIds: string[]): Promise<FieldIDToContractPath[]>;
40
86
  /**
41
87
  * Syncs the loan workspace with any changes made by other users
42
88
  * #### Product Compatibility:
@@ -0,0 +1,7 @@
1
+ import { To } from 'history';
2
+ /**
3
+ * Methods and events to view, modify & get notified about parent window url navigation
4
+ */
5
+ export interface IRoute {
6
+ navigate(path: To, state?: any): Promise<void>;
7
+ }
@@ -1,4 +1,28 @@
1
+ /**
2
+ * Scripting object interface
3
+ */
1
4
  export interface IScript {
5
+ /**
6
+ * get scripting object by name
7
+ *
8
+ * @param name scripting object name
9
+ */
2
10
  getObject<T>(name: string): Promise<T>;
3
- subscribe(objName: string, eventName: string, listener: () => void | boolean): Promise<void>;
11
+ /**
12
+ * subscribe to an scripting object event
13
+ *
14
+ * @returns token to be used to unsubscribe
15
+ * @param objName scripting object name
16
+ * @param eventName event name
17
+ * @param listener callback function to be called when the event is fired
18
+ */
19
+ subscribe(objName: string, eventName: string, listener: (ev: any) => any): string;
20
+ /**
21
+ * unsubscribe from an scripting object event
22
+ *
23
+ * @param objName scripting object name
24
+ * @param eventName event name
25
+ * @param token unique token returned by subscribe
26
+ */
27
+ unsubscribe(objName: string, eventName: string, token: string): void;
4
28
  }
@@ -0,0 +1,24 @@
1
+ import { ILoan } from './loan.js';
2
+ import { ILoanV2 } from './loanv2.js';
3
+ import { IApplication } from './application.js';
4
+ import { IAuth } from './auth.js';
5
+ import { ISession } from './session.js';
6
+ import { ITransaction } from './transaction.js';
7
+ import { ITransactionTemplate } from './transactiontemplate.js';
8
+ import { IForm } from './form.js';
9
+ import { IGlobal } from './global.js';
10
+ import { IHttp } from './http.js';
11
+ import { IAnalytics } from './analytics.js';
12
+ export declare type ScriptingObjectTypes = {
13
+ Application: IApplication;
14
+ Analytics: IAnalytics;
15
+ Auth: IAuth;
16
+ Form: IForm;
17
+ Global: IGlobal;
18
+ Http: IHttp;
19
+ Loan: ILoan;
20
+ LoanV2: ILoanV2;
21
+ Session: ISession;
22
+ Transaction: ITransaction;
23
+ TransactionTemplate: ITransactionTemplate;
24
+ };
@@ -1,4 +1,18 @@
1
+ /**
2
+ * Methods and events to view, modify & get notified about parent window session storage
3
+ */
1
4
  export interface ISession {
5
+ /**
6
+ * set a value in the session storage
7
+ *
8
+ * @param key unique key to store the value
9
+ * @param value value to be stored
10
+ */
2
11
  set(key: string, value: string): Promise<void>;
12
+ /**
13
+ * get a value from the session storage
14
+ *
15
+ * @param key unique key to retrieve the value
16
+ */
3
17
  get(key: string): Promise<string>;
4
18
  }
@@ -0,0 +1,41 @@
1
+ import { BreakPoint } from '@elliemae/pui-theme';
2
+ /**
3
+ * window viewport size
4
+ */
5
+ export declare type ViewportSize = {
6
+ width: number;
7
+ height: number;
8
+ };
9
+ /**
10
+ * parent window resize event handler
11
+ */
12
+ export declare type ResizeEventListener = (entries: ResizeObserverEntry) => void;
13
+ /**
14
+ * parent window breakpoint change event handler
15
+ */
16
+ export declare type BreakpointChangeEventListener = (breakpoint: BreakPoint) => void;
17
+ /**
18
+ * Methods and events to view, modify & get notified about parent's window attributes
19
+ */
20
+ export interface IView {
21
+ /**
22
+ * Get the current breakpoint of the parent window
23
+ */
24
+ getBreakpoint(): Promise<BreakPoint>;
25
+ /**
26
+ * Get the current viewport size of the parent window
27
+ */
28
+ getViewPortSize(): Promise<ViewportSize>;
29
+ /**
30
+ * parent window resize event
31
+ *
32
+ * @param eventHandler event handler to be called when the parent window is resized
33
+ */
34
+ onResizeEvent(eventHandler: ResizeEventListener): string;
35
+ /**
36
+ * parent window breakpoint change event
37
+ *
38
+ * @param eventHandler event handler to be called when the parent window's breakpoint changes
39
+ */
40
+ onBreakpointChangeEvent(eventHandler: BreakpointChangeEventListener): string;
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-scripting-object",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Typescript defintions for Scripting Objects",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/cjs/index.js",
@@ -58,12 +58,14 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.5.0",
61
- "@elliemae/pui-cli": "~7.6.1",
61
+ "@elliemae/pui-cli": "~7.9.0",
62
62
  "@elliemae/pui-doc-gen": "~1.3.0",
63
+ "@elliemae/pui-theme": "~2.6.0",
63
64
  "@types/styled-components": "~5.1.26",
65
+ "history": "~5.3.0",
64
66
  "redux": "~4.2.0",
65
67
  "redux-saga": "~1.2.1",
66
- "styled-components": "~5.3.5"
68
+ "styled-components": "~5.3.6"
67
69
  },
68
70
  "peerDependencies": {}
69
71
  }
@@ -1,19 +0,0 @@
1
-
2
- doctype html
3
- html(lang='en')
4
- head
5
- meta(charset='UTF-8')
6
- meta(name='viewport' content='width=device-width, initial-scale=1.0')
7
- meta(http-equiv='X-UA-Compatible' content='ie=edge')
8
- title #{htmlWebpackPlugin.options.libraryName}
9
- body
10
- p This library #{htmlWebpackPlugin.options.libraryName} exposes the following properties
11
- ul#libraryAttributes
12
- script(lang='javascript').
13
- window.onload = function() {
14
- const attribNode = document.getElementById('libraryAttributes');
15
- if (attribNode) {
16
- attribNode.innerHTML = Object.keys(window['#{htmlWebpackPlugin.options.libraryName}'] || {}).reduce((value, attribute) => value += `<li>${attribute}</li>`, '');
17
- }
18
- }
19
-
@@ -1,19 +0,0 @@
1
-
2
- doctype html
3
- html(lang='en')
4
- head
5
- meta(charset='UTF-8')
6
- meta(name='viewport' content='width=device-width, initial-scale=1.0')
7
- meta(http-equiv='X-UA-Compatible' content='ie=edge')
8
- title #{htmlWebpackPlugin.options.libraryName}
9
- body
10
- p This library #{htmlWebpackPlugin.options.libraryName} exposes the following properties
11
- ul#libraryAttributes
12
- script(lang='javascript').
13
- window.onload = function() {
14
- const attribNode = document.getElementById('libraryAttributes');
15
- if (attribNode) {
16
- attribNode.innerHTML = Object.keys(window['#{htmlWebpackPlugin.options.libraryName}'] || {}).reduce((value, attribute) => value += `<li>${attribute}</li>`, '');
17
- }
18
- }
19
-