@epigraph/epigraph-std-lib 4.6.0 → 4.7.0-alpha

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.
@@ -0,0 +1,196 @@
1
+ import { IAnalyticsEvent, IAnalyticsParameterItems } from './analytics-event-interface';
2
+ declare class BaseAnalyticsEvent implements IAnalyticsEvent {
3
+ readonly eventName: string;
4
+ interactiveEvent: boolean;
5
+ customParameters: Record<string, unknown>;
6
+ constructor({ eventName, interactiveEvent, customParameters }: {
7
+ eventName: string;
8
+ interactiveEvent: boolean;
9
+ customParameters: Record<string, unknown>;
10
+ });
11
+ getGa4Parameters(solution: string, experienceId: string, sendTo: string): {
12
+ solution: string;
13
+ experience_id: string;
14
+ interactive_event: boolean;
15
+ send_to: string;
16
+ };
17
+ getGTMParameters(solution: string, experienceId: string, sendTo: string): {
18
+ solution: string;
19
+ experience_id: string;
20
+ event: string;
21
+ interactive_event: boolean;
22
+ send_to: string;
23
+ };
24
+ getNexusParameters(): {
25
+ interactive_event: boolean;
26
+ };
27
+ }
28
+ export declare class EpigraphArRequestedEvent extends BaseAnalyticsEvent {
29
+ constructor(items: IAnalyticsParameterItems);
30
+ }
31
+ export declare class EpigraphModuleLoadingEvent extends BaseAnalyticsEvent {
32
+ constructor(isPreConfig: boolean);
33
+ }
34
+ export declare class EpigraphModuleReadyEvent extends BaseAnalyticsEvent {
35
+ constructor(isPreConfig: boolean, loadTimeMs: number);
36
+ }
37
+ export declare class EpigraphModuleFailedEvent extends BaseAnalyticsEvent {
38
+ constructor(isPreConfig: boolean, loadTimeMs: number, errorType: string);
39
+ }
40
+ export declare class EpigraphModuleClosedEvent extends BaseAnalyticsEvent {
41
+ constructor(items: IAnalyticsParameterItems);
42
+ }
43
+ export declare class EpigraphSupportDetectedEvent extends BaseAnalyticsEvent {
44
+ static readonly SUPPORT_TYPE: {
45
+ AR: string;
46
+ QR: string;
47
+ WEBGL2: string;
48
+ };
49
+ constructor(supportType: typeof EpigraphSupportDetectedEvent.SUPPORT_TYPE, deviceCapabilities?: Record<string, unknown>);
50
+ }
51
+ export declare class EpigraphButtonClickEvent extends BaseAnalyticsEvent {
52
+ static readonly BUTTON_TYPE: {
53
+ AR_VIEW: string;
54
+ DIMENSION_SHOW: string;
55
+ DIMENSION_HIDE: string;
56
+ HOTSPOTS_SHOW: string;
57
+ HOTSPOTS_HIDE: string;
58
+ HELP_SHOW: string;
59
+ HELP_HIDE: string;
60
+ HOTSPOT_ENTER: string;
61
+ HOTSPOT_EXIT: string;
62
+ SHARE: string;
63
+ PDF_DOWNLOAD: string;
64
+ COPY: string;
65
+ RESTART: string;
66
+ INSTRUCTIONS_SHOW: string;
67
+ REVIEW_CART: string;
68
+ SHOP_NOW: string;
69
+ SUB_CATEGORY: string;
70
+ NEXT_STEP: string;
71
+ PREVIOUS_STEP: string;
72
+ };
73
+ constructor(buttonType: typeof EpigraphButtonClickEvent.BUTTON_TYPE, buttonName: string);
74
+ }
75
+ export declare class EpigraphPanelOpenedEvent extends BaseAnalyticsEvent {
76
+ static readonly PANEL_TYPE: {
77
+ AR: string;
78
+ QR: string;
79
+ INFO: string;
80
+ DOWNLOAD: string;
81
+ PREVIEW_CART: string;
82
+ HOTSPOT_PANEL: string;
83
+ SHARE_MODAL: string;
84
+ RESTART_MODAL: string;
85
+ REMOVE_MODAL: string;
86
+ LOAD_PRECONFIG_MODAL: string;
87
+ MOVE_MODAL: string;
88
+ OUT_OF_STOCK_MODAL: string;
89
+ };
90
+ static readonly TRIGGER_SOURCE: {
91
+ AUTO: string;
92
+ BUTTON: string;
93
+ HOTSPOT: string;
94
+ GESTURE: string;
95
+ };
96
+ constructor(isInteractive: boolean, panelType: typeof EpigraphPanelOpenedEvent.PANEL_TYPE, triggerSource: typeof EpigraphPanelOpenedEvent.TRIGGER_SOURCE, items: IAnalyticsParameterItems);
97
+ }
98
+ export declare class EpigraphPanelClosedEvent extends BaseAnalyticsEvent {
99
+ static readonly PANEL_TYPE: {
100
+ AR: string;
101
+ QR: string;
102
+ INFO: string;
103
+ DOWNLOAD: string;
104
+ PREVIEW_CART: string;
105
+ HOTSPOT_PANEL: string;
106
+ SHARE_MODAL: string;
107
+ RESTART_MODAL: string;
108
+ REMOVE_MODAL: string;
109
+ LOAD_PRECONFIG_MODAL: string;
110
+ MOVE_MODAL: string;
111
+ OUT_OF_STOCK_MODAL: string;
112
+ };
113
+ static readonly TRIGGER_SOURCE: {
114
+ AUTO: string;
115
+ BUTTON: string;
116
+ HOTSPOT: string;
117
+ GESTURE: string;
118
+ };
119
+ constructor(isInteractive: boolean, panelType: typeof EpigraphPanelOpenedEvent.PANEL_TYPE, triggerSource: typeof EpigraphPanelOpenedEvent.TRIGGER_SOURCE, items: IAnalyticsParameterItems);
120
+ }
121
+ export declare class EpigraphAddToFavouritesEvent extends BaseAnalyticsEvent {
122
+ constructor(items: IAnalyticsParameterItems);
123
+ }
124
+ export declare class EpigraphKeyboardInteractionEvent extends BaseAnalyticsEvent {
125
+ static readonly ACTION_PERFORMED: {
126
+ ZOOM: string;
127
+ ROTATE: string;
128
+ };
129
+ constructor(actionPerformed: typeof EpigraphKeyboardInteractionEvent.ACTION_PERFORMED);
130
+ }
131
+ export declare class EpigraphTouchInteractionEvent extends BaseAnalyticsEvent {
132
+ static readonly INTERACTION_TYPE: {
133
+ ROTATE: string;
134
+ ZOOM: string;
135
+ PAN: string;
136
+ };
137
+ constructor(interactionType: string);
138
+ }
139
+ export declare class EpigraphItemAddedEvent extends BaseAnalyticsEvent {
140
+ static readonly CURRENCY: {
141
+ USD: string;
142
+ EUR: string;
143
+ GBP: string;
144
+ CAD: string;
145
+ };
146
+ constructor(isInteractive: boolean, value: number, currency: typeof EpigraphItemAddedEvent.CURRENCY, quantity: number, items: IAnalyticsParameterItems);
147
+ }
148
+ export declare class EpigraphItemMovedEvent extends BaseAnalyticsEvent {
149
+ constructor(items: IAnalyticsParameterItems);
150
+ }
151
+ export declare class EpigraphItemRemovedEvent extends BaseAnalyticsEvent {
152
+ static readonly CURRENCY: {
153
+ USD: string;
154
+ EUR: string;
155
+ GBP: string;
156
+ CAD: string;
157
+ };
158
+ constructor(value: number, currency: typeof EpigraphItemRemovedEvent.CURRENCY, quantity: number, items: IAnalyticsParameterItems);
159
+ }
160
+ export declare class EpigraphVariantChangedEvent extends BaseAnalyticsEvent {
161
+ constructor(changeType: string, items: IAnalyticsParameterItems);
162
+ }
163
+ export declare class EpigraphContentSharedEvent extends BaseAnalyticsEvent {
164
+ constructor(contentType: string, shareDestination: string, items: IAnalyticsParameterItems);
165
+ }
166
+ export declare class EpigraphCheckoutEvent extends BaseAnalyticsEvent {
167
+ static readonly CURRENCY: {
168
+ USD: string;
169
+ EUR: string;
170
+ GBP: string;
171
+ CAD: string;
172
+ };
173
+ constructor(value: number, currency: typeof EpigraphCheckoutEvent.CURRENCY, items: IAnalyticsParameterItems);
174
+ }
175
+ export declare class EpigraphConversionEvent extends BaseAnalyticsEvent {
176
+ static readonly CURRENCY: {
177
+ USD: string;
178
+ EUR: string;
179
+ GBP: string;
180
+ CAD: string;
181
+ };
182
+ constructor(value: number, currency: typeof EpigraphConversionEvent.CURRENCY, items: IAnalyticsParameterItems);
183
+ }
184
+ export declare class EpigraphChangeRateEvent extends BaseAnalyticsEvent {
185
+ constructor(value: number);
186
+ }
187
+ export declare class EpigraphCompletionRateEvent extends BaseAnalyticsEvent {
188
+ constructor(value: number);
189
+ }
190
+ export declare class EpigraphEngagementRateEvent extends BaseAnalyticsEvent {
191
+ constructor(value: number);
192
+ }
193
+ export declare class EpigraphCustomEvent extends BaseAnalyticsEvent {
194
+ constructor(eventName: string, interactiveEvent: boolean, customParameters: Record<string, unknown>);
195
+ }
196
+ export {};
@@ -0,0 +1,17 @@
1
+ import { AnalyticsStatus } from '../analytics-plugin-interface';
2
+ export declare class EpigraphNotifier {
3
+ static readonly NOTIFICATION_NAME = "epg-notification";
4
+ static readonly ACTION_SEND_EVENT = "send-event";
5
+ static readonly ACTION_INITIALIZED = "initialized";
6
+ static readonly ACTION_FAILED_INITIALIZATION = "initialization-failed";
7
+ private readonly _pluginName;
8
+ private readonly _trackingId;
9
+ private readonly _experienceId;
10
+ private readonly _solution;
11
+ private _initializer;
12
+ private _status;
13
+ constructor(pluginName: string, trackingId: string, experienceId: string, solution: string, initializer: string, status: AnalyticsStatus);
14
+ updateStatus(value: AnalyticsStatus): void;
15
+ updateInitializer(value: string): void;
16
+ notify(action: string, eventDetails: Record<string, any>): void;
17
+ }
@@ -1,5 +1,5 @@
1
1
  import { default as SLL } from './single-linked-list.js';
