@epigraph/epigraph-std-lib 5.0.0-alpha.11 → 5.0.0-alpha.13
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/epigraph.cjs +1 -1
- package/dist/Epigraph/epigraph.js +94 -126
- package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
- package/dist/Epigraph/epigraphBaseSolutions.js +60 -68
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +1 -16
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +2 -946
- package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.js +74 -198
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +197 -425
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +1 -7
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +2 -78
- package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js +24 -26
- package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +2 -88
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js +44 -75
- package/dist/enums-BSSe4NAs.js +8 -0
- package/dist/enums-PfFMiIoe.cjs +1 -0
- package/dist/epigraph-std-lib.cjs +1 -1
- package/dist/epigraph-std-lib.d.ts +1 -0
- package/dist/epigraph-std-lib.js +11 -72
- package/dist/epigraphAnalytics-CF9Czp8C.js +722 -0
- package/dist/epigraphAnalytics-H3EZRDUh.cjs +1 -0
- package/dist/epigraphQrCodeGenerator-BXUNL2XK.js +54 -0
- package/dist/epigraphQrCodeGenerator-F2eLrPC_.cjs +7 -0
- package/dist/epigraphUnitsConverter-CwpmWl7p.cjs +1 -0
- package/dist/epigraphUnitsConverter-DsX4Rmsp.js +66 -0
- package/dist/lit--5TUYSGn.js +508 -0
- package/dist/lit-DZtv4Pds.cjs +2 -0
- package/package.json +6 -7
- package/dist/enums-1vqWxJ0i.cjs +0 -1
- package/dist/enums-CvOTKyNu.js +0 -5
- package/dist/lit-element-C3moVMGu.js +0 -524
- package/dist/lit-element-CYaaFRfk.cjs +0 -19
|
@@ -1,425 +1,197 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { failureResult as
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
t !== "" && (e.version_id = t);
|
|
199
|
-
const r = `experience/tour/asin/${i}`, s = this.buildNexusUrl(
|
|
200
|
-
r,
|
|
201
|
-
e
|
|
202
|
-
);
|
|
203
|
-
return await this.callNexusAPI(
|
|
204
|
-
s,
|
|
205
|
-
"GET"
|
|
206
|
-
/* GET */
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
async getTourByUuid(i, t = "") {
|
|
210
|
-
const e = {};
|
|
211
|
-
t !== "" && (e.version_id = t);
|
|
212
|
-
const r = `experience/tour/uuid/${i}`, s = this.buildNexusUrl(
|
|
213
|
-
r,
|
|
214
|
-
e
|
|
215
|
-
);
|
|
216
|
-
return await this.callNexusAPI(
|
|
217
|
-
s,
|
|
218
|
-
"GET"
|
|
219
|
-
/* GET */
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
/*******************************************************************************************************************
|
|
223
|
-
* Epigraph Customizer API Calls *
|
|
224
|
-
******************************************************************************************************************/
|
|
225
|
-
async getCustomizerBySku(i, t = "") {
|
|
226
|
-
const e = {};
|
|
227
|
-
t !== "" && (e.version_id = t);
|
|
228
|
-
const r = `experience/customizer/sku/${i}`, s = this.buildNexusUrl(
|
|
229
|
-
r,
|
|
230
|
-
e
|
|
231
|
-
);
|
|
232
|
-
return await this.callNexusAPI(
|
|
233
|
-
s,
|
|
234
|
-
"GET"
|
|
235
|
-
/* GET */
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
async getCustomizerByShopifyVariantId(i, t = "") {
|
|
239
|
-
const e = {};
|
|
240
|
-
t !== "" && (e.version_id = t);
|
|
241
|
-
const r = `experience/customizer/shopify_variant_id/${i}`, s = this.buildNexusUrl(
|
|
242
|
-
r,
|
|
243
|
-
e
|
|
244
|
-
);
|
|
245
|
-
return await this.callNexusAPI(
|
|
246
|
-
s,
|
|
247
|
-
"GET"
|
|
248
|
-
/* GET */
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
async getCustomizerByUpc(i, t = "") {
|
|
252
|
-
const e = {};
|
|
253
|
-
t !== "" && (e.version_id = t);
|
|
254
|
-
const r = `experience/customizer/upc/${i}`, s = this.buildNexusUrl(
|
|
255
|
-
r,
|
|
256
|
-
e
|
|
257
|
-
);
|
|
258
|
-
return await this.callNexusAPI(
|
|
259
|
-
s,
|
|
260
|
-
"GET"
|
|
261
|
-
/* GET */
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
async getCustomizerByAsin(i, t = "") {
|
|
265
|
-
const e = {};
|
|
266
|
-
t !== "" && (e.version_id = t);
|
|
267
|
-
const r = `experience/customizer/asin/${i}`, s = this.buildNexusUrl(
|
|
268
|
-
r,
|
|
269
|
-
e
|
|
270
|
-
);
|
|
271
|
-
return await this.callNexusAPI(
|
|
272
|
-
s,
|
|
273
|
-
"GET"
|
|
274
|
-
/* GET */
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
async getCustomizerByUuid(i, t = "") {
|
|
278
|
-
const e = {};
|
|
279
|
-
t !== "" && (e.version_id = t);
|
|
280
|
-
const r = `experience/customizer/uuid/${i}`, s = this.buildNexusUrl(
|
|
281
|
-
r,
|
|
282
|
-
e
|
|
283
|
-
);
|
|
284
|
-
return await this.callNexusAPI(
|
|
285
|
-
s,
|
|
286
|
-
"GET"
|
|
287
|
-
/* GET */
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
/*******************************************************************************************************************
|
|
291
|
-
* Configurator API Calls *
|
|
292
|
-
******************************************************************************************************************/
|
|
293
|
-
async getConfiguratorByExperienceId(i, t = "") {
|
|
294
|
-
const e = {};
|
|
295
|
-
t !== "" && (e.version_id = t);
|
|
296
|
-
const r = `experience/configurator/experience_id/${i}`, s = this.buildNexusUrl(
|
|
297
|
-
r,
|
|
298
|
-
e
|
|
299
|
-
);
|
|
300
|
-
return await this.callNexusAPI(
|
|
301
|
-
s,
|
|
302
|
-
"GET"
|
|
303
|
-
/* GET */
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
async getConfiguratorByClientAccessKey(i, t = "") {
|
|
307
|
-
const e = {};
|
|
308
|
-
t !== "" && (e.version_id = t);
|
|
309
|
-
const r = `experience/configurator/client_access_key/${i}`, s = this.buildNexusUrl(
|
|
310
|
-
r,
|
|
311
|
-
e
|
|
312
|
-
);
|
|
313
|
-
return await this.callNexusAPI(
|
|
314
|
-
s,
|
|
315
|
-
"GET"
|
|
316
|
-
/* GET */
|
|
317
|
-
);
|
|
318
|
-
}
|
|
319
|
-
/*******************************************************************************************************************
|
|
320
|
-
* ConfiguratorLite API Calls *
|
|
321
|
-
******************************************************************************************************************/
|
|
322
|
-
async getConfiguratorLiteByExperienceId(i, t = "") {
|
|
323
|
-
const e = {};
|
|
324
|
-
t !== "" && (e.version_id = t);
|
|
325
|
-
const r = `experience/configurator-lite/experience_id/${i}`, s = this.buildNexusUrl(
|
|
326
|
-
r,
|
|
327
|
-
e
|
|
328
|
-
);
|
|
329
|
-
return await this.callNexusAPI(
|
|
330
|
-
s,
|
|
331
|
-
"GET"
|
|
332
|
-
/* GET */
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
|
-
async getConfiguratorLiteByProjectId(i, t = "") {
|
|
336
|
-
const e = {};
|
|
337
|
-
t !== "" && (e.version_id = t);
|
|
338
|
-
const r = `experience/configurator-lite/project_id/${i}`, s = this.buildNexusUrl(
|
|
339
|
-
r,
|
|
340
|
-
e
|
|
341
|
-
);
|
|
342
|
-
return await this.callNexusAPI(
|
|
343
|
-
s,
|
|
344
|
-
"GET"
|
|
345
|
-
/* GET */
|
|
346
|
-
);
|
|
347
|
-
}
|
|
348
|
-
/*******************************************************************************************************************
|
|
349
|
-
* Save & Share Calls *
|
|
350
|
-
******************************************************************************************************************/
|
|
351
|
-
async postExperienceSaveAndShare(i, t) {
|
|
352
|
-
const e = `experience/${i}/save`, r = this.buildNexusUrl(
|
|
353
|
-
e
|
|
354
|
-
), s = {
|
|
355
|
-
save_data: JSON.stringify(t)
|
|
356
|
-
}, a = new Headers();
|
|
357
|
-
return a.set("Content-Type", "application/json"), await this.callNexusAPI(r, "POST", JSON.stringify(s), a);
|
|
358
|
-
}
|
|
359
|
-
async getExperienceSaveAndShare(i, t) {
|
|
360
|
-
const e = `experience/${i}/save/${t}`, r = this.buildNexusUrl(
|
|
361
|
-
e
|
|
362
|
-
);
|
|
363
|
-
return await this.callNexusAPI(
|
|
364
|
-
r,
|
|
365
|
-
"GET"
|
|
366
|
-
/* GET */
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Makes a call to the Nexus API and ensures the response is returned in JSON format.
|
|
371
|
-
* Automatically appends the `application/json` accept header if not already provided.
|
|
372
|
-
*
|
|
373
|
-
* @param {URL} url - The URL of the Nexus API endpoint to call.
|
|
374
|
-
* @param method
|
|
375
|
-
* @param body
|
|
376
|
-
* @param headers
|
|
377
|
-
* @return {Promise<Result>} A promise that resolves with the API response, encapsulated in a success or failure result format.
|
|
378
|
-
*/
|
|
379
|
-
async callNexusAPI(i, t = "GET", e, r = new Headers()) {
|
|
380
|
-
r = this.addRequiredHeaders(r);
|
|
381
|
-
const s = {
|
|
382
|
-
method: t,
|
|
383
|
-
body: e,
|
|
384
|
-
headers: r
|
|
385
|
-
};
|
|
386
|
-
try {
|
|
387
|
-
const a = await fetch(i, s), u = await a.json();
|
|
388
|
-
if (!a.ok) {
|
|
389
|
-
let c = "Unable to retrieve configurator experience";
|
|
390
|
-
return u.message && (c = u.message), Promise.resolve(
|
|
391
|
-
o(u, a.status, c)
|
|
392
|
-
);
|
|
393
|
-
}
|
|
394
|
-
return Promise.resolve(p(u, a.status));
|
|
395
|
-
} catch {
|
|
396
|
-
return Promise.resolve(o({}, 500, "Unknown error"));
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
buildNexusUrl(i, t = {}) {
|
|
400
|
-
let e = new URL(this.baseUrl);
|
|
401
|
-
e.pathname += i;
|
|
402
|
-
for (const [r, s] of Object.entries(t))
|
|
403
|
-
e.searchParams.set(r, s);
|
|
404
|
-
return e;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Adds required headers to the provided headers object if they are not already present.
|
|
408
|
-
* Ensures that the headers include "accept", "EPG-Location", "EPG-Session-ID",
|
|
409
|
-
* and "EPG-XPATH" with their respective values.
|
|
410
|
-
*
|
|
411
|
-
* @param {Headers} headers - The headers object to which the required headers will be added.
|
|
412
|
-
* @return {Headers} The updated headers object containing all required headers.
|
|
413
|
-
*/
|
|
414
|
-
addRequiredHeaders(i) {
|
|
415
|
-
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;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
var 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 || {}), x = /* @__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))(x || {}), h = /* @__PURE__ */ ((n) => (n.V1 = "v1/", n))(h || {}), $ = /* @__PURE__ */ ((n) => (n.GET = "GET", n.POST = "POST", n.PUT = "PUT", n.DELETE = "DELETE", n))($ || {});
|
|
419
|
-
export {
|
|
420
|
-
P as EpigraphNexusAPI,
|
|
421
|
-
$ as HTTPMethod,
|
|
422
|
-
y as NexusAPIResourceIdentifier,
|
|
423
|
-
x as NexusAPIRoutes,
|
|
424
|
-
h as NexusAPIVersions
|
|
425
|
-
};
|
|
1
|
+
import { n as e } from "../../enums-BSSe4NAs.js";
|
|
2
|
+
import { failureResult as t, successResult as n } from "../EpigraphResultFactory/epigraphResultFactory.js";
|
|
3
|
+
//#region lib/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.ts
|
|
4
|
+
var r = class {
|
|
5
|
+
constructor(t = e.PRODUCTION, n, r, i = "", a = "", o = "v1/") {
|
|
6
|
+
this.epigraphXPath = "", this.epigraphComponentVersion = i, this.epigraphSessionId = r, this.epigraphXPath = a, this.baseUrl = t + o, this.epgLocation = n;
|
|
7
|
+
}
|
|
8
|
+
async getButtonBySku(e, t = "") {
|
|
9
|
+
let n = {};
|
|
10
|
+
t !== "" && (n.version_id = t);
|
|
11
|
+
let r = `experience/button/sku/${e}`, i = this.buildNexusUrl(r, n);
|
|
12
|
+
return await this.callNexusAPI(i, "GET");
|
|
13
|
+
}
|
|
14
|
+
async getButtonByShopifyVariantId(e, t = "") {
|
|
15
|
+
let n = {};
|
|
16
|
+
t !== "" && (n.version_id = t);
|
|
17
|
+
let r = `experience/button/shopify_variant_id/${e}`, i = this.buildNexusUrl(r, n);
|
|
18
|
+
return await this.callNexusAPI(i, "GET");
|
|
19
|
+
}
|
|
20
|
+
async getButtonByUpc(e, t = "") {
|
|
21
|
+
let n = {};
|
|
22
|
+
t !== "" && (n.version_id = t);
|
|
23
|
+
let r = `experience/button/upc/${e}`, i = this.buildNexusUrl(r, n);
|
|
24
|
+
return await this.callNexusAPI(i, "GET");
|
|
25
|
+
}
|
|
26
|
+
async getButtonByAsin(e, t = "") {
|
|
27
|
+
let n = {};
|
|
28
|
+
t !== "" && (n.version_id = t);
|
|
29
|
+
let r = `experience/button/asin/${e}`, i = this.buildNexusUrl(r, n);
|
|
30
|
+
return await this.callNexusAPI(i, "GET");
|
|
31
|
+
}
|
|
32
|
+
async getButtonByUuid(e, t = "") {
|
|
33
|
+
let n = {};
|
|
34
|
+
t !== "" && (n.version_id = t);
|
|
35
|
+
let r = `experience/button/uuid/${e}`, i = this.buildNexusUrl(r, n);
|
|
36
|
+
return await this.callNexusAPI(i, "GET");
|
|
37
|
+
}
|
|
38
|
+
async getViewerBySku(e, t = "") {
|
|
39
|
+
let n = {};
|
|
40
|
+
t !== "" && (n.version_id = t);
|
|
41
|
+
let r = `experience/viewer/sku/${e}`, i = this.buildNexusUrl(r, n);
|
|
42
|
+
return await this.callNexusAPI(i, "GET");
|
|
43
|
+
}
|
|
44
|
+
async getViewerByShopifyVariantId(e, t = "") {
|
|
45
|
+
let n = {};
|
|
46
|
+
t !== "" && (n.version_id = t);
|
|
47
|
+
let r = `experience/viewer/shopify_variant_id/${e}`, i = this.buildNexusUrl(r, n);
|
|
48
|
+
return await this.callNexusAPI(i, "GET");
|
|
49
|
+
}
|
|
50
|
+
async getViewerByUpc(e, t = "") {
|
|
51
|
+
let n = {};
|
|
52
|
+
t !== "" && (n.version_id = t);
|
|
53
|
+
let r = `experience/viewer/upc/${e}`, i = this.buildNexusUrl(r, n);
|
|
54
|
+
return await this.callNexusAPI(i, "GET");
|
|
55
|
+
}
|
|
56
|
+
async getViewerByAsin(e, t = "") {
|
|
57
|
+
let n = {};
|
|
58
|
+
t !== "" && (n.version_id = t);
|
|
59
|
+
let r = `experience/viewer/asin/${e}`, i = this.buildNexusUrl(r, n);
|
|
60
|
+
return await this.callNexusAPI(i, "GET");
|
|
61
|
+
}
|
|
62
|
+
async getViewerByUuid(e, t = "") {
|
|
63
|
+
let n = {};
|
|
64
|
+
t !== "" && (n.version_id = t);
|
|
65
|
+
let r = `experience/viewer/uuid/${e}`, i = this.buildNexusUrl(r, n);
|
|
66
|
+
return await this.callNexusAPI(i, "GET");
|
|
67
|
+
}
|
|
68
|
+
async getTourBySku(e, t = "") {
|
|
69
|
+
let n = {};
|
|
70
|
+
t !== "" && (n.version_id = t);
|
|
71
|
+
let r = `experience/tour/sku/${e}`, i = this.buildNexusUrl(r, n);
|
|
72
|
+
return await this.callNexusAPI(i, "GET");
|
|
73
|
+
}
|
|
74
|
+
async getTourByShopifyVariantId(e, t = "") {
|
|
75
|
+
let n = {};
|
|
76
|
+
t !== "" && (n.version_id = t);
|
|
77
|
+
let r = `experience/tour/shopify_variant_id/${e}`, i = this.buildNexusUrl(r, n);
|
|
78
|
+
return await this.callNexusAPI(i, "GET");
|
|
79
|
+
}
|
|
80
|
+
async getTourByUpc(e, t = "") {
|
|
81
|
+
let n = {};
|
|
82
|
+
t !== "" && (n.version_id = t);
|
|
83
|
+
let r = `experience/tour/upc/${e}`, i = this.buildNexusUrl(r, n);
|
|
84
|
+
return await this.callNexusAPI(i, "GET");
|
|
85
|
+
}
|
|
86
|
+
async getTourByAsin(e, t = "") {
|
|
87
|
+
let n = {};
|
|
88
|
+
t !== "" && (n.version_id = t);
|
|
89
|
+
let r = `experience/tour/asin/${e}`, i = this.buildNexusUrl(r, n);
|
|
90
|
+
return await this.callNexusAPI(i, "GET");
|
|
91
|
+
}
|
|
92
|
+
async getTourByUuid(e, t = "") {
|
|
93
|
+
let n = {};
|
|
94
|
+
t !== "" && (n.version_id = t);
|
|
95
|
+
let r = `experience/tour/uuid/${e}`, i = this.buildNexusUrl(r, n);
|
|
96
|
+
return await this.callNexusAPI(i, "GET");
|
|
97
|
+
}
|
|
98
|
+
async getCustomizerBySku(e, t = "") {
|
|
99
|
+
let n = {};
|
|
100
|
+
t !== "" && (n.version_id = t);
|
|
101
|
+
let r = `experience/customizer/sku/${e}`, i = this.buildNexusUrl(r, n);
|
|
102
|
+
return await this.callNexusAPI(i, "GET");
|
|
103
|
+
}
|
|
104
|
+
async getCustomizerByShopifyVariantId(e, t = "") {
|
|
105
|
+
let n = {};
|
|
106
|
+
t !== "" && (n.version_id = t);
|
|
107
|
+
let r = `experience/customizer/shopify_variant_id/${e}`, i = this.buildNexusUrl(r, n);
|
|
108
|
+
return await this.callNexusAPI(i, "GET");
|
|
109
|
+
}
|
|
110
|
+
async getCustomizerByUpc(e, t = "") {
|
|
111
|
+
let n = {};
|
|
112
|
+
t !== "" && (n.version_id = t);
|
|
113
|
+
let r = `experience/customizer/upc/${e}`, i = this.buildNexusUrl(r, n);
|
|
114
|
+
return await this.callNexusAPI(i, "GET");
|
|
115
|
+
}
|
|
116
|
+
async getCustomizerByAsin(e, t = "") {
|
|
117
|
+
let n = {};
|
|
118
|
+
t !== "" && (n.version_id = t);
|
|
119
|
+
let r = `experience/customizer/asin/${e}`, i = this.buildNexusUrl(r, n);
|
|
120
|
+
return await this.callNexusAPI(i, "GET");
|
|
121
|
+
}
|
|
122
|
+
async getCustomizerByUuid(e, t = "") {
|
|
123
|
+
let n = {};
|
|
124
|
+
t !== "" && (n.version_id = t);
|
|
125
|
+
let r = `experience/customizer/uuid/${e}`, i = this.buildNexusUrl(r, n);
|
|
126
|
+
return await this.callNexusAPI(i, "GET");
|
|
127
|
+
}
|
|
128
|
+
async getConfiguratorByExperienceId(e, t = "") {
|
|
129
|
+
let n = {};
|
|
130
|
+
t !== "" && (n.version_id = t);
|
|
131
|
+
let r = `experience/configurator/experience_id/${e}`, i = this.buildNexusUrl(r, n);
|
|
132
|
+
return await this.callNexusAPI(i, "GET");
|
|
133
|
+
}
|
|
134
|
+
async getConfiguratorByClientAccessKey(e, t = "") {
|
|
135
|
+
let n = {};
|
|
136
|
+
t !== "" && (n.version_id = t);
|
|
137
|
+
let r = `experience/configurator/client_access_key/${e}`, i = this.buildNexusUrl(r, n);
|
|
138
|
+
return await this.callNexusAPI(i, "GET");
|
|
139
|
+
}
|
|
140
|
+
async getConfiguratorLiteByExperienceId(e, t = "") {
|
|
141
|
+
let n = {};
|
|
142
|
+
t !== "" && (n.version_id = t);
|
|
143
|
+
let r = `experience/configurator-lite/experience_id/${e}`, i = this.buildNexusUrl(r, n);
|
|
144
|
+
return await this.callNexusAPI(i, "GET");
|
|
145
|
+
}
|
|
146
|
+
async getConfiguratorLiteByProjectId(e, t = "") {
|
|
147
|
+
let n = {};
|
|
148
|
+
t !== "" && (n.version_id = t);
|
|
149
|
+
let r = `experience/configurator-lite/project_id/${e}`, i = this.buildNexusUrl(r, n);
|
|
150
|
+
return await this.callNexusAPI(i, "GET");
|
|
151
|
+
}
|
|
152
|
+
async postExperienceSaveAndShare(e, t) {
|
|
153
|
+
let n = `experience/${e}/save`, r = this.buildNexusUrl(n), i = { save_data: JSON.stringify(t) }, a = new Headers();
|
|
154
|
+
return a.set("Content-Type", "application/json"), await this.callNexusAPI(r, "POST", JSON.stringify(i), a);
|
|
155
|
+
}
|
|
156
|
+
async getExperienceSaveAndShare(e, t) {
|
|
157
|
+
let n = `experience/${e}/save/${t}`, r = this.buildNexusUrl(n);
|
|
158
|
+
return await this.callNexusAPI(r, "GET");
|
|
159
|
+
}
|
|
160
|
+
async callNexusAPI(e, r = "GET", i, a = new Headers()) {
|
|
161
|
+
a = this.addRequiredHeaders(a);
|
|
162
|
+
let o = {
|
|
163
|
+
method: r,
|
|
164
|
+
body: i,
|
|
165
|
+
headers: a
|
|
166
|
+
};
|
|
167
|
+
try {
|
|
168
|
+
let r = await fetch(e, o), i = await r.json();
|
|
169
|
+
if (!r.ok) {
|
|
170
|
+
let e = "Unable to retrieve configurator experience";
|
|
171
|
+
return i.message && (e = i.message), Promise.resolve(t(i, r.status, e));
|
|
172
|
+
}
|
|
173
|
+
return Promise.resolve(n(i, r.status));
|
|
174
|
+
} catch {
|
|
175
|
+
return Promise.resolve(t({}, 500, "Unknown error"));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
buildNexusUrl(e, t = {}) {
|
|
179
|
+
let n = new URL(this.baseUrl);
|
|
180
|
+
n.pathname += e;
|
|
181
|
+
for (let [e, r] of Object.entries(t)) n.searchParams.set(e, r);
|
|
182
|
+
return n;
|
|
183
|
+
}
|
|
184
|
+
addRequiredHeaders(e) {
|
|
185
|
+
return e.has("accept") || e.set("accept", "application/json"), e.has("EPG-Location") || e.set("EPG-location", this.epgLocation), e.has("EPG-Session-ID") || e.set("EPG-Session-ID", this.epigraphSessionId), e.has("EPG-XPATH") || e.set("EPG-XPATH", this.epigraphXPath), e.has("EPG-Version") || e.set("EPG-Version", this.epigraphComponentVersion), e;
|
|
186
|
+
}
|
|
187
|
+
}, i = /* @__PURE__ */ function(e) {
|
|
188
|
+
return e.CLIENT_ACCESS_KEY = "client_access_key", e.EXPERIENCE_ID = "experience_id", e.PROJECT_ID = "project_id", e.SKU = "sku", e.SHOPIFY_VARIANT_ID = "shopify_variant_id", e.UPC = "upc", e.ASIN = "asin", e.UUID = "uuid", e;
|
|
189
|
+
}({}), a = /* @__PURE__ */ function(e) {
|
|
190
|
+
return e.BUTTON = "experience/button", e.VIEWER = "experience/viewer", e.TOUR = "experience/tour", e.CUSTOMIZER = "experience/customizer", e.CONFIGURATOR = "experience/configurator", e.CONFIGURATOR_LITE = "experience/configurator-lite", e.EXPERIENCE = "experience", e.SAVE = "save", e;
|
|
191
|
+
}({}), o = /* @__PURE__ */ function(e) {
|
|
192
|
+
return e.V1 = "v1/", e;
|
|
193
|
+
}({}), s = /* @__PURE__ */ function(e) {
|
|
194
|
+
return e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.DELETE = "DELETE", e;
|
|
195
|
+
}({});
|
|
196
|
+
//#endregion
|
|
197
|
+
export { r as EpigraphNexusAPI, s as HTTPMethod, i as NexusAPIResourceIdentifier, a as NexusAPIRoutes, o as NexusAPIVersions };
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
:host {
|
|
3
|
-
display: none;
|
|
4
|
-
}
|
|
5
|
-
`}get qrCodeGenCanvasRef(){return this._qrCodeGenCanvasRef}dataUritoBlob(t){const e=t.split(",");if(e.length!==2)throw new Error("Invalid data URI format");const o=e[0].split(":")[1].split(";")[0],r=atob(e[1]),n=new Uint8Array(Array.from(r,s=>s.charCodeAt(0)));return new Blob([n],{type:o})}generateQrCode(t={text:"www.epigraph.us",radius:.5,ecLevel:"H",fill:"black",background:null,size:256}){if(!this._qrCodeGenCanvasRef)return"";c.render(t,this._qrCodeGenCanvasRef);const e=this._qrCodeGenCanvasRef.toDataURL(),o=this.dataUritoBlob(e);return URL.createObjectURL(o)}render(){return d.x`
|
|
6
|
-
<canvas id="qrCodeCanvas"></canvas>
|
|
7
|
-
`}}p([l.query("#qrCodeCanvas")],a.prototype,"_qrCodeGenCanvasRef");window.customElements.get(a.webComponentName)===void 0&&window.customElements.define(a.webComponentName,a);exports.EpigraphQrCodeGenerator=a;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../epigraphQrCodeGenerator-F2eLrPC_.cjs");exports.EpigraphQrCodeGenerator=e.t;
|