@epigraph/epigraph-std-lib 5.0.0-alpha.13 → 5.0.0-alpha.14
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/README.md +68 -68
- package/dist/Epigraph/epigraph.cjs +1 -1
- package/dist/Epigraph/epigraph.js +126 -94
- package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
- package/dist/Epigraph/epigraphBaseSolutions.js +68 -60
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +16 -1
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.d.ts +2 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +1057 -2
- package/dist/EpigraphLibs/EpigraphAnalytics/plugins/ga4-analytics-plugin.d.ts +11 -6
- package/dist/EpigraphLibs/EpigraphAnalytics/plugins/nexus-solutions-analytics-plugin.d.ts +50 -0
- package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.js +198 -74
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +425 -197
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +7 -1
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +78 -2
- package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js +26 -24
- package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +88 -2
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js +75 -44
- package/dist/enums-1vqWxJ0i.cjs +1 -0
- package/dist/enums-CvOTKyNu.js +5 -0
- package/dist/epigraph-std-lib.cjs +1 -1
- package/dist/epigraph-std-lib.js +74 -11
- package/dist/lit-element-C3moVMGu.js +524 -0
- package/dist/lit-element-CYaaFRfk.cjs +19 -0
- package/package.json +40 -40
- package/dist/enums-BSSe4NAs.js +0 -8
- package/dist/enums-PfFMiIoe.cjs +0 -1
- package/dist/epigraphAnalytics-CF9Czp8C.js +0 -722
- package/dist/epigraphAnalytics-H3EZRDUh.cjs +0 -1
- package/dist/epigraphQrCodeGenerator-BXUNL2XK.js +0 -54
- package/dist/epigraphQrCodeGenerator-F2eLrPC_.cjs +0 -7
- package/dist/epigraphUnitsConverter-CwpmWl7p.cjs +0 -1
- package/dist/epigraphUnitsConverter-DsX4Rmsp.js +0 -66
- package/dist/lit--5TUYSGn.js +0 -508
- package/dist/lit-DZtv4Pds.cjs +0 -2
|
@@ -9,6 +9,12 @@ declare global {
|
|
|
9
9
|
google_tag_manager: Record<string, any>;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
export type GA4AnalyticsPluginConfig = {
|
|
13
|
+
trackingID: string;
|
|
14
|
+
experienceID: string;
|
|
15
|
+
solution: string;
|
|
16
|
+
verboseLogging?: boolean;
|
|
17
|
+
};
|
|
12
18
|
export declare class GA4AnalyticsPlugin implements IAnalyticsPlugin {
|
|
13
19
|
name: string;
|
|
14
20
|
pluginName: string;
|
|
@@ -29,12 +35,10 @@ export declare class GA4AnalyticsPlugin implements IAnalyticsPlugin {
|
|
|
29
35
|
private __initializationMethod;
|
|
30
36
|
private __nexusFailureReported;
|
|
31
37
|
private __epigraphNotifier;
|
|
32
|
-
constructor({ trackingID, experienceID, solution, verboseLogging }:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
verboseLogging?: boolean;
|
|
37
|
-
});
|
|
38
|
+
constructor({ trackingID, experienceID, solution, verboseLogging, }: GA4AnalyticsPluginConfig);
|
|
39
|
+
setTrackingID(trackingID: string): void;
|
|
40
|
+
setExperienceID(experienceID: string): void;
|
|
41
|
+
setSolution(solution: string): void;
|
|
38
42
|
getStatus(): AnalyticsStatus;
|
|
39
43
|
setStatus(newStatus: AnalyticsStatus): void;
|
|
40
44
|
getPendingEventCount(): number;
|
|
@@ -52,6 +56,7 @@ export declare class GA4AnalyticsPlugin implements IAnalyticsPlugin {
|
|
|
52
56
|
* @param consent boolean Whether consent is granted
|
|
53
57
|
*/
|
|
54
58
|
sendEvent(analyticsEvent: IAnalyticsEvent, consent: boolean): Promise<void>;
|
|
59
|
+
private resetInitialization;
|
|
55
60
|
private initializePlugin;
|
|
56
61
|
private detectAndSetupAnalytics;
|
|
57
62
|
private detectGTM;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AnalyticsStatus, IAnalyticsPlugin } from '../analytics-plugin-interface';
|
|
2
|
+
import { IAnalyticsEvent } from '../analytics-event-interface';
|
|
3
|
+
import { NexusEndpoints } from '../../../Epigraph/constants/enums.ts';
|
|
4
|
+
export type NexusSolutionsAnalyticsPluginConfig = {
|
|
5
|
+
productId: number;
|
|
6
|
+
identifier: string;
|
|
7
|
+
identifierType: string;
|
|
8
|
+
experienceType: string;
|
|
9
|
+
renderMode?: string;
|
|
10
|
+
sessionId: string;
|
|
11
|
+
xPath: string;
|
|
12
|
+
solution?: string;
|
|
13
|
+
verboseLogging?: boolean;
|
|
14
|
+
baseUrl?: NexusEndpoints;
|
|
15
|
+
};
|
|
16
|
+
export declare class NexusSolutionsAnalyticsPlugin implements IAnalyticsPlugin {
|
|
17
|
+
name: string;
|
|
18
|
+
pluginName: string;
|
|
19
|
+
trackingID: string;
|
|
20
|
+
experienceID: string;
|
|
21
|
+
solution: string;
|
|
22
|
+
verboseLogging: boolean;
|
|
23
|
+
url: string;
|
|
24
|
+
private productId;
|
|
25
|
+
private identifier;
|
|
26
|
+
private identifierType;
|
|
27
|
+
private experienceType;
|
|
28
|
+
private renderMode;
|
|
29
|
+
private readonly sessionId;
|
|
30
|
+
private readonly xPath;
|
|
31
|
+
private __queue;
|
|
32
|
+
private __status;
|
|
33
|
+
private __sentEventCount;
|
|
34
|
+
private __epigraphNotifier;
|
|
35
|
+
constructor({ productId, identifier, identifierType, experienceType, renderMode, sessionId, xPath, solution, verboseLogging, baseUrl, }: NexusSolutionsAnalyticsPluginConfig);
|
|
36
|
+
setProductId(productId: number): void;
|
|
37
|
+
setIdentifier(identifier: string): void;
|
|
38
|
+
setIdentifierType(identifierType: string): void;
|
|
39
|
+
setExperienceType(experienceType: string): void;
|
|
40
|
+
setRenderMode(renderMode: string): void;
|
|
41
|
+
getStatus(): AnalyticsStatus;
|
|
42
|
+
setStatus(newStatus: AnalyticsStatus): void;
|
|
43
|
+
getPendingEventCount(): number;
|
|
44
|
+
getSentEventCount(): number;
|
|
45
|
+
getTotalEventCount(): number;
|
|
46
|
+
getUniquePluginIdentifier(): string;
|
|
47
|
+
setupPlugin(): void;
|
|
48
|
+
sendEvent(event: IAnalyticsEvent, consent: boolean): Promise<void>;
|
|
49
|
+
private dequeueAndSendEvents;
|
|
50
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var s=(l=>(l.Release="release",l.Staging="staging",l.Dev="dev",l))(s||{}),t=(l=>(l.Info="info",l.Warn="warn",l.Error="error",l))(t||{});class a{constructor(o){this.context="EPIGRAPH-LOGGER",this._allModes={release:{name:"release",allows:["error"]},staging:{name:"staging",allows:["warn","error"]},dev:{name:"dev",allows:["info","warn","error"]}},this._currentMode="release",o&&(this.context=o.toLocaleUpperCase())}get modes(){return this._allModes}setCurrentMode(o){if(!Object.keys(this._allModes).includes(o)){console.warn(`"${o}": is not a valid logger mode`);return}this._currentMode=o}_isLogTypeAllowedInCurrentMode(o){return this._allModes[this._currentMode].allows.includes(o)}info({title:o,details:r="",contextOverride:e=void 0}){if(!this._isLogTypeAllowedInCurrentMode("info"))return;const n=e||this.context;console.groupCollapsed(`[${n}]: ${o}`),console.log(r),console.groupCollapsed("Traceback..."),console.trace(),console.groupEnd(),console.groupEnd()}warn({title:o,details:r="",contextOverride:e=void 0}){if(!this._isLogTypeAllowedInCurrentMode("warn"))return;const n=e||this.context;console.groupCollapsed(`%c[${n}]: ${o}`,"color: orange;"),console.warn(r),console.groupCollapsed("Traceback..."),console.trace(),console.groupEnd(),console.groupEnd()}error({title:o,details:r="",contextOverride:e=void 0}){if(!this._isLogTypeAllowedInCurrentMode("error"))return;const n=e||this.context;console.groupCollapsed(`%c[${n}]: ${o}`,"color: red;"),console.error(r),console.groupCollapsed("Traceback..."),console.trace(),console.groupEnd(),console.groupEnd()}table({title:o,details:r={},contextOverride:e=void 0,logType:n="info"}){if(!this._isLogTypeAllowedInCurrentMode(n))return;const c=e||this.context;console.groupCollapsed(`[${c}]: ${o}`),console.table(r),console.groupCollapsed("Traceback..."),console.trace(),console.groupEnd(),console.groupEnd()}group({title:o,contextOverride:r=void 0,logType:e="info"}){if(!this._isLogTypeAllowedInCurrentMode(e))return;const n=r||this.context;console.group(`%c ${n} GROUP`,o)}groupCollapsed({title:o,contextOverride:r=void 0,logType:e="info"}){if(!this._isLogTypeAllowedInCurrentMode(e))return;const n=r||this.context;console.groupCollapsed(`%c ${n} GROUP`,o)}groupEnd(){this._isLogTypeAllowedInCurrentMode("info")&&(console.log("----------------------------------"),console.groupEnd())}}exports.EpigraphLogger=a;exports.LogTypes=t;exports.LoggerModeNames=s;
|
|
@@ -1,75 +1,199 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
var t = /* @__PURE__ */ ((l) => (l.Release = "release", l.Staging = "staging", l.Dev = "dev", l))(t || {}), c = /* @__PURE__ */ ((l) => (l.Info = "info", l.Warn = "warn", l.Error = "error", l))(c || {});
|
|
2
|
+
class a {
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} [context="EPIGRAPH-LOGGER"] Used to categorise each message within
|
|
5
|
+
* the console.
|
|
6
|
+
* @example,CORE, UI
|
|
7
|
+
*/
|
|
8
|
+
constructor(o) {
|
|
9
|
+
this.context = "EPIGRAPH-LOGGER", this._allModes = {
|
|
10
|
+
release: { name: "release", allows: [
|
|
11
|
+
"error"
|
|
12
|
+
/* Error */
|
|
13
|
+
] },
|
|
14
|
+
staging: {
|
|
15
|
+
name: "staging",
|
|
16
|
+
allows: [
|
|
17
|
+
"warn",
|
|
18
|
+
"error"
|
|
19
|
+
/* Error */
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
dev: {
|
|
23
|
+
name: "dev",
|
|
24
|
+
allows: [
|
|
25
|
+
"info",
|
|
26
|
+
"warn",
|
|
27
|
+
"error"
|
|
28
|
+
/* Error */
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}, this._currentMode = "release", o && (this.context = o.toLocaleUpperCase());
|
|
32
|
+
}
|
|
33
|
+
get modes() {
|
|
34
|
+
return this._allModes;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param {LoggerModeNames} newValue Sets the logger mode of the current instance.
|
|
39
|
+
*/
|
|
40
|
+
setCurrentMode(o) {
|
|
41
|
+
if (!Object.keys(this._allModes).includes(o)) {
|
|
42
|
+
console.warn(`"${o}": is not a valid logger mode`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this._currentMode = o;
|
|
46
|
+
}
|
|
47
|
+
_isLogTypeAllowedInCurrentMode(o) {
|
|
48
|
+
return this._allModes[this._currentMode].allows.includes(o);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A log type that doesn't necessarily need to be looked at by the end user.
|
|
52
|
+
* This can be any generic log that would be ignored in most logger modes except verbose.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} title A short title for this log.
|
|
55
|
+
* @param {any} details Any optional detail that would be shown if this log was expanded in the console.
|
|
56
|
+
* @param {string | undefined} contextOverride Allows the user to specify where this log
|
|
57
|
+
* was recorded from. For eg. Core and Ui can pass in different values for this
|
|
58
|
+
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
59
|
+
* that was provided at the time of initialisation of this class.
|
|
60
|
+
*/
|
|
61
|
+
info({ title: o, details: r = "", contextOverride: e = void 0 }) {
|
|
62
|
+
if (!this._isLogTypeAllowedInCurrentMode(
|
|
63
|
+
"info"
|
|
64
|
+
/* Info */
|
|
65
|
+
))
|
|
66
|
+
return;
|
|
67
|
+
const n = e || this.context;
|
|
68
|
+
console.groupCollapsed(`[${n}]: ${o}`), console.log(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A warning log type that let's the user know that some action that could be dangerous was just
|
|
72
|
+
* performed and might need attention.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} title A short title for this log.
|
|
75
|
+
* @param {any} details Any optional detail that would be shown if this log was expanded in the console.
|
|
76
|
+
* @param {string | undefined} contextOverride Allows the user to specify where this log
|
|
77
|
+
* was recorded from. For eg. Core and Ui can pass in different values for this
|
|
78
|
+
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
79
|
+
* that was provided at the time of initialisation of this class.
|
|
80
|
+
*/
|
|
81
|
+
warn({ title: o, details: r = "", contextOverride: e = void 0 }) {
|
|
82
|
+
if (!this._isLogTypeAllowedInCurrentMode(
|
|
83
|
+
"warn"
|
|
84
|
+
/* Warn */
|
|
85
|
+
))
|
|
86
|
+
return;
|
|
87
|
+
const n = e || this.context;
|
|
88
|
+
console.groupCollapsed(`%c[${n}]: ${o}`, "color: orange;"), console.warn(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A critical error log type that let's the user know that some action that was unexpected and required immediate attention.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} title A short title for this log.
|
|
94
|
+
* @param {any} details Any optional detail that would be shown if this log was expanded in the console.
|
|
95
|
+
* @param {string | undefined} contextOverride Allows the user to specify where this log
|
|
96
|
+
* was recorded from. For eg. Core and Ui can pass in different values for this
|
|
97
|
+
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
98
|
+
* that was provided at the time of initialisation of this class.
|
|
99
|
+
*/
|
|
100
|
+
error({ title: o, details: r = "", contextOverride: e = void 0 }) {
|
|
101
|
+
if (!this._isLogTypeAllowedInCurrentMode(
|
|
102
|
+
"error"
|
|
103
|
+
/* Error */
|
|
104
|
+
))
|
|
105
|
+
return;
|
|
106
|
+
const n = e || this.context;
|
|
107
|
+
console.groupCollapsed(`%c[${n}]: ${o}`, "color: red;"), console.error(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A table log type that can show an object in an organised manner within the console.
|
|
111
|
+
* This is primarily for the visual purposes and doesn't provide any additional functionality
|
|
112
|
+
* that other log types cannot provide.
|
|
113
|
+
*
|
|
114
|
+
* @param {string} title A short title for this log.
|
|
115
|
+
* @param {any} details Any optional detail that would be shown if this log was expanded in the console.
|
|
116
|
+
* @param {string | undefined} contextOverride Allows the user to specify where this log
|
|
117
|
+
* was recorded from. For eg. Core and Ui can pass in different values for this
|
|
118
|
+
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
119
|
+
* that was provided at the time of initialisation of this class.
|
|
120
|
+
* @param {LogTypes} logType A
|
|
121
|
+
*/
|
|
122
|
+
table({
|
|
123
|
+
title: o,
|
|
124
|
+
details: r = {},
|
|
125
|
+
contextOverride: e = void 0,
|
|
126
|
+
logType: n = "info"
|
|
127
|
+
/* Info */
|
|
128
|
+
}) {
|
|
129
|
+
if (!this._isLogTypeAllowedInCurrentMode(n))
|
|
130
|
+
return;
|
|
131
|
+
const s = e || this.context;
|
|
132
|
+
console.groupCollapsed(`[${s}]: ${o}`), console.table(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Begins an expanded group with the browser's console window.
|
|
136
|
+
* NOTE: Please remember to close this group once done using EpigraphLogger.groupEnd();
|
|
137
|
+
*
|
|
138
|
+
* @param {string} title A short title for this group.
|
|
139
|
+
* @param {string | undefined} contextOverride Allows the user to specify where this log
|
|
140
|
+
* was recorded from. For eg. Core and Ui can pass in different values for this
|
|
141
|
+
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
142
|
+
* that was provided at the time of initialisation of this class.
|
|
143
|
+
* @param {LogTypes} logType A group can implictly of any log type, by default it is of type
|
|
144
|
+
* info but this parameter allows the user to override this.
|
|
145
|
+
* @returns {void}
|
|
146
|
+
*/
|
|
147
|
+
group({
|
|
148
|
+
title: o,
|
|
149
|
+
contextOverride: r = void 0,
|
|
150
|
+
logType: e = "info"
|
|
151
|
+
/* Info */
|
|
152
|
+
}) {
|
|
153
|
+
if (!this._isLogTypeAllowedInCurrentMode(e))
|
|
154
|
+
return;
|
|
155
|
+
const n = r || this.context;
|
|
156
|
+
console.group(`%c ${n} GROUP`, o);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Begins a collapsed group with the browser's console window.
|
|
160
|
+
* NOTE: Please remember to close this group once done using EpigraphLogger.groupEnd();
|
|
161
|
+
*
|
|
162
|
+
* @param {string} title A short title for this group.
|
|
163
|
+
* @param {string | undefined} contextOverride Allows the user to specify where this log
|
|
164
|
+
* was recorded from. For eg. Core and Ui can pass in different values for this
|
|
165
|
+
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
166
|
+
* that was provided at the time of initialisation of this class.
|
|
167
|
+
* @param {LogTypes} logType A group can implictly of any log type, by default it is of type
|
|
168
|
+
* info but this parameter allows the user to override this.
|
|
169
|
+
* @returns {void}
|
|
170
|
+
*/
|
|
171
|
+
groupCollapsed({
|
|
172
|
+
title: o,
|
|
173
|
+
contextOverride: r = void 0,
|
|
174
|
+
logType: e = "info"
|
|
175
|
+
/* Info */
|
|
176
|
+
}) {
|
|
177
|
+
if (!this._isLogTypeAllowedInCurrentMode(e))
|
|
178
|
+
return;
|
|
179
|
+
const n = r || this.context;
|
|
180
|
+
console.groupCollapsed(`%c ${n} GROUP`, o);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Similar to the console.groupEnd(). Useful for ending either a group or
|
|
184
|
+
* groupCollapse that was initialised by this logger.
|
|
185
|
+
*
|
|
186
|
+
* @returns {void}
|
|
187
|
+
*/
|
|
188
|
+
groupEnd() {
|
|
189
|
+
this._isLogTypeAllowedInCurrentMode(
|
|
190
|
+
"info"
|
|
191
|
+
/* Info */
|
|
192
|
+
) && (console.log("----------------------------------"), console.groupEnd());
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
export {
|
|
196
|
+
a as EpigraphLogger,
|
|
197
|
+
c as LogTypes,
|
|
198
|
+
t as LoggerModeNames
|
|
73
199
|
};
|
|
74
|
-
//#endregion
|
|
75
|
-
export { n as EpigraphLogger, t as LogTypes, e as LoggerModeNames };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../../enums-1vqWxJ0i.cjs"),c=require("../EpigraphResultFactory/epigraphResultFactory.cjs");class ${constructor(i=h.NexusEndpoints.PRODUCTION,t,e,r="",s="",a="v1/"){this.epigraphXPath="",this.epigraphComponentVersion=r,this.epigraphSessionId=e,this.epigraphXPath=s,this.baseUrl=i+a,this.epgLocation=t}async getButtonBySku(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/sku/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getButtonByShopifyVariantId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/shopify_variant_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getButtonByUpc(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/upc/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getButtonByAsin(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/asin/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getButtonByUuid(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/uuid/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerBySku(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/sku/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerByShopifyVariantId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/shopify_variant_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerByUpc(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/upc/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerByAsin(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/asin/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerByUuid(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/uuid/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourBySku(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/sku/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourByShopifyVariantId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/shopify_variant_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourByUpc(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/upc/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourByAsin(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/asin/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourByUuid(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/uuid/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerBySku(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/sku/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerByShopifyVariantId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/shopify_variant_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerByUpc(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/upc/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerByAsin(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/asin/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerByUuid(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/uuid/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getConfiguratorByExperienceId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/configurator/experience_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getConfiguratorByClientAccessKey(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/configurator/client_access_key/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getConfiguratorLiteByExperienceId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/configurator-lite/experience_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getConfiguratorLiteByProjectId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/configurator-lite/project_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async postExperienceSaveAndShare(i,t){const e=`experience/${i}/save`,r=this.buildNexusUrl(e),s={save_data:JSON.stringify(t)},a=new Headers;return a.set("Content-Type","application/json"),await this.callNexusAPI(r,"POST",JSON.stringify(s),a)}async getExperienceSaveAndShare(i,t){const e=`experience/${i}/save/${t}`,r=this.buildNexusUrl(e);return await this.callNexusAPI(r,"GET")}async callNexusAPI(i,t="GET",e,r=new Headers){r=this.addRequiredHeaders(r);const s={method:t,body:e,headers:r};try{const a=await fetch(i,s),u=await a.json();if(!a.ok){let o="Unable to retrieve configurator experience";return u.message&&(o=u.message),Promise.resolve(c.failureResult(u,a.status,o))}return Promise.resolve(c.successResult(u,a.status))}catch{return Promise.resolve(c.failureResult({},500,"Unknown error"))}}buildNexusUrl(i,t={}){let e=new URL(this.baseUrl);e.pathname+=i;for(const[r,s]of Object.entries(t))e.searchParams.set(r,s);return e}addRequiredHeaders(i){return i.has("accept")||i.set("accept","application/json"),i.has("EPG-Location")||i.set("EPG-location",this.epgLocation),i.has("EPG-Session-ID")||i.set("EPG-Session-ID",this.epigraphSessionId),i.has("EPG-XPATH")||i.set("EPG-XPATH",this.epigraphXPath),i.has("EPG-Version")||i.set("EPG-Version",this.epigraphComponentVersion),i}}var l=(n=>(n.CLIENT_ACCESS_KEY="client_access_key",n.EXPERIENCE_ID="experience_id",n.PROJECT_ID="project_id",n.SKU="sku",n.SHOPIFY_VARIANT_ID="shopify_variant_id",n.UPC="upc",n.ASIN="asin",n.UUID="uuid",n))(l||{}),p=(n=>(n.BUTTON="experience/button",n.VIEWER="experience/viewer",n.TOUR="experience/tour",n.CUSTOMIZER="experience/customizer",n.CONFIGURATOR="experience/configurator",n.CONFIGURATOR_LITE="experience/configurator-lite",n.EXPERIENCE="experience",n.SAVE="save",n))(p||{}),y=(n=>(n.V1="v1/",n))(y||{}),x=(n=>(n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n))(x||{});exports.EpigraphNexusAPI=$;exports.HTTPMethod=x;exports.NexusAPIResourceIdentifier=l;exports.NexusAPIRoutes=p;exports.NexusAPIVersions=y;
|