@telia-ace/widget-core-flamingo 1.1.75 → 1.1.76
Sign up to get free protection for your applications and to get access to all the features.
- package/bootstrap.d.ts +4 -1
- package/index.js +73 -42
- package/index.mjs +505 -430
- package/models/site.d.ts +4 -1
- package/package.json +1 -1
- package/types.d.ts +16 -0
package/models/site.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
+
import { IHttpClient } from '../services/http-client.service';
|
1
2
|
import { SiteAPI } from '../services/site-api';
|
2
|
-
import { InitConfig } from '../types';
|
3
|
+
import { InitConfig, SiteTrigger } from '../types';
|
3
4
|
import { Environment } from './environment';
|
4
5
|
export declare class Site {
|
5
6
|
environment?: Environment;
|
@@ -7,9 +8,11 @@ export declare class Site {
|
|
7
8
|
private url?;
|
8
9
|
private httpClient;
|
9
10
|
api: SiteAPI;
|
11
|
+
triggers: SiteTrigger[];
|
10
12
|
constructor(urlOrConfig: string | InitConfig);
|
11
13
|
load(url: string): Promise<void>;
|
12
14
|
loadFromConfig(config: InitConfig): void;
|
15
|
+
setHttpClient(client: IHttpClient): void;
|
13
16
|
bootstrap(handler: (environment: Environment) => void): Promise<void>;
|
14
17
|
private addGlobal;
|
15
18
|
}
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
@@ -40,8 +40,24 @@ export type AppConfig = {
|
|
40
40
|
};
|
41
41
|
export type SiteConfig = {
|
42
42
|
id: string;
|
43
|
+
triggers?: SiteTrigger[];
|
43
44
|
apps: AppConfig[];
|
44
45
|
};
|
46
|
+
export type SiteTrigger = {
|
47
|
+
id: string;
|
48
|
+
triggerType: 'visit';
|
49
|
+
condition: TriggerCondition;
|
50
|
+
};
|
51
|
+
export type TriggerCondition = {
|
52
|
+
type: 'url';
|
53
|
+
outputs: {
|
54
|
+
value: string;
|
55
|
+
action: {
|
56
|
+
type: string;
|
57
|
+
data: string;
|
58
|
+
};
|
59
|
+
}[];
|
60
|
+
};
|
45
61
|
export type InitConfig = {
|
46
62
|
apps: {
|
47
63
|
widgetId: string;
|