@epigraph/epigraph-std-lib 4.5.4-alpha → 4.6.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.
@@ -1,5 +1,5 @@
1
1
  import { default as SLL } from './single-linked-list.js';
2
- import { IAnalyticsEvent } from '../analytics-event-interface.ts';
2
+ import { AnalyticsEvent } 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: IAnalyticsEvent): void;
12
- dequeue(): IAnalyticsEvent;
11
+ enqueue(data: AnalyticsEvent): void;
12
+ dequeue(): AnalyticsEvent;
13
13
  }
14
14
  export {};
@@ -0,0 +1,44 @@
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
+ }
@@ -1,107 +1,44 @@
1
- import { AnalyticsStatus, IAnalyticsPlugin } from '../analytics-plugin-interface';
2
- import { IAnalyticsEvent } from '../analytics-event-interface';
1
+ import { IAnalyticsPlugin } from '../analytics-plugin-interface';
2
+ import { AnalyticsEvent } from '../analytics-event-interface';
3
+ import { IConsentPlugin } from '../consent-plugin-interface';
3
4
  declare global {
4
5
  interface Window {
5
6
  [key: string]: any;
6
- gtag?: (...args: any[]) => void;
7
- dataLayer?: Array<Record<string, any>>;
8
- epgDataLayerName?: string;
9
- google_tag_manager: Record<string, any>;
10
7
  }
11
8
  }
12
9
  export declare class GA4AnalyticsPlugin implements IAnalyticsPlugin {
13
10
  name: string;
14
11
  pluginName: string;
15
12
  trackingID: string;
16
- solution: string;
17
- experienceID: string;
18
13
  verboseLogging: boolean;
19
- dataLayer: Array<Record<string, any>> | undefined;
14
+ private queue;
15
+ dataLayer: Array<Record<string, any>>;
20
16
  dataLayerName: string | undefined;
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
- constructor({ trackingID, experienceID, solution, verboseLogging }: {
32
- trackingID: string;
33
- experienceID: string;
34
- solution: string;
35
- verboseLogging?: boolean;
36
- });
37
- getStatus(): AnalyticsStatus;
38
- setStatus(newStatus: AnalyticsStatus): void;
39
- getPendingEventCount(): number;
40
- getSentEventCount(): number;
41
- getTotalEventCount(): number;
17
+ constructor(trackingID: string, verboseLogging: boolean);
18
+ private setupDataLayer;
19
+ private initGtag;
42
20
  /**
43
- * Returns a unique plugin identifier so that tracking ID's can be the same across multiple plugins.
44
- */
45
- getUniquePluginIdentifier(): string;
46
- setupPlugin(): void;
47
- /**
48
- * This function will send an Event to Google Analytics 4.
21
+ * This function will send an Event to GA3.
49
22
  *
50
- * @param analyticsEvent
51
- * @param consent boolean Whether consent is granted
23
+ * @param eventData AnalyticsEvent The event to be tracked
24
+ * @param consentPlugin
52
25
  */
53
- sendEvent(analyticsEvent: IAnalyticsEvent, consent: boolean): Promise<void>;
54
- private initializePlugin;
55
- private detectAndSetupAnalytics;
56
- private detectGTM;
26
+ sendEvent(eventData: AnalyticsEvent, consentPlugin: IConsentPlugin | null): Promise<void>;
57
27
  /**
58
28
  * Send all events that are in the queue
59
29
  * @private
60
30
  */
61
31
  private dequeueAndSendEvents;
62
- /**
63
- * Send events to GTM based GA4
64
- * @param event
65
- * @private
66
- */
67
- private sendGTMEvent;
68
- /**
69
- * Send events to GA4 via Google Analytics 4.
70
- * @param event
71
- * @private
72
- */
73
- private sendGA4Event;
74
- /**
75
- * Validates a payload by checking its parameter count and the constraints of parameter names and values.
76
- * See docs here for requirements: https://support.google.com/analytics/answer/9267744?hl=en
77
- *
78
- * @param {Record<string, unknown>} parameterPayload - An object containing the parameters to validate.
79
- * The keys represent parameter names and the values represent parameter values.
80
- * @return {boolean} Returns true if the payload meets the validation criteria; false otherwise.
81
- */
82
- private isValidPayload;
83
- /**
84
- * Converts the given GTM parameters to an EPG event tag, sending specific parameter payloads
85
- * for processing and returning the formatted result. Falls back to the original payload in case of errors.
86
- *
87
- * @param {string} eventName - The event name associated with the EPG event tag being processed.
88
- * @param {Record<string, unknown>} parameterPayload - A key-value pair object containing the parameters to be converted.
89
- * @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.
90
- */
91
- private convertGTMParametersToEpgEventTag;
92
- /**
93
- * Converts GA4 parameters into an EPG event tag.
94
- *
95
- * @param {Record<string, unknown>} parameterPayload - The GA4 parameters to be converted.
96
- * @return {Promise<Record<string, any>>} A promise resolving to an object containing the EPG event tag or the original payload if the conversion fails.
97
- */
98
- private convertGA4ParametersToEpgEventTag;
99
32
  /**
100
33
  * Checks if verboseLogging is enabled, then logs the error
101
34
  * @param err
102
35
  */
103
36
  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;
104
42
  private sendGA4LongParameters;
105
- private reportFailureToNexus;
106
- private findGA4Info;
43
+ private findGA4ScriptInfo;
107
44
  }
