@faststore/api 4.9.1-dev.0 → 4.9.1
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/cjs/index.js +45 -45
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.mjs +322 -334
- package/dist/es/index.mjs.map +1 -1
- package/dist/src/__generated__/schema.d.ts +1 -1
- package/dist/src/__generated__/schema.d.ts.map +1 -1
- package/dist/src/platforms/vtex/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/product.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/__generated__/schema.ts +1 -1
- package/src/platforms/vtex/resolvers/product.ts +4 -3
- package/src/platforms/vtex/typeDefs/product.graphql +1 -1
- package/dist/src/platforms/vtex/utils/releaseDate.d.ts +0 -22
- package/dist/src/platforms/vtex/utils/releaseDate.d.ts.map +0 -1
- package/src/platforms/vtex/utils/releaseDate.ts +0 -70
package/dist/es/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { mergeTypeDefs as sn } from "@graphql-tools/merge";
|
|
2
2
|
import { makeExecutableSchema as xn, mergeSchemas as qn } from "@graphql-tools/schema";
|
|
3
3
|
import { mapSchema as cn, MapperKind as ln, getDirective as dn } from "@graphql-tools/utils";
|
|
4
|
-
import { GraphQLScalarType as jn, print as Wn, parse as
|
|
4
|
+
import { GraphQLScalarType as jn, print as Wn, parse as Gn, isSchema as Hn } from "graphql";
|
|
5
5
|
import { logger as Xn, OTELAPI as V } from "@faststore/diagnostics";
|
|
6
6
|
import Yn from "isomorphic-unfetch";
|
|
7
7
|
import { parse as Z } from "cookie";
|
|
8
|
-
import
|
|
8
|
+
import Ae from "p-limit";
|
|
9
9
|
import ue from "dataloader";
|
|
10
10
|
import Jn from "sanitize-html";
|
|
11
|
-
import
|
|
11
|
+
import De from "fast-deep-equal";
|
|
12
12
|
import Kn from "node:crypto";
|
|
13
13
|
var Qn = /* @__PURE__ */ ((e) => (e.Personal = "personal", e.Shared = "shared", e))(Qn || {}), Zn = /* @__PURE__ */ ((e) => (e.Accepted = "accepted", e.Denied = "denied", e.Pending = "pending", e))(Zn || {}), et = /* @__PURE__ */ ((e) => (e.Brand = "Brand", e.Category = "Category", e.Cluster = "Cluster", e.Collection = "Collection", e.Department = "Department", e.SubCategory = "SubCategory", e))(et || {}), nt = /* @__PURE__ */ ((e) => (e.Boolean = "BOOLEAN", e.Range = "RANGE", e))(nt || {}), tt = /* @__PURE__ */ ((e) => (e.DiscountDesc = "discount_desc", e.NameAsc = "name_asc", e.NameDesc = "name_desc", e.OrdersDesc = "orders_desc", e.PriceAsc = "price_asc", e.PriceDesc = "price_desc", e.ReleaseDesc = "release_desc", e.ScoreDesc = "score_desc", e))(tt || {}), rt = /* @__PURE__ */ ((e) => (e.Error = "ERROR", e.Info = "INFO", e.Warning = "WARNING", e))(rt || {}), it = /* @__PURE__ */ ((e) => (e.Input = "Input", e.Output = "Output", e))(it || {});
|
|
14
14
|
const at = () => function(n = {}) {
|
|
@@ -42,14 +42,14 @@ const at = () => function(n = {}) {
|
|
|
42
42
|
return n;
|
|
43
43
|
}
|
|
44
44
|
})
|
|
45
|
-
}, lt = "cacheControl",
|
|
45
|
+
}, lt = "cacheControl", ho = (e, n) => {
|
|
46
46
|
const {
|
|
47
47
|
scope: t = "private",
|
|
48
48
|
sMaxAge: r = 0,
|
|
49
49
|
staleWhileRevalidate: i = 0
|
|
50
50
|
} = e;
|
|
51
51
|
return `${n ? "private" : t}, s-maxage=${r}, stale-while-revalidate=${i}`;
|
|
52
|
-
},
|
|
52
|
+
}, Ue = (e, n) => typeof e == "number" && typeof n == "number" ? e > n ? n : e : typeof e == "number" ? e : n, dt = (e, n) => typeof e == "string" && typeof n == "string" ? e === "public" && n === "public" ? "public" : "private" : e || n, ut = {
|
|
53
53
|
typeDefs: "directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION",
|
|
54
54
|
transformer: (e) => cn(e, {
|
|
55
55
|
[ln.OBJECT_FIELD]: (n) => {
|
|
@@ -57,8 +57,8 @@ const at = () => function(n = {}) {
|
|
|
57
57
|
if (t) {
|
|
58
58
|
const { sMaxAge: r, staleWhileRevalidate: i, scope: a } = t, o = n.resolve;
|
|
59
59
|
n.resolve = (s, c, u, d) => (u.cacheControl = {
|
|
60
|
-
sMaxAge:
|
|
61
|
-
staleWhileRevalidate:
|
|
60
|
+
sMaxAge: Ue(u.cacheControl?.sMaxAge, r),
|
|
61
|
+
staleWhileRevalidate: Ue(
|
|
62
62
|
u.cacheControl?.staleWhileRevalidate,
|
|
63
63
|
i
|
|
64
64
|
),
|
|
@@ -80,7 +80,7 @@ const at = () => function(n = {}) {
|
|
|
80
80
|
resolvers: n
|
|
81
81
|
})
|
|
82
82
|
);
|
|
83
|
-
}, un = "@faststore/api", pn = "4.9.0",
|
|
83
|
+
}, un = "@faststore/api", pn = "4.9.0", Te = {
|
|
84
84
|
name: un,
|
|
85
85
|
version: pn
|
|
86
86
|
}, gt = Xn("@faststore/api"), mt = (e, n = "Unknown Graphql Resolver") => (t, r, i, a) => {
|
|
@@ -121,7 +121,7 @@ class ee extends Error {
|
|
|
121
121
|
super(t), this.extensions = n, this.name = "FastStoreError";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
class
|
|
124
|
+
class k extends ee {
|
|
125
125
|
constructor(n) {
|
|
126
126
|
super({ status: 400, type: "BadRequestError" }, n);
|
|
127
127
|
}
|
|
@@ -141,7 +141,7 @@ class $ extends ee {
|
|
|
141
141
|
super({ status: 404, type: "NotFoundError" }, n);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
const
|
|
144
|
+
const fo = (e) => e?.name === "FastStoreError", So = (e) => e?.extensions?.type === "BadRequestError", yo = (e) => e?.extensions?.type === "UnauthorizedError", ht = (e) => e?.extensions?.type === "ForbiddenError", J = (e) => e?.extensions?.type === "NotFoundError", ft = `${Te.name}@${Te.version}`, y = async (e, n, t) => {
|
|
145
145
|
const r = await Yn(e, {
|
|
146
146
|
...n,
|
|
147
147
|
headers: {
|
|
@@ -156,7 +156,7 @@ const Oo = (e) => e?.name === "FastStoreError", bo = (e) => e?.extensions?.type
|
|
|
156
156
|
if (typeof r?.status == "number")
|
|
157
157
|
switch (r.status) {
|
|
158
158
|
case 400:
|
|
159
|
-
throw new
|
|
159
|
+
throw new k(i);
|
|
160
160
|
case 401:
|
|
161
161
|
throw new ie(i);
|
|
162
162
|
case 403:
|
|
@@ -245,12 +245,12 @@ function x(e) {
|
|
|
245
245
|
return null;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
const Ct = "storefront/faststore.recommendation-shelf@v4",
|
|
248
|
+
const Ct = "storefront/faststore.recommendation-shelf@v4", H = {
|
|
249
249
|
method: "POST",
|
|
250
250
|
headers: {
|
|
251
251
|
"content-type": "application/json"
|
|
252
252
|
}
|
|
253
|
-
}, wt = (e) => e.split("/").map(encodeURIComponent).join("/"), pe = (e) => e ? { headers: { "Accept-Language": e } } : void 0,
|
|
253
|
+
}, wt = (e) => e.split("/").map(encodeURIComponent).join("/"), pe = (e) => e ? { headers: { "Accept-Language": e } } : void 0, At = /^\d{4}-\d{2}-\d{2}$/, Dt = /* @__PURE__ */ new Set([
|
|
254
254
|
"Draft",
|
|
255
255
|
"Requested",
|
|
256
256
|
"InReview",
|
|
@@ -284,12 +284,12 @@ function Pt({
|
|
|
284
284
|
["expiresAtFrom", a],
|
|
285
285
|
["expiresAtTo", o]
|
|
286
286
|
])
|
|
287
|
-
if (c && !
|
|
287
|
+
if (c && !At.test(c))
|
|
288
288
|
throw new Error(
|
|
289
289
|
`listUserQuotes: invalid ${s} "${c}" — must be YYYY-MM-DD`
|
|
290
290
|
);
|
|
291
291
|
if (t && t.length > 0) {
|
|
292
|
-
const s = t.filter((c) => !
|
|
292
|
+
const s = t.filter((c) => !Dt.has(c));
|
|
293
293
|
if (s.length > 0)
|
|
294
294
|
throw new Error(
|
|
295
295
|
`listUserQuotes: invalid status values: ${s.join(", ")}`
|
|
@@ -309,7 +309,7 @@ function Et({
|
|
|
309
309
|
const c = new URLSearchParams();
|
|
310
310
|
return e && c.append("pageNumber", e.toString()), n && c.append("pageSize", n.toString()), t?.forEach((u) => c.append("status", u)), r && c.append("createdAtFrom", r), i && c.append("createdAtTo", i), a && c.append("expiresAtFrom", a), o && c.append("expiresAtTo", o), s?.trim() && c.append("label", s.trim()), c;
|
|
311
311
|
}
|
|
312
|
-
const
|
|
312
|
+
const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix: r }, i) => {
|
|
313
313
|
const a = `https://${e}.${n}.com.br`, o = Ot(i), s = mn(i), c = at(), u = new Headers(i.headers).get("x-forwarded-host") ?? i.headers?.host ?? "", d = r && r.map((l) => l + ".").find((l) => u.includes(l)) || "", g = u.replace(d, ""), f = `${a}/api/recommend-bff/v2`, h = s({
|
|
314
314
|
accept: "application/json",
|
|
315
315
|
"content-type": "application/json",
|
|
@@ -415,7 +415,7 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
415
415
|
return y(
|
|
416
416
|
`${a}/api/checkout/pub/orderForms/simulation?${m.toString()}`,
|
|
417
417
|
{
|
|
418
|
-
...
|
|
418
|
+
...H,
|
|
419
419
|
headers: S,
|
|
420
420
|
body: JSON.stringify(l)
|
|
421
421
|
},
|
|
@@ -432,23 +432,23 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
432
432
|
startDateUtc: m?.deliveryWindow?.startDate,
|
|
433
433
|
endDateUtc: m?.deliveryWindow?.endDate
|
|
434
434
|
} : null, C = {
|
|
435
|
-
logisticsInfo: Array.from({ length: p }, (I,
|
|
436
|
-
itemIndex:
|
|
435
|
+
logisticsInfo: Array.from({ length: p }, (I, A) => ({
|
|
436
|
+
itemIndex: A,
|
|
437
437
|
selectedDeliveryChannel: m?.deliveryChannel || null,
|
|
438
438
|
selectedSla: m?.deliveryMethod || null,
|
|
439
439
|
deliveryWindow: w
|
|
440
440
|
})),
|
|
441
441
|
selectedAddresses: S,
|
|
442
442
|
clearAddressIfPostalCodeNotFound: t
|
|
443
|
-
},
|
|
443
|
+
}, _ = s({
|
|
444
444
|
"content-type": "application/json",
|
|
445
445
|
"X-FORWARDED-HOST": g
|
|
446
446
|
});
|
|
447
447
|
return y(
|
|
448
448
|
`${a}/api/checkout/pub/orderForm/${l}/attachments/shippingData`,
|
|
449
449
|
{
|
|
450
|
-
...
|
|
451
|
-
headers:
|
|
450
|
+
...H,
|
|
451
|
+
headers: _,
|
|
452
452
|
body: JSON.stringify(C)
|
|
453
453
|
},
|
|
454
454
|
{ storeCookies: o }
|
|
@@ -501,11 +501,11 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
501
501
|
"X-FORWARDED-HOST": g
|
|
502
502
|
}), C = new URLSearchParams();
|
|
503
503
|
(!S || !l) && C.set("sc", O), l && C.set("refreshOutdatedData", p.toString());
|
|
504
|
-
const
|
|
504
|
+
const _ = l ? `/${l}` : "", I = `${a}/api/checkout/pub/orderForm${_}?${C}`;
|
|
505
505
|
return y(
|
|
506
506
|
I,
|
|
507
507
|
{
|
|
508
|
-
...
|
|
508
|
+
...H,
|
|
509
509
|
headers: w,
|
|
510
510
|
...l ? {} : { body: "{}" }
|
|
511
511
|
},
|
|
@@ -520,7 +520,7 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
520
520
|
return y(
|
|
521
521
|
`${a}/api/checkout/pub/orderForm/${l}/messages/clear`,
|
|
522
522
|
{
|
|
523
|
-
...
|
|
523
|
+
...H,
|
|
524
524
|
headers: p,
|
|
525
525
|
body: "{}"
|
|
526
526
|
}
|
|
@@ -699,7 +699,7 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
699
699
|
subscribeToNewsletter: (l) => y(
|
|
700
700
|
`${a}/api/dataentities/NL/documents/`,
|
|
701
701
|
{
|
|
702
|
-
...
|
|
702
|
+
...H,
|
|
703
703
|
body: JSON.stringify({ ...l, isNewsletterOptIn: !0 }),
|
|
704
704
|
method: "PATCH"
|
|
705
705
|
},
|
|
@@ -741,32 +741,32 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
741
741
|
text: O,
|
|
742
742
|
clientEmail: w,
|
|
743
743
|
perPage: C,
|
|
744
|
-
pendingMyApproval:
|
|
744
|
+
pendingMyApproval: _
|
|
745
745
|
}) => {
|
|
746
746
|
const I = new URLSearchParams();
|
|
747
747
|
if (m) {
|
|
748
|
-
const
|
|
748
|
+
const D = new Date(m).setHours(
|
|
749
749
|
0,
|
|
750
750
|
0,
|
|
751
751
|
0,
|
|
752
752
|
0
|
|
753
753
|
);
|
|
754
|
-
m = new Date(
|
|
754
|
+
m = new Date(D).toISOString();
|
|
755
755
|
}
|
|
756
756
|
if (S) {
|
|
757
|
-
const
|
|
757
|
+
const D = new Date(S).setHours(
|
|
758
758
|
23,
|
|
759
759
|
59,
|
|
760
760
|
59,
|
|
761
761
|
999
|
|
762
762
|
);
|
|
763
|
-
S = new Date(
|
|
763
|
+
S = new Date(D).toISOString();
|
|
764
764
|
}
|
|
765
765
|
O && I.append("text", O), p && p.length > 0 && I.append("status", p.filter(Boolean).join(",")), m && S ? I.append(
|
|
766
766
|
"creation_date",
|
|
767
767
|
`creationDate:[${m} TO ${S}]`
|
|
768
|
-
) : m ? I.append("creation_date", `creationDate:[${m} TO *]`) : S && I.append("creation_date", `creationDate:[* TO ${S}]`), w && I.append("clientEmail", w), l && I.append("page", l.toString()), C && I.append("per_page", C.toString()),
|
|
769
|
-
const
|
|
768
|
+
) : m ? I.append("creation_date", `creationDate:[${m} TO *]`) : S && I.append("creation_date", `creationDate:[* TO ${S}]`), w && I.append("clientEmail", w), l && I.append("page", l.toString()), C && I.append("per_page", C.toString()), _ && I.append("my_pending_approvals", String(!0));
|
|
769
|
+
const A = s({
|
|
770
770
|
"content-type": "application/json",
|
|
771
771
|
"X-FORWARDED-HOST": g
|
|
772
772
|
});
|
|
@@ -774,7 +774,7 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
774
774
|
`${a}/api/oms/user/orders?${I.toString()}`,
|
|
775
775
|
{
|
|
776
776
|
method: "GET",
|
|
777
|
-
headers:
|
|
777
|
+
headers: A
|
|
778
778
|
},
|
|
779
779
|
{ storeCookies: o }
|
|
780
780
|
);
|
|
@@ -804,7 +804,7 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
804
804
|
const O = s({
|
|
805
805
|
"content-type": "application/json",
|
|
806
806
|
"X-FORWARDED-HOST": g
|
|
807
|
-
}),
|
|
807
|
+
}), _ = {
|
|
808
808
|
params: {
|
|
809
809
|
ruleId: m,
|
|
810
810
|
dimensionId: p,
|
|
@@ -816,7 +816,7 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
816
816
|
{
|
|
817
817
|
method: "POST",
|
|
818
818
|
headers: O,
|
|
819
|
-
body: JSON.stringify(
|
|
819
|
+
body: JSON.stringify(_)
|
|
820
820
|
},
|
|
821
821
|
{ storeCookies: o }
|
|
822
822
|
);
|
|
@@ -966,7 +966,7 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
966
966
|
contractId: l
|
|
967
967
|
}) => {
|
|
968
968
|
if (!l)
|
|
969
|
-
throw new
|
|
969
|
+
throw new k("Missing contractId to fetch CL fields.");
|
|
970
970
|
const p = v({
|
|
971
971
|
Accept: "application/json",
|
|
972
972
|
"content-type": "application/json"
|
|
@@ -984,7 +984,7 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
984
984
|
userId: l
|
|
985
985
|
}) => {
|
|
986
986
|
if (!l)
|
|
987
|
-
throw new
|
|
987
|
+
throw new k("Missing userId to fetch shopper name.");
|
|
988
988
|
const p = c({
|
|
989
989
|
Accept: "application/json",
|
|
990
990
|
"content-type": "application/json",
|
|
@@ -1044,13 +1044,13 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
1044
1044
|
"content-type": "application/json",
|
|
1045
1045
|
"X-FORWARDED-HOST": g
|
|
1046
1046
|
}), O = `----FastStoreUploadBoundary${Date.now()}`, w = `\r
|
|
1047
|
-
`,
|
|
1047
|
+
`, _ = /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_+]*$/.test(m) ? m : "application/octet-stream", I = p.replaceAll(/[\r\n"]/g, "_"), A = [
|
|
1048
1048
|
`--${O}`,
|
|
1049
1049
|
`Content-Disposition: form-data; name="file"; filename="${I}"`,
|
|
1050
|
-
`Content-Type: ${
|
|
1050
|
+
`Content-Type: ${_}`,
|
|
1051
1051
|
"",
|
|
1052
1052
|
""
|
|
1053
|
-
].join(w),
|
|
1053
|
+
].join(w), D = `${w}--${O}--${w}`, E = Buffer.from(A), P = Buffer.from(D), R = new Uint8Array(
|
|
1054
1054
|
E.byteLength + l.byteLength + P.byteLength
|
|
1055
1055
|
);
|
|
1056
1056
|
let b = 0;
|
|
@@ -1168,7 +1168,7 @@ const _t = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
1170
|
};
|
|
1171
|
-
}, Q = (e) => e.discoveryConfig?.localization ?? {}, j = (e) => Q(e).enabled === !0,
|
|
1171
|
+
}, Q = (e) => e.discoveryConfig?.localization ?? {}, j = (e) => Q(e).enabled === !0, _t = (e) => Object.keys(Q(e).locales ?? {}), Ut = (e) => Q(e).defaultLocale, hn = (e) => j(e) && e.storage.locale || void 0, he = "fuzzy", fe = "operator", Se = "pickupPoint", Fe = "shipping", Ne = "delivery-options", Tt = "in-stock", Rt = "trade-policy", Ft = "region-id", Nt = /* @__PURE__ */ new Set([
|
|
1172
1172
|
Rt,
|
|
1173
1173
|
Ft,
|
|
1174
1174
|
he,
|
|
@@ -1286,7 +1286,7 @@ function Wt(e) {
|
|
|
1286
1286
|
return r === "priceRange" && (r = "price", i = i.replace(" TO ", ":")), r === "ft" ? n : `${n}${Le(r)}/${Bt(Le(i)).replaceAll(/ |%20/g, "-")}/`;
|
|
1287
1287
|
}, "");
|
|
1288
1288
|
}
|
|
1289
|
-
const
|
|
1289
|
+
const Gt = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), Ht = (e) => e.key === "operator" && (e.value === "and" || e.value === "or");
|
|
1290
1290
|
function Xt(e, n) {
|
|
1291
1291
|
const { segmentParams: t, extraFacets: r } = zt(e ?? {}), i = n?.salesChannel ?? t.sc, a = n?.regionId ?? t.regionId, o = n?.locale ?? t.locale ?? "";
|
|
1292
1292
|
return {
|
|
@@ -1313,7 +1313,7 @@ function Yt(e, n) {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
function Jt(e, n) {
|
|
1315
1315
|
const t = e.find(({ key: a }) => a === he) ?? null, r = e.find(({ key: a }) => a === fe) ?? null, i = e.find(({ key: a }) => a === Se) ?? null;
|
|
1316
|
-
t &&
|
|
1316
|
+
t && Gt(t) && n.append(he, t.value), r && Ht(r) && n.append(fe, r.value), i && n.append(Se, i.value);
|
|
1317
1317
|
}
|
|
1318
1318
|
function Be(e, n, t, r) {
|
|
1319
1319
|
const {
|
|
@@ -1337,7 +1337,7 @@ function Be(e, n, t, r) {
|
|
|
1337
1337
|
c
|
|
1338
1338
|
);
|
|
1339
1339
|
if (Sn(h, v ?? t.segmentParams), Jt(c, h), u && h.append("show-invisible-items", "true"), n?.hideUnavailableItems !== void 0) {
|
|
1340
|
-
const p = c.find(({ key: S }) => S ===
|
|
1340
|
+
const p = c.find(({ key: S }) => S === Tt), m = p ? p.value : g?.toString() ?? n.hideUnavailableItems.toString();
|
|
1341
1341
|
h.append("hideUnavailableItems", m);
|
|
1342
1342
|
}
|
|
1343
1343
|
n?.simulationBehavior !== void 0 && h.append("simulationBehavior", n.simulationBehavior.toString()), n?.showSponsored !== void 0 && h.append("showSponsored", n.showSponsored.toString()), d !== void 0 && h.append("sponsoredCount", d.toString()), f !== void 0 && h.append("allowRedirect", f.toString());
|
|
@@ -1435,21 +1435,21 @@ const nr = ({
|
|
|
1435
1435
|
}), g = new Headers(o.headers).get("x-forwarded-host") ?? o.headers?.host ?? "", f = a && a.map((I) => I + ".").find((I) => g.includes(I)) || "", h = g.replace(f, ""), v = c({
|
|
1436
1436
|
"content-type": "application/json",
|
|
1437
1437
|
"X-FORWARDED-HOST": h
|
|
1438
|
-
}), l = ({ type: I, ...
|
|
1439
|
-
const
|
|
1440
|
-
endpoint:
|
|
1438
|
+
}), l = ({ type: I, ...A }) => {
|
|
1439
|
+
const D = I === "facets" ? "facets" : "product-search", E = Y({
|
|
1440
|
+
endpoint: D,
|
|
1441
1441
|
segment: u,
|
|
1442
1442
|
defaults: d(),
|
|
1443
|
-
args:
|
|
1443
|
+
args: A
|
|
1444
1444
|
});
|
|
1445
1445
|
return y(
|
|
1446
|
-
`${s}/api/intelligent-search/v1/${
|
|
1446
|
+
`${s}/api/intelligent-search/v1/${D}/${E.path}?${E.params.toString()}`,
|
|
1447
1447
|
{ headers: v }
|
|
1448
1448
|
);
|
|
1449
1449
|
}, p = (I) => l({ ...I, type: "product_search" }), m = ({
|
|
1450
1450
|
field: I,
|
|
1451
|
-
value:
|
|
1452
|
-
hideUnavailableItems:
|
|
1451
|
+
value: A,
|
|
1452
|
+
hideUnavailableItems: D,
|
|
1453
1453
|
showInvisibleItems: E
|
|
1454
1454
|
}) => {
|
|
1455
1455
|
const P = Y({
|
|
@@ -1458,8 +1458,8 @@ const nr = ({
|
|
|
1458
1458
|
defaults: d(),
|
|
1459
1459
|
args: {
|
|
1460
1460
|
field: I,
|
|
1461
|
-
value:
|
|
1462
|
-
hideUnavailableItems:
|
|
1461
|
+
value: A,
|
|
1462
|
+
hideUnavailableItems: D,
|
|
1463
1463
|
showInvisibleItems: E
|
|
1464
1464
|
}
|
|
1465
1465
|
});
|
|
@@ -1474,20 +1474,20 @@ const nr = ({
|
|
|
1474
1474
|
fetchProduct: m,
|
|
1475
1475
|
productsByIdentifier: async ({
|
|
1476
1476
|
field: I,
|
|
1477
|
-
values:
|
|
1478
|
-
showInvisibleItems:
|
|
1477
|
+
values: A,
|
|
1478
|
+
showInvisibleItems: D,
|
|
1479
1479
|
hideUnavailableItems: E
|
|
1480
1480
|
}) => {
|
|
1481
|
-
const P =
|
|
1481
|
+
const P = Ae(Qt);
|
|
1482
1482
|
return (await Promise.all(
|
|
1483
|
-
|
|
1483
|
+
A.map(
|
|
1484
1484
|
(b) => P(async () => {
|
|
1485
1485
|
try {
|
|
1486
1486
|
return await m({
|
|
1487
1487
|
field: I,
|
|
1488
1488
|
value: b,
|
|
1489
1489
|
hideUnavailableItems: E,
|
|
1490
|
-
showInvisibleItems:
|
|
1490
|
+
showInvisibleItems: D
|
|
1491
1491
|
});
|
|
1492
1492
|
} catch {
|
|
1493
1493
|
return null;
|
|
@@ -1499,14 +1499,14 @@ const nr = ({
|
|
|
1499
1499
|
);
|
|
1500
1500
|
},
|
|
1501
1501
|
suggestedTerms: (I) => {
|
|
1502
|
-
const
|
|
1502
|
+
const A = Y({
|
|
1503
1503
|
endpoint: "search-suggestions",
|
|
1504
1504
|
segment: u,
|
|
1505
1505
|
defaults: d(),
|
|
1506
1506
|
args: { query: I.query }
|
|
1507
1507
|
});
|
|
1508
1508
|
return y(
|
|
1509
|
-
`${s}/api/intelligent-search/v1/search-suggestions?${
|
|
1509
|
+
`${s}/api/intelligent-search/v1/search-suggestions?${A.params.toString()}`,
|
|
1510
1510
|
{ headers: v }
|
|
1511
1511
|
);
|
|
1512
1512
|
},
|
|
@@ -1522,27 +1522,27 @@ const nr = ({
|
|
|
1522
1522
|
);
|
|
1523
1523
|
},
|
|
1524
1524
|
productCount: (I) => {
|
|
1525
|
-
const
|
|
1525
|
+
const A = Y({
|
|
1526
1526
|
endpoint: "catalog-count",
|
|
1527
1527
|
segment: u,
|
|
1528
1528
|
defaults: d(),
|
|
1529
1529
|
args: I
|
|
1530
1530
|
});
|
|
1531
1531
|
return y(
|
|
1532
|
-
`${s}/api/intelligent-search/v1/catalog-count/${
|
|
1532
|
+
`${s}/api/intelligent-search/v1/catalog-count/${A.path}?${A.params.toString()}`,
|
|
1533
1533
|
{ headers: v }
|
|
1534
1534
|
);
|
|
1535
1535
|
}
|
|
1536
1536
|
};
|
|
1537
1537
|
}, tr = (e, n) => {
|
|
1538
|
-
const t = nr(e, n), r =
|
|
1538
|
+
const t = nr(e, n), r = kt(e, n), i = St(e);
|
|
1539
1539
|
return {
|
|
1540
1540
|
search: t,
|
|
1541
1541
|
commerce: r,
|
|
1542
1542
|
catalog: i
|
|
1543
1543
|
};
|
|
1544
1544
|
}, rr = 20, ir = (e) => e.entityType === "category", ye = (e) => e.entityType === "brand", $e = (e) => e.entityType === "collection", ar = (e, n) => {
|
|
1545
|
-
const t =
|
|
1545
|
+
const t = Ae(rr), r = async (i) => Promise.all(
|
|
1546
1546
|
i.map(
|
|
1547
1547
|
(a) => t(async () => {
|
|
1548
1548
|
const o = a.slug.toLowerCase(), s = a.locale, c = await n.commerce.catalog.byLinkId.category(
|
|
@@ -1584,7 +1584,7 @@ const nr = ({
|
|
|
1584
1584
|
const t = async (r) => Promise.all(r.map((i) => n.commerce.catalog.salesChannel(i)));
|
|
1585
1585
|
return new ue(t);
|
|
1586
1586
|
}, sr = 1, cr = (e, n) => {
|
|
1587
|
-
const t =
|
|
1587
|
+
const t = Ae(sr), r = async (a) => {
|
|
1588
1588
|
const o = a.reduce((g, { items: f }) => [...g, f], []), s = [...o.flat()], c = await n.commerce.checkout.simulation({
|
|
1589
1589
|
country: a[0].country,
|
|
1590
1590
|
postalCode: a[0].postalCode,
|
|
@@ -1806,7 +1806,7 @@ const ge = (e) => e.toLowerCase(), re = (e, n) => {
|
|
|
1806
1806
|
(t) => Or(t.key)
|
|
1807
1807
|
);
|
|
1808
1808
|
if (Array.isArray(n) && n.length > 1)
|
|
1809
|
-
throw new
|
|
1809
|
+
throw new k(
|
|
1810
1810
|
`You passed ${n.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${n.map((t) => t.key).join(",")}`
|
|
1811
1811
|
);
|
|
1812
1812
|
return n?.[0] ?? null;
|
|
@@ -1815,9 +1815,9 @@ const ge = (e) => e.toLowerCase(), re = (e, n) => {
|
|
|
1815
1815
|
for (let r = 1; r < e.length; r++)
|
|
1816
1816
|
n(e[t], e[r]) > 0 && (t = r);
|
|
1817
1817
|
return e[t];
|
|
1818
|
-
}, Dr = {
|
|
1819
|
-
__resolveType: ({ type: e, values: n }) => e !== "TEXT" && e !== "DELIVERY" ? "StoreFacetRange" : !n || n.length === 0 ? "StoreFacetBoolean" : n.every((t) => t.range) ? "StoreFacetRange" : "StoreFacetBoolean"
|
|
1820
1818
|
}, Ar = {
|
|
1819
|
+
__resolveType: ({ type: e, values: n }) => e !== "TEXT" && e !== "DELIVERY" ? "StoreFacetRange" : !n || n.length === 0 ? "StoreFacetBoolean" : n.every((t) => t.range) ? "StoreFacetRange" : "StoreFacetBoolean"
|
|
1820
|
+
}, Dr = {
|
|
1821
1821
|
key: ({ key: e }) => e,
|
|
1822
1822
|
label: ({ name: e }) => e,
|
|
1823
1823
|
values: ({ values: e }) => e.sort((n, t) => n.name.localeCompare(t.name))
|
|
@@ -1847,9 +1847,9 @@ const ge = (e) => e.toLowerCase(), re = (e, n) => {
|
|
|
1847
1847
|
label: ({ name: e }) => e || "unknown",
|
|
1848
1848
|
selected: ({ selected: e }) => e,
|
|
1849
1849
|
quantity: ({ quantity: e }) => e
|
|
1850
|
-
},
|
|
1850
|
+
}, kr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1851
1851
|
if (!n?.orderId)
|
|
1852
|
-
throw new
|
|
1852
|
+
throw new k("Missing orderId");
|
|
1853
1853
|
return { data: (await t.checkout.cancelOrder(n))?.data };
|
|
1854
1854
|
};
|
|
1855
1855
|
function bn(e) {
|
|
@@ -1870,20 +1870,20 @@ function bn(e) {
|
|
|
1870
1870
|
}
|
|
1871
1871
|
return null;
|
|
1872
1872
|
}
|
|
1873
|
-
function
|
|
1873
|
+
function _r(e) {
|
|
1874
1874
|
if (!e || e.status !== "pending") return !1;
|
|
1875
1875
|
const n = e.dimensionStatus.filter((t) => t.status === "pending").flatMap((t) => t.ruleCollection).filter((t) => t.status === "pending");
|
|
1876
1876
|
return n.length === 0 ? !1 : n.every((t) => !t.isUserNextAuthorizer);
|
|
1877
1877
|
}
|
|
1878
|
-
const
|
|
1878
|
+
const Ur = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1879
1879
|
const r = await t.oms.processOrderAuthorization(n), i = bn(r);
|
|
1880
1880
|
return {
|
|
1881
|
-
isPendingForOtherAuthorizer: !i &&
|
|
1881
|
+
isPendingForOtherAuthorizer: !i && _r(r),
|
|
1882
1882
|
ruleForAuthorization: i
|
|
1883
1883
|
};
|
|
1884
|
-
},
|
|
1884
|
+
}, Tr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1885
1885
|
if (!n?.objectKey)
|
|
1886
|
-
throw new
|
|
1886
|
+
throw new k("Missing objectKey");
|
|
1887
1887
|
const r = n.orderFormId || (await t.orderEntry.createOrderForm()).orderFormId;
|
|
1888
1888
|
return t.orderEntry.startOperation({
|
|
1889
1889
|
objectKey: n.objectKey,
|
|
@@ -1899,16 +1899,16 @@ const Tr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
|
1899
1899
|
}, Fr = async (e, { data: n }, { clients: { commerce: t } }) => ({ id: (await t.subscribeToNewsletter(n))?.Id }), Nr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1900
1900
|
const { fileContent: r, fileName: i, mimeType: a } = n;
|
|
1901
1901
|
if (!r || !i || !a)
|
|
1902
|
-
throw new
|
|
1902
|
+
throw new k(
|
|
1903
1903
|
"Missing required fields: fileContent, fileName, mimeType"
|
|
1904
1904
|
);
|
|
1905
1905
|
const o = r.replaceAll(/\s/g, ""), s = 5 * 1024 * 1024;
|
|
1906
1906
|
if (Math.floor(o.length * 3 / 4) > s)
|
|
1907
|
-
throw new
|
|
1907
|
+
throw new k("File exceeds maximum allowed size of 5MB");
|
|
1908
1908
|
if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
|
|
1909
1909
|
o
|
|
1910
1910
|
))
|
|
1911
|
-
throw new
|
|
1911
|
+
throw new k("Invalid Base64 fileContent");
|
|
1912
1912
|
const d = Buffer.from(o, "base64");
|
|
1913
1913
|
return await t.orderEntry.uploadFile({
|
|
1914
1914
|
fileBuffer: d,
|
|
@@ -1979,12 +1979,12 @@ function wn(e) {
|
|
|
1979
1979
|
`${e.name}:${JSON.stringify(e.value)}:${e.valueReference}`
|
|
1980
1980
|
);
|
|
1981
1981
|
}
|
|
1982
|
-
const
|
|
1982
|
+
const An = (e, n) => e < n ? -1 : e > n ? 1 : 0, $r = (e, n) => An(e.name, n.name), Mr = (e) => [...e ?? []].sort($r), Ge = (e) => e !== null && typeof e == "object" && !Array.isArray(e), zr = (e) => Ge(e) && typeof e.name == "string" && Ge(e.content), Vr = (e) => ({
|
|
1983
1983
|
name: e.name,
|
|
1984
1984
|
content: Object.fromEntries(
|
|
1985
|
-
Object.keys(e.content).sort(
|
|
1985
|
+
Object.keys(e.content).sort(An).map((n) => [n, e.content[n]])
|
|
1986
1986
|
)
|
|
1987
|
-
}),
|
|
1987
|
+
}), Dn = (e, n) => Pe(
|
|
1988
1988
|
`SERVICE:${e}:${JSON.stringify(
|
|
1989
1989
|
Mr((n ?? []).filter(zr)).map(
|
|
1990
1990
|
Vr
|
|
@@ -1994,7 +1994,7 @@ const Dn = (e, n) => e < n ? -1 : e > n ? 1 : 0, $r = (e, n) => Dn(e.name, n.nam
|
|
|
1994
1994
|
function Ee(e) {
|
|
1995
1995
|
const n = e.attachments ?? [];
|
|
1996
1996
|
return {
|
|
1997
|
-
propertyID:
|
|
1997
|
+
propertyID: Dn(e.id, n),
|
|
1998
1998
|
name: e.name,
|
|
1999
1999
|
value: {
|
|
2000
2000
|
id: e.id,
|
|
@@ -2019,12 +2019,12 @@ const qr = (e) => {
|
|
|
2019
2019
|
};
|
|
2020
2020
|
function Wr(e) {
|
|
2021
2021
|
const n = jr(e.value);
|
|
2022
|
-
return n ?
|
|
2022
|
+
return n ? Dn(
|
|
2023
2023
|
n.id,
|
|
2024
2024
|
Array.isArray(n.attachments) ? n.attachments : []
|
|
2025
2025
|
) : xr;
|
|
2026
2026
|
}
|
|
2027
|
-
const
|
|
2027
|
+
const Gr = (e) => {
|
|
2028
2028
|
const n = e.postalCode, t = e.geoCoordinates, r = {
|
|
2029
2029
|
addressType: e.addressType || null,
|
|
2030
2030
|
postalCode: n || null,
|
|
@@ -2043,7 +2043,7 @@ const Hr = (e) => {
|
|
|
2043
2043
|
r.geoCoordinates = i !== null && a !== null ? [a, i] : [];
|
|
2044
2044
|
}
|
|
2045
2045
|
return [r];
|
|
2046
|
-
},
|
|
2046
|
+
}, Hr = (e, n, t) => {
|
|
2047
2047
|
const r = n.postalCode, i = n.geoCoordinates, a = e?.shippingData?.availableAddresses ?? [], o = e?.shippingData?.selectedAddresses ?? [];
|
|
2048
2048
|
if (!t && o.length > 0)
|
|
2049
2049
|
return [o[0]];
|
|
@@ -2077,7 +2077,7 @@ const Hr = (e) => {
|
|
|
2077
2077
|
));
|
|
2078
2078
|
}
|
|
2079
2079
|
);
|
|
2080
|
-
}, En = (e) => e.valueReference === M.attachment, ei = (e) => e.valueReference === M.service, ni = (e) => (e.itemOffered.additionalProperty ?? []).filter(ei).map(Wr).sort((n, t) => n.localeCompare(t)),
|
|
2080
|
+
}, En = (e) => e.valueReference === M.attachment, ei = (e) => e.valueReference === M.service, ni = (e) => (e.itemOffered.additionalProperty ?? []).filter(ei).map(Wr).sort((n, t) => n.localeCompare(t)), kn = (e) => {
|
|
2081
2081
|
const n = ni(e);
|
|
2082
2082
|
return n.length > 0 ? `services:${n.join("-")}` : void 0;
|
|
2083
2083
|
}, Oe = (e) => [
|
|
@@ -2085,7 +2085,7 @@ const Hr = (e) => {
|
|
|
2085
2085
|
e.seller.identifier,
|
|
2086
2086
|
e.price < 0.01 ? "Gift" : void 0,
|
|
2087
2087
|
e.itemOffered.additionalProperty?.filter(En).map(wn).join("-"),
|
|
2088
|
-
|
|
2088
|
+
kn(e)
|
|
2089
2089
|
].filter(Boolean).join("::"), le = (e, n) => ({
|
|
2090
2090
|
listPrice: e.listPrice / 100,
|
|
2091
2091
|
price: e.sellingPrice / 100,
|
|
@@ -2111,7 +2111,7 @@ const Hr = (e) => {
|
|
|
2111
2111
|
content: n.value
|
|
2112
2112
|
})),
|
|
2113
2113
|
...e.priceToken ? { priceToken: e.priceToken } : {}
|
|
2114
|
-
}),
|
|
2114
|
+
}), He = (e) => e.reduce((n, t) => {
|
|
2115
2115
|
const r = Oe(t);
|
|
2116
2116
|
return n.has(r) || n.set(r, []), n.get(r)?.push(t), n;
|
|
2117
2117
|
}, /* @__PURE__ */ new Map()), ri = (e, n) => {
|
|
@@ -2120,17 +2120,17 @@ const Hr = (e) => {
|
|
|
2120
2120
|
itemOffered: {
|
|
2121
2121
|
sku: c.itemOffered.sku
|
|
2122
2122
|
},
|
|
2123
|
-
services:
|
|
2123
|
+
services: kn(c),
|
|
2124
2124
|
index: u
|
|
2125
|
-
}), r = n.items.map(le).map(t), i = e.acceptedOffer.map(t), a = e.orderNumber === n.orderFormId, o =
|
|
2125
|
+
}), r = n.items.map(le).map(t), i = e.acceptedOffer.map(t), a = e.orderNumber === n.orderFormId, o = De(r, i);
|
|
2126
2126
|
return a && o;
|
|
2127
2127
|
};
|
|
2128
|
-
function
|
|
2128
|
+
function _n(e, n) {
|
|
2129
2129
|
return e?.some(
|
|
2130
2130
|
(t) => t.parentItemIndex !== null && t.parentItemIndex !== void 0 && e[t.parentItemIndex]?.id === n
|
|
2131
2131
|
);
|
|
2132
2132
|
}
|
|
2133
|
-
function
|
|
2133
|
+
function Un(e, n) {
|
|
2134
2134
|
return e?.some(
|
|
2135
2135
|
(t) => t.id === n && t.parentItemIndex !== null
|
|
2136
2136
|
);
|
|
@@ -2138,7 +2138,7 @@ function Tn(e, n) {
|
|
|
2138
2138
|
const Xe = (e) => {
|
|
2139
2139
|
const n = e.items.reduce(
|
|
2140
2140
|
(t, r, i) => {
|
|
2141
|
-
const a =
|
|
2141
|
+
const a = Un(e.items, r.id) || _n(e.items, r.id) ? `${Oe(le(r))}::${i}` : Oe(le(r));
|
|
2142
2142
|
return t[a] || (t[a] = []), t[a].push(r), t;
|
|
2143
2143
|
},
|
|
2144
2144
|
{}
|
|
@@ -2171,7 +2171,7 @@ const Xe = (e) => {
|
|
|
2171
2171
|
text: i,
|
|
2172
2172
|
status: a.toUpperCase()
|
|
2173
2173
|
}))
|
|
2174
|
-
}),
|
|
2174
|
+
}), Tn = ({ items: e }, n) => {
|
|
2175
2175
|
const t = e.map((r) => {
|
|
2176
2176
|
const i = (r.bundleItems ?? []).map(Ee).map(({ propertyID: a }) => a).sort((a, o) => a.localeCompare(o));
|
|
2177
2177
|
return {
|
|
@@ -2192,7 +2192,7 @@ const Xe = (e) => {
|
|
|
2192
2192
|
id: e.orderFormId,
|
|
2193
2193
|
appId: "faststore",
|
|
2194
2194
|
key: "cartEtag",
|
|
2195
|
-
value:
|
|
2195
|
+
value: Tn(e, t)
|
|
2196
2196
|
});
|
|
2197
2197
|
} catch (r) {
|
|
2198
2198
|
throw console.error(
|
|
@@ -2206,7 +2206,7 @@ const Xe = (e) => {
|
|
|
2206
2206
|
const r = e.customData?.customApps.find(
|
|
2207
2207
|
(a) => a.id === "faststore"
|
|
2208
2208
|
)?.fields?.cartEtag;
|
|
2209
|
-
return r == null ? !0 :
|
|
2209
|
+
return r == null ? !0 : Tn(e, n) !== r;
|
|
2210
2210
|
}, ai = async (e, { clients: { commerce: n } }) => n.checkout.clearOrderFormMessages({
|
|
2211
2211
|
id: e
|
|
2212
2212
|
}), Je = async (e, n, { clients: { commerce: t } }) => {
|
|
@@ -2217,7 +2217,7 @@ const Xe = (e) => {
|
|
|
2217
2217
|
n
|
|
2218
2218
|
);
|
|
2219
2219
|
if (r) {
|
|
2220
|
-
const a =
|
|
2220
|
+
const a = Hr(e, n, i), s = a || Gr(n);
|
|
2221
2221
|
return !!n.deliveryMode?.deliveryWindow && await t.checkout.shippingData(
|
|
2222
2222
|
{
|
|
2223
2223
|
id: e.orderFormId,
|
|
@@ -2284,28 +2284,28 @@ const Xe = (e) => {
|
|
|
2284
2284
|
const m = Ke(
|
|
2285
2285
|
r,
|
|
2286
2286
|
d
|
|
2287
|
-
), S =
|
|
2288
|
-
(b, [N,
|
|
2289
|
-
const
|
|
2290
|
-
if (!
|
|
2291
|
-
return
|
|
2292
|
-
const [te, ...Mn] =
|
|
2293
|
-
if (
|
|
2287
|
+
), S = He(v), O = He(d.items.map(le)), w = Array.from(O.entries()), C = Array.from(S.entries()), { itemsToAdd: _, itemsToUpdate: I } = C.reduce(
|
|
2288
|
+
(b, [N, ke]) => {
|
|
2289
|
+
const _e = O.get(N);
|
|
2290
|
+
if (!_e)
|
|
2291
|
+
return ke.forEach((G) => b.itemsToAdd.push(G)), b;
|
|
2292
|
+
const [te, ...Mn] = _e;
|
|
2293
|
+
if (Un(d.items, te.itemOffered.sku) || _n(d.items, te.itemOffered.sku))
|
|
2294
2294
|
return b.itemsToUpdate.push(te), b;
|
|
2295
|
-
const zn =
|
|
2295
|
+
const zn = ke.reduce((G, Vn) => G + Vn.quantity, 0);
|
|
2296
2296
|
return b.itemsToUpdate.push({
|
|
2297
2297
|
...te,
|
|
2298
2298
|
quantity: zn
|
|
2299
|
-
}), Mn.forEach((
|
|
2299
|
+
}), Mn.forEach((G) => b.itemsToUpdate.push({ ...G, quantity: 0 })), b;
|
|
2300
2300
|
},
|
|
2301
2301
|
{
|
|
2302
2302
|
itemsToAdd: [],
|
|
2303
2303
|
itemsToUpdate: []
|
|
2304
2304
|
}
|
|
2305
|
-
),
|
|
2305
|
+
), A = w.filter(([b]) => !S.has(b)).flatMap(([, b]) => b.map((N) => ({ ...N, quantity: 0 }))), D = [..._, ...I, ...A].map(
|
|
2306
2306
|
ti
|
|
2307
2307
|
), { updateShipping: E } = t ? Pn(d, t) : { updateShipping: !1 };
|
|
2308
|
-
if (
|
|
2308
|
+
if (D.length === 0 && !E)
|
|
2309
2309
|
return Qe(
|
|
2310
2310
|
d,
|
|
2311
2311
|
o,
|
|
@@ -2313,9 +2313,9 @@ const Xe = (e) => {
|
|
|
2313
2313
|
m
|
|
2314
2314
|
);
|
|
2315
2315
|
let P;
|
|
2316
|
-
|
|
2316
|
+
D.length > 0 ? P = await a.checkout.updateOrderFormItems({
|
|
2317
2317
|
id: d.orderFormId,
|
|
2318
|
-
orderItems:
|
|
2318
|
+
orderItems: D,
|
|
2319
2319
|
shouldSplitItem: l
|
|
2320
2320
|
}).then(
|
|
2321
2321
|
(b) => Je(b, t, r)
|
|
@@ -2342,7 +2342,7 @@ const Xe = (e) => {
|
|
|
2342
2342
|
locale: c
|
|
2343
2343
|
}
|
|
2344
2344
|
}) : b).then((b) => Ye(b, a, h)).then(Xe);
|
|
2345
|
-
const R =
|
|
2345
|
+
const R = De(
|
|
2346
2346
|
d.messages,
|
|
2347
2347
|
P.messages
|
|
2348
2348
|
);
|
|
@@ -2503,11 +2503,11 @@ const bi = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
|
|
|
2503
2503
|
r,
|
|
2504
2504
|
i?.cookie,
|
|
2505
2505
|
a
|
|
2506
|
-
), m = await r.commerce.session(f.toString()).catch(() => null), S = m?.namespaces.profile ?? null, O = m?.namespaces.shopper ?? null, w = m?.namespaces.store ?? null, C = m?.namespaces.authentication ?? null,
|
|
2507
|
-
let
|
|
2506
|
+
), m = await r.commerce.session(f.toString()).catch(() => null), S = m?.namespaces.profile ?? null, O = m?.namespaces.shopper ?? null, w = m?.namespaces.store ?? null, C = m?.namespaces.authentication ?? null, _ = m?.namespaces.checkout ?? null, I = m?.namespaces.public ?? null;
|
|
2507
|
+
let A = null;
|
|
2508
2508
|
if (v && S?.id?.value)
|
|
2509
2509
|
try {
|
|
2510
|
-
|
|
2510
|
+
A = await r.commerce.masterData.getContractById({
|
|
2511
2511
|
contractId: S.id.value
|
|
2512
2512
|
});
|
|
2513
2513
|
} catch {
|
|
@@ -2516,7 +2516,7 @@ const bi = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
|
|
|
2516
2516
|
`
|
|
2517
2517
|
);
|
|
2518
2518
|
}
|
|
2519
|
-
const
|
|
2519
|
+
const D = await Ii(
|
|
2520
2520
|
r,
|
|
2521
2521
|
o,
|
|
2522
2522
|
s,
|
|
@@ -2533,8 +2533,8 @@ const bi = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
|
|
|
2533
2533
|
channel: ci(
|
|
2534
2534
|
o,
|
|
2535
2535
|
w?.channel?.value,
|
|
2536
|
-
|
|
2537
|
-
|
|
2536
|
+
_?.regionId?.value,
|
|
2537
|
+
D
|
|
2538
2538
|
),
|
|
2539
2539
|
/**
|
|
2540
2540
|
* B2B data structure in Session:
|
|
@@ -2548,7 +2548,7 @@ const bi = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
|
|
|
2548
2548
|
shopper: O,
|
|
2549
2549
|
publicData: I,
|
|
2550
2550
|
profile: S,
|
|
2551
|
-
contract:
|
|
2551
|
+
contract: A,
|
|
2552
2552
|
customerId: l,
|
|
2553
2553
|
unitId: p
|
|
2554
2554
|
}),
|
|
@@ -2557,15 +2557,15 @@ const bi = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
|
|
|
2557
2557
|
geoCoordinates: d?.latitude && d?.longitude && d || null,
|
|
2558
2558
|
city: u
|
|
2559
2559
|
};
|
|
2560
|
-
return
|
|
2560
|
+
return De(n, E) ? null : E;
|
|
2561
2561
|
}, Ci = {
|
|
2562
2562
|
validateCart: si,
|
|
2563
2563
|
validateSession: bi,
|
|
2564
2564
|
subscribeToNewsletter: Fr,
|
|
2565
|
-
cancelOrder:
|
|
2566
|
-
processOrderAuthorization:
|
|
2565
|
+
cancelOrder: kr,
|
|
2566
|
+
processOrderAuthorization: Ur,
|
|
2567
2567
|
uploadFileToOrderEntry: Nr,
|
|
2568
|
-
startOrderEntryOperation:
|
|
2568
|
+
startOrderEntryOperation: Tr,
|
|
2569
2569
|
startRecommendationSession: Rr
|
|
2570
2570
|
};
|
|
2571
2571
|
var Ce;
|
|
@@ -2580,15 +2580,15 @@ function Fn(e) {
|
|
|
2580
2580
|
return e;
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
2583
|
-
const
|
|
2583
|
+
const Ai = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string" ? e : null, Di = new jn({
|
|
2584
2584
|
name: "ObjectOrString",
|
|
2585
2585
|
description: "A string or the string representation of an object (a stringified object).",
|
|
2586
2586
|
parseValue: wi,
|
|
2587
|
-
serialize:
|
|
2587
|
+
serialize: Ai,
|
|
2588
2588
|
parseLiteral(e) {
|
|
2589
2589
|
return e.kind === Ce.STRING ? Fn(e.value) : null;
|
|
2590
2590
|
}
|
|
2591
|
-
}),
|
|
2591
|
+
}), U = (e) => "Price" in e && "seller" in e && "product" in e, T = (e) => "skuName" in e, Pi = {
|
|
2592
2592
|
priceCurrency: async (e, n, t) => {
|
|
2593
2593
|
const {
|
|
2594
2594
|
loaders: { salesChannelLoader: r },
|
|
@@ -2596,36 +2596,36 @@ const Di = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
|
|
|
2596
2596
|
} = t;
|
|
2597
2597
|
return (await r.load(i.salesChannel)).CurrencyCode ?? "";
|
|
2598
2598
|
},
|
|
2599
|
-
priceValidUntil: (e) =>
|
|
2599
|
+
priceValidUntil: (e) => U(e) ? e.PriceValidUntil ?? "" : T(e) ? e.priceValidUntil ?? "" : null,
|
|
2600
2600
|
itemCondition: () => "https://schema.org/NewCondition",
|
|
2601
|
-
availability: async (e) =>
|
|
2602
|
-
seller: (e, n, t) =>
|
|
2601
|
+
availability: async (e) => U(e) ? Me(B(e)) : T(e) ? Me(mr(e.availability)) : null,
|
|
2602
|
+
seller: (e, n, t) => U(e) ? {
|
|
2603
2603
|
identifier: t.storage.channel?.seller || e.seller.sellerId || ""
|
|
2604
|
-
} :
|
|
2604
|
+
} : T(e) ? {
|
|
2605
2605
|
identifier: e.seller
|
|
2606
2606
|
} : null,
|
|
2607
|
-
price: (e) =>
|
|
2608
|
-
priceWithTaxes: (e) =>
|
|
2607
|
+
price: (e) => U(e) ? W(e) : T(e) ? e.sellingPrice / 100 : null,
|
|
2608
|
+
priceWithTaxes: (e) => U(e) ? q(W(e), e?.Tax, e.product.unitMultiplier) : T(e) ? q(
|
|
2609
2609
|
e.sellingPrice / 100,
|
|
2610
2610
|
e.tax / 100,
|
|
2611
2611
|
e.unitMultiplier
|
|
2612
2612
|
) : null,
|
|
2613
|
-
sellingPrice: (e) =>
|
|
2614
|
-
listPrice: (e) =>
|
|
2615
|
-
listPriceWithTaxes: (e) =>
|
|
2613
|
+
sellingPrice: (e) => U(e) ? gr(e) : T(e) ? e.sellingPrice / 100 : null,
|
|
2614
|
+
listPrice: (e) => U(e) ? e.ListPrice ?? 0 : T(e) ? e.listPrice / 100 : null,
|
|
2615
|
+
listPriceWithTaxes: (e) => U(e) ? q(
|
|
2616
2616
|
e.ListPrice ?? 0,
|
|
2617
2617
|
e?.Tax,
|
|
2618
2618
|
e.product.unitMultiplier
|
|
2619
|
-
) :
|
|
2620
|
-
itemOffered: (e) =>
|
|
2619
|
+
) : T(e) ? q(e.listPrice / 100, e.tax / 100, e.unitMultiplier) : null,
|
|
2620
|
+
itemOffered: (e) => U(e) ? e.product : T(e) ? {
|
|
2621
2621
|
...e.product,
|
|
2622
2622
|
attachmentsValues: e.attachments,
|
|
2623
2623
|
servicesValues: e.bundleItems ?? []
|
|
2624
2624
|
} : null,
|
|
2625
|
-
quantity: (e) =>
|
|
2626
|
-
isGift: (e) =>
|
|
2627
|
-
priceToken: (e) =>
|
|
2628
|
-
}, Ei = ({ linkText: e }) => `/${e}/p`,
|
|
2625
|
+
quantity: (e) => U(e) ? e.AvailableQuantity ?? 0 : T(e) ? e.quantity : null,
|
|
2626
|
+
isGift: (e) => T(e) ? e.isGift ?? !1 : null,
|
|
2627
|
+
priceToken: (e) => U(e) ? e.PriceToken ?? null : null
|
|
2628
|
+
}, Ei = ({ linkText: e }) => `/${e}/p`, ki = ({
|
|
2629
2629
|
offer: e,
|
|
2630
2630
|
seller: n,
|
|
2631
2631
|
product: t
|
|
@@ -2633,26 +2633,11 @@ const Di = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
|
|
|
2633
2633
|
...e,
|
|
2634
2634
|
product: t,
|
|
2635
2635
|
seller: n
|
|
2636
|
-
}),
|
|
2637
|
-
if (!Ti(e))
|
|
2638
|
-
return new Date(
|
|
2639
|
-
Ui.test(e) ? `${e}Z` : e
|
|
2640
|
-
);
|
|
2641
|
-
const n = Number(e);
|
|
2642
|
-
return new Date(n >= ki ? n : n * 1e3);
|
|
2643
|
-
}, Fi = (e) => {
|
|
2644
|
-
if (e == null)
|
|
2645
|
-
return "";
|
|
2646
|
-
const n = String(e).trim();
|
|
2647
|
-
if (n === "")
|
|
2648
|
-
return "";
|
|
2649
|
-
const t = Ri(n);
|
|
2650
|
-
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
2651
|
-
}, Ni = {
|
|
2636
|
+
}), _i = {
|
|
2652
2637
|
imageText: "image",
|
|
2653
2638
|
imageUrl: "https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg",
|
|
2654
2639
|
imageLabel: "label"
|
|
2655
|
-
}, ae = (e, n) => `${e}-${n}`, nn = (e, n) => `/${ae(e, n)}/p`,
|
|
2640
|
+
}, ae = (e, n) => `${e}-${n}`, nn = (e, n) => `/${ae(e, n)}/p`, Ui = (e) => Array.isArray(e) && e.length > 0 ? e : null;
|
|
2656
2641
|
function we(e) {
|
|
2657
2642
|
return e.replace(/^\/+|\/+$/g, "");
|
|
2658
2643
|
}
|
|
@@ -2681,10 +2666,10 @@ async function oe(e, n, t) {
|
|
|
2681
2666
|
})();
|
|
2682
2667
|
return i.set(r, o), o;
|
|
2683
2668
|
}
|
|
2684
|
-
const
|
|
2669
|
+
const Ti = (e, n) => {
|
|
2685
2670
|
const t = e.findIndex((r) => we(r).split("/").at(-1) === n);
|
|
2686
2671
|
return t < 0 ? 0 : t;
|
|
2687
|
-
},
|
|
2672
|
+
}, Ri = {
|
|
2688
2673
|
productID: ({ itemId: e }) => e,
|
|
2689
2674
|
name: ({ isVariantOf: e, name: n }) => n ?? e.productName,
|
|
2690
2675
|
slug: ({ isVariantOf: { linkText: e }, itemId: n }) => ae(e, n),
|
|
@@ -2707,7 +2692,7 @@ const Bi = (e, n) => {
|
|
|
2707
2692
|
productId: c
|
|
2708
2693
|
},
|
|
2709
2694
|
itemId: u
|
|
2710
|
-
} = e, d =
|
|
2695
|
+
} = e, d = Ti(s, o), g = r[d], f = we(g).split("/"), h = t.storage.locale;
|
|
2711
2696
|
if (j(t) && h) {
|
|
2712
2697
|
const v = await oe(t, c, h);
|
|
2713
2698
|
if (v) {
|
|
@@ -2756,7 +2741,7 @@ const Bi = (e, n) => {
|
|
|
2756
2741
|
};
|
|
2757
2742
|
},
|
|
2758
2743
|
image: ({ images: e }, n) => {
|
|
2759
|
-
const t = (
|
|
2744
|
+
const t = (Ui(e) ?? [_i]).map(
|
|
2760
2745
|
({ imageUrl: s, imageText: c, imageLabel: u }) => ({
|
|
2761
2746
|
alternateName: c ?? "",
|
|
2762
2747
|
url: s.replace("vteximg.com.br", "vtexassets.com"),
|
|
@@ -2779,7 +2764,7 @@ const Bi = (e, n) => {
|
|
|
2779
2764
|
review: () => [],
|
|
2780
2765
|
aggregateRating: () => ({}),
|
|
2781
2766
|
offers: (e) => e.sellers.map(
|
|
2782
|
-
(n) =>
|
|
2767
|
+
(n) => ki({
|
|
2783
2768
|
offer: n.commertialOffer,
|
|
2784
2769
|
seller: n,
|
|
2785
2770
|
product: e
|
|
@@ -2812,12 +2797,15 @@ const Bi = (e, n) => {
|
|
|
2812
2797
|
hasSpecifications: ({ isVariantOf: e }) => !!e.skuSpecifications?.length,
|
|
2813
2798
|
skuSpecifications: ({ isVariantOf: { skuSpecifications: e } }) => e ?? [],
|
|
2814
2799
|
specificationGroups: ({ isVariantOf: { specificationGroups: e } }) => e,
|
|
2815
|
-
|
|
2800
|
+
// Passed through as Intelligent Search delivers it (epoch milliseconds for
|
|
2801
|
+
// most accounts). Stores read this raw value; the PDP JSON-LD normalizes it
|
|
2802
|
+
// on its own in `@faststore/core`.
|
|
2803
|
+
releaseDate: ({ isVariantOf: { releaseDate: e } }) => e ?? "",
|
|
2816
2804
|
advertisement: ({ isVariantOf: { advertisement: e } }) => e,
|
|
2817
2805
|
deliveryPromiseBadges: ({ isVariantOf: { deliveryPromisesBadges: e } }) => e,
|
|
2818
2806
|
otherLocales: async (e, n, t) => {
|
|
2819
2807
|
if (!j(t)) return null;
|
|
2820
|
-
const r =
|
|
2808
|
+
const r = _t(t);
|
|
2821
2809
|
if (r.length === 0) return null;
|
|
2822
2810
|
const i = e.isVariantOf.productId, a = e.itemId, o = t.storage.locale, s = await oe(t, i, o);
|
|
2823
2811
|
if (!s?.availableLinkIds) return null;
|
|
@@ -2829,7 +2817,7 @@ const Bi = (e, n) => {
|
|
|
2829
2817
|
},
|
|
2830
2818
|
defaultLocaleSlug: async (e, n, t) => {
|
|
2831
2819
|
if (!j(t)) return null;
|
|
2832
|
-
const r =
|
|
2820
|
+
const r = Ut(t);
|
|
2833
2821
|
if (!r) return null;
|
|
2834
2822
|
const { productId: i, linkText: a } = e.isVariantOf, o = e.itemId, c = (await oe(
|
|
2835
2823
|
t,
|
|
@@ -2838,14 +2826,14 @@ const Bi = (e, n) => {
|
|
|
2838
2826
|
))?.availableLinkIds?.[r] ?? a;
|
|
2839
2827
|
return ae(c, o);
|
|
2840
2828
|
}
|
|
2841
|
-
},
|
|
2829
|
+
}, Fi = /* @__PURE__ */ new Set(["allSpecifications"]), Ni = {
|
|
2842
2830
|
hasVariant: (e) => e.isVariantOf.items.map((n) => F(n, e.isVariantOf)),
|
|
2843
2831
|
productGroupID: ({ isVariantOf: e }) => e.productId,
|
|
2844
2832
|
productClusters: ({ isVariantOf: e }) => e.productClusters ?? [],
|
|
2845
2833
|
name: (e) => e.isVariantOf.productName,
|
|
2846
2834
|
skuVariants: (e) => e,
|
|
2847
2835
|
additionalProperty: ({ isVariantOf: { specificationGroups: e } }) => e.filter(
|
|
2848
|
-
(n) => !
|
|
2836
|
+
(n) => !Fi.has(n.name)
|
|
2849
2837
|
).flatMap(
|
|
2850
2838
|
({ specifications: n }) => n.flatMap(
|
|
2851
2839
|
({ name: t, values: r }) => r.map((i) => ({
|
|
@@ -2855,7 +2843,7 @@ const Bi = (e, n) => {
|
|
|
2855
2843
|
}))
|
|
2856
2844
|
)
|
|
2857
2845
|
)
|
|
2858
|
-
},
|
|
2846
|
+
}, Li = {
|
|
2859
2847
|
propertyID: (e) => e.propertyID || wn(e),
|
|
2860
2848
|
name: ({ name: e }) => e,
|
|
2861
2849
|
value: ({ value: e }) => e,
|
|
@@ -2871,17 +2859,17 @@ const Bi = (e, n) => {
|
|
|
2871
2859
|
({ offer: r }, { offer: i }) => In(r, i)
|
|
2872
2860
|
);
|
|
2873
2861
|
return t ? t.sku : e[0];
|
|
2874
|
-
}, Nn = (e) => e !== "" && !Number.isNaN(Number(e)),
|
|
2862
|
+
}, Nn = (e) => e !== "" && !Number.isNaN(Number(e)), Bi = /^vrn:recommendations:[^:]+:[^:]+:[^:]+$/, $i = async (e, { campaignVrn: n, userId: t, products: r }, i) => {
|
|
2875
2863
|
const {
|
|
2876
2864
|
clients: { commerce: a }
|
|
2877
2865
|
} = i, { salesChannel: o } = i.storage.channel, s = n?.trim();
|
|
2878
|
-
if (!s || !
|
|
2879
|
-
throw new
|
|
2866
|
+
if (!s || !Bi.test(s))
|
|
2867
|
+
throw new k(`Invalid campaignVrn: "${n}"`);
|
|
2880
2868
|
const c = t?.trim();
|
|
2881
2869
|
if (t != null && !c)
|
|
2882
|
-
throw new
|
|
2870
|
+
throw new k("Invalid userId: must be a non-empty string");
|
|
2883
2871
|
if (r != null && (!Array.isArray(r) || r.some((h) => !h?.trim())))
|
|
2884
|
-
throw new
|
|
2872
|
+
throw new k(
|
|
2885
2873
|
"Invalid products: must be an array of non-empty strings"
|
|
2886
2874
|
);
|
|
2887
2875
|
const u = await a.recommendation.recommendations({
|
|
@@ -2909,19 +2897,19 @@ const Bi = (e, n) => {
|
|
|
2909
2897
|
discount_desc: "discount:desc",
|
|
2910
2898
|
score_desc: ""
|
|
2911
2899
|
};
|
|
2912
|
-
function
|
|
2900
|
+
function Mi(e, n) {
|
|
2913
2901
|
let t;
|
|
2914
2902
|
if (Object.hasOwn(n, e) ? t = n[e] : Object.hasOwn(tn, e) && (t = tn[e]), t === void 0)
|
|
2915
|
-
throw new
|
|
2903
|
+
throw new k(`Unknown sort value: ${e}`);
|
|
2916
2904
|
return t;
|
|
2917
2905
|
}
|
|
2918
|
-
const
|
|
2906
|
+
const zi = async (e, { operationId: n }, { clients: { commerce: t } }) => {
|
|
2919
2907
|
if (!n)
|
|
2920
|
-
throw new
|
|
2908
|
+
throw new k("Missing operationId");
|
|
2921
2909
|
return t.orderEntry.getOperation({ operationId: n });
|
|
2922
|
-
},
|
|
2910
|
+
}, Vi = async (e, { orderFormId: n }, { clients: { commerce: t } }) => {
|
|
2923
2911
|
if (!n)
|
|
2924
|
-
throw new
|
|
2912
|
+
throw new k("Missing orderFormId");
|
|
2925
2913
|
const { items: r } = await t.orderEntry.getOrderFormItems({ orderFormId: n });
|
|
2926
2914
|
return (r ?? []).map((i) => ({
|
|
2927
2915
|
id: i.id,
|
|
@@ -2935,19 +2923,19 @@ const Wi = async (e, { operationId: n }, { clients: { commerce: t } }) => {
|
|
|
2935
2923
|
unitMultiplier: i.unitMultiplier ?? 1
|
|
2936
2924
|
}));
|
|
2937
2925
|
};
|
|
2938
|
-
async function
|
|
2926
|
+
async function xi(e, n, t, r) {
|
|
2939
2927
|
const i = n.slice(0, n.lastIndexOf("-"));
|
|
2940
2928
|
return (await oe(e, t, r))?.linkId === i;
|
|
2941
2929
|
}
|
|
2942
|
-
const Ln = "Invalid SkuId", Bn = "Slug was set but the fetched sku does not satisfy the slug condition.",
|
|
2943
|
-
async function
|
|
2930
|
+
const Ln = "Invalid SkuId", Bn = "Slug was set but the fetched sku does not satisfy the slug condition.", qi = "UseAdHocCard", ji = (e) => J(e) || e instanceof Error && (e.message === Ln || e.message.startsWith(Bn));
|
|
2931
|
+
async function Wi(e, n, t, r) {
|
|
2944
2932
|
const { linkText: i, productId: a } = n.isVariantOf;
|
|
2945
|
-
if (!(!t || !i || t.startsWith(i) || j(e) && r && Nn(t.split("-").pop() ?? "") && await
|
|
2933
|
+
if (!(!t || !i || t.startsWith(i) || j(e) && r && Nn(t.split("-").pop() ?? "") && await xi(e, t, a, r)))
|
|
2946
2934
|
throw new Error(`${Bn} slug: ${t}, linkText: ${i}`);
|
|
2947
2935
|
}
|
|
2948
|
-
async function
|
|
2936
|
+
async function Gi(e, n) {
|
|
2949
2937
|
if (n == null)
|
|
2950
|
-
throw new
|
|
2938
|
+
throw new k("Missing slug or id");
|
|
2951
2939
|
const {
|
|
2952
2940
|
clients: { commerce: t, search: r }
|
|
2953
2941
|
} = e, i = await t.catalog.portal.pagetype(`${n}/p`);
|
|
@@ -2961,7 +2949,7 @@ async function Ki(e, n) {
|
|
|
2961
2949
|
throw new $(`No product found for id ${i.id}`);
|
|
2962
2950
|
return F(de(a.items), a);
|
|
2963
2951
|
}
|
|
2964
|
-
const
|
|
2952
|
+
const Hi = {
|
|
2965
2953
|
product: async (e, { locator: n }, t) => {
|
|
2966
2954
|
const r = We(n), i = je(n), a = wr(n), o = Cr(n);
|
|
2967
2955
|
r && ce(t, r), i && ve(t, i);
|
|
@@ -2973,11 +2961,11 @@ const Qi = {
|
|
|
2973
2961
|
if (!Nn(c))
|
|
2974
2962
|
throw new Error(Ln);
|
|
2975
2963
|
const u = await s.load(c);
|
|
2976
|
-
return await
|
|
2964
|
+
return await Wi(t, u, o, i), u;
|
|
2977
2965
|
} catch (c) {
|
|
2978
|
-
if (!
|
|
2966
|
+
if (!ji(c))
|
|
2979
2967
|
throw c;
|
|
2980
|
-
return
|
|
2968
|
+
return Gi(t, o);
|
|
2981
2969
|
}
|
|
2982
2970
|
},
|
|
2983
2971
|
collection: (e, { slug: n }, t) => {
|
|
@@ -3003,7 +2991,7 @@ const Qi = {
|
|
|
3003
2991
|
page: Math.ceil(g / n) || 0,
|
|
3004
2992
|
count: n,
|
|
3005
2993
|
query: i ?? void 0,
|
|
3006
|
-
sort:
|
|
2994
|
+
sort: Mi(r ?? "score_desc", s.storage.customSortMap),
|
|
3007
2995
|
selectedFacets: a?.flatMap(xe) ?? [],
|
|
3008
2996
|
sponsoredCount: o ?? void 0
|
|
3009
2997
|
};
|
|
@@ -3187,7 +3175,7 @@ const Qi = {
|
|
|
3187
3175
|
userOrder: async (e, { orderId: n }, t) => {
|
|
3188
3176
|
try {
|
|
3189
3177
|
if (!n)
|
|
3190
|
-
throw new
|
|
3178
|
+
throw new k("Missing orderId");
|
|
3191
3179
|
const {
|
|
3192
3180
|
clients: { commerce: r }
|
|
3193
3181
|
} = t, i = await r.oms.userOrder({ orderId: n });
|
|
@@ -3286,7 +3274,7 @@ const Qi = {
|
|
|
3286
3274
|
} = t, s = x(L(i?.cookie ?? "", r))?.userId ?? "";
|
|
3287
3275
|
if (!s)
|
|
3288
3276
|
return !0;
|
|
3289
|
-
const c = await a.licenseManager.isResourceGranted({ userId: s, resourceKey:
|
|
3277
|
+
const c = await a.licenseManager.isResourceGranted({ userId: s, resourceKey: qi }).catch(() => null);
|
|
3290
3278
|
return typeof c == "boolean" ? c : !0;
|
|
3291
3279
|
},
|
|
3292
3280
|
listUserQuotes: async (e, n, t) => {
|
|
@@ -3401,7 +3389,7 @@ const Qi = {
|
|
|
3401
3389
|
// Contract list from VTEX session `shopper.availableContracts`.
|
|
3402
3390
|
availableContracts: async (e, { orgUnitId: n }, t) => {
|
|
3403
3391
|
if (!n)
|
|
3404
|
-
throw new
|
|
3392
|
+
throw new k("Missing orgUnitId");
|
|
3405
3393
|
const {
|
|
3406
3394
|
account: r,
|
|
3407
3395
|
headers: i,
|
|
@@ -3438,10 +3426,10 @@ const Qi = {
|
|
|
3438
3426
|
geoCoordinates: n
|
|
3439
3427
|
});
|
|
3440
3428
|
},
|
|
3441
|
-
orderEntryOperation:
|
|
3442
|
-
orderFormItems:
|
|
3443
|
-
recommendations:
|
|
3444
|
-
},
|
|
3429
|
+
orderEntryOperation: zi,
|
|
3430
|
+
orderFormItems: Vi,
|
|
3431
|
+
recommendations: $i
|
|
3432
|
+
}, Xi = {
|
|
3445
3433
|
reviewRating: () => ({
|
|
3446
3434
|
ratingValue: 5,
|
|
3447
3435
|
bestRating: 5
|
|
@@ -3449,7 +3437,7 @@ const Qi = {
|
|
|
3449
3437
|
author: () => ({
|
|
3450
3438
|
name: ""
|
|
3451
3439
|
})
|
|
3452
|
-
},
|
|
3440
|
+
}, Yi = (e, n, t) => n ? e.key === "category-1" : t ? e.key === "brand" : !1, Ji = {
|
|
3453
3441
|
suggestions: async (e, n, t) => {
|
|
3454
3442
|
const {
|
|
3455
3443
|
clients: { search: r }
|
|
@@ -3500,7 +3488,7 @@ const Qi = {
|
|
|
3500
3488
|
t.storage.searchArgs = e;
|
|
3501
3489
|
const { facets: i = [] } = await r.facets(e), a = !e.query, o = e.selectedFacets?.length ? e.selectedFacets[0].key === "category-1" : !1, s = e.selectedFacets?.length ? e.selectedFacets[0].key === "brand" : !1;
|
|
3502
3490
|
return i.filter(
|
|
3503
|
-
(u) => !a || !
|
|
3491
|
+
(u) => !a || !Yi(u, o, s)
|
|
3504
3492
|
);
|
|
3505
3493
|
},
|
|
3506
3494
|
metadata: async ({ productSearchPromise: e }) => {
|
|
@@ -3512,12 +3500,12 @@ const Qi = {
|
|
|
3512
3500
|
};
|
|
3513
3501
|
},
|
|
3514
3502
|
searchId: async ({ productSearchPromise: e }) => (await e).searchId
|
|
3515
|
-
},
|
|
3503
|
+
}, Ki = {
|
|
3516
3504
|
title: ({ title: e }) => e ?? "",
|
|
3517
3505
|
description: ({ description: e }) => e ?? "",
|
|
3518
3506
|
canonical: ({ canonical: e }) => e ?? "",
|
|
3519
3507
|
titleTemplate: () => ""
|
|
3520
|
-
},
|
|
3508
|
+
}, Qi = ["bd", "d", "h", "m"], Zi = (e) => Qi.includes(e), ea = {
|
|
3521
3509
|
bd: {
|
|
3522
3510
|
0: "Today",
|
|
3523
3511
|
1: "In 1 business day",
|
|
@@ -3539,12 +3527,12 @@ const Qi = {
|
|
|
3539
3527
|
other: "Up to # minutes"
|
|
3540
3528
|
}
|
|
3541
3529
|
}, $n = (e) => {
|
|
3542
|
-
const [n, t] = [e.split(/\D+/)[0], e.split(/[0-9]+/)[1]], r = n !== "" && !Number.isNaN(Number(n)), i =
|
|
3530
|
+
const [n, t] = [e.split(/\D+/)[0], e.split(/[0-9]+/)[1]], r = n !== "" && !Number.isNaN(Number(n)), i = Zi(t);
|
|
3543
3531
|
if (!r || !i)
|
|
3544
3532
|
return "";
|
|
3545
3533
|
const a = Number(n) < 2 ? Number(n) : "other";
|
|
3546
|
-
return
|
|
3547
|
-
},
|
|
3534
|
+
return ea[t][a].replace("#", n) ?? "";
|
|
3535
|
+
}, na = {
|
|
3548
3536
|
carrier: (e) => e?.friendlyName ?? e?.name ?? "",
|
|
3549
3537
|
price: (e) => e?.price ? e.price / 100 : e?.price,
|
|
3550
3538
|
localizedEstimates: (e) => e?.shippingEstimate ? $n(e.shippingEstimate) : ""
|
|
@@ -3560,7 +3548,7 @@ function an(e, n) {
|
|
|
3560
3548
|
);
|
|
3561
3549
|
return i || e[0];
|
|
3562
3550
|
}
|
|
3563
|
-
function
|
|
3551
|
+
function ta(e, n, t) {
|
|
3564
3552
|
const r = {};
|
|
3565
3553
|
return e.forEach((i) => {
|
|
3566
3554
|
const a = i.variations;
|
|
@@ -3578,24 +3566,24 @@ function on(e) {
|
|
|
3578
3566
|
n[t.name] = t.values[0];
|
|
3579
3567
|
}), n;
|
|
3580
3568
|
}
|
|
3581
|
-
function
|
|
3569
|
+
function ra(e) {
|
|
3582
3570
|
const n = {};
|
|
3583
3571
|
return e?.forEach((t) => {
|
|
3584
3572
|
n[t.field.originalName ?? t.field.name] = t.values.map((r) => r.originalName ?? r.name);
|
|
3585
3573
|
}), n;
|
|
3586
3574
|
}
|
|
3587
|
-
function
|
|
3575
|
+
function ia(e, n) {
|
|
3588
3576
|
return Number.isNaN(Number(e) - Number(n)) ? e < n ? -1 : e > n ? 1 : 0 : Number(e) - Number(n);
|
|
3589
3577
|
}
|
|
3590
|
-
function
|
|
3578
|
+
function aa(e) {
|
|
3591
3579
|
const n = e;
|
|
3592
3580
|
for (const t in e)
|
|
3593
3581
|
e[t].every(
|
|
3594
3582
|
(i) => !Number.isNaN(Number(i.value))
|
|
3595
|
-
) && e[t].sort((i, a) =>
|
|
3583
|
+
) && e[t].sort((i, a) => ia(i.value, a.value));
|
|
3596
3584
|
return n;
|
|
3597
3585
|
}
|
|
3598
|
-
function
|
|
3586
|
+
function oa(e, n, t) {
|
|
3599
3587
|
const r = {}, i = /* @__PURE__ */ new Set();
|
|
3600
3588
|
return e.forEach((a) => {
|
|
3601
3589
|
if (a.variations.length === 0)
|
|
@@ -3636,38 +3624,38 @@ function ua(e, n, t) {
|
|
|
3636
3624
|
};
|
|
3637
3625
|
r[c.name] ? r[c.name].push(g) : r[c.name] = [g];
|
|
3638
3626
|
});
|
|
3639
|
-
}),
|
|
3627
|
+
}), aa(r);
|
|
3640
3628
|
}
|
|
3641
|
-
const
|
|
3629
|
+
const sa = {
|
|
3642
3630
|
activeVariations: (e) => on(e.variations),
|
|
3643
|
-
allVariantsByName: (e) =>
|
|
3644
|
-
slugsMap: (e, n) =>
|
|
3631
|
+
allVariantsByName: (e) => ra(e.isVariantOf.skuSpecifications),
|
|
3632
|
+
slugsMap: (e, n) => ta(
|
|
3645
3633
|
e.isVariantOf.items,
|
|
3646
3634
|
n.dominantVariantName ?? e.variations[0]?.name,
|
|
3647
3635
|
e.isVariantOf.linkText
|
|
3648
3636
|
),
|
|
3649
3637
|
availableVariations: (e, n) => {
|
|
3650
3638
|
const t = n.dominantVariantName ?? e.variations[0]?.name, i = on(e.variations)[t];
|
|
3651
|
-
return
|
|
3639
|
+
return oa(
|
|
3652
3640
|
e.isVariantOf.items,
|
|
3653
3641
|
t,
|
|
3654
3642
|
i
|
|
3655
3643
|
);
|
|
3656
3644
|
},
|
|
3657
3645
|
allVariantProducts: (e) => e.isVariantOf.items.map((n) => F(n, e.isVariantOf))
|
|
3658
|
-
},
|
|
3646
|
+
}, ca = {
|
|
3659
3647
|
"pickup-in-point": "Pickup",
|
|
3660
3648
|
delivery: "Delivery",
|
|
3661
3649
|
pickup: "Pickup",
|
|
3662
3650
|
"take-away": "Take away",
|
|
3663
3651
|
"": ""
|
|
3664
|
-
},
|
|
3652
|
+
}, la = {
|
|
3665
3653
|
deliveryOptionsData: (e) => {
|
|
3666
3654
|
const { shippingData: n, items: t } = e, r = n?.logisticsInfo || [], i = n?.selectedAddresses || n?.availableAddresses || [n?.address], a = r.reduce(
|
|
3667
3655
|
(u, d) => {
|
|
3668
|
-
const g = d?.selectedSla || "", f = d?.selectedDeliveryChannel || d?.deliveryChannel || "", h = d?.deliveryCompany || "", v = d?.deliveryWindow, l = d?.pickupStoreInfo, p = d?.shippingEstimate || "", m = d?.shippingEstimate ? $n(d?.shippingEstimate) : "", S = d?.shippingEstimateDate || "", O = d?.addressId || "", w = d?.itemIndex ?? 0, C = t?.[w],
|
|
3656
|
+
const g = d?.selectedSla || "", f = d?.selectedDeliveryChannel || d?.deliveryChannel || "", h = d?.deliveryCompany || "", v = d?.deliveryWindow, l = d?.pickupStoreInfo, p = d?.shippingEstimate || "", m = d?.shippingEstimate ? $n(d?.shippingEstimate) : "", S = d?.shippingEstimateDate || "", O = d?.addressId || "", w = d?.itemIndex ?? 0, C = t?.[w], _ = C?.seller || "", I = `${g}|${f}|${h}|${_}|${p}|${S}|${O}|${v?.startDateUtc}|${v?.endDateUtc}`, A = i?.find(
|
|
3669
3657
|
(b) => b?.addressId === O
|
|
3670
|
-
),
|
|
3658
|
+
), D = `${ca[f] || ""} ${m} ${A?.neighborhood ? `to ${A?.neighborhood}` : ""}`.trim(), { taxPriceTagsTotal: E, taxPriceTags: P } = da(
|
|
3671
3659
|
C?.priceTags ?? []
|
|
3672
3660
|
), R = (C?.sellingPrice ?? 0) * (C?.quantity ?? 0) + (C?.tax ?? 0) + (E ?? 0);
|
|
3673
3661
|
return u[I] || (u[I] = {
|
|
@@ -3678,10 +3666,10 @@ const pa = {
|
|
|
3678
3666
|
deliveryWindow: v,
|
|
3679
3667
|
shippingEstimate: p,
|
|
3680
3668
|
shippingEstimateDate: S,
|
|
3681
|
-
seller:
|
|
3669
|
+
seller: _,
|
|
3682
3670
|
friendlyShippingEstimate: m,
|
|
3683
|
-
friendlyDeliveryOptionName:
|
|
3684
|
-
address:
|
|
3671
|
+
friendlyDeliveryOptionName: D,
|
|
3672
|
+
address: A,
|
|
3685
3673
|
pickupStoreInfo: l,
|
|
3686
3674
|
// dynamic fields
|
|
3687
3675
|
quantityOfDifferentItems: 0,
|
|
@@ -3725,7 +3713,7 @@ const pa = {
|
|
|
3725
3713
|
) || [];
|
|
3726
3714
|
}
|
|
3727
3715
|
};
|
|
3728
|
-
function
|
|
3716
|
+
function da(e) {
|
|
3729
3717
|
const t = e.filter(
|
|
3730
3718
|
(i) => i?.name?.includes("TAX")
|
|
3731
3719
|
), r = t.reduce(
|
|
@@ -3737,28 +3725,28 @@ function ha(e) {
|
|
|
3737
3725
|
taxPriceTagsTotal: r
|
|
3738
3726
|
};
|
|
3739
3727
|
}
|
|
3740
|
-
const
|
|
3728
|
+
const ua = {
|
|
3741
3729
|
StoreCollection: vn,
|
|
3742
3730
|
StoreAggregateOffer: fr,
|
|
3743
|
-
StoreProduct:
|
|
3744
|
-
StoreSeo:
|
|
3745
|
-
StoreFacet:
|
|
3746
|
-
StoreFacetBoolean:
|
|
3731
|
+
StoreProduct: Ri,
|
|
3732
|
+
StoreSeo: Ki,
|
|
3733
|
+
StoreFacet: Ar,
|
|
3734
|
+
StoreFacetBoolean: Dr,
|
|
3747
3735
|
StoreFacetRange: Pr,
|
|
3748
3736
|
StoreFacetValueBoolean: Er,
|
|
3749
3737
|
StoreOffer: Pi,
|
|
3750
3738
|
StoreAggregateRating: Sr,
|
|
3751
|
-
StoreReview:
|
|
3752
|
-
StoreProductGroup:
|
|
3753
|
-
StoreSearchResult:
|
|
3754
|
-
StorePropertyValue:
|
|
3755
|
-
SkuVariants:
|
|
3756
|
-
ShippingSLA:
|
|
3757
|
-
UserOrderResult:
|
|
3758
|
-
ObjectOrString:
|
|
3759
|
-
Query:
|
|
3739
|
+
StoreReview: Xi,
|
|
3740
|
+
StoreProductGroup: Ni,
|
|
3741
|
+
StoreSearchResult: Ji,
|
|
3742
|
+
StorePropertyValue: Li,
|
|
3743
|
+
SkuVariants: sa,
|
|
3744
|
+
ShippingSLA: na,
|
|
3745
|
+
UserOrderResult: la,
|
|
3746
|
+
ObjectOrString: Di,
|
|
3747
|
+
Query: Hi,
|
|
3760
3748
|
Mutation: Ci
|
|
3761
|
-
},
|
|
3749
|
+
}, pa = () => ua, ga = `"""
|
|
3762
3750
|
Address information.
|
|
3763
3751
|
"""
|
|
3764
3752
|
type Address {
|
|
@@ -3803,7 +3791,7 @@ type Address {
|
|
|
3803
3791
|
"""
|
|
3804
3792
|
geoCoordinates: [Float]
|
|
3805
3793
|
}
|
|
3806
|
-
`,
|
|
3794
|
+
`, ma = `"""
|
|
3807
3795
|
Advertisement information about a specific product in a campaign
|
|
3808
3796
|
"""
|
|
3809
3797
|
type Advertisement {
|
|
@@ -3828,7 +3816,7 @@ type Advertisement {
|
|
|
3828
3816
|
"""
|
|
3829
3817
|
adResponseId: String!
|
|
3830
3818
|
}
|
|
3831
|
-
`,
|
|
3819
|
+
`, ha = `"""
|
|
3832
3820
|
Aggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.
|
|
3833
3821
|
"""
|
|
3834
3822
|
type StoreAggregateOffer {
|
|
@@ -3857,7 +3845,7 @@ type StoreAggregateOffer {
|
|
|
3857
3845
|
"""
|
|
3858
3846
|
offers: [StoreOffer!]!
|
|
3859
3847
|
}
|
|
3860
|
-
`,
|
|
3848
|
+
`, fa = `"""
|
|
3861
3849
|
Average rating, based on multiple ratings or reviews.
|
|
3862
3850
|
"""
|
|
3863
3851
|
type StoreAggregateRating {
|
|
@@ -3870,7 +3858,7 @@ type StoreAggregateRating {
|
|
|
3870
3858
|
"""
|
|
3871
3859
|
reviewCount: Int!
|
|
3872
3860
|
}
|
|
3873
|
-
`,
|
|
3861
|
+
`, Sa = `"""
|
|
3874
3862
|
information about the author of a product review or rating.
|
|
3875
3863
|
"""
|
|
3876
3864
|
type StoreAuthor {
|
|
@@ -3879,7 +3867,7 @@ type StoreAuthor {
|
|
|
3879
3867
|
"""
|
|
3880
3868
|
name: String!
|
|
3881
3869
|
}
|
|
3882
|
-
`,
|
|
3870
|
+
`, ya = `"""
|
|
3883
3871
|
Brand of a given product.
|
|
3884
3872
|
"""
|
|
3885
3873
|
type StoreBrand {
|
|
@@ -3888,7 +3876,7 @@ type StoreBrand {
|
|
|
3888
3876
|
"""
|
|
3889
3877
|
name: String!
|
|
3890
3878
|
}
|
|
3891
|
-
`,
|
|
3879
|
+
`, Ia = `"""
|
|
3892
3880
|
Item of a list.
|
|
3893
3881
|
"""
|
|
3894
3882
|
type StoreListItem {
|
|
@@ -3919,7 +3907,7 @@ type StoreBreadcrumbList {
|
|
|
3919
3907
|
"""
|
|
3920
3908
|
numberOfItems: Int!
|
|
3921
3909
|
}
|
|
3922
|
-
`,
|
|
3910
|
+
`, va = `"""
|
|
3923
3911
|
Shopping cart message.
|
|
3924
3912
|
"""
|
|
3925
3913
|
type StoreCartMessage {
|
|
@@ -3956,7 +3944,7 @@ input IStoreCart {
|
|
|
3956
3944
|
"""
|
|
3957
3945
|
order: IStoreOrder!
|
|
3958
3946
|
}
|
|
3959
|
-
`,
|
|
3947
|
+
`, Oa = `"""
|
|
3960
3948
|
Product collection type. Possible values are \`Department\`, \`Category\`, \`Brand\` or \`Collection\`.
|
|
3961
3949
|
|
|
3962
3950
|
\`SubCategory\` and \`Cluster\` are still declared for backward compatibility but are
|
|
@@ -4082,7 +4070,7 @@ type StoreCollectionLocale {
|
|
|
4082
4070
|
"""
|
|
4083
4071
|
slug: String!
|
|
4084
4072
|
}
|
|
4085
|
-
`,
|
|
4073
|
+
`, ba = `"""
|
|
4086
4074
|
Delivery Promise badge.
|
|
4087
4075
|
"""
|
|
4088
4076
|
type DeliveryPromiseBadge {
|
|
@@ -4091,7 +4079,7 @@ type DeliveryPromiseBadge {
|
|
|
4091
4079
|
"""
|
|
4092
4080
|
typeName: String
|
|
4093
4081
|
}
|
|
4094
|
-
`,
|
|
4082
|
+
`, Ca = `union StoreFacet = StoreFacetRange | StoreFacetBoolean
|
|
4095
4083
|
|
|
4096
4084
|
"""
|
|
4097
4085
|
Search facet range information.
|
|
@@ -4168,7 +4156,7 @@ type StoreFacetValueBoolean {
|
|
|
4168
4156
|
"""
|
|
4169
4157
|
quantity: Int
|
|
4170
4158
|
}
|
|
4171
|
-
`,
|
|
4159
|
+
`, wa = `"""
|
|
4172
4160
|
Image.
|
|
4173
4161
|
"""
|
|
4174
4162
|
type StoreImage {
|
|
@@ -4195,7 +4183,7 @@ input IStoreImage {
|
|
|
4195
4183
|
"""
|
|
4196
4184
|
alternateName: String!
|
|
4197
4185
|
}
|
|
4198
|
-
`,
|
|
4186
|
+
`, Aa = `type Mutation {
|
|
4199
4187
|
"""
|
|
4200
4188
|
Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns \`null\`.
|
|
4201
4189
|
"""
|
|
@@ -4237,7 +4225,7 @@ input IStoreImage {
|
|
|
4237
4225
|
"""
|
|
4238
4226
|
startRecommendationSession: Boolean!
|
|
4239
4227
|
}
|
|
4240
|
-
`,
|
|
4228
|
+
`, Da = `"""
|
|
4241
4229
|
Newsletter information.
|
|
4242
4230
|
"""
|
|
4243
4231
|
type PersonNewsletter {
|
|
@@ -4260,8 +4248,8 @@ input IPersonNewsletter {
|
|
|
4260
4248
|
"""
|
|
4261
4249
|
email: String!
|
|
4262
4250
|
}
|
|
4263
|
-
`,
|
|
4264
|
-
`,
|
|
4251
|
+
`, Pa = `scalar ObjectOrString
|
|
4252
|
+
`, Ea = `"""
|
|
4265
4253
|
Offer information.
|
|
4266
4254
|
"""
|
|
4267
4255
|
type StoreOffer {
|
|
@@ -4354,7 +4342,7 @@ input IStoreOffer {
|
|
|
4354
4342
|
"""
|
|
4355
4343
|
priceToken: String
|
|
4356
4344
|
}
|
|
4357
|
-
`,
|
|
4345
|
+
`, ka = `"""
|
|
4358
4346
|
Information of a specific order.
|
|
4359
4347
|
"""
|
|
4360
4348
|
type StoreOrder {
|
|
@@ -4395,7 +4383,7 @@ input IStoreOrder {
|
|
|
4395
4383
|
"""
|
|
4396
4384
|
shouldSplitItem: Boolean
|
|
4397
4385
|
}
|
|
4398
|
-
`,
|
|
4386
|
+
`, _a = `"""
|
|
4399
4387
|
Commercial Authorization response.
|
|
4400
4388
|
"""
|
|
4401
4389
|
type CommercialAuthorizationResponse {
|
|
@@ -4794,7 +4782,7 @@ type ProcessOrderAuthorizationRule {
|
|
|
4794
4782
|
"""
|
|
4795
4783
|
rule: CommercialAuthorizationRule!
|
|
4796
4784
|
}
|
|
4797
|
-
`,
|
|
4785
|
+
`, Ua = `"""
|
|
4798
4786
|
Input for uploading a file to the Order Entry Service.
|
|
4799
4787
|
The file is transmitted as a Base64-encoded string so it can travel
|
|
4800
4788
|
through the standard GraphQL JSON pipeline without multipart support.
|
|
@@ -4855,7 +4843,7 @@ type StoreOrderFormCartItem {
|
|
|
4855
4843
|
seller: String!
|
|
4856
4844
|
unitMultiplier: Float
|
|
4857
4845
|
}
|
|
4858
|
-
`,
|
|
4846
|
+
`, Ta = `"""
|
|
4859
4847
|
Organization.
|
|
4860
4848
|
"""
|
|
4861
4849
|
type StoreOrganization {
|
|
@@ -4896,7 +4884,7 @@ type StoreContract {
|
|
|
4896
4884
|
"""
|
|
4897
4885
|
isDefault: Boolean!
|
|
4898
4886
|
}
|
|
4899
|
-
`,
|
|
4887
|
+
`, Ra = `"""
|
|
4900
4888
|
Whenever you make a query that allows for pagination, such as \`allProducts\` or \`allCollections\`, you can check \`StorePageInfo\` to learn more about the complete set of items and use it to paginate your queries.
|
|
4901
4889
|
"""
|
|
4902
4890
|
type StorePageInfo {
|
|
@@ -4921,7 +4909,7 @@ type StorePageInfo {
|
|
|
4921
4909
|
"""
|
|
4922
4910
|
totalCount: Int!
|
|
4923
4911
|
}
|
|
4924
|
-
`,
|
|
4912
|
+
`, Fa = `"""
|
|
4925
4913
|
Input type for setting a new password.
|
|
4926
4914
|
"""
|
|
4927
4915
|
input ISetPassword {
|
|
@@ -4964,7 +4952,7 @@ type SetPasswordResponse {
|
|
|
4964
4952
|
"""
|
|
4965
4953
|
message: String
|
|
4966
4954
|
}
|
|
4967
|
-
`,
|
|
4955
|
+
`, Na = `"""
|
|
4968
4956
|
Client profile data.
|
|
4969
4957
|
"""
|
|
4970
4958
|
type StorePerson {
|
|
@@ -5007,7 +4995,7 @@ input IStorePerson {
|
|
|
5007
4995
|
"""
|
|
5008
4996
|
familyName: String!
|
|
5009
4997
|
}
|
|
5010
|
-
`,
|
|
4998
|
+
`, La = `type PickupPointAddress {
|
|
5011
4999
|
"""
|
|
5012
5000
|
Address city.
|
|
5013
5001
|
"""
|
|
@@ -5086,7 +5074,7 @@ type PickupPoints {
|
|
|
5086
5074
|
"""
|
|
5087
5075
|
pickupPointsHash: String
|
|
5088
5076
|
}
|
|
5089
|
-
`,
|
|
5077
|
+
`, Ba = `"""
|
|
5090
5078
|
Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
|
|
5091
5079
|
"""
|
|
5092
5080
|
type StoreProduct {
|
|
@@ -5155,7 +5143,7 @@ type StoreProduct {
|
|
|
5155
5143
|
"""
|
|
5156
5144
|
additionalProperty: [StorePropertyValue!]!
|
|
5157
5145
|
"""
|
|
5158
|
-
The product's release date.
|
|
5146
|
+
The product's release date, passed through exactly as the catalog returns it, without validation or normalization. Usually epoch milliseconds (e.g. "1774224000000"), but some accounts store an ISO 8601 string, and the value may be empty. Parse and validate it before use.
|
|
5159
5147
|
"""
|
|
5160
5148
|
releaseDate: String!
|
|
5161
5149
|
"""
|
|
@@ -5262,7 +5250,7 @@ input IStoreProduct {
|
|
|
5262
5250
|
"""
|
|
5263
5251
|
additionalProperty: [IStorePropertyValue!]
|
|
5264
5252
|
}
|
|
5265
|
-
`,
|
|
5253
|
+
`, $a = `"""
|
|
5266
5254
|
Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
|
|
5267
5255
|
"""
|
|
5268
5256
|
type StoreProductGroup {
|
|
@@ -5307,7 +5295,7 @@ type StoreProductCluster {
|
|
|
5307
5295
|
"""
|
|
5308
5296
|
name: String!
|
|
5309
5297
|
}
|
|
5310
|
-
`,
|
|
5298
|
+
`, Ma = `type Profile {
|
|
5311
5299
|
"""
|
|
5312
5300
|
Collection of user's address
|
|
5313
5301
|
"""
|
|
@@ -5368,7 +5356,7 @@ type ProfileAddress {
|
|
|
5368
5356
|
"""
|
|
5369
5357
|
geoCoordinate: [Float]
|
|
5370
5358
|
}
|
|
5371
|
-
`,
|
|
5359
|
+
`, za = `"""
|
|
5372
5360
|
Properties that can be associated with products and products groups.
|
|
5373
5361
|
"""
|
|
5374
5362
|
type StorePropertyValue {
|
|
@@ -5408,7 +5396,7 @@ input IStorePropertyValue {
|
|
|
5408
5396
|
"""
|
|
5409
5397
|
valueReference: ObjectOrString!
|
|
5410
5398
|
}
|
|
5411
|
-
`,
|
|
5399
|
+
`, Va = `"""
|
|
5412
5400
|
Each product edge contains a \`node\`, with product information, and a \`cursor\`, that can be used as a reference for pagination.
|
|
5413
5401
|
"""
|
|
5414
5402
|
type StoreProductEdge {
|
|
@@ -6057,7 +6045,7 @@ type StoreAccountProfile {
|
|
|
6057
6045
|
email: String
|
|
6058
6046
|
id: String
|
|
6059
6047
|
}
|
|
6060
|
-
`,
|
|
6048
|
+
`, xa = `"""
|
|
6061
6049
|
Summary of a quote returned in list results.
|
|
6062
6050
|
"""
|
|
6063
6051
|
type UserQuoteSummary {
|
|
@@ -6122,7 +6110,7 @@ type UserQuoteListPaging {
|
|
|
6122
6110
|
"""
|
|
6123
6111
|
perPage: Int!
|
|
6124
6112
|
}
|
|
6125
|
-
`,
|
|
6113
|
+
`, qa = `type RecommendationResponse {
|
|
6126
6114
|
products: [StoreProduct!]!
|
|
6127
6115
|
correlationId: String!
|
|
6128
6116
|
campaign: RecommendationCampaign!
|
|
@@ -6133,7 +6121,7 @@ type RecommendationCampaign {
|
|
|
6133
6121
|
title: String
|
|
6134
6122
|
type: String!
|
|
6135
6123
|
}
|
|
6136
|
-
`,
|
|
6124
|
+
`, ja = `"""
|
|
6137
6125
|
Information of a given review rating.
|
|
6138
6126
|
"""
|
|
6139
6127
|
type StoreReviewRating {
|
|
@@ -6160,7 +6148,7 @@ type StoreReview {
|
|
|
6160
6148
|
"""
|
|
6161
6149
|
author: StoreAuthor!
|
|
6162
6150
|
}
|
|
6163
|
-
`,
|
|
6151
|
+
`, Wa = `"""
|
|
6164
6152
|
Whether a saved card is personally owned by the buyer or shared by their
|
|
6165
6153
|
Organization/Contract. Resolved server-side by the Saved-cards service from
|
|
6166
6154
|
the buyer's \`useAdHocCard\` role — never inferred client-side.
|
|
@@ -6224,7 +6212,7 @@ type SavedCardListResult {
|
|
|
6224
6212
|
"""
|
|
6225
6213
|
list: [SavedCard!]
|
|
6226
6214
|
}
|
|
6227
|
-
`,
|
|
6215
|
+
`, Ga = `"""
|
|
6228
6216
|
Search Engine Optimization (SEO) tags data.
|
|
6229
6217
|
"""
|
|
6230
6218
|
type StoreSeo {
|
|
@@ -6245,7 +6233,7 @@ type StoreSeo {
|
|
|
6245
6233
|
"""
|
|
6246
6234
|
canonical: String!
|
|
6247
6235
|
}
|
|
6248
|
-
`,
|
|
6236
|
+
`, Ha = `"""
|
|
6249
6237
|
Currency information.
|
|
6250
6238
|
"""
|
|
6251
6239
|
type StoreCurrency {
|
|
@@ -6520,7 +6508,7 @@ input IStoreSession {
|
|
|
6520
6508
|
"""
|
|
6521
6509
|
refreshAfter: String
|
|
6522
6510
|
}
|
|
6523
|
-
`,
|
|
6511
|
+
`, Xa = `"""
|
|
6524
6512
|
Shipping Simulation item input.
|
|
6525
6513
|
"""
|
|
6526
6514
|
input IShippingItem {
|
|
@@ -6851,7 +6839,7 @@ type MessageFields {
|
|
|
6851
6839
|
"""
|
|
6852
6840
|
skuName: String
|
|
6853
6841
|
}
|
|
6854
|
-
`,
|
|
6842
|
+
`, Ya = `type SkuVariants {
|
|
6855
6843
|
"""
|
|
6856
6844
|
SKU property values for the current SKU.
|
|
6857
6845
|
"""
|
|
@@ -6946,7 +6934,7 @@ Example:
|
|
|
6946
6934
|
\`\`\`
|
|
6947
6935
|
"""
|
|
6948
6936
|
scalar FormattedVariants
|
|
6949
|
-
`,
|
|
6937
|
+
`, Ja = `"""
|
|
6950
6938
|
Status used to indicate a message type. For instance, a shopping cart informative or error message.
|
|
6951
6939
|
"""
|
|
6952
6940
|
enum StoreStatus {
|
|
@@ -6954,7 +6942,7 @@ enum StoreStatus {
|
|
|
6954
6942
|
WARNING
|
|
6955
6943
|
ERROR
|
|
6956
6944
|
}
|
|
6957
|
-
`,
|
|
6945
|
+
`, Ka = `scalar JSONObject
|
|
6958
6946
|
|
|
6959
6947
|
type UserOrder {
|
|
6960
6948
|
orderId: String
|
|
@@ -7778,84 +7766,84 @@ type UserOrderBudgetAllocationLinkedEntity {
|
|
|
7778
7766
|
type: String
|
|
7779
7767
|
id: String
|
|
7780
7768
|
}
|
|
7781
|
-
`,
|
|
7782
|
-
"./address.graphql":
|
|
7783
|
-
"./advertisement.graphql":
|
|
7784
|
-
"./aggregateOffer.graphql":
|
|
7785
|
-
"./aggregateRating.graphql":
|
|
7786
|
-
"./author.graphql":
|
|
7787
|
-
"./brand.graphql":
|
|
7788
|
-
"./breadcrumb.graphql":
|
|
7789
|
-
"./cart.graphql":
|
|
7790
|
-
"./collection.graphql":
|
|
7791
|
-
"./deliveryPromisesBadge.graphql":
|
|
7792
|
-
"./facet.graphql":
|
|
7793
|
-
"./image.graphql":
|
|
7794
|
-
"./mutation.graphql":
|
|
7795
|
-
"./newsletter.graphql":
|
|
7796
|
-
"./objectOrString.graphql":
|
|
7797
|
-
"./offer.graphql":
|
|
7798
|
-
"./order.graphql":
|
|
7799
|
-
"./orderCommercialAuthorizaton.graphql":
|
|
7800
|
-
"./orderEntry.graphql":
|
|
7801
|
-
"./organization.graphql":
|
|
7802
|
-
"./pageInfo.graphql":
|
|
7803
|
-
"./password.graphql":
|
|
7804
|
-
"./person.graphql":
|
|
7805
|
-
"./pickupPoints.graphql":
|
|
7806
|
-
"./product.graphql":
|
|
7807
|
-
"./productGroup.graphql":
|
|
7808
|
-
"./profile.graphql":
|
|
7809
|
-
"./propertyValue.graphql":
|
|
7810
|
-
"./query.graphql":
|
|
7811
|
-
"./quote.graphql":
|
|
7812
|
-
"./recommendation.graphql":
|
|
7813
|
-
"./review.graphql":
|
|
7814
|
-
"./savedCard.graphql":
|
|
7815
|
-
"./seo.graphql":
|
|
7816
|
-
"./session.graphql":
|
|
7817
|
-
"./shipping.graphql":
|
|
7818
|
-
"./skuVariants.graphql":
|
|
7819
|
-
"./status.graphql":
|
|
7820
|
-
"./userOrder.graphql":
|
|
7821
|
-
}),
|
|
7822
|
-
Object.values(
|
|
7769
|
+
`, Qa = /* @__PURE__ */ Object.assign({
|
|
7770
|
+
"./address.graphql": ga,
|
|
7771
|
+
"./advertisement.graphql": ma,
|
|
7772
|
+
"./aggregateOffer.graphql": ha,
|
|
7773
|
+
"./aggregateRating.graphql": fa,
|
|
7774
|
+
"./author.graphql": Sa,
|
|
7775
|
+
"./brand.graphql": ya,
|
|
7776
|
+
"./breadcrumb.graphql": Ia,
|
|
7777
|
+
"./cart.graphql": va,
|
|
7778
|
+
"./collection.graphql": Oa,
|
|
7779
|
+
"./deliveryPromisesBadge.graphql": ba,
|
|
7780
|
+
"./facet.graphql": Ca,
|
|
7781
|
+
"./image.graphql": wa,
|
|
7782
|
+
"./mutation.graphql": Aa,
|
|
7783
|
+
"./newsletter.graphql": Da,
|
|
7784
|
+
"./objectOrString.graphql": Pa,
|
|
7785
|
+
"./offer.graphql": Ea,
|
|
7786
|
+
"./order.graphql": ka,
|
|
7787
|
+
"./orderCommercialAuthorizaton.graphql": _a,
|
|
7788
|
+
"./orderEntry.graphql": Ua,
|
|
7789
|
+
"./organization.graphql": Ta,
|
|
7790
|
+
"./pageInfo.graphql": Ra,
|
|
7791
|
+
"./password.graphql": Fa,
|
|
7792
|
+
"./person.graphql": Na,
|
|
7793
|
+
"./pickupPoints.graphql": La,
|
|
7794
|
+
"./product.graphql": Ba,
|
|
7795
|
+
"./productGroup.graphql": $a,
|
|
7796
|
+
"./profile.graphql": Ma,
|
|
7797
|
+
"./propertyValue.graphql": za,
|
|
7798
|
+
"./query.graphql": Va,
|
|
7799
|
+
"./quote.graphql": xa,
|
|
7800
|
+
"./recommendation.graphql": qa,
|
|
7801
|
+
"./review.graphql": ja,
|
|
7802
|
+
"./savedCard.graphql": Wa,
|
|
7803
|
+
"./seo.graphql": Ga,
|
|
7804
|
+
"./session.graphql": Ha,
|
|
7805
|
+
"./shipping.graphql": Xa,
|
|
7806
|
+
"./skuVariants.graphql": Ya,
|
|
7807
|
+
"./status.graphql": Ja,
|
|
7808
|
+
"./userOrder.graphql": Ka
|
|
7809
|
+
}), Za = Wn(
|
|
7810
|
+
Object.values(Qa).map((e) => Gn(e)).reduce(
|
|
7823
7811
|
(e, n) => sn([e, n], { sort: !0 })
|
|
7824
7812
|
)
|
|
7825
|
-
),
|
|
7813
|
+
), eo = Za, Io = async (e) => (n) => (n.storage = {
|
|
7826
7814
|
channel: ne.parse(e.channel),
|
|
7827
7815
|
flags: e.flags ?? {},
|
|
7828
7816
|
locale: e.locale,
|
|
7829
7817
|
customSortMap: e.customSortMap ?? {},
|
|
7830
7818
|
cookies: /* @__PURE__ */ new Map()
|
|
7831
7819
|
}, n.account = e.account, n.OTEL_ENABLED = e.OTEL_ENABLED, n.discoveryConfig = e.discoveryConfig, n.clients = tr(e, n), n.loaders = pr(e, n), n);
|
|
7832
|
-
function
|
|
7833
|
-
const e =
|
|
7820
|
+
function no() {
|
|
7821
|
+
const e = pa(), n = {};
|
|
7834
7822
|
for (const [t, r] of Object.entries(e))
|
|
7835
7823
|
n[t] = Object.fromEntries(
|
|
7836
7824
|
Object.entries(r).map(([i, a]) => typeof a != "function" ? [i, a] : [i, mt(a, `${t}(${i})`)])
|
|
7837
7825
|
);
|
|
7838
7826
|
return n;
|
|
7839
7827
|
}
|
|
7840
|
-
function
|
|
7828
|
+
function vo(e) {
|
|
7841
7829
|
const t = pt([
|
|
7842
7830
|
ut,
|
|
7843
7831
|
ct
|
|
7844
|
-
])(
|
|
7845
|
-
return e &&
|
|
7832
|
+
])(no(), eo);
|
|
7833
|
+
return e && Hn(e) ? qn({
|
|
7846
7834
|
schemas: [t, e]
|
|
7847
7835
|
}) : t;
|
|
7848
7836
|
}
|
|
7849
7837
|
export {
|
|
7850
7838
|
ct as AuthDirective,
|
|
7851
|
-
|
|
7839
|
+
k as BadRequestError,
|
|
7852
7840
|
ut as CacheControlDirective,
|
|
7853
7841
|
Qn as CardOrigin,
|
|
7854
7842
|
Zn as CommercialAuthorizationStatus,
|
|
7855
7843
|
ee as FastStoreError,
|
|
7856
7844
|
K as ForbiddenError,
|
|
7857
|
-
|
|
7858
|
-
|
|
7845
|
+
Io as GraphqlVtexContextFactory,
|
|
7846
|
+
vo as GraphqlVtexSchema,
|
|
7859
7847
|
$ as NotFoundError,
|
|
7860
7848
|
et as StoreCollectionType,
|
|
7861
7849
|
nt as StoreFacetType,
|
|
@@ -7864,13 +7852,13 @@ export {
|
|
|
7864
7852
|
ie as UnauthorizedError,
|
|
7865
7853
|
it as UserOrderInvoiceType,
|
|
7866
7854
|
L as getAuthCookie,
|
|
7867
|
-
|
|
7868
|
-
|
|
7855
|
+
So as isBadRequestError,
|
|
7856
|
+
fo as isFastStoreError,
|
|
7869
7857
|
ht as isForbiddenError,
|
|
7870
7858
|
J as isNotFoundError,
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7859
|
+
yo as isUnauthorizedError,
|
|
7860
|
+
ho as stringifyCacheControl,
|
|
7861
|
+
eo as typeDefs,
|
|
7874
7862
|
ot as validateUserAuthentication,
|
|
7875
7863
|
pt as withDirectives
|
|
7876
7864
|
};
|