@elliemae/pui-scripting-object 1.16.5 → 1.16.7

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/index.js CHANGED
@@ -3,10 +3,6 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
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
6
  var __copyProps = (to, from, except, desc) => {
11
7
  if (from && typeof from === "object" || typeof from === "function") {
12
8
  for (let key of __getOwnPropNames(from))
@@ -18,12 +14,6 @@ var __copyProps = (to, from, except, desc) => {
18
14
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
16
  var lib_exports = {};
21
- __export(lib_exports, {
22
- IEvent: () => import_event.IEvent,
23
- IScriptingObject: () => import_scriptingObject.IScriptingObject,
24
- IScriptingObjectProxy: () => import_scriptingObject.IScriptingObjectProxy,
25
- Listener: () => import_event.Listener
26
- });
27
17
  module.exports = __toCommonJS(lib_exports);
28
18
  __reExport(lib_exports, require("./objects/analytics.js"), module.exports);
29
19
  __reExport(lib_exports, require("./objects/application.js"), module.exports);
@@ -44,5 +34,8 @@ __reExport(lib_exports, require("./objects/transactionTemplate.js"), module.expo
44
34
  __reExport(lib_exports, require("./objects/userAccessRights.js"), module.exports);
45
35
  __reExport(lib_exports, require("./objects/view.js"), module.exports);
46
36
  __reExport(lib_exports, require("./objects/shared.js"), module.exports);
47
- var import_event = require("./event.js");
48
- var import_scriptingObject = require("./scriptingObject.js");
37
+ __reExport(lib_exports, require("./event.js"), module.exports);
38
+ __reExport(lib_exports, require("./scriptingObject.js"), module.exports);
39
+ __reExport(lib_exports, require("./remotingScriptingObject.js"), module.exports);
40
+ __reExport(lib_exports, require("./scriptingObjectList.js"), module.exports);
41
+ __reExport(lib_exports, require("./scriptingObjectEventList.js"), module.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 scriptingObjectEventList_exports = {};
16
+ module.exports = __toCommonJS(scriptingObjectEventList_exports);
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
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
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -13,4 +17,27 @@ var __copyProps = (to, from, except, desc) => {
13
17
  };
14
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
19
  var scriptingObjectList_exports = {};
20
+ __export(scriptingObjectList_exports, {
21
+ ScriptingObjectNames: () => ScriptingObjectNames
22
+ });
16
23
  module.exports = __toCommonJS(scriptingObjectList_exports);
24
+ var ScriptingObjectNames = /* @__PURE__ */ ((ScriptingObjectNames2) => {
25
+ ScriptingObjectNames2["Analytics"] = "analytics";
26
+ ScriptingObjectNames2["Application"] = "application";
27
+ ScriptingObjectNames2["Auth"] = "auth";
28
+ ScriptingObjectNames2["Form"] = "form";
29
+ ScriptingObjectNames2["Global"] = "global";
30
+ ScriptingObjectNames2["Http"] = "http";
31
+ ScriptingObjectNames2["Loan"] = "loan";
32
+ ScriptingObjectNames2["LoanV2"] = "loanV2";
33
+ ScriptingObjectNames2["MemStorage"] = "memstorage";
34
+ ScriptingObjectNames2["Module"] = "module";
35
+ ScriptingObjectNames2["Route"] = "route";
36
+ ScriptingObjectNames2["Service"] = "service";
37
+ ScriptingObjectNames2["Session"] = "session";
38
+ ScriptingObjectNames2["Transaction"] = "transaction";
39
+ ScriptingObjectNames2["TransactionV2"] = "transactionV2";
40
+ ScriptingObjectNames2["TransactionTemplate"] = "transactionTemplate";
41
+ ScriptingObjectNames2["View"] = "view";
42
+ return ScriptingObjectNames2;
43
+ })(ScriptingObjectNames || {});
package/dist/esm/index.js CHANGED
@@ -17,11 +17,8 @@ export * from "./objects/transactionTemplate.js";
17
17
  export * from "./objects/userAccessRights.js";
18
18
  export * from "./objects/view.js";
19
19
  export * from "./objects/shared.js";
20
- import { IEvent, Listener } from "./event.js";
21
- import { IScriptingObjectProxy, IScriptingObject } from "./scriptingObject.js";
22
- export {
23
- IEvent,
24
- IScriptingObject,
25
- IScriptingObjectProxy,
26
- Listener
27
- };
20
+ export * from "./event.js";
21
+ export * from "./scriptingObject.js";
22
+ export * from "./remotingScriptingObject.js";
23
+ export * from "./scriptingObjectList.js";
24
+ export * from "./scriptingObjectEventList.js";
File without changes
@@ -0,0 +1,23 @@
1
+ var ScriptingObjectNames = /* @__PURE__ */ ((ScriptingObjectNames2) => {
2
+ ScriptingObjectNames2["Analytics"] = "analytics";
3
+ ScriptingObjectNames2["Application"] = "application";
4
+ ScriptingObjectNames2["Auth"] = "auth";
5
+ ScriptingObjectNames2["Form"] = "form";
6
+ ScriptingObjectNames2["Global"] = "global";
7
+ ScriptingObjectNames2["Http"] = "http";
8
+ ScriptingObjectNames2["Loan"] = "loan";
9
+ ScriptingObjectNames2["LoanV2"] = "loanV2";
10
+ ScriptingObjectNames2["MemStorage"] = "memstorage";
11
+ ScriptingObjectNames2["Module"] = "module";
12
+ ScriptingObjectNames2["Route"] = "route";
13
+ ScriptingObjectNames2["Service"] = "service";
14
+ ScriptingObjectNames2["Session"] = "session";
15
+ ScriptingObjectNames2["Transaction"] = "transaction";
16
+ ScriptingObjectNames2["TransactionV2"] = "transactionV2";
17
+ ScriptingObjectNames2["TransactionTemplate"] = "transactionTemplate";
18
+ ScriptingObjectNames2["View"] = "view";
19
+ return ScriptingObjectNames2;
20
+ })(ScriptingObjectNames || {});
21
+ export {
22
+ ScriptingObjectNames
23
+ };
@@ -2,7 +2,7 @@ import { IScriptingObjectProxy, IScriptingObject } from './scriptingObject.js';
2
2
  /**
3
3
  * callback for event
4
4
  */
5
- export declare type Listener<SO extends IScriptingObjectProxy, Params extends Record<string, unknown>, Options extends Record<string, unknown>, ReturnType> = ({ obj, eventName, eventParams, eventOptions, }: {
5
+ export type Listener<SO extends IScriptingObjectProxy, Params extends Record<string, unknown>, Options extends Record<string, unknown>, ReturnType> = ({ obj, eventName, eventParams, eventOptions, }: {
6
6
  obj: SO;
7
7
  eventName: string;
8
8
  eventParams: Params;
@@ -12,6 +12,10 @@ export declare type Listener<SO extends IScriptingObjectProxy, Params extends Re
12
12
  * base class for events
13
13
  */
14
14
  export interface IEvent {
15
+ /**
16
+ * unique id of the event
17
+ */
18
+ readonly id: string;
15
19
  /**
16
20
  * name of the event
17
21
  */
@@ -32,12 +36,4 @@ export interface IEvent {
32
36
  * scripting object from where the event was triggered
33
37
  */
34
38
  readonly scriptingObject: IScriptingObject;
35
- /**
36
- * subscribe to the event
37
- */
38
- subscribe: (callback: Listener<IScriptingObject, Record<string, unknown>, Record<string, unknown>, any>) => string;
39
- /**
40
- * unsubscribe from the event
41
- */
42
- unsubscribe: (subscriptionId: string) => void;
43
39
  }
@@ -17,7 +17,8 @@ export * from './objects/transactionTemplate.js';
17
17
  export * from './objects/userAccessRights.js';
18
18
  export * from './objects/view.js';
19
19
  export * from './objects/shared.js';
20
- export { IEvent, Listener } from './event.js';
21
- export { IScriptingObjectProxy, IScriptingObject } from './scriptingObject.js';
22
- export type { RemotingScriptingObject } from './remotingScriptingObject.js';
23
- export type { ScriptingObjects } from './scriptingObjectList.js';
20
+ export * from './event.js';
21
+ export * from './scriptingObject.js';
22
+ export * from './remotingScriptingObject.js';
23
+ export * from './scriptingObjectList.js';
24
+ export * from './scriptingObjectEventList.js';
@@ -2,7 +2,7 @@ import { IScriptingObject } from '../scriptingObject.js';
2
2
  /**
3
3
  * Business analytics event to be sent
4
4
  */
5
- export declare type BAEvent = {
5
+ export type BAEvent = {
6
6
  /**
7
7
  * name of the analytic event
8
8
  */
@@ -15,7 +15,7 @@ export declare enum LogLevel {
15
15
  /**
16
16
  * metadata about the application
17
17
  */
18
- export declare type AppInfo = {
18
+ export type AppInfo = {
19
19
  id: string;
20
20
  name: string;
21
21
  };
@@ -29,7 +29,7 @@ export declare enum ApplicationExtensionType {
29
29
  /**
30
30
  * metadata about the application extension
31
31
  */
32
- export declare type ApplicationExtension = {
32
+ export type ApplicationExtension = {
33
33
  /**
34
34
  * type of application extension
35
35
  */
@@ -61,12 +61,12 @@ export declare enum NavigationType {
61
61
  /**
62
62
  * navigation options
63
63
  */
64
- export declare type NavigationOptions = {
64
+ export type NavigationOptions = {
65
65
  target: string;
66
66
  type: NavigationType;
67
67
  context?: Record<string, string>;
68
68
  };
69
- export declare type OpenOptions = {
69
+ export type OpenOptions = {
70
70
  target: string;
71
71
  type?: string;
72
72
  };
@@ -78,45 +78,45 @@ export declare enum ModalSize {
78
78
  MEDIUM = "md",
79
79
  LARGE = "lg"
80
80
  }
81
- export declare type OpenModalOptions = {
81
+ export type OpenModalOptions = {
82
82
  target: string;
83
83
  name: string;
84
84
  type?: string;
85
85
  size: ModalSize;
86
86
  };
87
- export declare type Capabilities = {
87
+ export type Capabilities = {
88
88
  supprotedActions: Array<string>;
89
89
  supportedFeatures: Array<string>;
90
90
  };
91
- export declare type Route = {
91
+ export type Route = {
92
92
  url: string;
93
93
  type: NavigationType;
94
94
  name: string;
95
95
  id: string;
96
96
  };
97
- export declare type Environment = {
97
+ export type Environment = {
98
98
  apiHost: string;
99
99
  };
100
- export declare type ApplicationContext = {
100
+ export type ApplicationContext = {
101
101
  env: Environment;
102
102
  route: Route;
103
103
  };
104
104
  /**
105
105
  * Options for printing the document
106
106
  */
107
- export declare type PrintOptions = {
107
+ export type PrintOptions = {
108
108
  /**
109
109
  * document to print
110
110
  */
111
111
  blob: Blob;
112
112
  };
113
- declare type UserInfo = {
113
+ type UserInfo = {
114
114
  /**
115
115
  * user id
116
116
  */
117
117
  userId: string;
118
118
  };
119
- declare type ActionInfo = {
119
+ type ActionInfo = {
120
120
  /**
121
121
  * name of the action
122
122
  */
@@ -125,60 +125,38 @@ declare type ActionInfo = {
125
125
  /**
126
126
  * event handler that handles user login event
127
127
  */
128
- export declare type ApplicationLoginListener = Listener<IApplication, UserInfo, Record<string, unknown>, void>;
128
+ export type ApplicationLoginListener = Listener<IApplication, UserInfo, Record<string, unknown>, void>;
129
129
  /**
130
130
  * event fired when the user logs in
131
131
  */
132
132
  export interface IApplicationLoginEvent extends IEvent {
133
- /**
134
- * event name
135
- */
136
- readonly name: 'Login';
137
- /**
138
- * scripting object from where the event is fired
139
- */
140
- readonly objectId: 'Application';
141
- /**
142
- * event does not require feedback from listeners
143
- */
144
- readonly requiresFeedback: false;
145
133
  /**
146
134
  * event parameters
147
135
  */
148
136
  readonly params: UserInfo;
149
- /**
150
- * subscribe to the event
151
- */
152
- subscribe: (callback: ApplicationLoginListener) => string;
153
137
  }
154
138
  /**
155
139
  * event handler that handles action completed event
156
140
  */
157
- export declare type ApplicationActionCompletedListener = Listener<IApplication, ActionInfo, Record<string, unknown>, void>;
158
- /**
159
- * event fired when an action is completed. actions are executed through the performAction method
160
- */
161
- export interface IApplicationActionCompletedEvent extends IEvent {
141
+ export type ApplicationActionCompletedListener = Listener<IApplication, ActionInfo, Record<string, unknown>, void>;
142
+ export type ApplicationEvents = {
162
143
  /**
163
- * event name
144
+ * event fired when the user logs in
164
145
  */
165
- readonly name: 'ActionCompleted';
146
+ 'application.login': ApplicationLoginListener;
166
147
  /**
167
- * scripting object from where the event is fired
148
+ * event fired when an action is completed. actions are executed through the performAction method
168
149
  */
169
- readonly objectId: 'Application';
170
- /**
171
- * event does not require feedback from listeners
172
- */
173
- readonly requiresFeedback: false;
150
+ 'application.actioncompleted': ApplicationActionCompletedListener;
151
+ };
152
+ /**
153
+ * event fired when an action is completed. actions are executed through the performAction method
154
+ */
155
+ export interface IApplicationActionCompletedEvent extends IEvent {
174
156
  /**
175
157
  * event parameters
176
158
  */
177
159
  readonly params: ActionInfo;
178
- /**
179
- * subscribe to the event
180
- */
181
- subscribe: (callback: ApplicationActionCompletedListener) => string;
182
160
  }
183
161
  /**
184
162
  * Allows access to application-level UI elements, behaviors and events
@@ -187,17 +165,24 @@ export interface IApplication extends IScriptingObject {
187
165
  /**
188
166
  * notifies user login
189
167
  */
190
- readonly Login: IApplicationLoginEvent;
168
+ readonly Login: {
169
+ new (): IApplicationLoginEvent;
170
+ };
191
171
  /**
192
172
  * notifies action completion
193
173
  */
194
- readonly ActionCompleted: IApplicationActionCompletedEvent;
174
+ readonly ActionCompleted: {
175
+ new (): IApplicationActionCompletedEvent;
176
+ };
195
177
  /**
196
178
  * Gets descriptor for the Application
197
179
  *
198
180
  * @returns application descriptor
199
181
  */
200
182
  getDescriptior(): Promise<AppInfo>;
183
+ /**
184
+ * Get the context of the application
185
+ */
201
186
  getApplicationContext(): Promise<ApplicationContext>;
202
187
  /**
203
188
  * extends the application with a new menu item or tool
@@ -1,11 +1,11 @@
1
1
  import { IScriptingObject } from '../scriptingObject.js';
2
2
  import { UserAccessRights } from './userAccessRights.js';
3
- export declare type Personas = {
3
+ export type Personas = {
4
4
  entityId: string;
5
5
  entityType: string;
6
6
  entityName: string;
7
7
  };
8
- export declare type User = {
8
+ export type User = {
9
9
  /**
10
10
  * unique identifier for the user
11
11
  */
@@ -40,7 +40,7 @@ export declare type User = {
40
40
  export declare enum TokenType {
41
41
  BEARER = "Bearer"
42
42
  }
43
- export declare type PluginInfo = {
43
+ export type PluginInfo = {
44
44
  /**
45
45
  * unique identifier for the plugin
46
46
  */
@@ -54,7 +54,7 @@ export declare type PluginInfo = {
54
54
  */
55
55
  scope: TokenType;
56
56
  };
57
- export declare type TokenInfo = {
57
+ export type TokenInfo = {
58
58
  /**
59
59
  * child access token
60
60
  */
@@ -1,10 +1,10 @@
1
1
  import { IEvent, Listener } from '../event.js';
2
2
  import { IScriptingObject } from '../scriptingObject.js';
3
- export declare type FormDescriptor = {
3
+ export type FormDescriptor = {
4
4
  id: string;
5
5
  name: string;
6
6
  };
7
- declare type FormInfo = {
7
+ type FormInfo = {
8
8
  /**
9
9
  * unique id of the form
10
10
  */
@@ -13,61 +13,42 @@ declare type FormInfo = {
13
13
  /**
14
14
  * event handler for form load event
15
15
  */
16
- export declare type FormLoadListener = Listener<IForm, FormInfo, Record<string, unknown>, void>;
17
- /**
18
- * event handler for form unload event
19
- */
20
- export declare type FormUnLoadListener = Listener<IForm, FormInfo, Record<string, unknown>, void>;
16
+ export type FormLoadListener = Listener<IForm, FormInfo, Record<string, unknown>, void>;
21
17
  /**
22
18
  * event to notify form load operation
23
19
  */
24
20
  export interface IFormLoadEvent extends IEvent {
25
- /**
26
- * event name
27
- */
28
- readonly name: 'Load';
29
- /**
30
- * scripting object from where the event is fired
31
- */
32
- readonly objectId: 'Form';
33
- /**
34
- * event does not require feedback from listeners
35
- */
36
- readonly requiresFeedback: false;
37
21
  /**
38
22
  * event parameters
39
23
  */
40
24
  readonly params: FormInfo;
41
- /**
42
- * subscribe to the event
43
- */
44
- subscribe: (callback: FormLoadListener) => string;
45
25
  }
26
+ /**
27
+ * event handler for form unload event
28
+ */
29
+ export type FormUnloadListener = Listener<IForm, FormInfo, Record<string, unknown>, void>;
46
30
  /**
47
31
  * event to notify form unload operation
48
32
  */
49
- export interface IFormUnLoadEvent extends IEvent {
50
- /**
51
- * event name
52
- */
53
- readonly name: 'UnLoad';
54
- /**
55
- * scripting object from where the event is fired
56
- */
57
- readonly objectId: 'Form';
58
- /**
59
- * event does not require feedback from listeners
60
- */
61
- readonly requiresFeedback: false;
33
+ export interface IFormUnloadEvent extends IEvent {
62
34
  /**
63
35
  * event parameters
64
36
  */
65
37
  readonly params: FormInfo;
38
+ }
39
+ /**
40
+ * events that notifies the form's lifecycle
41
+ */
42
+ export type FormEvents = {
66
43
  /**
67
- * subscribe to the event
44
+ * form is loaded and ready for user interaction
68
45
  */
69
- subscribe: (callback: FormUnLoadListener) => string;
70
- }
46
+ 'form.load': FormLoadListener;
47
+ /**
48
+ * form is unloaded and no longer available for user interaction
49
+ */
50
+ 'form.unload': FormUnloadListener;
51
+ };
71
52
  /**
72
53
  * Methods to get information about the custom form
73
54
  */
@@ -75,11 +56,15 @@ export interface IForm extends IScriptingObject {
75
56
  /**
76
57
  * event fired when the form is loaded
77
58
  */
78
- readonly Load: IFormLoadEvent;
59
+ readonly Load: {
60
+ new (): IFormLoadEvent;
61
+ };
79
62
  /**
80
63
  * event fired when the form is unloaded
81
64
  */
82
- readonly UnLoad: IFormUnLoadEvent;
65
+ readonly Unload: {
66
+ new (): IFormUnloadEvent;
67
+ };
83
68
  /**
84
69
  * get metadata of the form
85
70
  *
@@ -1,6 +1,6 @@
1
1
  import { IEvent, Listener } from '../event.js';
2
2
  import { IScriptingObject } from '../scriptingObject.js';
3
- declare type StateInfo = {
3
+ type StateInfo = {
4
4
  /**
5
5
  * name of the key for which the value changed
6
6
  */
@@ -9,32 +9,25 @@ declare type StateInfo = {
9
9
  /**
10
10
  * event handler for global state change event
11
11
  */
12
- export declare type GlobalChangeListener = Listener<IGlobal, StateInfo, Record<string, unknown>, void>;
12
+ export type GlobalChangeListener = Listener<IGlobal, StateInfo, Record<string, unknown>, void>;
13
13
  /**
14
14
  * event to notify change in global state
15
15
  */
16
16
  export interface IGlobalChangeEvent extends IEvent {
17
- /**
18
- * event name
19
- */
20
- readonly name: 'Change';
21
- /**
22
- * scripting object from where the event is fired
23
- */
24
- readonly objectId: 'Global';
25
- /**
26
- * event does not require feedback from listeners
27
- */
28
- readonly requiresFeedback: false;
29
17
  /**
30
18
  * event parameters
31
19
  */
32
20
  readonly params: StateInfo;
21
+ }
22
+ /**
23
+ * events fired from Global scripting object
24
+ */
25
+ export type GlobalEvents = {
33
26
  /**
34
- * subscribe to the event
27
+ * event fired when a value changes in the global store
35
28
  */
36
- subscribe: (callback: GlobalChangeListener) => string;
37
- }
29
+ 'global.change': GlobalChangeListener;
30
+ };
38
31
  /**
39
32
  * The Global object allows for data to be shared between custom forms/tools/plugins within a user's session.
40
33
  * Unlike the Session scripting object, where data is isolated to be visible/accessible only by the form/plugin that writes the variables,
@@ -55,7 +48,9 @@ export interface IGlobal extends IScriptingObject {
55
48
  /**
56
49
  * event fired when the global state changes
57
50
  */
58
- readonly Change: IGlobalChangeEvent;
51
+ readonly Change: {
52
+ new (): IGlobalChangeEvent;
53
+ };
59
54
  /**
60
55
  * set a value in the global store
61
56
  *