@elliemae/ssf-host 2.17.3 → 2.17.5

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.
@@ -24,11 +24,13 @@ __export(appraisalServiceModule_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(appraisalServiceModule_exports);
26
26
  var import_microfe_common = require("@elliemae/microfe-common");
27
+ var import_creditServiceModule = require("./creditServiceModule.js");
27
28
  var import_constant = require("./constant.js");
28
29
  const APPRAISAL_SERVICE_OBJECT = "AppraisalService";
29
30
  class AppraisalService extends import_microfe_common.ScriptingObject {
30
31
  #loanId;
31
32
  #creditScore;
33
+ #creditService = null;
32
34
  Close = new import_microfe_common.Event({
33
35
  name: "Close",
34
36
  objectId: this.constructor.name
@@ -52,6 +54,7 @@ class AppraisalService extends import_microfe_common.ScriptingObject {
52
54
  super(APPRAISAL_SERVICE_OBJECT);
53
55
  this.#loanId = loanId;
54
56
  this.#creditScore = creditScore;
57
+ this.#creditService = new import_creditServiceModule.CreditService();
55
58
  }
56
59
  getCapabilities = () => Promise.resolve({
57
60
  isAdmin: true,
@@ -62,6 +65,7 @@ class AppraisalService extends import_microfe_common.ScriptingObject {
62
65
  loanId: this.#loanId,
63
66
  creditScore: this.#creditScore
64
67
  });
68
+ getCreditService = () => Promise.resolve(this.#creditService);
65
69
  getLoanDetails = () => Promise.resolve({
66
70
  loanId: this.#loanId,
67
71
  creditScore: this.#creditScore
@@ -0,0 +1,62 @@
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 __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var creditServiceModule_exports = {};
20
+ __export(creditServiceModule_exports, {
21
+ CREDIT_SERVICE_OBJECT: () => CREDIT_SERVICE_OBJECT,
22
+ CreditService: () => CreditService,
23
+ creditServiceObject: () => creditServiceObject
24
+ });
25
+ module.exports = __toCommonJS(creditServiceModule_exports);
26
+ var import_microfe_common = require("@elliemae/microfe-common");
27
+ var import_constant = require("./constant.js");
28
+ const CREDIT_SERVICE_OBJECT = "CreditService";
29
+ class CreditService extends import_microfe_common.ScriptingObject {
30
+ Close = new import_microfe_common.Event({
31
+ name: "Close",
32
+ objectId: this.constructor.name
33
+ });
34
+ Unloading = new import_microfe_common.Event({
35
+ name: "Unloading",
36
+ objectId: this.constructor.name
37
+ });
38
+ constructor() {
39
+ super(CREDIT_SERVICE_OBJECT);
40
+ }
41
+ getCapabilities = () => Promise.resolve({
42
+ vendor: "ICE"
43
+ });
44
+ getParameters = () => Promise.resolve({
45
+ moduleId: "creditservice"
46
+ });
47
+ log = async (message, level) => {
48
+ console.log(message, level);
49
+ return Promise.resolve();
50
+ };
51
+ unload = async () => {
52
+ };
53
+ }
54
+ const creditServiceObject = {
55
+ object: {
56
+ events: [import_constant.UNLOADING_EVENT_NAME],
57
+ functions: ["getParameters", "getCapabilities", "unload"],
58
+ objectId: CREDIT_SERVICE_OBJECT,
59
+ objectType: "Object"
60
+ },
61
+ type: "object"
62
+ };
@@ -1,4 +1,5 @@
1
1
  import { ScriptingObject, Event } from "@elliemae/microfe-common";
2
+ import { CreditService } from "./creditServiceModule.js";
2
3
  import {
3
4
  UNLOADING_EVENT_NAME,
4
5
  PRE_COMMIT_EVENT_NAME,
@@ -8,6 +9,7 @@ const APPRAISAL_SERVICE_OBJECT = "AppraisalService";
8
9
  class AppraisalService extends ScriptingObject {
9
10
  #loanId;
10
11
  #creditScore;
12
+ #creditService = null;
11
13
  Close = new Event({
12
14
  name: "Close",
13
15
  objectId: this.constructor.name
@@ -31,6 +33,7 @@ class AppraisalService extends ScriptingObject {
31
33
  super(APPRAISAL_SERVICE_OBJECT);
32
34
  this.#loanId = loanId;
33
35
  this.#creditScore = creditScore;
36
+ this.#creditService = new CreditService();
34
37
  }
35
38
  getCapabilities = () => Promise.resolve({
36
39
  isAdmin: true,
@@ -41,6 +44,7 @@ class AppraisalService extends ScriptingObject {
41
44
  loanId: this.#loanId,
42
45
  creditScore: this.#creditScore
43
46
  });
47
+ getCreditService = () => Promise.resolve(this.#creditService);
44
48
  getLoanDetails = () => Promise.resolve({
45
49
  loanId: this.#loanId,
46
50
  creditScore: this.#creditScore
@@ -0,0 +1,42 @@
1
+ import { ScriptingObject, Event } from "@elliemae/microfe-common";
2
+ import { UNLOADING_EVENT_NAME } from "./constant.js";
3
+ const CREDIT_SERVICE_OBJECT = "CreditService";
4
+ class CreditService extends ScriptingObject {
5
+ Close = new Event({
6
+ name: "Close",
7
+ objectId: this.constructor.name
8
+ });
9
+ Unloading = new Event({
10
+ name: "Unloading",
11
+ objectId: this.constructor.name
12
+ });
13
+ constructor() {
14
+ super(CREDIT_SERVICE_OBJECT);
15
+ }
16
+ getCapabilities = () => Promise.resolve({
17
+ vendor: "ICE"
18
+ });
19
+ getParameters = () => Promise.resolve({
20
+ moduleId: "creditservice"
21
+ });
22
+ log = async (message, level) => {
23
+ console.log(message, level);
24
+ return Promise.resolve();
25
+ };
26
+ unload = async () => {
27
+ };
28
+ }
29
+ const creditServiceObject = {
30
+ object: {
31
+ events: [UNLOADING_EVENT_NAME],
32
+ functions: ["getParameters", "getCapabilities", "unload"],
33
+ objectId: CREDIT_SERVICE_OBJECT,
34
+ objectType: "Object"
35
+ },
36
+ type: "object"
37
+ };
38
+ export {
39
+ CREDIT_SERVICE_OBJECT,
40
+ CreditService,
41
+ creditServiceObject
42
+ };
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Guest V1 -> V2 Host</title><style>body,html,main{height:100%;margin:2px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script><script src="https://cdn.elliemae.io/elliemae/core/ssf/1.0/elli.ssf.guest.js"></script><script defer="defer" src="js/emuiSsfHost.29d46bdf0e76b4f904aa.js"></script></head><body><h2>Guest V1 nesting Host V2</h2><div id="result"><p id="loan-details"></p><p id="loan-pre-save-event-details"></p></div><div id="guest-container"></div><script type="module">import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loadV2Guest=async()=>{const t=await getGuestBaseUrl(),{id:e}=hostV2.loadGuest({id:"guestV2",url:new URL("./v2-guest.html",t).href,title:"Guest V2",targetElement:document.getElementById("guest-container")})};window.addEventListener("load",(async()=>{await elli.script.connect();const t=await elli.script.getObject("Application"),e=await elli.script.getObject("Loan"),a=await e.getLoanDetails();document.getElementById("loan-details").innerText=`Loan Data: ${JSON.stringify(a)}`,elli.script.subscribe("loan","onPreSave",((t,e)=>(document.getElementById("loan-pre-save-event-details").innerText=`Presave event data: ${JSON.stringify(e)}`,!1))),hostV2.addScriptingObject(hostV2.cloneScriptingObject(t,{})),hostV2.addScriptingObject(hostV2.cloneScriptingObject(e,{})),await loadV2Guest()}))</script></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Guest V1 -> V2 Host</title><style>body,html,main{height:100%;margin:2px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script><script src="https://cdn.elliemae.io/elliemae/core/ssf/1.0/elli.ssf.guest.js"></script><script defer="defer" src="js/emuiSsfHost.29d46bdf0e76b4f904aa.js"></script></head><body><h2>Guest V1 nesting Host V2</h2><div id="result"><p id="loan-details"></p><p id="loan-pre-save-event-details"></p></div><div id="guest-container"></div><script type="module">import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loadV2Guest=async()=>{const t=await getGuestBaseUrl(),{id:e}=hostV2.loadGuest({id:"guestV2",url:new URL("./v2-guest.html",t).href,title:"Guest V2",targetElement:document.getElementById("guest-container")})};window.addEventListener("load",async()=>{await elli.script.connect();const t=await elli.script.getObject("Application"),e=await elli.script.getObject("Loan"),a=await e.getLoanDetails();document.getElementById("loan-details").innerText=`Loan Data: ${JSON.stringify(a)}`,elli.script.subscribe("loan","onPreSave",(t,e)=>(document.getElementById("loan-pre-save-event-details").innerText=`Presave event data: ${JSON.stringify(e)}`,!1)),hostV2.addScriptingObject(hostV2.cloneScriptingObject(t,{})),hostV2.addScriptingObject(hostV2.cloneScriptingObject(e,{})),await loadV2Guest()})</script></body></html>
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host V2 -> V1 Guest</title><style>body,html,main{height:100%;margin:4px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.29d46bdf0e76b4f904aa.js"></script></head><body><main><h1>Host V2 nesting V1 Guest</h1><button id="save-btn" type="button" onclick="saveLoan()">Save Loan</button><div id="results"><p id="pre-save-feedback-result"></p></div><div id="guest-container"></div></main><script type="module">import{Loan}from"./loan-object.js";import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loanObj=new Loan;hostV2.addScriptingObject(loanObj);const params=new URLSearchParams(document.location.search),{id:id}=hostV2.loadGuest({id:"guestV1",url:new URL("true"!==params.get("nestV1GuestV2Host")?"./v1-guest.html":"./v1-guest-v2-host.html",window.location.href).href,searchParams:{nestHostV1:!0},title:"Guest V1",targetElement:document.getElementById("guest-container")});window.saveLoan=async()=>{const e=loanObj.getLoanDetails();(await hostV2.dispatchEvent({event:loanObj.onPreSave,eventParams:e,eventOptions:{timeout:1e3}})).some((e=>!1===e))?document.getElementById("pre-save-feedback-result").innerText="Pre save failed":document.getElementById("pre-save-feedback-result").innerText="Pre save succeeded"}</script></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host V2 -> V1 Guest</title><style>body,html,main{height:100%;margin:4px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.29d46bdf0e76b4f904aa.js"></script></head><body><main><h1>Host V2 nesting V1 Guest</h1><button id="save-btn" type="button" onclick="saveLoan()">Save Loan</button><div id="results"><p id="pre-save-feedback-result"></p></div><div id="guest-container"></div></main><script type="module">import{Loan}from"./loan-object.js";import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loanObj=new Loan;hostV2.addScriptingObject(loanObj);const params=new URLSearchParams(document.location.search),{id:id}=hostV2.loadGuest({id:"guestV1",url:new URL("true"!==params.get("nestV1GuestV2Host")?"./v1-guest.html":"./v1-guest-v2-host.html",window.location.href).href,searchParams:{nestHostV1:!0},title:"Guest V1",targetElement:document.getElementById("guest-container")});window.saveLoan=async()=>{const e=loanObj.getLoanDetails();(await hostV2.dispatchEvent({event:loanObj.onPreSave,eventParams:e,eventOptions:{timeout:1e3}})).some(e=>!1===e)?document.getElementById("pre-save-feedback-result").innerText="Pre save failed":document.getElementById("pre-save-feedback-result").innerText="Pre save succeeded"}</script></body></html>
@@ -1,5 +1,6 @@
1
1
  import { IModule, Listener, Events, LogLevels, LogMessage } from '@elliemae/pui-scripting-object';
2
2
  import { ScriptingObject, Event } from '@elliemae/microfe-common';
3
+ import { CreditService } from './creditServiceModule.js';
3
4
  export declare const APPRAISAL_SERVICE_OBJECT = "AppraisalService";
4
5
  export type LoanInfo = {
5
6
  loanId: string;
@@ -27,6 +28,7 @@ export declare class AppraisalService extends ScriptingObject implements IModule
27
28
  loanId: string;
28
29
  creditScore: number;
29
30
  }>;
31
+ getCreditService: () => Promise<CreditService | null>;
30
32
  getLoanDetails: () => Promise<{
31
33
  loanId: string;
32
34
  creditScore: number;
@@ -0,0 +1,25 @@
1
+ import { IModule, Events, LogLevels, LogMessage } from '@elliemae/pui-scripting-object';
2
+ import { ScriptingObject, Event } from '@elliemae/microfe-common';
3
+ export declare const CREDIT_SERVICE_OBJECT = "CreditService";
4
+ export declare class CreditService extends ScriptingObject implements IModule {
5
+ Close: Event<Events>;
6
+ Unloading: Event<Events>;
7
+ constructor();
8
+ getCapabilities: () => Promise<{
9
+ vendor: string;
10
+ }>;
11
+ getParameters: () => Promise<{
12
+ moduleId: string;
13
+ }>;
14
+ log: (message: string | LogMessage, level: keyof typeof LogLevels) => Promise<void>;
15
+ unload: () => Promise<void>;
16
+ }
17
+ export declare const creditServiceObject: {
18
+ object: {
19
+ events: string[];
20
+ functions: string[];
21
+ objectId: string;
22
+ objectType: string;
23
+ };
24
+ type: string;
25
+ };