novo-elements 9.2.0-next.2 → 9.2.0-next.3
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/esm2020/utils/app-bridge/AppBridge.mjs +183 -180
- package/esm2020/utils/app-bridge/index.mjs +2 -1
- package/esm2020/utils/app-bridge/interfaces.mjs +38 -0
- package/fesm2015/novo-elements-utils.mjs +184 -143
- package/fesm2015/novo-elements-utils.mjs.map +1 -1
- package/fesm2020/novo-elements-utils.mjs +182 -142
- package/fesm2020/novo-elements-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/utils/app-bridge/AppBridge.d.ts +30 -37
- package/utils/app-bridge/index.d.ts +1 -0
- package/utils/app-bridge/interfaces.d.ts +58 -0
package/package.json
CHANGED
|
@@ -1,36 +1,11 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
REGISTER = 6,
|
|
10
|
-
UPDATE = 7,
|
|
11
|
-
REQUEST_DATA = 8,
|
|
12
|
-
CALLBACK = 9,
|
|
13
|
-
PING = 10
|
|
14
|
-
}
|
|
15
|
-
export declare type NovoApps = 'record' | 'add' | 'fast-add' | 'slide-out-add' | 'custom' | 'preview';
|
|
16
|
-
export declare type AlleyLinkColors = 'purple' | 'green' | 'blue' | 'lead' | 'candidate' | 'contact' | 'company' | 'opportunity' | 'job' | 'billable-charge' | 'earn-code' | 'invoice-statement' | 'job-code' | 'payable-charge' | 'sales-tax-rate' | 'tax-rules' | 'submission' | 'placement' | 'navigation' | 'canvas' | 'neutral' | 'neutral-italic' | 'initial' | 'distributionList' | 'contract';
|
|
17
|
-
export interface IAppBridgeOpenEvent {
|
|
18
|
-
type: NovoApps;
|
|
19
|
-
entityType: string;
|
|
20
|
-
entityId?: string;
|
|
21
|
-
tab?: string;
|
|
22
|
-
data?: any;
|
|
23
|
-
passthrough?: string;
|
|
24
|
-
}
|
|
25
|
-
export declare type MosaicLists = 'Candidate' | 'ClientContact' | 'ClientCorporation' | 'JobOrder' | 'JobSubmission' | 'JobPosting' | 'Placement' | 'Lead' | 'Opportunity';
|
|
26
|
-
export interface IAppBridgeOpenListEvent {
|
|
27
|
-
type: MosaicLists;
|
|
28
|
-
keywords: Array<string>;
|
|
29
|
-
criteria: any;
|
|
30
|
-
}
|
|
31
|
-
export declare type NovoDataType = 'entitlements' | 'settings' | 'user';
|
|
32
|
-
export interface IAppBridgeRequestDataEvent {
|
|
33
|
-
type: NovoDataType;
|
|
2
|
+
import { AppBridgeHandler, AlleyLinkColors, IAppBridgeOpenEvent, IAppBridgeOpenListEvent, MESSAGE_TYPES } from './interfaces';
|
|
3
|
+
declare type ValueOf<T> = T[keyof T];
|
|
4
|
+
declare type MessageType = ValueOf<typeof MESSAGE_TYPES>;
|
|
5
|
+
export interface PostRobotEvent<T> {
|
|
6
|
+
data: T;
|
|
7
|
+
origin: string;
|
|
8
|
+
source: Window;
|
|
34
9
|
}
|
|
35
10
|
export declare class AppBridgeService {
|
|
36
11
|
create(name: string): AppBridge;
|
|
@@ -48,11 +23,20 @@ export declare class AppBridge {
|
|
|
48
23
|
private _handlers;
|
|
49
24
|
private _tracing;
|
|
50
25
|
private _eventListeners;
|
|
51
|
-
|
|
26
|
+
private postRobot;
|
|
27
|
+
constructor(traceName?: string, postRobotRef?: any);
|
|
52
28
|
set tracing(tracing: boolean);
|
|
53
29
|
handle(type: AppBridgeHandler, handler: Function): void;
|
|
54
30
|
private _trace;
|
|
55
31
|
protected _setupHandlers(): void;
|
|
32
|
+
protected windowOrigin(): string;
|
|
33
|
+
handleMessage<T>({ msgType, handler, packet, echoPacket, resolveEventData }: {
|
|
34
|
+
msgType: MessageType;
|
|
35
|
+
handler: AppBridgeHandler;
|
|
36
|
+
packet: T;
|
|
37
|
+
echoPacket: any;
|
|
38
|
+
resolveEventData: (any: any) => boolean;
|
|
39
|
+
}): Promise<boolean>;
|
|
56
40
|
/**
|
|
57
41
|
* Fires or responds to an open event
|
|
58
42
|
* @param packet any - packet of data to send with the open event
|
|
@@ -115,23 +99,31 @@ export declare class AppBridge {
|
|
|
115
99
|
/**
|
|
116
100
|
* Fires or responds to an HTTP_GET event
|
|
117
101
|
* @param packet any - packet of data to send with the event
|
|
102
|
+
* @param timeout - how long to attempt the request before reporting an error
|
|
103
|
+
* @param originStack - the domain of the previous frame(s) the request originated from
|
|
118
104
|
*/
|
|
119
|
-
httpGET(relativeURL: string, timeout?: number): Promise<any>;
|
|
105
|
+
httpGET(relativeURL: string, timeout?: number, originStack?: string[]): Promise<any>;
|
|
120
106
|
/**
|
|
121
107
|
* Fires or responds to an HTTP_POST event
|
|
122
108
|
* @param packet any - packet of data to send with the event
|
|
109
|
+
* @param timeout - how long to attempt the request before reporting an error
|
|
110
|
+
* @param originStack - the domain of the previous frame(s) the request originated from
|
|
123
111
|
*/
|
|
124
|
-
httpPOST(relativeURL: string, postData: any, timeout?: number): Promise<any>;
|
|
112
|
+
httpPOST(relativeURL: string, postData: any, timeout?: number, originStack?: string[]): Promise<any>;
|
|
125
113
|
/**
|
|
126
114
|
* Fires or responds to an HTTP_PUT event
|
|
127
115
|
* @param packet any - packet of data to send with the event
|
|
116
|
+
* @param timeout - how long to attempt the request before reporting an error
|
|
117
|
+
* @param originStack - the domain of the previous frame(s) the request originated from
|
|
128
118
|
*/
|
|
129
|
-
httpPUT(relativeURL: string, putData: any, timeout?: number): Promise<any>;
|
|
119
|
+
httpPUT(relativeURL: string, putData: any, timeout?: number, originStack?: string[]): Promise<any>;
|
|
130
120
|
/**
|
|
131
121
|
* Fires or responds to an HTTP_DELETE event
|
|
132
122
|
* @param packet any - packet of data to send with the event
|
|
123
|
+
* @param timeout - how long to attempt the request before reporting an error
|
|
124
|
+
* @param originStack - the domain of the previous frame(s) the request originated from
|
|
133
125
|
*/
|
|
134
|
-
httpDELETE(relativeURL: string, timeout?: number): Promise<any>;
|
|
126
|
+
httpDELETE(relativeURL: string, timeout?: number, originStack?: string[]): Promise<any>;
|
|
135
127
|
/**
|
|
136
128
|
* Fires a custom event to anywhere in the application
|
|
137
129
|
* @param event string - event name to fire
|
|
@@ -185,3 +177,4 @@ export declare class DevAppBridge extends AppBridge {
|
|
|
185
177
|
httpDELETE(relativeURL: string): Promise<any>;
|
|
186
178
|
private getCookie;
|
|
187
179
|
}
|
|
180
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare enum AppBridgeHandler {
|
|
2
|
+
HTTP = 0,
|
|
3
|
+
OPEN = 1,
|
|
4
|
+
OPEN_LIST = 2,
|
|
5
|
+
CLOSE = 3,
|
|
6
|
+
REFRESH = 4,
|
|
7
|
+
PIN = 5,
|
|
8
|
+
REGISTER = 6,
|
|
9
|
+
UPDATE = 7,
|
|
10
|
+
REQUEST_DATA = 8,
|
|
11
|
+
CALLBACK = 9,
|
|
12
|
+
PING = 10
|
|
13
|
+
}
|
|
14
|
+
export declare type NovoApps = 'record' | 'add' | 'fast-add' | 'slide-out-add' | 'custom' | 'preview';
|
|
15
|
+
export declare type AlleyLinkColors = 'purple' | 'green' | 'blue' | 'lead' | 'candidate' | 'contact' | 'company' | 'opportunity' | 'job' | 'billable-charge' | 'earn-code' | 'invoice-statement' | 'job-code' | 'payable-charge' | 'sales-tax-rate' | 'tax-rules' | 'submission' | 'placement' | 'navigation' | 'canvas' | 'neutral' | 'neutral-italic' | 'initial' | 'distributionList' | 'contract';
|
|
16
|
+
export interface IAppBridgeOpenEvent {
|
|
17
|
+
type: NovoApps;
|
|
18
|
+
entityType: string;
|
|
19
|
+
entityId?: string;
|
|
20
|
+
tab?: string;
|
|
21
|
+
data?: any;
|
|
22
|
+
passthrough?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare type MosaicLists = 'Candidate' | 'ClientContact' | 'ClientCorporation' | 'JobOrder' | 'JobSubmission' | 'JobPosting' | 'Placement' | 'Lead' | 'Opportunity';
|
|
25
|
+
export interface IAppBridgeOpenListEvent {
|
|
26
|
+
type: MosaicLists;
|
|
27
|
+
keywords: Array<string>;
|
|
28
|
+
criteria: any;
|
|
29
|
+
}
|
|
30
|
+
export declare type NovoDataType = 'entitlements' | 'settings' | 'user';
|
|
31
|
+
export interface IAppBridgeRequestDataEvent {
|
|
32
|
+
type: NovoDataType;
|
|
33
|
+
}
|
|
34
|
+
export declare type HttpVerb = 'get' | 'post' | 'put' | 'delete';
|
|
35
|
+
export declare const HTTP_VERBS: {
|
|
36
|
+
GET: string;
|
|
37
|
+
POST: string;
|
|
38
|
+
PUT: string;
|
|
39
|
+
DELETE: string;
|
|
40
|
+
};
|
|
41
|
+
export declare type MessageType = 'register' | 'open' | 'openList' | 'close' | 'refresh' | 'pin' | 'ping' | 'update' | 'httpGET' | 'httpPOST' | 'httpPUT' | 'httpDELETE' | 'customEvent' | 'requestData' | 'callback';
|
|
42
|
+
export declare const MESSAGE_TYPES: {
|
|
43
|
+
REGISTER: string;
|
|
44
|
+
OPEN: string;
|
|
45
|
+
OPEN_LIST: string;
|
|
46
|
+
CLOSE: string;
|
|
47
|
+
REFRESH: string;
|
|
48
|
+
PIN: string;
|
|
49
|
+
PING: string;
|
|
50
|
+
UPDATE: string;
|
|
51
|
+
HTTP_GET: string;
|
|
52
|
+
HTTP_POST: string;
|
|
53
|
+
HTTP_PUT: string;
|
|
54
|
+
HTTP_DELETE: string;
|
|
55
|
+
CUSTOM_EVENT: string;
|
|
56
|
+
REQUEST_DATA: string;
|
|
57
|
+
CALLBACK: string;
|
|
58
|
+
};
|