@@ -1,34 +1,18 @@
1
- import { AnalyticsStatus, IAnalyticsPlugin } from '../analytics-plugin-interface';
2
- import { IAnalyticsEvent } from '../analytics-event-interface';
1
+ import { IAnalyticsPlugin } from '../analytics-plugin-interface';
2
+ import { AnalyticsEvent } from '../analytics-event-interface';
3
+ import { IConsentPlugin } from '../consent-plugin-interface';
3
4
  export declare class NexusAnalyticsPlugin implements IAnalyticsPlugin {
4
5
  name: string;
5
6
  pluginName: string;
6
7
  trackingID: string;
7
- experienceID: string;
8
- solution: string;
9
8
  verboseLogging: boolean;
10
9
  url: string;
10
+ private queue;
11
11
  private readonly sessionId;
12
12
  private readonly xPath;
13
- private __queue;
14
- private __status;
15
- private __sentEventCount;
16
- constructor({ trackingID, experienceID, solution, sessionId, xPath, verboseLogging, sendToStaging }: {
17
- trackingID: string;
18
- experienceID: string;
19
- solution: string;
20
- sessionId: string;
21
- xPath: string;
22
- verboseLogging?: boolean;
23
- sendToStaging?: boolean;
24
- });
25
- getStatus(): AnalyticsStatus;
26
- setStatus(newStatus: AnalyticsStatus): void;
27
- getPendingEventCount(): number;
28
- getSentEventCount(): number;
29
- getTotalEventCount(): number;
13
+ constructor(trackingID: string, sessionId: string, xPath: string, verboseLogging: boolean, sendToStaging?: boolean);
14
+ sendEvent(event: AnalyticsEvent, consentPlugin: IConsentPlugin | null): Promise<void>;
15
+ private dequeueAndSendEvents;
30
16
  getUniquePluginIdentifier(): string;
31
17
  setupPlugin(): void;
32
- sendEvent(event: IAnalyticsEvent, consent: boolean): Promise<void>;
33
- private dequeueAndSendEvents;
34
18
  }
@@ -1 +1 @@
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
+ "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,62 +1,40 @@
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";
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";
10
10
  export {
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
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
62
40
  };
