@epigraph/epigraph-std-lib 5.0.0-alpha.6 → 5.0.0-alpha.8
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/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
- package/dist/Epigraph/epigraphBaseSolutions.d.ts +5 -5
- package/dist/Epigraph/epigraphBaseSolutions.js +4 -4
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.d.ts +13 -1
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +117 -10
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../lit-element-CYaaFRfk.cjs"),e=require("./epigraph.cjs");class s extends HTMLElement{constructor(t,i){super(),this._isReady=!1,this._elementName="epigraph-base-solution-html",this._solutionVersion="",this._loggerContextOverride="[EPIGRAPH BASE SOLUTION]",this.attachShadow({mode:"open"}),this.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../lit-element-CYaaFRfk.cjs"),e=require("./epigraph.cjs");class s extends HTMLElement{constructor(t,i){super(),this._isReady=!1,this._elementName="epigraph-base-solution-html",this._solutionVersion="",this._loggerContextOverride="[EPIGRAPH BASE SOLUTION]",this.attachShadow({mode:"open"}),this.__environment=i,this._solutionVersion=t,this.__xPath=e.Epigraph.generateXPath(this),this.__uuid=e.Epigraph.safeGenerateUuid()??this.__xPath,new e.Epigraph(this),window.epigraph.logger.info({title:"Epigraph Base Solution Ready",contextOverride:this._loggerContextOverride})}get isReady(){return this._isReady}get environment(){return this.__environment}get elementName(){return this._elementName}get solutionVersion(){return this._solutionVersion}get uuid(){return this.__uuid}get xPath(){return this.__xPath}disconnectedCallback(){window.epigraph.deregisterActiveComponent(this)}}class o extends r.i{constructor(t,i){super(),this._isReady=!1,this._elementName="epigraph-base-solution-lit",this._solutionVersion="",this._loggerContextOverride="[EPIGRAPH BASE SOLUTION]",this._environment=i,this._solutionVersion=t,this._xPath=e.Epigraph.generateXPath(this),this._uuid=e.Epigraph.safeGenerateUuid()??this._xPath,new e.Epigraph(this),this._isReady=!0,window.epigraph.logger.info({title:"Epigraph Base Solution Ready",contextOverride:this._loggerContextOverride})}get isReady(){return this._isReady}get environment(){return this._environment}get elementName(){return this._elementName}get solutionVersion(){return this._solutionVersion}get uuid(){return this._uuid}get xPath(){return this._xPath}disconnectedCallback(){window.epigraph.deregisterActiveComponent(this)}}exports.EpigraphBaseSolutionHtmlElement=s;exports.EpigraphBaseSolutionLitElement=o;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { ENVIRONMENT_TYPE } from './constants/enums';
|
|
3
3
|
export declare class EpigraphBaseSolutionHtmlElement extends HTMLElement {
|
|
4
|
-
private
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
|
|
4
|
+
private __xPath;
|
|
5
|
+
private __uuid;
|
|
6
|
+
private __environment;
|
|
7
|
+
protected _isReady: boolean;
|
|
8
8
|
protected _elementName: string;
|
|
9
9
|
protected _solutionVersion: string;
|
|
10
10
|
protected _loggerContextOverride: string;
|
|
@@ -23,8 +23,8 @@ export declare class EpigraphBaseSolutionHtmlElement extends HTMLElement {
|
|
|
23
23
|
export declare class EpigraphBaseSolutionLitElement extends LitElement {
|
|
24
24
|
private _xPath;
|
|
25
25
|
private _uuid;
|
|
26
|
-
private _isReady;
|
|
27
26
|
private _environment;
|
|
27
|
+
protected _isReady: boolean;
|
|
28
28
|
protected _elementName: string;
|
|
29
29
|
protected _solutionVersion: string;
|
|
30
30
|
protected _loggerContextOverride: string;
|
|
@@ -2,7 +2,7 @@ import { i as s } from "../lit-element-C3moVMGu.js";
|
|
|
2
2
|
import { Epigraph as e } from "./epigraph.js";
|
|
3
3
|
class h extends HTMLElement {
|
|
4
4
|
constructor(t, i) {
|
|
5
|
-
super(), this._isReady = !1, this._elementName = "epigraph-base-solution-html", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this.attachShadow({ mode: "open" }), this.
|
|
5
|
+
super(), this._isReady = !1, this._elementName = "epigraph-base-solution-html", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this.attachShadow({ mode: "open" }), this.__environment = i, this._solutionVersion = t, this.__xPath = e.generateXPath(this), this.__uuid = e.safeGenerateUuid() ?? this.__xPath, new e(this), window.epigraph.logger.info({
|
|
6
6
|
title: "Epigraph Base Solution Ready",
|
|
7
7
|
contextOverride: this._loggerContextOverride
|
|
8
8
|
});
|
|
@@ -11,7 +11,7 @@ class h extends HTMLElement {
|
|
|
11
11
|
return this._isReady;
|
|
12
12
|
}
|
|
13
13
|
get environment() {
|
|
14
|
-
return this.
|
|
14
|
+
return this.__environment;
|
|
15
15
|
}
|
|
16
16
|
get elementName() {
|
|
17
17
|
return this._elementName;
|
|
@@ -23,10 +23,10 @@ class h extends HTMLElement {
|
|
|
23
23
|
return this._solutionVersion;
|
|
24
24
|
}
|
|
25
25
|
get uuid() {
|
|
26
|
-
return this.
|
|
26
|
+
return this.__uuid;
|
|
27
27
|
}
|
|
28
28
|
get xPath() {
|
|
29
|
-
return this.
|
|
29
|
+
return this.__xPath;
|
|
30
30
|
}
|
|
31
31
|
disconnectedCallback() {
|
|
32
32
|
window.epigraph.deregisterActiveComponent(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../EpigraphResultFactory/epigraphResultFactory.cjs");class ${constructor(i="https://api.myepigraph.com/api/",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.PRODUCTION="https://api.myepigraph.com/api/",n.STAGING="https://nexus.epigraph.dev/api/",n.LOCAL="https://nexus.test/api/",n))(l||{}),p=(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))(p||{}),y=(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))(y||{}),h=(n=>(n.V1="v1/",n))(h||{}),x=(n=>(n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n))(x||{});exports.EpigraphNexusAPI=$;exports.HTTPMethod=x;exports.NexusAPIResourceIdentifier=p;exports.NexusAPIRoutes=y;exports.NexusAPIVersions=h;exports.NexusEndpoints=l;
|
|
@@ -24,6 +24,7 @@ export declare class EpigraphNexusAPI {
|
|
|
24
24
|
getButtonByShopifyVariantId(shopify_variant_id: string, versionId?: string): Promise<Result>;
|
|
25
25
|
getButtonByUpc(upc: string, versionId?: string): Promise<Result>;
|
|
26
26
|
getButtonByAsin(asin: string, versionId?: string): Promise<Result>;
|
|
27
|
+
getButtonByUuid(uuid: string, versionId?: string): Promise<Result>;
|
|
27
28
|
/*******************************************************************************************************************
|
|
28
29
|
* Epigraph Viewer API Calls *
|
|
29
30
|
******************************************************************************************************************/
|
|
@@ -31,6 +32,7 @@ export declare class EpigraphNexusAPI {
|
|
|
31
32
|
getViewerByShopifyVariantId(shopify_variant_id: string, versionId?: string): Promise<Result>;
|
|
32
33
|
getViewerByUpc(upc: string, versionId?: string): Promise<Result>;
|
|
33
34
|
getViewerByAsin(asin: string, versionId?: string): Promise<Result>;
|
|
35
|
+
getViewerByUuid(uuid: string, versionId?: string): Promise<Result>;
|
|
34
36
|
/*******************************************************************************************************************
|
|
35
37
|
* Epigraph Tour API Calls *
|
|
36
38
|
******************************************************************************************************************/
|
|
@@ -38,6 +40,15 @@ export declare class EpigraphNexusAPI {
|
|
|
38
40
|
getTourByShopifyVariantId(shopify_variant_id: string, versionId?: string): Promise<Result>;
|
|
39
41
|
getTourByUpc(upc: string, versionId?: string): Promise<Result>;
|
|
40
42
|
getTourByAsin(asin: string, versionId?: string): Promise<Result>;
|
|
43
|
+
getTourByUuid(uuid: string, versionId?: string): Promise<Result>;
|
|
44
|
+
/*******************************************************************************************************************
|
|
45
|
+
* Epigraph Customizer API Calls *
|
|
46
|
+
******************************************************************************************************************/
|
|
47
|
+
getCustomizerBySku(sku: string, versionId?: string): Promise<Result>;
|
|
48
|
+
getCustomizerByShopifyVariantId(shopify_variant_id: string, versionId?: string): Promise<Result>;
|
|
49
|
+
getCustomizerByUpc(upc: string, versionId?: string): Promise<Result>;
|
|
50
|
+
getCustomizerByAsin(asin: string, versionId?: string): Promise<Result>;
|
|
51
|
+
getCustomizerByUuid(uuid: string, versionId?: string): Promise<Result>;
|
|
41
52
|
/*******************************************************************************************************************
|
|
42
53
|
* Configurator API Calls *
|
|
43
54
|
******************************************************************************************************************/
|
|
@@ -88,7 +99,8 @@ export declare enum NexusAPIResourceIdentifier {
|
|
|
88
99
|
SKU = "sku",
|
|
89
100
|
SHOPIFY_VARIANT_ID = "shopify_variant_id",
|
|
90
101
|
UPC = "upc",
|
|
91
|
-
ASIN = "asin"
|
|
102
|
+
ASIN = "asin",
|
|
103
|
+
UUID = "uuid"
|
|
92
104
|
}
|
|
93
105
|
export declare enum NexusAPIRoutes {
|
|
94
106
|
BUTTON = "experience/button",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { failureResult as
|
|
1
|
+
import { failureResult as o, successResult as l } from "../EpigraphResultFactory/epigraphResultFactory.js";
|
|
2
2
|
class P {
|
|
3
3
|
/**
|
|
4
4
|
* Constructs a new instance of the class with the provided parameters.
|
|
@@ -69,6 +69,19 @@ class P {
|
|
|
69
69
|
/* GET */
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
+
async getButtonByUuid(i, t = "") {
|
|
73
|
+
const e = {};
|
|
74
|
+
t !== "" && (e.version_id = t);
|
|
75
|
+
const r = `experience/button/uuid/${i}`, s = this.buildNexusUrl(
|
|
76
|
+
r,
|
|
77
|
+
e
|
|
78
|
+
);
|
|
79
|
+
return await this.callNexusAPI(
|
|
80
|
+
s,
|
|
81
|
+
"GET"
|
|
82
|
+
/* GET */
|
|
83
|
+
);
|
|
84
|
+
}
|
|
72
85
|
/*******************************************************************************************************************
|
|
73
86
|
* Epigraph Viewer API Calls *
|
|
74
87
|
******************************************************************************************************************/
|
|
@@ -124,6 +137,19 @@ class P {
|
|
|
124
137
|
/* GET */
|
|
125
138
|
);
|
|
126
139
|
}
|
|
140
|
+
async getViewerByUuid(i, t = "") {
|
|
141
|
+
const e = {};
|
|
142
|
+
t !== "" && (e.version_id = t);
|
|
143
|
+
const r = `experience/viewer/uuid/${i}`, s = this.buildNexusUrl(
|
|
144
|
+
r,
|
|
145
|
+
e
|
|
146
|
+
);
|
|
147
|
+
return await this.callNexusAPI(
|
|
148
|
+
s,
|
|
149
|
+
"GET"
|
|
150
|
+
/* GET */
|
|
151
|
+
);
|
|
152
|
+
}
|
|
127
153
|
/*******************************************************************************************************************
|
|
128
154
|
* Epigraph Tour API Calls *
|
|
129
155
|
******************************************************************************************************************/
|
|
@@ -179,6 +205,87 @@ class P {
|
|
|
179
205
|
/* GET */
|
|
180
206
|
);
|
|
181
207
|
}
|
|
208
|
+
async getTourByUuid(i, t = "") {
|
|
209
|
+
const e = {};
|
|
210
|
+
t !== "" && (e.version_id = t);
|
|
211
|
+
const r = `experience/tour/uuid/${i}`, s = this.buildNexusUrl(
|
|
212
|
+
r,
|
|
213
|
+
e
|
|
214
|
+
);
|
|
215
|
+
return await this.callNexusAPI(
|
|
216
|
+
s,
|
|
217
|
+
"GET"
|
|
218
|
+
/* GET */
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
/*******************************************************************************************************************
|
|
222
|
+
* Epigraph Customizer API Calls *
|
|
223
|
+
******************************************************************************************************************/
|
|
224
|
+
async getCustomizerBySku(i, t = "") {
|
|
225
|
+
const e = {};
|
|
226
|
+
t !== "" && (e.version_id = t);
|
|
227
|
+
const r = `experience/customizer/sku/${i}`, s = this.buildNexusUrl(
|
|
228
|
+
r,
|
|
229
|
+
e
|
|
230
|
+
);
|
|
231
|
+
return await this.callNexusAPI(
|
|
232
|
+
s,
|
|
233
|
+
"GET"
|
|
234
|
+
/* GET */
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
async getCustomizerByShopifyVariantId(i, t = "") {
|
|
238
|
+
const e = {};
|
|
239
|
+
t !== "" && (e.version_id = t);
|
|
240
|
+
const r = `experience/customizer/shopify_variant_id/${i}`, s = this.buildNexusUrl(
|
|
241
|
+
r,
|
|
242
|
+
e
|
|
243
|
+
);
|
|
244
|
+
return await this.callNexusAPI(
|
|
245
|
+
s,
|
|
246
|
+
"GET"
|
|
247
|
+
/* GET */
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
async getCustomizerByUpc(i, t = "") {
|
|
251
|
+
const e = {};
|
|
252
|
+
t !== "" && (e.version_id = t);
|
|
253
|
+
const r = `experience/customizer/upc/${i}`, s = this.buildNexusUrl(
|
|
254
|
+
r,
|
|
255
|
+
e
|
|
256
|
+
);
|
|
257
|
+
return await this.callNexusAPI(
|
|
258
|
+
s,
|
|
259
|
+
"GET"
|
|
260
|
+
/* GET */
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
async getCustomizerByAsin(i, t = "") {
|
|
264
|
+
const e = {};
|
|
265
|
+
t !== "" && (e.version_id = t);
|
|
266
|
+
const r = `experience/customizer/asin/${i}`, s = this.buildNexusUrl(
|
|
267
|
+
r,
|
|
268
|
+
e
|
|
269
|
+
);
|
|
270
|
+
return await this.callNexusAPI(
|
|
271
|
+
s,
|
|
272
|
+
"GET"
|
|
273
|
+
/* GET */
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
async getCustomizerByUuid(i, t = "") {
|
|
277
|
+
const e = {};
|
|
278
|
+
t !== "" && (e.version_id = t);
|
|
279
|
+
const r = `experience/customizer/uuid/${i}`, s = this.buildNexusUrl(
|
|
280
|
+
r,
|
|
281
|
+
e
|
|
282
|
+
);
|
|
283
|
+
return await this.callNexusAPI(
|
|
284
|
+
s,
|
|
285
|
+
"GET"
|
|
286
|
+
/* GET */
|
|
287
|
+
);
|
|
288
|
+
}
|
|
182
289
|
/*******************************************************************************************************************
|
|
183
290
|
* Configurator API Calls *
|
|
184
291
|
******************************************************************************************************************/
|
|
@@ -276,16 +383,16 @@ class P {
|
|
|
276
383
|
headers: r
|
|
277
384
|
};
|
|
278
385
|
try {
|
|
279
|
-
const a = await fetch(i, s),
|
|
386
|
+
const a = await fetch(i, s), u = await a.json();
|
|
280
387
|
if (!a.ok) {
|
|
281
|
-
let
|
|
282
|
-
return
|
|
283
|
-
u
|
|
388
|
+
let c = "Unable to retrieve configurator experience";
|
|
389
|
+
return u.message && (c = u.message), Promise.resolve(
|
|
390
|
+
o(u, a.status, c)
|
|
284
391
|
);
|
|
285
392
|
}
|
|
286
|
-
return Promise.resolve(l(
|
|
393
|
+
return Promise.resolve(l(u, a.status));
|
|
287
394
|
} catch {
|
|
288
|
-
return Promise.resolve(
|
|
395
|
+
return Promise.resolve(o({}, 500, "Unknown error"));
|
|
289
396
|
}
|
|
290
397
|
}
|
|
291
398
|
buildNexusUrl(i, t = {}) {
|
|
@@ -307,12 +414,12 @@ class P {
|
|
|
307
414
|
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;
|
|
308
415
|
}
|
|
309
416
|
}
|
|
310
|
-
var p = /* @__PURE__ */ ((n) => (n.PRODUCTION = "https://api.myepigraph.com/api/", n.STAGING = "https://nexus.epigraph.dev/api/", n.LOCAL = "https://nexus.test/api/", n))(p || {}),
|
|
417
|
+
var p = /* @__PURE__ */ ((n) => (n.PRODUCTION = "https://api.myepigraph.com/api/", n.STAGING = "https://nexus.epigraph.dev/api/", n.LOCAL = "https://nexus.test/api/", n))(p || {}), y = /* @__PURE__ */ ((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))(y || {}), h = /* @__PURE__ */ ((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))(h || {}), x = /* @__PURE__ */ ((n) => (n.V1 = "v1/", n))(x || {}), $ = /* @__PURE__ */ ((n) => (n.GET = "GET", n.POST = "POST", n.PUT = "PUT", n.DELETE = "DELETE", n))($ || {});
|
|
311
418
|
export {
|
|
312
419
|
P as EpigraphNexusAPI,
|
|
313
420
|
$ as HTTPMethod,
|
|
314
|
-
|
|
315
|
-
|
|
421
|
+
y as NexusAPIResourceIdentifier,
|
|
422
|
+
h as NexusAPIRoutes,
|
|
316
423
|
x as NexusAPIVersions,
|
|
317
424
|
p as NexusEndpoints
|
|
318
425
|
};
|