2
- import { AnalyticsEvent } from '../analytics-event-interface.ts';
2
+ import { IAnalyticsEvent } from '../analytics-event-interface.ts';
3
3
  declare const $queue: unique symbol;
4
4
  declare const $size: unique symbol;
5
5
  export default class Queue {
@@ -8,7 +8,7 @@ export default class Queue {
8
8
  constructor();
9
9
  get queue(): SLL;
10
10
  get size(): number;
11
- enqueue(data: AnalyticsEvent): void;
12
- dequeue(): AnalyticsEvent;
11
+ enqueue(data: IAnalyticsEvent): void;
12
+ dequeue(): IAnalyticsEvent;
13
13
  }
14
14
  export {};
@@ -1,44 +1,108 @@
1
- import { IAnalyticsPlugin } from '../analytics-plugin-interface';
2
- import { AnalyticsEvent } from '../analytics-event-interface';
3
- import { IConsentPlugin } from '../consent-plugin-interface';
1
+ import { AnalyticsStatus, IAnalyticsPlugin } from '../analytics-plugin-interface';
2
+ import { IAnalyticsEvent } from '../analytics-event-interface';
4
3
  declare global {
5
4
  interface Window {
6
5
  [key: string]: any;
6
+ gtag?: (...args: any[]) => void;
7
+ dataLayer?: Array<Record<string, any>>;
8
+ epgDataLayerName?: string;
9
+ google_tag_manager: Record<string, any>;
7
10
  }
8
11
  }
9
12
  export declare class GA4AnalyticsPlugin implements IAnalyticsPlugin {
10
13
  name: string;
11
14
  pluginName: string;
12
15
  trackingID: string;
16
+ solution: string;
17
+ experienceID: string;
13
18
  verboseLogging: boolean;
14
- private queue;
15
- dataLayer: Array<Record<string, any>>;
19
+ dataLayer: Array<Record<string, any>> | undefined;
16
20
  dataLayerName: string | undefined;
17
- constructor(trackingID: string, verboseLogging: boolean);
18
- private setupDataLayer;
19
- private initGtag;
21
+ private __queue;
22
+ private __status;
23
+ private __sentEventCount;
24
+ private __initializationAttempts;
25
+ private __lastInitializationAttempt;
26
+ private __maxInitializationAttempts;
27
+ private __initializationRetryDelay;
28
+ private __isInitialized;
29
+ private __initializationMethod;
30
+ private __nexusFailureReported;
31
+ private __epigraphNotifier;
32
+ constructor({ trackingID, experienceID, solution, verboseLogging }: {
33
+ trackingID: string;
34
+ experienceID: string;
35
+ solution: string;
36
+ verboseLogging?: boolean;
37
+ });
38
+ getStatus(): AnalyticsStatus;
39
+ setStatus(newStatus: AnalyticsStatus): void;
40
+ getPendingEventCount(): number;
41
+ getSentEventCount(): number;
42
+ getTotalEventCount(): number;
20
43
  /**
21
- * This function will send an Event to GA3.
44
+ * Returns a unique plugin identifier so that tracking ID's can be the same across multiple plugins.
45
+ */
46
+ getUniquePluginIdentifier(): string;
47
+ setupPlugin(): void;
48
+ /**
49
+ * This function will send an Event to Google Analytics 4.
22
50
  *
23
- * @param eventData AnalyticsEvent The event to be tracked
24
- * @param consentPlugin
51
+ * @param analyticsEvent
52
+ * @param consent boolean Whether consent is granted
25
53
  */
26
- sendEvent(eventData: AnalyticsEvent, consentPlugin: IConsentPlugin | null): Promise<void>;
54
+ sendEvent(analyticsEvent: IAnalyticsEvent, consent: boolean): Promise<void>;
55
+ private initializePlugin;
56
+ private detectAndSetupAnalytics;
57
+ private detectGTM;
27
58
  /**
28
59
  * Send all events that are in the queue
29
60
  * @private
30
61
  */
31
62
  private dequeueAndSendEvents;
63
+ /**
64
+ * Send events to GTM based GA4
65
+ * @param event
66
+ * @private
67
+ */
68
+ private sendGTMEvent;
69
+ /**
70
+ * Send events to GA4 via Google Analytics 4.
71
+ * @param event
72
+ * @private
73
+ */
74
+ private sendGA4Event;
75
+ /**
76
+ * Validates a payload by checking its parameter count and the constraints of parameter names and values.
77
+ * See docs here for requirements: https://support.google.com/analytics/answer/9267744?hl=en
78
+ *
79
+ * @param {Record<string, unknown>} parameterPayload - An object containing the parameters to validate.
80
+ * The keys represent parameter names and the values represent parameter values.
81
+ * @return {boolean} Returns true if the payload meets the validation criteria; false otherwise.
82
+ */
83
+ private isValidPayload;
84
+ /**
85
+ * Converts the given GTM parameters to an EPG event tag, sending specific parameter payloads
86
+ * for processing and returning the formatted result. Falls back to the original payload in case of errors.
87
+ *
88
+ * @param {string} eventName - The event name associated with the EPG event tag being processed.
89
+ * @param {Record<string, unknown>} parameterPayload - A key-value pair object containing the parameters to be converted.
90
+ * @return {Promise<Record<string, unknown>>} A promise that resolves to an object containing the event name and the generated EPG event tag, or the original payload upon failure.
91
+ */
92
+ private convertGTMParametersToEpgEventTag;
93
+ /**
94
+ * Converts GA4 parameters into an EPG event tag.
95
+ *
96
+ * @param {Record<string, unknown>} parameterPayload - The GA4 parameters to be converted.
97
+ * @return {Promise<Record<string, any>>} A promise resolving to an object containing the EPG event tag or the original payload if the conversion fails.
98
+ */
99
+ private convertGA4ParametersToEpgEventTag;
32
100
  /**
33
101
  * Checks if verboseLogging is enabled, then logs the error
34
102
  * @param err
35
103
  */
36
104
  private logger;
37
- /**
38
- * Returns a unique plugin identifier so that tracking ID's can be the same across multiple plugins.
39
- */
40
- getUniquePluginIdentifier(): string;
41
- setupPlugin(): void;
42
105
  private sendGA4LongParameters;
43
- private findGA4ScriptInfo;
106
+ private reportFailureToNexus;
107
+ private findGA4Info;
44
108
  }
@@ -1,18 +1,35 @@
1
- import { IAnalyticsPlugin } from '../analytics-plugin-interface';
2
- import { AnalyticsEvent } from '../analytics-event-interface';
3
- import { IConsentPlugin } from '../consent-plugin-interface';
1
+ import { AnalyticsStatus, IAnalyticsPlugin } from '../analytics-plugin-interface';
2
+ import { IAnalyticsEvent } from '../analytics-event-interface';
4
3
  export declare class NexusAnalyticsPlugin implements IAnalyticsPlugin {
5
4
  name: string;
6
5
  pluginName: string;
7
6
  trackingID: string;
7
+ experienceID: string;
8
+ solution: string;
8
9
  verboseLogging: boolean;
9
10
  url: string;
10
- private queue;
11
11
  private readonly sessionId;
12
12
  private readonly xPath;
13
- constructor(trackingID: string, sessionId: string, xPath: string, verboseLogging: boolean, sendToStaging?: boolean);
14
- sendEvent(event: AnalyticsEvent, consentPlugin: IConsentPlugin | null): Promise<void>;
15
- private dequeueAndSendEvents;
13
+ private __queue;
14
+ private __status;
15
+ private __sentEventCount;
16
+ private __epigraphNotifier;
17
+ constructor({ trackingID, experienceID, solution, sessionId, xPath, verboseLogging, sendToStaging }: {
18
+ trackingID: string;
19
+ experienceID: string;
20
+ solution: string;
21
+ sessionId: string;
22
+ xPath: string;
23
+ verboseLogging?: boolean;
24
+ sendToStaging?: boolean;
25
+ });
26
+ getStatus(): AnalyticsStatus;
27
+ setStatus(newStatus: AnalyticsStatus): void;
28
+ getPendingEventCount(): number;
29
+ getSentEventCount(): number;
30
+ getTotalEventCount(): number;
16
31
  getUniquePluginIdentifier(): string;
17
32
  setupPlugin(): void;
33
+ sendEvent(event: IAnalyticsEvent, consent: boolean): Promise<void>;
34
+ private dequeueAndSendEvents;
18
35
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./Epigraph/epigraph.cjs"),n=require("./Epigraph/epigraphBaseSolutions.cjs"),e=require("./EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs"),r=require("./EpigraphLibs/EpigraphLogger/epigraphLogger.cjs"),i=require("./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs"),g=require("./EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs"),s=require("./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs"),p=require("./EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs"),t=require("./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs");exports.ENVIRONMENT_TYPE=a.ENVIRONMENT_TYPE;exports.Epigraph=a.Epigraph;exports.EpigraphBaseSolutionHtmlElement=n.EpigraphBaseSolutionHtmlElement;exports.EpigraphBaseSolutionLitElement=n.EpigraphBaseSolutionLitElement;exports.ConsentPluginNames=e.ConsentPluginNames;exports.EpigraphAnalytics=e.EpigraphAnalytics;exports.GA3AnalyticsPlugin=e.GA3AnalyticsPlugin;exports.GA4AnalyticsPlugin=e.GA4AnalyticsPlugin;exports.NexusAnalyticsPlugin=e.NexusAnalyticsPlugin;exports.OneTrustConsentPlugin=e.OneTrustConsentPlugin;exports.EpigraphLogger=r.EpigraphLogger;exports.LogTypes=r.LogTypes;exports.LoggerModeNames=r.LoggerModeNames;exports.EpigraphNexusAPI=i.EpigraphNexusAPI;exports.HTTPMethod=i.HTTPMethod;exports.NexusAPIResourceIdentifier=i.NexusAPIResourceIdentifier;exports.NexusAPIRoutes=i.NexusAPIRoutes;exports.NexusAPIVersions=i.NexusAPIVersions;exports.NexusEndpoints=i.NexusEndpoints;exports.EpigraphQrCodeGenerator=g.EpigraphQrCodeGenerator;exports.Result=s.Result;exports.failureResult=s.failureResult;exports.successResult=s.successResult;exports.Distance=p.Distance;exports.DistanceUnits=p.DistanceUnits;exports.UnitTypes=p.UnitTypes;exports.EpigraphUrlProcessor=t.EpigraphUrlProcessor;exports.QUERY_PARAMETER_ACTION_NAMES=t.QUERY_PARAMETER_ACTION_NAMES;exports.QUERY_PARAMETER_NAMES=t.QUERY_PARAMETER_NAMES;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./Epigraph/epigraph.cjs"),E=require("./Epigraph/epigraphBaseSolutions.cjs"),e=require("./EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs"),r=require("./EpigraphLibs/EpigraphLogger/epigraphLogger.cjs"),p=require("./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs"),g=require("./EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs"),t=require("./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs"),i=require("./EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs"),a=require("./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs");exports.ENVIRONMENT_TYPE=n.ENVIRONMENT_TYPE;exports.Epigraph=n.Epigraph;exports.EpigraphBaseSolutionHtmlElement=E.EpigraphBaseSolutionHtmlElement;exports.EpigraphBaseSolutionLitElement=E.EpigraphBaseSolutionLitElement;exports.ConsentPluginNames=e.ConsentPluginNames;exports.EpigraphAddToFavouritesEvent=e.EpigraphAddToFavouritesEvent;exports.EpigraphAnalytics=e.EpigraphAnalytics;exports.EpigraphArRequestedEvent=e.EpigraphArRequestedEvent;exports.EpigraphButtonClickEvent=e.EpigraphButtonClickEvent;exports.EpigraphChangeRateEvent=e.EpigraphChangeRateEvent;exports.EpigraphCheckoutEvent=e.EpigraphCheckoutEvent;exports.EpigraphCompletionRateEvent=e.EpigraphCompletionRateEvent;exports.EpigraphContentSharedEvent=e.EpigraphContentSharedEvent;exports.EpigraphConversionEvent=e.EpigraphConversionEvent;exports.EpigraphCustomEvent=e.EpigraphCustomEvent;exports.EpigraphEngagementRateEvent=e.EpigraphEngagementRateEvent;exports.EpigraphItemAddedEvent=e.EpigraphItemAddedEvent;exports.EpigraphItemMovedEvent=e.EpigraphItemMovedEvent;exports.EpigraphItemRemovedEvent=e.EpigraphItemRemovedEvent;exports.EpigraphKeyboardInteractionEvent=e.EpigraphKeyboardInteractionEvent;exports.EpigraphModuleClosedEvent=e.EpigraphModuleClosedEvent;exports.EpigraphModuleFailedEvent=e.EpigraphModuleFailedEvent;exports.EpigraphModuleLoadingEvent=e.EpigraphModuleLoadingEvent;exports.EpigraphModuleReadyEvent=e.EpigraphModuleReadyEvent;exports.EpigraphPanelClosedEvent=e.EpigraphPanelClosedEvent;exports.EpigraphPanelOpenedEvent=e.EpigraphPanelOpenedEvent;exports.EpigraphSupportDetectedEvent=e.EpigraphSupportDetectedEvent;exports.EpigraphTouchInteractionEvent=e.EpigraphTouchInteractionEvent;exports.EpigraphVariantChangedEvent=e.EpigraphVariantChangedEvent;exports.GA4AnalyticsPlugin=e.GA4AnalyticsPlugin;exports.NexusAnalyticsPlugin=e.NexusAnalyticsPlugin;exports.OneTrustConsentPlugin=e.OneTrustConsentPlugin;exports.EpigraphLogger=r.EpigraphLogger;exports.LogTypes=r.LogTypes;exports.LoggerModeNames=r.LoggerModeNames;exports.EpigraphNexusAPI=p.EpigraphNexusAPI;exports.HTTPMethod=p.HTTPMethod;exports.NexusAPIResourceIdentifier=p.NexusAPIResourceIdentifier;exports.NexusAPIRoutes=p.NexusAPIRoutes;exports.NexusAPIVersions=p.NexusAPIVersions;exports.NexusEndpoints=p.NexusEndpoints;exports.EpigraphQrCodeGenerator=g.EpigraphQrCodeGenerator;exports.Result=t.Result;exports.failureResult=t.failureResult;exports.successResult=t.successResult;exports.Distance=i.Distance;exports.DistanceUnits=i.DistanceUnits;exports.UnitTypes=i.UnitTypes;exports.EpigraphUrlProcessor=a.EpigraphUrlProcessor;exports.QUERY_PARAMETER_ACTION_NAMES=a.QUERY_PARAMETER_ACTION_NAMES;exports.QUERY_PARAMETER_NAMES=a.QUERY_PARAMETER_NAMES;
@@ -1,40 +1,62 @@
1
- import { ENVIRONMENT_TYPE as o, Epigraph as s } from "./Epigraph/epigraph.js";
2
- import { EpigraphBaseSolutionHtmlElement as i, EpigraphBaseSolutionLitElement as p } from "./Epigraph/epigraphBaseSolutions.js";
3
- import { ConsentPluginNames as E, EpigraphAnalytics as u, GA3AnalyticsPlugin as a, GA4AnalyticsPlugin as l, NexusAnalyticsPlugin as g, OneTrustConsentPlugin as A } from "./EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js";
4
- import { EpigraphLogger as m, LogTypes as N, LoggerModeNames as P } from "./EpigraphLibs/EpigraphLogger/epigraphLogger.js";
5
- import { EpigraphNexusAPI as f, HTTPMethod as c, NexusAPIResourceIdentifier as T, NexusAPIRoutes as h, NexusAPIVersions as I, NexusEndpoints as M } from "./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js";
6
- import { EpigraphQrCodeGenerator as _ } from "./EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js";
7
- import { Result as U, failureResult as C, successResult as L } from "./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js";
8
- import { Distance as G, DistanceUnits as O, UnitTypes as Q } from "./EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js";
9
- import { EpigraphUrlProcessor as B, QUERY_PARAMETER_ACTION_NAMES as D, QUERY_PARAMETER_NAMES as H } from "./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js";
1
+ import { ENVIRONMENT_TYPE as p, Epigraph as r } from "./Epigraph/epigraph.js";
2
+ import { EpigraphBaseSolutionHtmlElement as n, EpigraphBaseSolutionLitElement as o } from "./Epigraph/epigraphBaseSolutions.js";
3
+ import { ConsentPluginNames as i, EpigraphAddToFavouritesEvent as g, EpigraphAnalytics as s, EpigraphArRequestedEvent as h, EpigraphButtonClickEvent as u, EpigraphChangeRateEvent as l, EpigraphCheckoutEvent as d, EpigraphCompletionRateEvent as v, EpigraphContentSharedEvent as m, EpigraphConversionEvent as A, EpigraphCustomEvent as R, EpigraphEngagementRateEvent as c, EpigraphItemAddedEvent as x, EpigraphItemMovedEvent as P, EpigraphItemRemovedEvent as C, EpigraphKeyboardInteractionEvent as N, EpigraphModuleClosedEvent as I, EpigraphModuleFailedEvent as M, EpigraphModuleLoadingEvent as T, EpigraphModuleReadyEvent as f, EpigraphPanelClosedEvent as y, EpigraphPanelOpenedEvent as S, EpigraphSupportDetectedEvent as _, EpigraphTouchInteractionEvent as L, EpigraphVariantChangedEvent as U, GA4AnalyticsPlugin as O, NexusAnalyticsPlugin as B, OneTrustConsentPlugin as D } from "./EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js";
4
+ import { EpigraphLogger as V, LogTypes as Y, LoggerModeNames as k } from "./EpigraphLibs/EpigraphLogger/epigraphLogger.js";
5
+ import { EpigraphNexusAPI as G, HTTPMethod as H, NexusAPIResourceIdentifier as b, NexusAPIRoutes as q, NexusAPIVersions as K, NexusEndpoints as j } from "./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js";
6
+ import { EpigraphQrCodeGenerator as z } from "./EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js";
7
+ import { Result as W, failureResult as X, successResult as Z } from "./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js";
8
+ import { Distance as ee, DistanceUnits as te, UnitTypes as pe } from "./EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js";
9
+ import { EpigraphUrlProcessor as Ee, QUERY_PARAMETER_ACTION_NAMES as ne, QUERY_PARAMETER_NAMES as oe } from "./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js";
10
10
  export {
11
- E as ConsentPluginNames,
12
- G as Distance,
13
- O as DistanceUnits,
14
- o as ENVIRONMENT_TYPE,
15
- s as Epigraph,
16
- u as EpigraphAnalytics,
17
- i as EpigraphBaseSolutionHtmlElement,
18
- p as EpigraphBaseSolutionLitElement,
19
- m as EpigraphLogger,
20
- f as EpigraphNexusAPI,
21
- _ as EpigraphQrCodeGenerator,
22
- B as EpigraphUrlProcessor,
23
- a as GA3AnalyticsPlugin,
24
- l as GA4AnalyticsPlugin,
25
- c as HTTPMethod,
26
- N as LogTypes,
27
- P as LoggerModeNames,
28
- T as NexusAPIResourceIdentifier,
29
- h as NexusAPIRoutes,
30
- I as NexusAPIVersions,
31
- g as NexusAnalyticsPlugin,
32
- M as NexusEndpoints,
33
- A as OneTrustConsentPlugin,
34
- D as QUERY_PARAMETER_ACTION_NAMES,
35
- H as QUERY_PARAMETER_NAMES,
36
- U as Result,
37
- Q as UnitTypes,
38
- C as failureResult,
39
- L as successResult
11
+ i as ConsentPluginNames,
12
+ ee as Distance,
13
+ te as DistanceUnits,
14
+ p as ENVIRONMENT_TYPE,
15
+ r as Epigraph,
16
+ g as EpigraphAddToFavouritesEvent,
17
+ s as EpigraphAnalytics,
18
+ h as EpigraphArRequestedEvent,
19
+ n as EpigraphBaseSolutionHtmlElement,
20
+ o as EpigraphBaseSolutionLitElement,
21
+ u as EpigraphButtonClickEvent,
22
+ l as EpigraphChangeRateEvent,
23
+ d as EpigraphCheckoutEvent,
24
+ v as EpigraphCompletionRateEvent,
25
+ m as EpigraphContentSharedEvent,
26
+ A as EpigraphConversionEvent,
27
+ R as EpigraphCustomEvent,
28
+ c as EpigraphEngagementRateEvent,
29
+ x as EpigraphItemAddedEvent,
30
+ P as EpigraphItemMovedEvent,
31
+ C as EpigraphItemRemovedEvent,
32
+ N as EpigraphKeyboardInteractionEvent,
33
+ V as EpigraphLogger,
34
+ I as EpigraphModuleClosedEvent,
35
+ M as EpigraphModuleFailedEvent,
36
+ T as EpigraphModuleLoadingEvent,
37
+ f as EpigraphModuleReadyEvent,
38
+ G as EpigraphNexusAPI,
39
+ y as EpigraphPanelClosedEvent,
40
+ S as EpigraphPanelOpenedEvent,
41
+ z as EpigraphQrCodeGenerator,
42
+ _ as EpigraphSupportDetectedEvent,
43
+ L as EpigraphTouchInteractionEvent,
44
+ Ee as EpigraphUrlProcessor,
45
+ U as EpigraphVariantChangedEvent,
46
+ O as GA4AnalyticsPlugin,
47
+ H as HTTPMethod,
48
+ Y as LogTypes,
49
+ k as LoggerModeNames,
50
+ b as NexusAPIResourceIdentifier,
51
+ q as NexusAPIRoutes,
52
+ K as NexusAPIVersions,
53
+ B as NexusAnalyticsPlugin,
54
+ j as NexusEndpoints,
55
+ D as OneTrustConsentPlugin,
56
+ ne as QUERY_PARAMETER_ACTION_NAMES,
57
+ oe as QUERY_PARAMETER_NAMES,
58
+ W as Result,
59
+ pe as UnitTypes,
60
+ X as failureResult,
61
+ Z as successResult
40
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epigraph/epigraph-std-lib",
3
- "version": "4.6.0",
3
+ "version": "4.7.0-alpha",
4
4
  "type": "module",
5
5
  "main": "./dist/epigraph-std-lib.cjs",
6
6
  "module": "./dist/epigraph-std-lib.js",
@@ -1,44 +0,0 @@
1
- import { IAnalyticsPlugin } from '../analytics-plugin-interface';
2
- import { AnalyticsEvent } from '../analytics-event-interface';
3
- export declare class GA3AnalyticsPlugin implements IAnalyticsPlugin {
4
- name: string;
5
- pluginName: string;
6
- trackingID: string;
7
- verboseLogging: boolean;
8
- private queue;
9
- private readonly user;
10
- private readonly trackerName;
11
- private trackerInterval;
12
- private trackerCreated;
13
- constructor(trackingID: string, verboseLogging: boolean, user: string, trackerName: string);
14
- /**
15
- * This function will send an Event to GA3.
16
- *
17
- * @param eventData AnalyticsEvent The event to be tracked
18
- */
19
- sendEvent(eventData: AnalyticsEvent): boolean;
20
- /**
21
- * Send all events that are in the queue
22
- * @private
23
- */
24
- private dequeueAndSendEvents;
25
- /**
26
- * GA3 requires that a tracker be created prior to being sent. This is called from the constructor. It is
27
- * important to note that the promise that is inherently returned is ignored in the constructor at this
28
- * time. This is due to the events that are added will be queued from the page. This script requires
29
- * that the GA script has been imported on the page already as it does not check for it today.
30
- *
31
- * @private
32
- */
33
- private createTracker;
34
- /**
35
- * Checks if verboseLogging is enabled, then logs the error
36
- * @param err
37
- */
38
- private logger;
39
- /**
40
- * Returns a unique plugin identifier so that tracking ID's can be the same across multiple plugins.
41
- */
42
- getUniquePluginIdentifier(): string;
43
- setupPlugin(): void;
44
- }