@getmicdrop/venue-calendar 4.3.92 → 4.3.94
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/{AddOnCard-CoZxA8Ss.js → AddOnCard-DCKFn21s.js} +2 -2
- package/dist/{CalendarFoundryView-C_j409DI.js → CalendarFoundryView-CyyPVF96.js} +1 -1
- package/dist/{CartView-Dzje7N6m.js → CartView-CKipFgsW.js} +5 -5
- package/dist/{ChartBlock-BmkCI-vc.js → ChartBlock-BKubDZDP.js} +4 -1
- package/dist/{Checkout-D1De_3qe.js → Checkout-DEdXCYJd.js} +13 -13
- package/dist/{Checkout-BKEQIOYJ.js → Checkout-Dk2RtnG_.js} +7 -7
- package/dist/{CollectionView-KQcIi7Ov.js → CollectionView-B8UPI4kV.js} +3 -3
- package/dist/{Event-uaQkHUne.js → Event-DfLoC6EH.js} +6 -6
- package/dist/{EventPage-wvN2rQ7Z.js → EventPage-BXorHP0g.js} +8 -8
- package/dist/{RecommendationsRail-BUqK-9TQ.js → RecommendationsRail-DeiRJBX-.js} +2 -2
- package/dist/{ScarcityBadge-BKGJzuQn.js → ScarcityBadge-Bo7ILdv5.js} +1 -1
- package/dist/{SeriesPage-yn2TULyn.js → SeriesPage-Dimz6hR9.js} +2 -2
- package/dist/{Success-BiuvQueK.js → Success-Cxh6ocdz.js} +21 -21
- package/dist/{ViewTicketsEmbed-Bbtq90pG.js → ViewTicketsEmbed-CrPWLrcK.js} +3 -3
- package/dist/api/api.cjs +1 -1
- package/dist/api/api.mjs +94 -94
- package/dist/api/client.d.ts +29 -0
- package/dist/{api-c7gIPjjT.js → api-DAK-QNVZ.js} +112 -112
- package/dist/{defaults-Z_lKbqvf.js → defaults-D0DK9-0V.js} +1 -1
- package/dist/{event-transform-DnTfI9EZ.js → event-transform-2AkuKTGX.js} +1 -1
- package/dist/{eventStatusStream-BAx7uYiz.js → eventStatusStream-BpG0SCT-.js} +1 -1
- package/dist/{i18n-D7YN7gkj.js → i18n-Ba_Bqe_Y.js} +2 -2
- package/dist/{i18n-BpINnLyf.js → i18n-CCFiUzoX.js} +1 -1
- package/dist/{orders-2OEBLUMn.js → orders-2lTsorF-.js} +66 -66
- package/dist/{pixels-CZRDw2lY.js → pixels-X0-xsWmp.js} +1 -1
- package/dist/{utils-CttW5Ot0.js → utils-d34-d_aC.js} +59 -59
- package/dist/venue-calendar.es.js +765 -765
- package/dist/venue-calendar.iife.js +26 -26
- package/dist/venue-calendar.umd.js +50 -50
- package/package.json +2 -2
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/de.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/es.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/fr.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/id.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/it.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/ja.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/ko.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/nl.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/pl.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/pt-br.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/tr.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/flow/zh.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/de.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/es.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/fr.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/id.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/it.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/ja.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/ko.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/nl.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/pl.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/pt-br.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/tr.js +0 -0
- /package/dist/locales/{4.3.92 → 4.3.94}/main/zh.js +0 -0
package/dist/api/api.mjs
CHANGED
|
@@ -13,14 +13,14 @@ function oe(e) {
|
|
|
13
13
|
} catch {}
|
|
14
14
|
}
|
|
15
15
|
var se = "ABORTED";
|
|
16
|
-
function
|
|
16
|
+
function x(e, t) {
|
|
17
17
|
let n = t || void 0;
|
|
18
18
|
return n ? {
|
|
19
19
|
...e,
|
|
20
20
|
"X-Widget-Key": n
|
|
21
21
|
} : e;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function ce(e, t) {
|
|
24
24
|
let n = `HTTP ${t}`;
|
|
25
25
|
if (!e || typeof e != "object") return { message: n };
|
|
26
26
|
let r = e, i = r.error && typeof r.error == "object" ? r.error : null, a = typeof r.code == "string" ? r.code : typeof i?.code == "string" ? i.code : void 0;
|
|
@@ -29,42 +29,42 @@ function le(e, t) {
|
|
|
29
29
|
code: a
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var le = class extends Error {
|
|
33
33
|
code;
|
|
34
34
|
statusCode;
|
|
35
35
|
constructor(e, t, n) {
|
|
36
36
|
super(e), this.name = "ApiRequestError", this.code = t, this.statusCode = n;
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, S = {
|
|
39
39
|
baseUrl: "https://get-micdrop.com",
|
|
40
40
|
timeout: 3e4,
|
|
41
41
|
retries: 2,
|
|
42
42
|
retryDelay: 500,
|
|
43
43
|
onError: (e) => b.error("API Error:", e)
|
|
44
44
|
};
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
...
|
|
45
|
+
function ue(e) {
|
|
46
|
+
S = {
|
|
47
|
+
...S,
|
|
48
48
|
...e
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return { ...
|
|
51
|
+
function de() {
|
|
52
|
+
return { ...S };
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return `${
|
|
54
|
+
function C() {
|
|
55
|
+
return `${S.baseUrl}/api/v2/public`;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return `${
|
|
57
|
+
function fe() {
|
|
58
|
+
return `${S.baseUrl}/api/public`;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return `${
|
|
60
|
+
function w() {
|
|
61
|
+
return `${S.baseUrl}/api/orders/v2/public`;
|
|
62
62
|
}
|
|
63
|
-
async function
|
|
63
|
+
async function pe() {
|
|
64
64
|
return "";
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
async function
|
|
66
|
+
var me = (e) => new Promise((t) => setTimeout(t, e));
|
|
67
|
+
async function he(e, t, n) {
|
|
68
68
|
let r = (t.method || "GET").toUpperCase(), i = r === "GET" || r === "HEAD" ? n.retries + 1 : 1, a;
|
|
69
69
|
for (let r = 1; r <= i; r++) {
|
|
70
70
|
let o = new AbortController(), s = setTimeout(() => o.abort(), n.timeout), c = t.signal, l;
|
|
@@ -81,39 +81,39 @@ async function ge(e, t, n) {
|
|
|
81
81
|
} finally {
|
|
82
82
|
clearTimeout(s), c && l && c.removeEventListener("abort", l);
|
|
83
83
|
}
|
|
84
|
-
r < i && await
|
|
84
|
+
r < i && await me(n.retryDelay * 2 ** (r - 1));
|
|
85
85
|
}
|
|
86
86
|
throw a;
|
|
87
87
|
}
|
|
88
|
-
async function
|
|
89
|
-
return
|
|
88
|
+
async function T(e, t) {
|
|
89
|
+
return D("GET", e, void 0, t);
|
|
90
90
|
}
|
|
91
|
-
async function
|
|
92
|
-
return
|
|
91
|
+
async function E(e, t, n) {
|
|
92
|
+
return D("POST", e, t, n);
|
|
93
93
|
}
|
|
94
|
-
async function
|
|
95
|
-
return
|
|
94
|
+
async function ge(e, t, n) {
|
|
95
|
+
return D("PUT", e, t, n);
|
|
96
96
|
}
|
|
97
|
-
async function
|
|
98
|
-
return
|
|
97
|
+
async function _e(e, t) {
|
|
98
|
+
return D("DELETE", e, void 0, t);
|
|
99
99
|
}
|
|
100
|
-
async function
|
|
101
|
-
let i = t.startsWith("http") || t.startsWith("/api/") ? t : `${
|
|
102
|
-
o ||
|
|
100
|
+
async function D(e, t, n, r) {
|
|
101
|
+
let i = t.startsWith("http") || t.startsWith("/api/") ? t : `${C()}${t}`, { widgetKey: a, suppressOnError: o, headers: s, ...c } = r ?? {}, l = (e) => {
|
|
102
|
+
o || S.onError(e);
|
|
103
103
|
};
|
|
104
104
|
try {
|
|
105
|
-
let t = await
|
|
105
|
+
let t = await he(i, {
|
|
106
106
|
method: e,
|
|
107
|
-
headers:
|
|
107
|
+
headers: x({
|
|
108
108
|
"Content-Type": "application/json",
|
|
109
109
|
...s
|
|
110
110
|
}, a),
|
|
111
111
|
body: n === void 0 ? void 0 : JSON.stringify(n),
|
|
112
112
|
...c
|
|
113
|
-
},
|
|
113
|
+
}, S);
|
|
114
114
|
if (!t.ok) {
|
|
115
|
-
let { message: e, code: n } =
|
|
116
|
-
return l(new
|
|
115
|
+
let { message: e, code: n } = ce(await t.json().catch(() => ({})), t.status);
|
|
116
|
+
return l(new le(e, n, t.status)), oe(n), {
|
|
117
117
|
success: !1,
|
|
118
118
|
error: e,
|
|
119
119
|
errorCode: n,
|
|
@@ -139,12 +139,12 @@ async function E(e, t, n, r) {
|
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
async function
|
|
142
|
+
async function O(e, t) {
|
|
143
143
|
try {
|
|
144
|
-
let n = e.startsWith(
|
|
144
|
+
let n = e.startsWith(S.baseUrl), { widgetKey: r, ...i } = t ?? {}, a = await he(e, {
|
|
145
145
|
...i,
|
|
146
|
-
...n ? { headers:
|
|
147
|
-
},
|
|
146
|
+
...n ? { headers: x(i.headers, r) } : {}
|
|
147
|
+
}, S);
|
|
148
148
|
if (!a.ok) {
|
|
149
149
|
let e = await a.json().catch(() => ({}));
|
|
150
150
|
return b.error(`API request failed: ${a.status}`, e), null;
|
|
@@ -156,7 +156,7 @@ async function D(e, t) {
|
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/lib/api/transformers/cart.ts
|
|
159
|
-
function
|
|
159
|
+
function ve(e) {
|
|
160
160
|
let t = e ?? {};
|
|
161
161
|
return {
|
|
162
162
|
ticketID: Number(t.TicketID ?? t.ticketID ?? 0),
|
|
@@ -165,7 +165,7 @@ function ye(e) {
|
|
|
165
165
|
status: String(t.Status ?? t.status ?? "")
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function ye(e) {
|
|
169
169
|
let t = e ?? {}, n = t.Amount ?? t.amount, r = Number(n);
|
|
170
170
|
return {
|
|
171
171
|
giftCardId: Number(t.GiftCardID ?? t.giftCardId ?? 0),
|
|
@@ -173,20 +173,20 @@ function be(e) {
|
|
|
173
173
|
amount: n == null || !Number.isFinite(r) ? null : i(p(r))
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function be(e) {
|
|
177
177
|
let t = e ?? {};
|
|
178
178
|
return {
|
|
179
179
|
uuid: t.UUID ?? t.uuid ?? "",
|
|
180
180
|
eventID: Number(t.EventID ?? t.eventID ?? 0),
|
|
181
181
|
status: t.Status ?? t.status ?? "",
|
|
182
182
|
expiresAt: t.ExpiresAt ?? t.expiresAt ?? "",
|
|
183
|
-
reservations: (t.Reservations ?? t.reservations ?? []).map(
|
|
184
|
-
giftCards: (t.GiftCards ?? t.giftCards ?? []).map(
|
|
183
|
+
reservations: (t.Reservations ?? t.reservations ?? []).map(ve),
|
|
184
|
+
giftCards: (t.GiftCards ?? t.giftCards ?? []).map(ye)
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
//#endregion
|
|
188
188
|
//#region src/lib/tracking/normalize.ts
|
|
189
|
-
var
|
|
189
|
+
var xe = [
|
|
190
190
|
"utmSource",
|
|
191
191
|
"utmMedium",
|
|
192
192
|
"utmCampaign",
|
|
@@ -204,12 +204,12 @@ function we(e) {
|
|
|
204
204
|
}
|
|
205
205
|
function Te(e) {
|
|
206
206
|
let t = {};
|
|
207
|
-
for (let n of
|
|
207
|
+
for (let n of xe) t[n] = we(e[n]);
|
|
208
208
|
return t.utmSource ||= Ce, t;
|
|
209
209
|
}
|
|
210
210
|
function Ee(e) {
|
|
211
211
|
let t = {};
|
|
212
|
-
for (let n of
|
|
212
|
+
for (let n of xe) t[n] = e.get(Se[n]);
|
|
213
213
|
return Te(t);
|
|
214
214
|
}
|
|
215
215
|
//#endregion
|
|
@@ -419,7 +419,7 @@ function N(e) {
|
|
|
419
419
|
var P = e("VC");
|
|
420
420
|
async function Ke(e, t, n, r, i) {
|
|
421
421
|
let a = N(i);
|
|
422
|
-
return
|
|
422
|
+
return E(`${w()}/cart/${e}/payment-intent`, {
|
|
423
423
|
productQuantities: t,
|
|
424
424
|
...n && Object.keys(n).length > 0 ? { donationAmounts: n } : {},
|
|
425
425
|
...r ? {
|
|
@@ -438,7 +438,7 @@ async function qe(e, n, r, i, a) {
|
|
|
438
438
|
try {
|
|
439
439
|
let o = await Ke(e, n, r, i, a);
|
|
440
440
|
if (!o.success) throw P.error("Payment intent creation failed:", o.error), new t(o.error || "Failed to create payment intent", o.statusCode ?? 0, {
|
|
441
|
-
endpoint: `${
|
|
441
|
+
endpoint: `${w()}/cart/${e}/payment-intent`,
|
|
442
442
|
method: "POST"
|
|
443
443
|
});
|
|
444
444
|
return P.debug("Payment intent created:", o.data), o.data;
|
|
@@ -462,9 +462,9 @@ async function Ye(e, t, n, r, i) {
|
|
|
462
462
|
async function Xe(e, t) {
|
|
463
463
|
if (!e) return null;
|
|
464
464
|
try {
|
|
465
|
-
let n = await
|
|
465
|
+
let n = await T(`${w()}/cart/${e}`);
|
|
466
466
|
if (!n.success) return null;
|
|
467
|
-
let { uuid: r, eventID: i, status: a, expiresAt: o, reservations: s, giftCards: c } =
|
|
467
|
+
let { uuid: r, eventID: i, status: a, expiresAt: o, reservations: s, giftCards: c } = be(n.data);
|
|
468
468
|
return a !== "reserved" && a !== "active" || t !== void 0 && i !== Number(t) ? null : {
|
|
469
469
|
uuid: r,
|
|
470
470
|
eventID: i,
|
|
@@ -489,7 +489,7 @@ async function Ze(e, t, n) {
|
|
|
489
489
|
let n = typeof e == "number" ? e : parseInt(e, 10);
|
|
490
490
|
!Number.isNaN(n) && t > 0 && (i[n] = t);
|
|
491
491
|
}
|
|
492
|
-
let a = await fetch(`${
|
|
492
|
+
let a = await fetch(`${w()}/cart/${e}`, {
|
|
493
493
|
method: "PUT",
|
|
494
494
|
headers: { "Content-Type": "application/json" },
|
|
495
495
|
body: JSON.stringify({
|
|
@@ -508,7 +508,7 @@ async function Ze(e, t, n) {
|
|
|
508
508
|
}
|
|
509
509
|
async function Qe(e) {
|
|
510
510
|
try {
|
|
511
|
-
let t = await
|
|
511
|
+
let t = await E(`${C()}/orders/complete/${e}`);
|
|
512
512
|
return t.success ? {
|
|
513
513
|
success: !0,
|
|
514
514
|
message: t.data?.message
|
|
@@ -525,7 +525,7 @@ async function Qe(e) {
|
|
|
525
525
|
}
|
|
526
526
|
async function $e(e) {
|
|
527
527
|
try {
|
|
528
|
-
let t = await
|
|
528
|
+
let t = await E(`${C()}/orders/cancel/${e}`);
|
|
529
529
|
return t.success ? {
|
|
530
530
|
success: !0,
|
|
531
531
|
message: t.data?.message
|
|
@@ -542,7 +542,7 @@ async function $e(e) {
|
|
|
542
542
|
}
|
|
543
543
|
async function et(e, t) {
|
|
544
544
|
try {
|
|
545
|
-
let n = await
|
|
545
|
+
let n = await E(`${C()}/orders/create`, {
|
|
546
546
|
eventID: e,
|
|
547
547
|
promoCode: t,
|
|
548
548
|
attribution: j()
|
|
@@ -553,12 +553,12 @@ async function et(e, t) {
|
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
async function tt(e) {
|
|
556
|
-
return
|
|
556
|
+
return O(`${C()}/orders/${e}`);
|
|
557
557
|
}
|
|
558
558
|
async function nt(e, t, n) {
|
|
559
559
|
let r = N(n);
|
|
560
560
|
try {
|
|
561
|
-
let n = await
|
|
561
|
+
let n = await E(`${w()}/validatePaymentIntent/${e}`, {
|
|
562
562
|
...t,
|
|
563
563
|
attribution: j(),
|
|
564
564
|
...r ? { locale: r } : {}
|
|
@@ -585,7 +585,7 @@ async function nt(e, t, n) {
|
|
|
585
585
|
}
|
|
586
586
|
async function rt(e) {
|
|
587
587
|
try {
|
|
588
|
-
let t = await
|
|
588
|
+
let t = await E(`${C()}/orders/extend-session`, { orderUuid: e });
|
|
589
589
|
if (!t.success) return {
|
|
590
590
|
success: !1,
|
|
591
591
|
error: t.error || "Failed to extend session",
|
|
@@ -606,7 +606,7 @@ async function rt(e) {
|
|
|
606
606
|
}
|
|
607
607
|
async function it(e) {
|
|
608
608
|
try {
|
|
609
|
-
let t = await
|
|
609
|
+
let t = await T(`${C()}/orders/session/${e}`);
|
|
610
610
|
if (!t.success) return {
|
|
611
611
|
error: t.error || "No active session found",
|
|
612
612
|
notFound: t.statusCode === 404
|
|
@@ -626,7 +626,7 @@ async function it(e) {
|
|
|
626
626
|
}
|
|
627
627
|
async function at(e = { eventID: "" }) {
|
|
628
628
|
try {
|
|
629
|
-
let t = await
|
|
629
|
+
let t = await E(`${C()}/orders/create`, {
|
|
630
630
|
...e,
|
|
631
631
|
attribution: j()
|
|
632
632
|
});
|
|
@@ -639,7 +639,7 @@ async function ot(e) {
|
|
|
639
639
|
if (typeof window > "u") return;
|
|
640
640
|
let t = we(new URLSearchParams(window.location.search).get("utm_source")) || "direct";
|
|
641
641
|
try {
|
|
642
|
-
await fetch(`${
|
|
642
|
+
await fetch(`${C()}/utm/${e}/${encodeURIComponent(t)}`);
|
|
643
643
|
} catch (e) {
|
|
644
644
|
P.error("UTM tracking failed:", e);
|
|
645
645
|
}
|
|
@@ -658,7 +658,7 @@ async function ct(e, t) {
|
|
|
658
658
|
valid: !1,
|
|
659
659
|
error: "Promo code is required"
|
|
660
660
|
};
|
|
661
|
-
let n = await
|
|
661
|
+
let n = await T(`/promo-codes/validate/${e}/${encodeURIComponent(t.trim())}`);
|
|
662
662
|
if (!n.success) return {
|
|
663
663
|
valid: !1,
|
|
664
664
|
error: st(n.statusCode, n.error)
|
|
@@ -684,7 +684,7 @@ async function ct(e, t) {
|
|
|
684
684
|
}
|
|
685
685
|
async function lt(e) {
|
|
686
686
|
try {
|
|
687
|
-
let t = await
|
|
687
|
+
let t = await T(`/promo-codes/check/${e}`);
|
|
688
688
|
return !t.success || t.data.hasPromoCodes === !0;
|
|
689
689
|
} catch (e) {
|
|
690
690
|
return F.error("Error checking promo codes availability:", e), !0;
|
|
@@ -694,7 +694,7 @@ async function ut(e, t, n) {
|
|
|
694
694
|
try {
|
|
695
695
|
let r = { promoCode: t };
|
|
696
696
|
n && Object.keys(n).length > 0 && (r.productQuantities = n);
|
|
697
|
-
let i = await
|
|
697
|
+
let i = await E(`${w()}/cart/${e}/apply-promo`, r);
|
|
698
698
|
return i.success ? { success: !0 } : {
|
|
699
699
|
success: !1,
|
|
700
700
|
error: i.error || "Failed to apply promo code"
|
|
@@ -708,7 +708,7 @@ async function ut(e, t, n) {
|
|
|
708
708
|
}
|
|
709
709
|
async function dt(e) {
|
|
710
710
|
try {
|
|
711
|
-
let t = await
|
|
711
|
+
let t = await E(`/orders/${e}/remove-promo`);
|
|
712
712
|
return t.success ? { success: !0 } : {
|
|
713
713
|
success: !1,
|
|
714
714
|
error: t.error || "Failed to remove promo code"
|
|
@@ -774,7 +774,7 @@ async function _t(e, t = fetch, n) {
|
|
|
774
774
|
}
|
|
775
775
|
let i = (async () => {
|
|
776
776
|
try {
|
|
777
|
-
let r = await t(n ? `${
|
|
777
|
+
let r = await t(n ? `${C()}/events/${e}?password=${encodeURIComponent(n)}` : `${C()}/events/${e}`, { headers: x() });
|
|
778
778
|
if (!r.ok) return r.status === 404 ? R("event_not_found") : (U.error(`Failed to fetch event details: ${r.status}`), L("event_fetch_failed"));
|
|
779
779
|
let i = await r.json();
|
|
780
780
|
return i ? I(i) : R("event_not_found");
|
|
@@ -792,7 +792,7 @@ async function vt(e, t = fetch, n) {
|
|
|
792
792
|
}
|
|
793
793
|
async function G(e, t, n = (e) => e) {
|
|
794
794
|
try {
|
|
795
|
-
let r = await
|
|
795
|
+
let r = await O(e);
|
|
796
796
|
return r ? I(n(r)) : (U.error(`Failed to load (${t}): network or server error`), L(t));
|
|
797
797
|
} catch (e) {
|
|
798
798
|
return U.error(`Error loading (${t}):`, e), L(t);
|
|
@@ -803,13 +803,13 @@ function K(e) {
|
|
|
803
803
|
}
|
|
804
804
|
async function q(e, t) {
|
|
805
805
|
let n = t?.trim(), r = n ? `?promoCode=${encodeURIComponent(n)}` : "";
|
|
806
|
-
return G(`${
|
|
806
|
+
return G(`${C()}/tickets/event/${e}${r}`, "tickets_fetch_failed", K);
|
|
807
807
|
}
|
|
808
808
|
async function yt(e, t) {
|
|
809
809
|
return z(await q(e, t), []);
|
|
810
810
|
}
|
|
811
811
|
async function bt(e) {
|
|
812
|
-
return e ? G(`${
|
|
812
|
+
return e ? G(`${C()}/events/${e}/performers`, "performers_fetch_failed", (e) => ft(e)) : (U.warn("fetchEventPerformers called without eventId"), L("performers_missing_event_id"));
|
|
813
813
|
}
|
|
814
814
|
async function xt(e) {
|
|
815
815
|
return z(await bt(e), {
|
|
@@ -818,13 +818,13 @@ async function xt(e) {
|
|
|
818
818
|
});
|
|
819
819
|
}
|
|
820
820
|
async function St(e) {
|
|
821
|
-
return e ? G(`${
|
|
821
|
+
return e ? G(`${C()}/venues/organization/${e}`, "venues_fetch_failed", K) : (U.warn("fetchAllVenues called without orgId"), L("venues_missing_org_id"));
|
|
822
822
|
}
|
|
823
823
|
async function Ct(e) {
|
|
824
824
|
return z(await St(e), []);
|
|
825
825
|
}
|
|
826
826
|
async function wt(e) {
|
|
827
|
-
return e ? G(`${
|
|
827
|
+
return e ? G(`${C()}/events/venue/${e}`, "venue_events_fetch_failed", K) : (U.warn("fetchVenueEvents called without venueId"), L("venue_events_missing_venue_id"));
|
|
828
828
|
}
|
|
829
829
|
async function Tt(e) {
|
|
830
830
|
return z(await wt(e), []);
|
|
@@ -844,26 +844,26 @@ function Dt(e, t, n) {
|
|
|
844
844
|
}), r;
|
|
845
845
|
}
|
|
846
846
|
async function Ot(e, t, n, r) {
|
|
847
|
-
return Dt(`${
|
|
847
|
+
return Dt(`${C()}/events/venue/${e}/month/${t}/${n}`, "month_events_fetch_failed", r);
|
|
848
848
|
}
|
|
849
849
|
async function kt(e, t, n) {
|
|
850
850
|
return z(await Ot(e, t, n), []);
|
|
851
851
|
}
|
|
852
852
|
async function At(e, t, n, r) {
|
|
853
|
-
return Dt(`${
|
|
853
|
+
return Dt(`${C()}/events/organization/${e}/month/${t}/${n}`, "org_month_events_fetch_failed", r);
|
|
854
854
|
}
|
|
855
855
|
async function jt(e, t, n) {
|
|
856
856
|
return z(await At(e, t, n), []);
|
|
857
857
|
}
|
|
858
858
|
async function Mt(e) {
|
|
859
|
-
return G(`${
|
|
859
|
+
return G(`${C()}/series/${e}/occurrences`, "series_occurrences_fetch_failed");
|
|
860
860
|
}
|
|
861
861
|
async function Nt(e) {
|
|
862
862
|
let t = await Mt(e);
|
|
863
863
|
return t.ok ? t.data : null;
|
|
864
864
|
}
|
|
865
865
|
async function Pt(e, t) {
|
|
866
|
-
return G(`${
|
|
866
|
+
return G(`${C()}/series/${e}/occurrences?venueId=${t}`, "series_cta_fetch_failed");
|
|
867
867
|
}
|
|
868
868
|
async function Ft(e, t) {
|
|
869
869
|
let n = await Pt(e, t);
|
|
@@ -871,7 +871,7 @@ async function Ft(e, t) {
|
|
|
871
871
|
}
|
|
872
872
|
async function It(e, t) {
|
|
873
873
|
try {
|
|
874
|
-
let r = t ? `?slug=${encodeURIComponent(t)}` : "", i = await
|
|
874
|
+
let r = t ? `?slug=${encodeURIComponent(t)}` : "", i = await O(`${C()}/resolve/${encodeURIComponent(String(e))}${r}`);
|
|
875
875
|
if (!i || !i.type) throw new n("entity", String(e));
|
|
876
876
|
return i;
|
|
877
877
|
} catch (e) {
|
|
@@ -880,7 +880,7 @@ async function It(e, t) {
|
|
|
880
880
|
}
|
|
881
881
|
async function Lt(e, t) {
|
|
882
882
|
try {
|
|
883
|
-
let r = await
|
|
883
|
+
let r = await O(t ? `${C()}/collections/${e}?password=${encodeURIComponent(t)}` : `${C()}/collections/${e}`);
|
|
884
884
|
if (!r) throw new n("collection", String(e));
|
|
885
885
|
return r;
|
|
886
886
|
} catch (e) {
|
|
@@ -889,7 +889,7 @@ async function Lt(e, t) {
|
|
|
889
889
|
}
|
|
890
890
|
async function Rt(e, t) {
|
|
891
891
|
try {
|
|
892
|
-
return (await
|
|
892
|
+
return (await O(`${C()}/collections/${e}/check-password`, {
|
|
893
893
|
method: "POST",
|
|
894
894
|
headers: { "Content-Type": "application/json" },
|
|
895
895
|
body: JSON.stringify({ password: t })
|
|
@@ -900,7 +900,7 @@ async function Rt(e, t) {
|
|
|
900
900
|
}
|
|
901
901
|
async function zt(e, t) {
|
|
902
902
|
try {
|
|
903
|
-
let n = await
|
|
903
|
+
let n = await O(`${C()}/events/${e}/check-password`, {
|
|
904
904
|
method: "POST",
|
|
905
905
|
headers: { "Content-Type": "application/json" },
|
|
906
906
|
body: JSON.stringify({ password: t })
|
|
@@ -912,7 +912,7 @@ async function zt(e, t) {
|
|
|
912
912
|
}
|
|
913
913
|
async function Bt(e, t) {
|
|
914
914
|
try {
|
|
915
|
-
let n = t ? `${
|
|
915
|
+
let n = t ? `${C()}/events/venue/${t}` : e ? `${C()}/venues/organization/${e}` : `${C()}/venues/${gt}`;
|
|
916
916
|
return (await fetch(n, { method: "HEAD" })).status < 500;
|
|
917
917
|
} catch (e) {
|
|
918
918
|
return U.error("Network connection test failed:", e), !1;
|
|
@@ -931,7 +931,7 @@ var Y = e("VC");
|
|
|
931
931
|
async function Ut(e) {
|
|
932
932
|
try {
|
|
933
933
|
if (!e) return Y.warn("getVenue called without venueId"), null;
|
|
934
|
-
let t = await
|
|
934
|
+
let t = await T(`/venues/${e}`);
|
|
935
935
|
return t.success ? t.data ?? null : (Y.error(`Failed to fetch venue: ${t.statusCode}`), null);
|
|
936
936
|
} catch (e) {
|
|
937
937
|
return Y.error("Error fetching venue:", e), null;
|
|
@@ -948,7 +948,7 @@ async function Wt(e) {
|
|
|
948
948
|
async function Gt(e) {
|
|
949
949
|
try {
|
|
950
950
|
if (!e) return Y.warn("getVenueBySlug called without slug"), null;
|
|
951
|
-
let t = await
|
|
951
|
+
let t = await T(`/venues/slug/${encodeURIComponent(e)}`);
|
|
952
952
|
return t.success ? t.data ?? null : (Y.error(`Failed to fetch venue by slug: ${t.statusCode}`), null);
|
|
953
953
|
} catch (e) {
|
|
954
954
|
return Y.error("Error fetching venue by slug:", e), null;
|
|
@@ -958,7 +958,7 @@ async function Kt(e) {
|
|
|
958
958
|
let t = Ht(e);
|
|
959
959
|
if (!t) return !1;
|
|
960
960
|
try {
|
|
961
|
-
let e = await
|
|
961
|
+
let e = await T(`/sites/by-host/${encodeURIComponent(new URL(t).host)}`);
|
|
962
962
|
return !!(e.success && e.data);
|
|
963
963
|
} catch (e) {
|
|
964
964
|
return Y.warn("hasPublishedSite failed:", e), !1;
|
|
@@ -997,9 +997,9 @@ function Yt(e) {
|
|
|
997
997
|
var Z = e("VC");
|
|
998
998
|
async function Xt(e) {
|
|
999
999
|
try {
|
|
1000
|
-
let n = await
|
|
1000
|
+
let n = await E(`${w()}/gift-cards/purchase/create`, e);
|
|
1001
1001
|
if (!n.success) throw Z.error("Gift card purchase creation failed:", n.error), new t(n.error || "Failed to create gift card purchase", n.statusCode ?? 0, {
|
|
1002
|
-
endpoint: `${
|
|
1002
|
+
endpoint: `${w()}/gift-cards/purchase/create`,
|
|
1003
1003
|
method: "POST"
|
|
1004
1004
|
});
|
|
1005
1005
|
return Z.debug("Gift card purchase created:", n.data), n.data;
|
|
@@ -1009,7 +1009,7 @@ async function Xt(e) {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
async function Zt(e, t) {
|
|
1011
1011
|
try {
|
|
1012
|
-
let n = await
|
|
1012
|
+
let n = await E(`${w()}/cart/${e}/apply-gift-card`, { giftCardCode: t });
|
|
1013
1013
|
if (!n.success) return n.statusCode === 429 ? {
|
|
1014
1014
|
valid: !1,
|
|
1015
1015
|
error: "Too many attempts. Please wait a moment and try again."
|
|
@@ -1028,7 +1028,7 @@ async function Zt(e, t) {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
async function Qt(e, t) {
|
|
1030
1030
|
try {
|
|
1031
|
-
let n = t?.giftCardId ? { giftCardId: t.giftCardId } : t?.code ? { giftCardCode: t.code } : null, r = await
|
|
1031
|
+
let n = t?.giftCardId ? { giftCardId: t.giftCardId } : t?.code ? { giftCardCode: t.code } : null, r = await _e(`${w()}/cart/${e}/gift-card`, n ? { body: JSON.stringify(n) } : void 0);
|
|
1032
1032
|
if (!r.success) return Z.error("Remove gift card failed:", r.error), {
|
|
1033
1033
|
success: !1,
|
|
1034
1034
|
error: r.error || "Failed to remove gift card"
|
|
@@ -1048,7 +1048,7 @@ async function Qt(e, t) {
|
|
|
1048
1048
|
async function $t(e, t, n) {
|
|
1049
1049
|
let r = N(n);
|
|
1050
1050
|
try {
|
|
1051
|
-
let n = await
|
|
1051
|
+
let n = await E(`${w()}/cart/${e}/complete-gift-card-payment`, {
|
|
1052
1052
|
customerName: s(t.firstName, t.lastName),
|
|
1053
1053
|
customerEmail: t.email,
|
|
1054
1054
|
firstName: t.firstName,
|
|
@@ -1093,7 +1093,7 @@ async function tn(e, t) {
|
|
|
1093
1093
|
!Number.isNaN(t) && n > 0 && (r[t] = n);
|
|
1094
1094
|
}
|
|
1095
1095
|
try {
|
|
1096
|
-
let t = await
|
|
1096
|
+
let t = await E(`${w()}/cart/${e}/add-ons`, { addOnQuantities: r });
|
|
1097
1097
|
if (!t.success) return n(t.error || null);
|
|
1098
1098
|
let i = t.data || {};
|
|
1099
1099
|
return {
|
|
@@ -1114,7 +1114,7 @@ async function nn(e, t, n = null, r = !1) {
|
|
|
1114
1114
|
try {
|
|
1115
1115
|
let i = { email: t };
|
|
1116
1116
|
n && r && (i.phone = n, i.smsOptIn = !0);
|
|
1117
|
-
let a = await
|
|
1117
|
+
let a = await E(`/events/${e}/waitlist`, i);
|
|
1118
1118
|
return a.success ? {
|
|
1119
1119
|
success: !0,
|
|
1120
1120
|
updated: a.data?.updated,
|
|
@@ -1132,7 +1132,7 @@ async function nn(e, t, n = null, r = !1) {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
async function rn(e, t) {
|
|
1134
1134
|
try {
|
|
1135
|
-
let n = await
|
|
1135
|
+
let n = await E(`/checkout/validate-token/${e}`, { email: t });
|
|
1136
1136
|
return n.success ? {
|
|
1137
1137
|
valid: !0,
|
|
1138
1138
|
eventId: n.data?.eventId ?? 0,
|
|
@@ -1152,7 +1152,7 @@ async function rn(e, t) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
async function an(e, t) {
|
|
1154
1154
|
try {
|
|
1155
|
-
let n = await
|
|
1155
|
+
let n = await E(`/waitlist/requeue/${e}`, { email: t });
|
|
1156
1156
|
return n.success ? { success: !0 } : {
|
|
1157
1157
|
success: !1,
|
|
1158
1158
|
errorCode: n.error
|
|
@@ -1171,7 +1171,7 @@ async function on(e) {
|
|
|
1171
1171
|
gated: !1
|
|
1172
1172
|
};
|
|
1173
1173
|
try {
|
|
1174
|
-
let n = await
|
|
1174
|
+
let n = await T(`/events/${e}/waitlist/status`);
|
|
1175
1175
|
return n.success ? {
|
|
1176
1176
|
waitlistEnabled: !!n.data?.waitlistEnabled,
|
|
1177
1177
|
soldOut: !!n.data?.soldOut,
|
|
@@ -1521,4 +1521,4 @@ function Dn(e) {
|
|
|
1521
1521
|
].filter(Boolean).join(", ");
|
|
1522
1522
|
}
|
|
1523
1523
|
//#endregion
|
|
1524
|
-
export {
|
|
1524
|
+
export { _e as apiDelete, T as apiGet, E as apiPost, ge as apiPut, Zt as applyGiftCard, ut as applyPromoCode, _n as calculateCtaState, $e as cancelReservation, Rt as checkCollectionPassword, zt as checkEventPassword, $t as completeGiftCardPayment, Qe as completeReservation, cn as computeCtaState, ue as configureApi, Xt as createGiftCardPurchase, et as createOrder, qe as createPaymentIntent, L as err, R as errNotFound, rt as extendCheckoutSession, En as extractVenueFees, Ct as fetchAllVenues, St as fetchAllVenuesResult, vt as fetchEventDetails, _t as fetchEventDetailsResult, xt as fetchEventPerformers, bt as fetchEventPerformersResult, yt as fetchEventTickets, q as fetchEventTicketsResult, Lt as fetchPublicCollection, Ft as fetchSeriesOccurrences, Pt as fetchSeriesOccurrencesResult, Tt as fetchVenueEvents, wt as fetchVenueEventsResult, Dn as formatVenueAddress, sn as formatWaitlistWindow, de as getApiConfig, hn as getCDNImageUrl, Xe as getCartByUUID, pe as getClientIP, $ as getEventImageUrl, fe as getLegacyPublicUrl, kt as getMonthEvents, Ot as getMonthEventsResult, tt as getOrder, w as getOrdersV2Url, jt as getOrgMonthEvents, At as getOrgMonthEventsResult, C as getPublicBaseUrl, Nt as getSeriesOccurrences, Mt as getSeriesOccurrencesResult, it as getSessionStatus, Ut as getVenue, Gt as getVenueBySlug, Wt as getVenueFees, on as getWaitlistStatus, lt as hasPromoCodes, Kt as hasPublishedSite, at as initiateOrder, mt as isErr, pt as isOk, nn as joinWaitlist, I as ok, Qt as removeGiftCard, dt as removePromoCode, an as requeueWaitlistToFront, It as resolvePublicEntity, Ye as submitCheckoutAnswers, Bt as testNetworkConnection, ot as trackUTMSource, bn as transformAvailableTicket, xn as transformEvent, Sn as transformEventData, pn as transformOrder, mn as transformOrderForDisplay, fn as transformTicket, Tn as transformVenue, z as unwrapOr, tn as updateCartAddOns, Ze as updateCartQuantities, nt as validatePaymentIntent, ct as validatePromoCode, rn as validateWaitlistToken };
|
package/dist/api/client.d.ts
CHANGED
|
@@ -76,6 +76,35 @@ export interface ApiResult<T> extends ApiResponse<T> {
|
|
|
76
76
|
*/
|
|
77
77
|
aborted?: boolean;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Merge the widget API key header into a request.
|
|
81
|
+
*
|
|
82
|
+
* ON A THIRD-PARTY ORIGIN THE KEY IS REQUIRED, AND EVERY STRICT PUBLIC READ
|
|
83
|
+
* MUST GO THROUGH HERE. The widget-key middleware in auth
|
|
84
|
+
* (auth/middlewares/widget_auth.go) has two rejection paths, not one: a
|
|
85
|
+
* provided-but-invalid key is WIDGET_KEY_INVALID, and a KEYLESS request
|
|
86
|
+
* carrying a foreign Origin header is WIDGET_KEY_REQUIRED. Keyless is served
|
|
87
|
+
* only to a first-party origin (get-micdrop.com and its subdomains, localhost)
|
|
88
|
+
* or to a caller that sends no Origin header at all — which is why a curl probe
|
|
89
|
+
* and a browser disagree here, and why a bug in this layer is invisible from
|
|
90
|
+
* the terminal.
|
|
91
|
+
*
|
|
92
|
+
* So a single call site that reaches a strict endpoint without this helper 403s
|
|
93
|
+
* for every real visitor on a venue's own domain while looking fine in local
|
|
94
|
+
* dev and in any origin-less probe. The strict surface is enumerated in the
|
|
95
|
+
* strictPublic group in auth/internal/api/v2/router.go: the event detail read,
|
|
96
|
+
* the venue-by-slug read and the widget-config read are all on it.
|
|
97
|
+
*
|
|
98
|
+
* A key is also validated against the request's Origin header, so a key sent
|
|
99
|
+
* from a domain that is not on its allow-list is a hard 403 — "the read failed"
|
|
100
|
+
* can mean the key is missing OR that the embedding domain was never
|
|
101
|
+
* registered, and the response body's code field is what tells those apart.
|
|
102
|
+
*
|
|
103
|
+
* @param headers - the caller's headers, passed through unchanged when there is
|
|
104
|
+
* no key to add.
|
|
105
|
+
* @param explicitKey - this instance's key, preferred over the module global.
|
|
106
|
+
*/
|
|
107
|
+
export declare function withWidgetKey(headers?: HeadersInit, explicitKey?: string): Record<string, string> | HeadersInit | undefined;
|
|
79
108
|
/**
|
|
80
109
|
* The Error handed to the global `onError` handler, carrying the same code the
|
|
81
110
|
* returned `ApiResult` does. `onError` receives an `Error` by contract, so the
|