@elliemae/microfe-common 2.3.1 → 2.4.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.
- package/dist/cjs/event.js +0 -1
- package/dist/cjs/remoting.js +0 -9
- package/dist/cjs/scriptingObject.js +0 -2
- package/dist/cjs/scriptingObjectManager.js +0 -5
- package/dist/esm/event.js +0 -1
- package/dist/esm/remoting.js +0 -9
- package/dist/esm/scriptingObject.js +0 -2
- package/dist/esm/scriptingObjectManager.js +0 -5
- package/dist/types/event.d.ts +0 -3
- package/dist/types/guest.d.ts +0 -6
- package/dist/types/remoting.d.ts +0 -10
- package/dist/types/scriptingObject.d.ts +0 -2
- package/dist/types/scriptingObjectManager.d.ts +0 -4
- package/package.json +2 -2
package/dist/cjs/event.js
CHANGED
package/dist/cjs/remoting.js
CHANGED
|
@@ -63,7 +63,6 @@ class Remoting {
|
|
|
63
63
|
#allowedSenders = /* @__PURE__ */ new Map();
|
|
64
64
|
/**
|
|
65
65
|
* Create a new instance of the Remoting class
|
|
66
|
-
*
|
|
67
66
|
* @param logger pui-diagnostic logger
|
|
68
67
|
* @param correlationId unique id for the current session
|
|
69
68
|
*/
|
|
@@ -212,7 +211,6 @@ class Remoting {
|
|
|
212
211
|
};
|
|
213
212
|
/**
|
|
214
213
|
* Adds window and its origin list of allowed senders
|
|
215
|
-
*
|
|
216
214
|
* @param {AddSenderParam} param - The sender to add
|
|
217
215
|
*/
|
|
218
216
|
addSender = (param) => {
|
|
@@ -225,7 +223,6 @@ class Remoting {
|
|
|
225
223
|
};
|
|
226
224
|
/**
|
|
227
225
|
* Initializes the remoting service for a window
|
|
228
|
-
*
|
|
229
226
|
* @param win The window to initialize remoting for
|
|
230
227
|
*/
|
|
231
228
|
initialize = (win) => {
|
|
@@ -242,7 +239,6 @@ class Remoting {
|
|
|
242
239
|
};
|
|
243
240
|
/**
|
|
244
241
|
* Sends an invocation which generates a Promise to be used to get a response
|
|
245
|
-
*
|
|
246
242
|
* @param {InvokeParam} param The parameters for the invocation
|
|
247
243
|
* @returns promisifyed response
|
|
248
244
|
*/
|
|
@@ -277,7 +273,6 @@ class Remoting {
|
|
|
277
273
|
};
|
|
278
274
|
/**
|
|
279
275
|
* Setup callback for a specific message type
|
|
280
|
-
*
|
|
281
276
|
* @param {ListenParam<T>} param The parameters for the listener
|
|
282
277
|
*/
|
|
283
278
|
listen = (param) => {
|
|
@@ -288,7 +283,6 @@ class Remoting {
|
|
|
288
283
|
};
|
|
289
284
|
/**
|
|
290
285
|
* Send a message without any form of response. Fire and forget
|
|
291
|
-
*
|
|
292
286
|
* @param {SendParam} param The parameters for the send
|
|
293
287
|
*/
|
|
294
288
|
send = (param) => {
|
|
@@ -303,7 +297,6 @@ class Remoting {
|
|
|
303
297
|
};
|
|
304
298
|
/**
|
|
305
299
|
* Removes a window from the list of allowed senders
|
|
306
|
-
*
|
|
307
300
|
* @param {AddSenderParam} param - The sender to remove
|
|
308
301
|
*/
|
|
309
302
|
removeSender = (param) => {
|
|
@@ -313,7 +306,6 @@ class Remoting {
|
|
|
313
306
|
};
|
|
314
307
|
/**
|
|
315
308
|
* Send a response message to a window
|
|
316
|
-
*
|
|
317
309
|
* @param {RespondParam} param The parameters for the response
|
|
318
310
|
*/
|
|
319
311
|
respond = (param) => {
|
|
@@ -330,7 +322,6 @@ class Remoting {
|
|
|
330
322
|
};
|
|
331
323
|
/**
|
|
332
324
|
* Send an exception message to a window
|
|
333
|
-
*
|
|
334
325
|
* @param {RaiseExceptionParam} param The parameters for the exception
|
|
335
326
|
*/
|
|
336
327
|
raiseException = (param) => {
|
|
@@ -35,7 +35,6 @@ class ScriptingObject {
|
|
|
35
35
|
#objectType = "Object";
|
|
36
36
|
/**
|
|
37
37
|
* Creates an instance of ScriptingObject.
|
|
38
|
-
*
|
|
39
38
|
* @param objectId unique id of the scripting object
|
|
40
39
|
* @param objectType type of the scripting object
|
|
41
40
|
*/
|
|
@@ -57,7 +56,6 @@ class ScriptingObject {
|
|
|
57
56
|
}
|
|
58
57
|
/**
|
|
59
58
|
* transform the scripting object to a format suitable for transmitting over window.postMessage
|
|
60
|
-
*
|
|
61
59
|
* @returns marshalled scripting object
|
|
62
60
|
*/
|
|
63
61
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -96,7 +96,6 @@ class ScriptingObjectManager {
|
|
|
96
96
|
};
|
|
97
97
|
/**
|
|
98
98
|
* attach guest context to the scripting object methods
|
|
99
|
-
*
|
|
100
99
|
* @param root0
|
|
101
100
|
* @param root0.so
|
|
102
101
|
* @param root0.guest
|
|
@@ -124,7 +123,6 @@ class ScriptingObjectManager {
|
|
|
124
123
|
});
|
|
125
124
|
/**
|
|
126
125
|
* registers scripting object to the host
|
|
127
|
-
*
|
|
128
126
|
* @param so scripting object to register
|
|
129
127
|
* @param {AddScriptingObjectParams<ValueOf<AppObjects>>}
|
|
130
128
|
* @param params
|
|
@@ -148,7 +146,6 @@ class ScriptingObjectManager {
|
|
|
148
146
|
};
|
|
149
147
|
/**
|
|
150
148
|
* Get reference to the scripting object proxy for a guest
|
|
151
|
-
*
|
|
152
149
|
* @param {string} objectId scripting object id
|
|
153
150
|
* @param {GuestContext} guest that is requesting the scripting object
|
|
154
151
|
* @returns proxied scripting object reference
|
|
@@ -179,7 +176,6 @@ class ScriptingObjectManager {
|
|
|
179
176
|
};
|
|
180
177
|
/**
|
|
181
178
|
* removes scripting object
|
|
182
|
-
*
|
|
183
179
|
* @param objectId unique id of the scripting object
|
|
184
180
|
* @param guestId unique id of the guest
|
|
185
181
|
*/
|
|
@@ -197,7 +193,6 @@ class ScriptingObjectManager {
|
|
|
197
193
|
};
|
|
198
194
|
/**
|
|
199
195
|
* removes all scripting objects
|
|
200
|
-
*
|
|
201
196
|
* @param guestId unique id of the guest
|
|
202
197
|
*/
|
|
203
198
|
removeAllScriptingObjects = (guestId) => {
|
package/dist/esm/event.js
CHANGED
package/dist/esm/remoting.js
CHANGED
|
@@ -39,7 +39,6 @@ class Remoting {
|
|
|
39
39
|
#allowedSenders = /* @__PURE__ */ new Map();
|
|
40
40
|
/**
|
|
41
41
|
* Create a new instance of the Remoting class
|
|
42
|
-
*
|
|
43
42
|
* @param logger pui-diagnostic logger
|
|
44
43
|
* @param correlationId unique id for the current session
|
|
45
44
|
*/
|
|
@@ -188,7 +187,6 @@ class Remoting {
|
|
|
188
187
|
};
|
|
189
188
|
/**
|
|
190
189
|
* Adds window and its origin list of allowed senders
|
|
191
|
-
*
|
|
192
190
|
* @param {AddSenderParam} param - The sender to add
|
|
193
191
|
*/
|
|
194
192
|
addSender = (param) => {
|
|
@@ -201,7 +199,6 @@ class Remoting {
|
|
|
201
199
|
};
|
|
202
200
|
/**
|
|
203
201
|
* Initializes the remoting service for a window
|
|
204
|
-
*
|
|
205
202
|
* @param win The window to initialize remoting for
|
|
206
203
|
*/
|
|
207
204
|
initialize = (win) => {
|
|
@@ -218,7 +215,6 @@ class Remoting {
|
|
|
218
215
|
};
|
|
219
216
|
/**
|
|
220
217
|
* Sends an invocation which generates a Promise to be used to get a response
|
|
221
|
-
*
|
|
222
218
|
* @param {InvokeParam} param The parameters for the invocation
|
|
223
219
|
* @returns promisifyed response
|
|
224
220
|
*/
|
|
@@ -253,7 +249,6 @@ class Remoting {
|
|
|
253
249
|
};
|
|
254
250
|
/**
|
|
255
251
|
* Setup callback for a specific message type
|
|
256
|
-
*
|
|
257
252
|
* @param {ListenParam<T>} param The parameters for the listener
|
|
258
253
|
*/
|
|
259
254
|
listen = (param) => {
|
|
@@ -264,7 +259,6 @@ class Remoting {
|
|
|
264
259
|
};
|
|
265
260
|
/**
|
|
266
261
|
* Send a message without any form of response. Fire and forget
|
|
267
|
-
*
|
|
268
262
|
* @param {SendParam} param The parameters for the send
|
|
269
263
|
*/
|
|
270
264
|
send = (param) => {
|
|
@@ -279,7 +273,6 @@ class Remoting {
|
|
|
279
273
|
};
|
|
280
274
|
/**
|
|
281
275
|
* Removes a window from the list of allowed senders
|
|
282
|
-
*
|
|
283
276
|
* @param {AddSenderParam} param - The sender to remove
|
|
284
277
|
*/
|
|
285
278
|
removeSender = (param) => {
|
|
@@ -289,7 +282,6 @@ class Remoting {
|
|
|
289
282
|
};
|
|
290
283
|
/**
|
|
291
284
|
* Send a response message to a window
|
|
292
|
-
*
|
|
293
285
|
* @param {RespondParam} param The parameters for the response
|
|
294
286
|
*/
|
|
295
287
|
respond = (param) => {
|
|
@@ -306,7 +298,6 @@ class Remoting {
|
|
|
306
298
|
};
|
|
307
299
|
/**
|
|
308
300
|
* Send an exception message to a window
|
|
309
|
-
*
|
|
310
301
|
* @param {RaiseExceptionParam} param The parameters for the exception
|
|
311
302
|
*/
|
|
312
303
|
raiseException = (param) => {
|
|
@@ -12,7 +12,6 @@ class ScriptingObject {
|
|
|
12
12
|
#objectType = "Object";
|
|
13
13
|
/**
|
|
14
14
|
* Creates an instance of ScriptingObject.
|
|
15
|
-
*
|
|
16
15
|
* @param objectId unique id of the scripting object
|
|
17
16
|
* @param objectType type of the scripting object
|
|
18
17
|
*/
|
|
@@ -34,7 +33,6 @@ class ScriptingObject {
|
|
|
34
33
|
}
|
|
35
34
|
/**
|
|
36
35
|
* transform the scripting object to a format suitable for transmitting over window.postMessage
|
|
37
|
-
*
|
|
38
36
|
* @returns marshalled scripting object
|
|
39
37
|
*/
|
|
40
38
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -72,7 +72,6 @@ class ScriptingObjectManager {
|
|
|
72
72
|
};
|
|
73
73
|
/**
|
|
74
74
|
* attach guest context to the scripting object methods
|
|
75
|
-
*
|
|
76
75
|
* @param root0
|
|
77
76
|
* @param root0.so
|
|
78
77
|
* @param root0.guest
|
|
@@ -100,7 +99,6 @@ class ScriptingObjectManager {
|
|
|
100
99
|
});
|
|
101
100
|
/**
|
|
102
101
|
* registers scripting object to the host
|
|
103
|
-
*
|
|
104
102
|
* @param so scripting object to register
|
|
105
103
|
* @param {AddScriptingObjectParams<ValueOf<AppObjects>>}
|
|
106
104
|
* @param params
|
|
@@ -124,7 +122,6 @@ class ScriptingObjectManager {
|
|
|
124
122
|
};
|
|
125
123
|
/**
|
|
126
124
|
* Get reference to the scripting object proxy for a guest
|
|
127
|
-
*
|
|
128
125
|
* @param {string} objectId scripting object id
|
|
129
126
|
* @param {GuestContext} guest that is requesting the scripting object
|
|
130
127
|
* @returns proxied scripting object reference
|
|
@@ -155,7 +152,6 @@ class ScriptingObjectManager {
|
|
|
155
152
|
};
|
|
156
153
|
/**
|
|
157
154
|
* removes scripting object
|
|
158
|
-
*
|
|
159
155
|
* @param objectId unique id of the scripting object
|
|
160
156
|
* @param guestId unique id of the guest
|
|
161
157
|
*/
|
|
@@ -173,7 +169,6 @@ class ScriptingObjectManager {
|
|
|
173
169
|
};
|
|
174
170
|
/**
|
|
175
171
|
* removes all scripting objects
|
|
176
|
-
*
|
|
177
172
|
* @param guestId unique id of the guest
|
|
178
173
|
*/
|
|
179
174
|
removeAllScriptingObjects = (guestId) => {
|
package/dist/types/event.d.ts
CHANGED
|
@@ -60,21 +60,18 @@ export declare class Event<EventsList extends EventListeners = Events> implement
|
|
|
60
60
|
readonly id: Extract<keyof EventsList, string>;
|
|
61
61
|
/**
|
|
62
62
|
* Create an event object
|
|
63
|
-
*
|
|
64
63
|
* @param {EventParam} param - parameters for creating an event
|
|
65
64
|
*/
|
|
66
65
|
constructor(param: EventParam);
|
|
67
66
|
}
|
|
68
67
|
/**
|
|
69
68
|
* Check given object is an event
|
|
70
|
-
*
|
|
71
69
|
* @param value object to check
|
|
72
70
|
* @returns true if given object is an event
|
|
73
71
|
*/
|
|
74
72
|
export declare const isEvent: (value: any) => value is Event<Events>;
|
|
75
73
|
/**
|
|
76
74
|
* Get normalized event ID for an object and event
|
|
77
|
-
*
|
|
78
75
|
* @param objectId scripting object id
|
|
79
76
|
* @param eventName event name
|
|
80
77
|
* @returns normalized event ID
|
package/dist/types/guest.d.ts
CHANGED
|
@@ -42,7 +42,6 @@ export type UnsubscribeParam<EventId> = {
|
|
|
42
42
|
export interface ISSFGuest<AppEvents extends EventListeners> {
|
|
43
43
|
/**
|
|
44
44
|
* Initialize guest using script
|
|
45
|
-
*
|
|
46
45
|
* @param scriptUri uri of the script
|
|
47
46
|
* @param containerElement dom element to inject the script at
|
|
48
47
|
*/
|
|
@@ -53,13 +52,11 @@ export interface ISSFGuest<AppEvents extends EventListeners> {
|
|
|
53
52
|
close: () => void;
|
|
54
53
|
/**
|
|
55
54
|
* Connect to the host
|
|
56
|
-
*
|
|
57
55
|
* @param {ConnectParam} param - reference to the guest window or parameters
|
|
58
56
|
*/
|
|
59
57
|
connect: (param?: ConnectParam) => Promise<void>;
|
|
60
58
|
/**
|
|
61
59
|
* Get scripting object proxy by id
|
|
62
|
-
*
|
|
63
60
|
* @param objectId unique id of the scripting object
|
|
64
61
|
* @returns scripting object proxy
|
|
65
62
|
*/
|
|
@@ -70,20 +67,17 @@ export interface ISSFGuest<AppEvents extends EventListeners> {
|
|
|
70
67
|
removeScript: () => void;
|
|
71
68
|
/**
|
|
72
69
|
* set the log level
|
|
73
|
-
*
|
|
74
70
|
* @param {LogLevels} logLevel - log level
|
|
75
71
|
*/
|
|
76
72
|
setLogLevel: (logLevel: LogLevels) => void;
|
|
77
73
|
/**
|
|
78
74
|
* subscribe to an scripting object event
|
|
79
|
-
*
|
|
80
75
|
* @param {SubscribeParam<EventId, AppEvents[EventId]>} param - parameters for subscribing to an event
|
|
81
76
|
* @returns subscription token
|
|
82
77
|
*/
|
|
83
78
|
subscribe: <EventId extends Extract<keyof AppEvents, string>>(param: SubscribeParam<EventId, AppEvents[EventId]>) => string;
|
|
84
79
|
/**
|
|
85
80
|
* unsubscribe from an scripting object event
|
|
86
|
-
*
|
|
87
81
|
* @param {UnsubscribeParam<EventId>} param - parameters for unsubscribing from an event
|
|
88
82
|
*/
|
|
89
83
|
unsubscribe: <EventId extends Extract<keyof AppEvents, string>>(param: UnsubscribeParam<EventId>) => void;
|
package/dist/types/remoting.d.ts
CHANGED
|
@@ -152,7 +152,6 @@ export type RaiseExceptionParam = {
|
|
|
152
152
|
};
|
|
153
153
|
/**
|
|
154
154
|
* Sends a message to another window
|
|
155
|
-
*
|
|
156
155
|
* @param {SendParam} param - parameters for sending the message
|
|
157
156
|
*/
|
|
158
157
|
export declare const sendMessage: (param: SendParam) => void;
|
|
@@ -176,20 +175,17 @@ export declare class Remoting {
|
|
|
176
175
|
#private;
|
|
177
176
|
/**
|
|
178
177
|
* Create a new instance of the Remoting class
|
|
179
|
-
*
|
|
180
178
|
* @param logger pui-diagnostic logger
|
|
181
179
|
* @param correlationId unique id for the current session
|
|
182
180
|
*/
|
|
183
181
|
constructor(logger: Logger, correlationId: string);
|
|
184
182
|
/**
|
|
185
183
|
* Adds window and its origin list of allowed senders
|
|
186
|
-
*
|
|
187
184
|
* @param {AddSenderParam} param - The sender to add
|
|
188
185
|
*/
|
|
189
186
|
addSender: (param: AddSenderParam) => void;
|
|
190
187
|
/**
|
|
191
188
|
* Initializes the remoting service for a window
|
|
192
|
-
*
|
|
193
189
|
* @param win The window to initialize remoting for
|
|
194
190
|
*/
|
|
195
191
|
initialize: (win: Window) => void;
|
|
@@ -199,38 +195,32 @@ export declare class Remoting {
|
|
|
199
195
|
close: () => void;
|
|
200
196
|
/**
|
|
201
197
|
* Sends an invocation which generates a Promise to be used to get a response
|
|
202
|
-
*
|
|
203
198
|
* @param {InvokeParam} param The parameters for the invocation
|
|
204
199
|
* @returns promisifyed response
|
|
205
200
|
*/
|
|
206
201
|
invoke: <T>(param: InvokeParam) => Promise<T>;
|
|
207
202
|
/**
|
|
208
203
|
* Setup callback for a specific message type
|
|
209
|
-
*
|
|
210
204
|
* @param {ListenParam<T>} param The parameters for the listener
|
|
211
205
|
*/
|
|
212
206
|
listen: <T>(param: ListenParam<T>) => void;
|
|
213
207
|
/**
|
|
214
208
|
* Send a message without any form of response. Fire and forget
|
|
215
|
-
*
|
|
216
209
|
* @param {SendParam} param The parameters for the send
|
|
217
210
|
*/
|
|
218
211
|
send: (param: SendParam) => void;
|
|
219
212
|
/**
|
|
220
213
|
* Removes a window from the list of allowed senders
|
|
221
|
-
*
|
|
222
214
|
* @param {AddSenderParam} param - The sender to remove
|
|
223
215
|
*/
|
|
224
216
|
removeSender: (param: AddSenderParam) => void;
|
|
225
217
|
/**
|
|
226
218
|
* Send a response message to a window
|
|
227
|
-
*
|
|
228
219
|
* @param {RespondParam} param The parameters for the response
|
|
229
220
|
*/
|
|
230
221
|
respond: (param: RespondParam) => void;
|
|
231
222
|
/**
|
|
232
223
|
* Send an exception message to a window
|
|
233
|
-
*
|
|
234
224
|
* @param {RaiseExceptionParam} param The parameters for the exception
|
|
235
225
|
*/
|
|
236
226
|
raiseException: (param: RaiseExceptionParam) => void;
|
|
@@ -7,7 +7,6 @@ export declare class ScriptingObject implements IScriptingObject {
|
|
|
7
7
|
#private;
|
|
8
8
|
/**
|
|
9
9
|
* Creates an instance of ScriptingObject.
|
|
10
|
-
*
|
|
11
10
|
* @param objectId unique id of the scripting object
|
|
12
11
|
* @param objectType type of the scripting object
|
|
13
12
|
*/
|
|
@@ -22,7 +21,6 @@ export declare class ScriptingObject implements IScriptingObject {
|
|
|
22
21
|
get objectType(): string;
|
|
23
22
|
/**
|
|
24
23
|
* transform the scripting object to a format suitable for transmitting over window.postMessage
|
|
25
|
-
*
|
|
26
24
|
* @returns marshalled scripting object
|
|
27
25
|
*/
|
|
28
26
|
_toJSON: () => RemotingScriptingObject;
|
|
@@ -66,7 +66,6 @@ export declare class ScriptingObjectManager<AppObjects extends ScriptingObjects
|
|
|
66
66
|
#private;
|
|
67
67
|
/**
|
|
68
68
|
* registers scripting object to the host
|
|
69
|
-
*
|
|
70
69
|
* @param so scripting object to register
|
|
71
70
|
* @param {AddScriptingObjectParams<ValueOf<AppObjects>>}
|
|
72
71
|
* @param params
|
|
@@ -74,7 +73,6 @@ export declare class ScriptingObjectManager<AppObjects extends ScriptingObjects
|
|
|
74
73
|
addScriptingObject: <SO extends ValueOf<AppObjects>>(so: SO, params?: AddScriptingObjectParams) => void;
|
|
75
74
|
/**
|
|
76
75
|
* Get reference to the scripting object proxy for a guest
|
|
77
|
-
*
|
|
78
76
|
* @param {string} objectId scripting object id
|
|
79
77
|
* @param {GuestContext} guest that is requesting the scripting object
|
|
80
78
|
* @returns proxied scripting object reference
|
|
@@ -82,14 +80,12 @@ export declare class ScriptingObjectManager<AppObjects extends ScriptingObjects
|
|
|
82
80
|
getObject: <ObjectId extends Extract<keyof AppObjects, string>>(objectId: ObjectId, guest?: GuestContext) => AppObjects[ObjectId] | null;
|
|
83
81
|
/**
|
|
84
82
|
* removes scripting object
|
|
85
|
-
*
|
|
86
83
|
* @param objectId unique id of the scripting object
|
|
87
84
|
* @param guestId unique id of the guest
|
|
88
85
|
*/
|
|
89
86
|
removeScriptingObject: (objectId: Extract<keyof AppObjects, string>, guestId?: string) => void;
|
|
90
87
|
/**
|
|
91
88
|
* removes all scripting objects
|
|
92
|
-
*
|
|
93
89
|
* @param guestId unique id of the guest
|
|
94
90
|
*/
|
|
95
91
|
removeAllScriptingObjects: (guestId?: string) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/microfe-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "common micro frontend functional modules",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@elliemae/browserslist-config-elliemae-latest-browsers": "~1.8.0",
|
|
41
41
|
"@elliemae/pui-diagnostics": "~3.4.1",
|
|
42
|
-
"@elliemae/pui-scripting-object": "~1.31.
|
|
42
|
+
"@elliemae/pui-scripting-object": "~1.31.3",
|
|
43
43
|
"@types/uuid": "~9.0.7"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|