package/package.json CHANGED
@@ -1,41 +1,41 @@
1
- {
2
- "name": "@epigraph/epigraph-std-lib",
3
- "version": "4.5.4-alpha",
4
- "type": "module",
5
- "main": "./dist/epigraph-std-lib.cjs",
6
- "module": "./dist/epigraph-std-lib.js",
7
- "files": [
8
- "dist",
9
- "dist/**/*"
10
- ],
11
- "types": "./dist/epigraph-std-lib.d.ts",
12
- "exports": {
13
- ".": {
14
- "types": "./dist/epigraph-std-lib.d.ts",
15
- "import": "./dist/epigraph-std-lib.js",
16
- "require": "./dist/epigraph-std-lib.cjs"
17
- }
18
- },
19
- "scripts": {
20
- "dev": "vite",
21
- "build": "tsc -b ./tsconfig.lib.json && vite build",
22
- "preview": "vite preview",
23
- "prepublishOnly": "npm run build",
24
- "test": "npm run build && vitest"
25
- },
26
- "dependencies": {},
27
- "peerDependencies": {
28
- "lit": "^3.2.1",
29
- "qr-creator": "^1.0.0"
30
- },
31
- "devDependencies": {
32
- "@types/node": "^22.13.0",
33
- "happy-dom": "^16.8.1",
34
- "typescript": "^5.8.2",
35
- "vite": "^6.0.5",
36
- "vite-plugin-dts": "^4.5.0",
37
- "vitest": "^3.0.5",
38
- "@types/google.analytics": "^0.0.42",
39
- "@types/gtag.js": "^0.0.20"
40
- }
41
- }
1
+ {
2
+ "name": "@epigraph/epigraph-std-lib",
3
+ "version": "4.6.0",
4
+ "type": "module",
5
+ "main": "./dist/epigraph-std-lib.cjs",
6
+ "module": "./dist/epigraph-std-lib.js",
7
+ "files": [
8
+ "dist",
9
+ "dist/**/*"
10
+ ],
11
+ "types": "./dist/epigraph-std-lib.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/epigraph-std-lib.d.ts",
15
+ "import": "./dist/epigraph-std-lib.js",
16
+ "require": "./dist/epigraph-std-lib.cjs"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "dev": "vite",
21
+ "build": "tsc -b ./tsconfig.lib.json && vite build",
22
+ "preview": "vite preview",
23
+ "prepublishOnly": "npm run build",
24
+ "test": "npm run build && vitest"
25
+ },
26
+ "dependencies": {},
27
+ "peerDependencies": {
28
+ "lit": "^3.2.1",
29
+ "qr-creator": "^1.0.0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/node": "^22.13.0",
33
+ "happy-dom": "^16.8.1",
34
+ "typescript": "^5.8.2",
35
+ "vite": "^6.0.5",
36
+ "vite-plugin-dts": "^4.5.0",
37
+ "vitest": "^3.0.5",
38
+ "@types/google.analytics": "^0.0.42",
39
+ "@types/gtag.js": "^0.0.20"
40
+ }
41
+ }
@@ -1,98 +0,0 @@
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
- sendTo: 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
- items: never[];
23
- sendTo: string;
24
- };
25
- getNexusParameters(): {
26
- interactive_event: boolean;
27
- };
28
- }
29
- export declare class EpigraphArRequestedEvent extends BaseAnalyticsEvent {
30
- constructor(items?: IAnalyticsParameterItems);
31
- }
32
- export declare class EpigraphModuleLoadingEvent extends BaseAnalyticsEvent {
33
- constructor(isPreConfig: boolean);
34
- }
35
- export declare class EpigraphModuleReadyEvent extends BaseAnalyticsEvent {
36
- constructor(isPreConfig: boolean, loadTimeMs: number);
37
- }
38
- export declare class EpigraphModuleFailedEvent extends BaseAnalyticsEvent {
39
- constructor(isPreConfig: boolean, loadTimeMs: number, errorType: string);
40
- }
41
- export declare class EpigraphModuleClosedEvent extends BaseAnalyticsEvent {
42
- constructor(items?: IAnalyticsParameterItems);
43
- }
44
- export declare class EpigraphSupportDetectedEvent extends BaseAnalyticsEvent {
45
- constructor(supportType: string, deviceCapabilities?: Record<string, unknown>);
46
- }
47
- export declare class EpigraphButtonClickEvent extends BaseAnalyticsEvent {
48
- constructor(buttonType: string, buttonName: string);
49
- }
50
- export declare class EpigraphPanelOpenedEvent extends BaseAnalyticsEvent {
51
- constructor(items: IAnalyticsParameterItems | undefined, isInteractive: boolean, panelType: string, triggerSource: string);
52
- }
53
- export declare class EpigraphPanelClosedEvent extends BaseAnalyticsEvent {
54
- constructor(items: IAnalyticsParameterItems | undefined, isInteractive: boolean, panelType: string, triggerSource: string);
55
- }
56
- export declare class EpigraphAddToFavouritesEvent extends BaseAnalyticsEvent {
57
- constructor(items?: IAnalyticsParameterItems);
58
- }
59
- export declare class EpigraphKeyboardInteractionEvent extends BaseAnalyticsEvent {
60
- constructor(actionPerformed: string);
61
- }
62
- export declare class EpigraphTouchInteractionEvent extends BaseAnalyticsEvent {
63
- constructor(interactionType: string);
64
- }
65
- export declare class EpigraphItemAddedEvent extends BaseAnalyticsEvent {
66
- constructor(items: IAnalyticsParameterItems | undefined, isInteractive: boolean, value: number, currency: string, quantity: number);
67
- }
68
- export declare class EpigraphItemMovedEvent extends BaseAnalyticsEvent {
69
- constructor(items?: IAnalyticsParameterItems);
70
- }
71
- export declare class EpigraphItemRemovedEvent extends BaseAnalyticsEvent {
72
- constructor(items: IAnalyticsParameterItems | undefined, value: number, currency: string, quantity: number);
73
- }
74
- export declare class EpigraphVariantChangedEvent extends BaseAnalyticsEvent {
75
- constructor(items: IAnalyticsParameterItems | undefined, changeType: string);
76
- }
77
- export declare class EpigraphContentSharedEvent extends BaseAnalyticsEvent {
78
- constructor(items: IAnalyticsParameterItems | undefined, contentType: string, shareDestination: string);
79
- }
80
- export declare class EpigraphCheckoutEvent extends BaseAnalyticsEvent {
81
- constructor(items: IAnalyticsParameterItems | undefined, value: number, currency: string);
82
- }
83
- export declare class EpigraphConversionEvent extends BaseAnalyticsEvent {
84
- constructor(items: IAnalyticsParameterItems | undefined, value: number, currency: string);
85
- }
86
- export declare class EpigraphChangeRateEvent extends BaseAnalyticsEvent {
87
- constructor(value: number);
88
- }
89
- export declare class EpigraphCompletionRateEvent extends BaseAnalyticsEvent {
90
- constructor(value: number);
91
- }
92
- export declare class EpigraphEngagementRateEvent extends BaseAnalyticsEvent {
93
- constructor(value: number);
94
- }
95
- export declare class EpigraphCustomEvent extends BaseAnalyticsEvent {
96
- constructor(eventName: string, interactiveEvent: boolean, customParameters: Record<string, unknown>);
97
- }
98
- export {};