@usereq/widget 0.2.3 → 0.2.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.
@@ -1,13 +0,0 @@
1
- export function scheduleRenewal(
2
- expiresAt: string,
3
- onRenew: () => Promise<void> | void
4
- ): () => void {
5
- const expiryMs = new Date(expiresAt).getTime();
6
- const delay = Math.max(5_000, expiryMs - Date.now() - 60_000);
7
- const timer = window.setTimeout(() => {
8
- void onRenew();
9
- }, delay);
10
-
11
- return () => window.clearTimeout(timer);
12
- }
13
-
@@ -1,54 +0,0 @@
1
- export const WIDGET_ANALYTICS_EVENT_TYPES = [
2
- "SCRIPT_LOADED",
3
- "UNIQUE_SCRIPT_LOADED",
4
- "VIEW",
5
- "CLICK",
6
- "SESSION_START",
7
- "DISPLAY_AFTER_ELEMENT_SHOWED",
8
- "WIDGET_DISPLAY_AFTER_VSL_SHOWED",
9
- "LINK_CLICKED",
10
- ] as const;
11
-
12
- export type WidgetAnalyticsEventType =
13
- (typeof WIDGET_ANALYTICS_EVENT_TYPES)[number];
14
-
15
- export const WIDGET_CLIENT_ANALYTICS_EVENT_TYPES = [
16
- "SCRIPT_LOADED",
17
- "UNIQUE_SCRIPT_LOADED",
18
- "VIEW",
19
- "CLICK",
20
- "DISPLAY_AFTER_ELEMENT_SHOWED",
21
- "LINK_CLICKED",
22
- ] as const;
23
-
24
- export type WidgetClientAnalyticsEventType =
25
- (typeof WIDGET_CLIENT_ANALYTICS_EVENT_TYPES)[number];
26
-
27
- export const WIDGET_TRIGGER_RULE_TYPES = [
28
- "time_delay",
29
- "scroll_to_bottom",
30
- "element_clicked",
31
- "element_displayed",
32
- ] as const;
33
-
34
- export type WidgetTriggerRuleType = (typeof WIDGET_TRIGGER_RULE_TYPES)[number];
35
-
36
- export type WidgetAnalyticsBatchEvent = {
37
- eventType: WidgetClientAnalyticsEventType;
38
- occurredAt?: string;
39
- conversationId?: string | null;
40
- triggerRuleType?: WidgetTriggerRuleType | null;
41
- linkUrl?: string | null;
42
- };
43
-
44
- export type WidgetAnalyticsBatchRequest = {
45
- events: WidgetAnalyticsBatchEvent[];
46
- pageUrl?: string;
47
- referrer?: string;
48
- sessionToken?: string;
49
- };
50
-
51
- export type WidgetAnalyticsBatchResponse = {
52
- accepted: number;
53
- };
54
-