@asteby/storefront 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/{account-settings-DNcJKOQl.d.ts → account-settings-Cw3PamUA.d.ts} +98 -1
- package/dist/{account-settings-H6zuI7iG.d.cts → account-settings-DAzmXHIn.d.cts} +98 -1
- package/dist/{chunk-IPUAZ3LQ.js → chunk-5BJRZIS3.js} +196 -3
- package/dist/chunk-5BJRZIS3.js.map +1 -0
- package/dist/cli.js +25 -2
- package/dist/fiscal-document.d.cts +2 -2
- package/dist/fiscal-document.d.ts +2 -2
- package/dist/index.cjs +232 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -3
- package/dist/index.d.ts +104 -3
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/dist/mock.cjs +247 -1
- package/dist/mock.cjs.map +1 -1
- package/dist/mock.d.cts +18 -2
- package/dist/mock.d.ts +18 -2
- package/dist/mock.js +143 -3
- package/dist/mock.js.map +1 -1
- package/dist/mockup.d.cts +1 -1
- package/dist/mockup.d.ts +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-IPUAZ3LQ.js.map +0 -1
package/dist/mock.cjs
CHANGED
|
@@ -1347,6 +1347,111 @@ function maskTaxId(taxId) {
|
|
|
1347
1347
|
return v.length <= 4 ? "*".repeat(v.length) : `${v.slice(0, 2)}${"*".repeat(v.length - 5)}${v.slice(-3)}`;
|
|
1348
1348
|
}
|
|
1349
1349
|
|
|
1350
|
+
// src/subjects.ts
|
|
1351
|
+
var MIN_SUBJECT_YEAR = 1900;
|
|
1352
|
+
var MAX_SUBJECT_YEAR = 2100;
|
|
1353
|
+
var MAX_VALUE_LENGTH = 80;
|
|
1354
|
+
var MAX_LABEL_LENGTH = 120;
|
|
1355
|
+
var MAX_FIT_KEY_LENGTH = 100;
|
|
1356
|
+
var isPresent = (v) => v !== null && v !== void 0 && v !== "";
|
|
1357
|
+
var asYear = (v) => {
|
|
1358
|
+
const n = typeof v === "number" ? v : typeof v === "string" && /^\s*\d+\s*$/.test(v) ? Number(v) : NaN;
|
|
1359
|
+
return Number.isInteger(n) && n >= MIN_SUBJECT_YEAR && n <= MAX_SUBJECT_YEAR ? n : null;
|
|
1360
|
+
};
|
|
1361
|
+
var cleanText = (v, max) => {
|
|
1362
|
+
if (typeof v !== "string") return null;
|
|
1363
|
+
const s = v.split(/\s+/).filter(Boolean).join(" ");
|
|
1364
|
+
return [...s].length > max || /[\u0000-\u001f\u007f-\u009f]/.test(s) ? null : s;
|
|
1365
|
+
};
|
|
1366
|
+
var slug = (s) => s.toLowerCase().replace(/[^a-z0-9._+-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1367
|
+
function coversYear(node, year) {
|
|
1368
|
+
if (node.ranges && node.ranges.length > 0) return node.ranges.some(([a, b]) => year >= a && year <= b);
|
|
1369
|
+
if (node.from !== void 0 && year < node.from) return false;
|
|
1370
|
+
if (node.to !== void 0 && year > node.to) return false;
|
|
1371
|
+
return true;
|
|
1372
|
+
}
|
|
1373
|
+
function resolveSubject(kind, values) {
|
|
1374
|
+
const problems = {};
|
|
1375
|
+
const known = new Set(kind.fields.map((f) => f.key));
|
|
1376
|
+
for (const key2 of Object.keys(values)) if (isPresent(values[key2]) && !known.has(key2)) problems[key2] = "unknown";
|
|
1377
|
+
const attributes = {};
|
|
1378
|
+
const priv = {};
|
|
1379
|
+
const display = {};
|
|
1380
|
+
const ids = {};
|
|
1381
|
+
const path = [];
|
|
1382
|
+
let tree = kind.catalog?.tree;
|
|
1383
|
+
const years = [];
|
|
1384
|
+
const put = (f, v) => {
|
|
1385
|
+
if (f.private) priv[f.key] = String(v);
|
|
1386
|
+
else attributes[f.key] = v;
|
|
1387
|
+
};
|
|
1388
|
+
for (const f of kind.fields) {
|
|
1389
|
+
const raw = values[f.key];
|
|
1390
|
+
if (!isPresent(raw)) {
|
|
1391
|
+
if (f.required) problems[f.key] = "required";
|
|
1392
|
+
if (f.source === "catalog" && f.type !== "year") tree = void 0;
|
|
1393
|
+
continue;
|
|
1394
|
+
}
|
|
1395
|
+
const max = f.max ?? MAX_VALUE_LENGTH;
|
|
1396
|
+
if (f.type === "year") {
|
|
1397
|
+
const y = asYear(raw);
|
|
1398
|
+
if (y === null) {
|
|
1399
|
+
problems[f.key] = "invalid";
|
|
1400
|
+
continue;
|
|
1401
|
+
}
|
|
1402
|
+
put(f, y);
|
|
1403
|
+
display[f.key] = ids[f.key] = String(y);
|
|
1404
|
+
if (f.source === "catalog") years.push(f.key);
|
|
1405
|
+
} else if (f.source === "catalog") {
|
|
1406
|
+
if (!kind.catalog) {
|
|
1407
|
+
problems[f.key] = "catalog_unavailable";
|
|
1408
|
+
continue;
|
|
1409
|
+
}
|
|
1410
|
+
const s = cleanText(raw, max);
|
|
1411
|
+
if (s === null) {
|
|
1412
|
+
problems[f.key] = "invalid";
|
|
1413
|
+
continue;
|
|
1414
|
+
}
|
|
1415
|
+
const node = tree?.[s] ?? tree?.[s.toLowerCase()];
|
|
1416
|
+
if (!node) {
|
|
1417
|
+
problems[f.key] = "not_in_catalog";
|
|
1418
|
+
continue;
|
|
1419
|
+
}
|
|
1420
|
+
const id = tree?.[s] ? s : s.toLowerCase();
|
|
1421
|
+
path.push(node);
|
|
1422
|
+
tree = node.children;
|
|
1423
|
+
put(f, id);
|
|
1424
|
+
display[f.key] = node.label;
|
|
1425
|
+
ids[f.key] = id;
|
|
1426
|
+
} else {
|
|
1427
|
+
const s = cleanText(raw, max);
|
|
1428
|
+
if (s === null) {
|
|
1429
|
+
problems[f.key] = "invalid";
|
|
1430
|
+
continue;
|
|
1431
|
+
}
|
|
1432
|
+
put(f, s);
|
|
1433
|
+
display[f.key] = s;
|
|
1434
|
+
ids[f.key] = slug(s);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
for (const key2 of years) {
|
|
1438
|
+
const y = attributes[key2];
|
|
1439
|
+
if (y !== void 0 && !problems[key2] && !path.every((n) => coversYear(n, y))) problems[key2] = "year_range";
|
|
1440
|
+
}
|
|
1441
|
+
if (Object.keys(problems).length > 0) return { ok: false, problems };
|
|
1442
|
+
const label = [...kind.fields.filter((f) => !f.private).map((f) => display[f.key]).filter(Boolean).join(" ")].slice(0, MAX_LABEL_LENGTH).join("").trim();
|
|
1443
|
+
if (!label) return { ok: false, problems: { _: "required" } };
|
|
1444
|
+
let complete = true;
|
|
1445
|
+
const key = kind.fit_key_template.replace(/\{([a-z][a-z0-9_]*)\}/g, (_m, name) => {
|
|
1446
|
+
const id = ids[name];
|
|
1447
|
+
if (!id) complete = false;
|
|
1448
|
+
return id ?? "";
|
|
1449
|
+
});
|
|
1450
|
+
return { ok: true, subject: { label, fit_key: complete && key.length <= MAX_FIT_KEY_LENGTH ? key.toLowerCase() : "", attributes, private: priv } };
|
|
1451
|
+
}
|
|
1452
|
+
var PRIVATE_MASK = "\u2022\u2022";
|
|
1453
|
+
var isMasked = (v) => typeof v === "string" && v.startsWith(PRIVATE_MASK);
|
|
1454
|
+
|
|
1350
1455
|
// src/mock/seed.ts
|
|
1351
1456
|
var MOCK_IMAGE_URL = (seed, width = 800, height = 800) => `https://picsum.photos/seed/${encodeURIComponent(seed)}/${width}/${height}`;
|
|
1352
1457
|
var MOCK_CURRENCY = "MXN";
|
|
@@ -1683,6 +1788,55 @@ function buildCustomers() {
|
|
|
1683
1788
|
];
|
|
1684
1789
|
}
|
|
1685
1790
|
|
|
1791
|
+
// src/mock/subjects.ts
|
|
1792
|
+
var MOCK_SUBJECT_KINDS = [
|
|
1793
|
+
{
|
|
1794
|
+
key: "vehicle",
|
|
1795
|
+
label: "Veh\xEDculo",
|
|
1796
|
+
label_plural: "Mi garage",
|
|
1797
|
+
max_per_account: 3,
|
|
1798
|
+
attach_to_order: true,
|
|
1799
|
+
fit_key_template: "{make}/{model}/{year}/{engine}",
|
|
1800
|
+
fields: [
|
|
1801
|
+
{ key: "make", label: "Marca", type: "select", source: "catalog", required: true },
|
|
1802
|
+
{ key: "model", label: "Modelo", type: "select", source: "catalog", depends_on: "make", required: true },
|
|
1803
|
+
{ key: "year", label: "A\xF1o", type: "year", source: "catalog", depends_on: "model", required: true },
|
|
1804
|
+
{ key: "engine", label: "Versi\xF3n / motor", type: "select", source: "catalog", depends_on: "year" },
|
|
1805
|
+
{ key: "plate", label: "Placas (opcional)", type: "text", max: 12, private: true }
|
|
1806
|
+
],
|
|
1807
|
+
catalog: {
|
|
1808
|
+
version: "mock-1",
|
|
1809
|
+
tree: {
|
|
1810
|
+
nissan: {
|
|
1811
|
+
label: "Nissan",
|
|
1812
|
+
children: {
|
|
1813
|
+
np300: {
|
|
1814
|
+
label: "NP300 Frontier",
|
|
1815
|
+
from: 2008,
|
|
1816
|
+
to: 2022,
|
|
1817
|
+
children: { "2.5": { label: "2.5 L", ranges: [[2010, 2015]] }, "2.4": { label: "2.4 L" } }
|
|
1818
|
+
},
|
|
1819
|
+
versa: { label: "Versa", from: 2012, to: 2024, children: { "1.6": { label: "1.6 L" } } }
|
|
1820
|
+
}
|
|
1821
|
+
},
|
|
1822
|
+
ford: { label: "Ford", children: { f150: { label: "F-150", from: 2e3, to: 2020, children: { "5.0": { label: "5.0 L" } } } } }
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
},
|
|
1826
|
+
{
|
|
1827
|
+
key: "size",
|
|
1828
|
+
label: "Talla",
|
|
1829
|
+
label_plural: "Mis tallas",
|
|
1830
|
+
max_per_account: 5,
|
|
1831
|
+
fit_key_template: "{garment}/{value}",
|
|
1832
|
+
fields: [
|
|
1833
|
+
{ key: "garment", label: "Prenda", type: "text", required: true },
|
|
1834
|
+
{ key: "value", label: "Talla", type: "text", required: true, max: 8 }
|
|
1835
|
+
],
|
|
1836
|
+
catalog: null
|
|
1837
|
+
}
|
|
1838
|
+
];
|
|
1839
|
+
|
|
1686
1840
|
// src/mock/index.ts
|
|
1687
1841
|
var HttpError = class extends Error {
|
|
1688
1842
|
constructor(status, code, message, field, details, requiredScopes) {
|
|
@@ -1760,6 +1914,7 @@ function createMockStorefront(options = {}) {
|
|
|
1760
1914
|
notifications: { channels: ["email"] },
|
|
1761
1915
|
data_export: true,
|
|
1762
1916
|
account_delete: true,
|
|
1917
|
+
...(options.subjectKinds?.length ?? 0) > 0 ? { subjects: { kinds: options.subjectKinds.map((k) => k.key), share_with_workshop: false } } : {},
|
|
1763
1918
|
...options.customerCapabilities
|
|
1764
1919
|
};
|
|
1765
1920
|
const missingScopes = options.missingScopes ?? [];
|
|
@@ -1791,6 +1946,7 @@ function createMockStorefront(options = {}) {
|
|
|
1791
1946
|
customers: buildCustomers(),
|
|
1792
1947
|
addresses: /* @__PURE__ */ new Map(),
|
|
1793
1948
|
fiscalProfiles: /* @__PURE__ */ new Map(),
|
|
1949
|
+
subjects: /* @__PURE__ */ new Map(),
|
|
1794
1950
|
orders: [
|
|
1795
1951
|
{
|
|
1796
1952
|
id: "ord_seed_1",
|
|
@@ -1896,6 +2052,9 @@ function createMockStorefront(options = {}) {
|
|
|
1896
2052
|
if (list.length > 100) throw new HttpError(400, "validation", "At most 100 handles", "handles");
|
|
1897
2053
|
items = items.filter((p) => list.includes(p.handle));
|
|
1898
2054
|
}
|
|
2055
|
+
const tagsAny = (search.get("tags_any") ?? "").split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
|
|
2056
|
+
if (tagsAny.length > 5 || tagsAny.some((t) => t.length > 120)) throw new HttpError(400, "validation", "tags_any takes at most 5 tags of 120 characters", "tags_any");
|
|
2057
|
+
if (tagsAny.length > 0) items = items.filter((p) => p.tags.some((t) => tagsAny.includes(t.toLowerCase())));
|
|
1899
2058
|
const base = items;
|
|
1900
2059
|
if (search.get("available") === "true") items = items.filter((p) => p.available_for_sale);
|
|
1901
2060
|
const priceMin = search.get("price_min");
|
|
@@ -2023,6 +2182,7 @@ function createMockStorefront(options = {}) {
|
|
|
2023
2182
|
const expires = new Date(Date.now() + 24 * 36e5).toISOString();
|
|
2024
2183
|
return options.shippingRates.map((r) => ({ ...r, expires_at: r.expires_at ?? expires, cost: free ? fromCents(0, r.cost.currency_code) : r.cost }));
|
|
2025
2184
|
}
|
|
2185
|
+
if (free && options.shippingQuoteMode === "fixed_when_free") return [{ id: "flat", title: "Env\xEDo gratis", cost: fromCents(0, currency), eta: "2 a 5 d\xEDas h\xE1biles" }];
|
|
2026
2186
|
return [
|
|
2027
2187
|
{ id: "flat", title: free ? "Env\xEDo est\xE1ndar (gratis)" : "Env\xEDo est\xE1ndar", cost: fromCents(free ? 0 : flatShippingCents, currency), eta: "2 a 5 d\xEDas h\xE1biles" },
|
|
2028
2188
|
{ id: "express", title: "Env\xEDo expr\xE9s", cost: fromCents(flatShippingCents + 1e4, currency), eta: "1 a 2 d\xEDas h\xE1biles" }
|
|
@@ -2326,8 +2486,10 @@ function createMockStorefront(options = {}) {
|
|
|
2326
2486
|
route("GET", "/carts/:id/delivery-options", "cart:write", ({ params }) => {
|
|
2327
2487
|
const cart = renderCart(getCartRecord(params[0]));
|
|
2328
2488
|
const net = toCents(cart.cost.subtotal.amount) - toCents(cart.cost.discount.amount);
|
|
2489
|
+
const rates = shippingRates(net);
|
|
2490
|
+
const free = options.shippingQuoteMode === "fixed_when_free" && rates.length > 0 && rates.every((r) => toCents(r.cost.amount) === 0);
|
|
2329
2491
|
return {
|
|
2330
|
-
body: { rates:
|
|
2492
|
+
body: { rates, free, fixed: free, pickup: state.shop.branches.filter((b) => b.pickup?.enabled !== false).map((b) => ({ branch_id: b.id, name: b.name, address: b.address, city: b.city })), partial: false, unavailable: [] },
|
|
2331
2493
|
cache: "private"
|
|
2332
2494
|
};
|
|
2333
2495
|
});
|
|
@@ -3002,6 +3164,89 @@ function createMockStorefront(options = {}) {
|
|
|
3002
3164
|
mirrorDefaultProfile(c);
|
|
3003
3165
|
return { status: 204 };
|
|
3004
3166
|
});
|
|
3167
|
+
const MAX_SUBJECTS = 50;
|
|
3168
|
+
const subjectsOf = (c) => state.subjects.get(c.id) ?? [];
|
|
3169
|
+
const kinds = () => options.subjectKinds ?? [];
|
|
3170
|
+
const publicSubject = (s) => {
|
|
3171
|
+
const { private: priv, ...rest } = s;
|
|
3172
|
+
return { ...rest, attributes: { ...s.attributes, ...Object.fromEntries(Object.keys(priv).map((k) => [k, PRIVATE_MASK + (priv[k].length > 3 ? priv[k].slice(-2) : "")])) } };
|
|
3173
|
+
};
|
|
3174
|
+
const ownSubject = (c, id) => {
|
|
3175
|
+
const s = subjectsOf(c).find((x) => x.id === id);
|
|
3176
|
+
if (!s) throw new HttpError(404, "not_found", "Item not found", "id");
|
|
3177
|
+
return s;
|
|
3178
|
+
};
|
|
3179
|
+
const setDefaultSubject = (c, id) => {
|
|
3180
|
+
const kind = ownSubject(c, id).kind;
|
|
3181
|
+
state.subjects.set(c.id, subjectsOf(c).map((s) => s.kind !== kind ? s : s.id === id ? { ...s, is_default: true, last_used_at: now() } : { ...s, is_default: false }));
|
|
3182
|
+
};
|
|
3183
|
+
const resolveOrThrow = (kind, values) => {
|
|
3184
|
+
const r = resolveSubject(kind, values);
|
|
3185
|
+
if (!r.ok) {
|
|
3186
|
+
const [field, code] = Object.entries(r.problems)[0];
|
|
3187
|
+
throw new HttpError(422, "validation", `${field}: ${code}`, field === "_" ? "attributes" : `attributes.${field}`);
|
|
3188
|
+
}
|
|
3189
|
+
return r.subject;
|
|
3190
|
+
};
|
|
3191
|
+
const cleanNickname = (v) => {
|
|
3192
|
+
if (v === void 0 || v === null || v === "") return null;
|
|
3193
|
+
if (typeof v !== "string" || [...v.trim()].length > 40) throw new HttpError(422, "validation", "nickname is too long (max 40)", "nickname");
|
|
3194
|
+
return v.trim().split(/\s+/).join(" ");
|
|
3195
|
+
};
|
|
3196
|
+
route("GET", "/subject-kinds", "content:read", () => ({ body: { nodes: kinds() }, cache: "public" }));
|
|
3197
|
+
route("GET", "/customer/subjects", "customer:read", ({ headers, search }) => {
|
|
3198
|
+
const c = requireCustomer(headers);
|
|
3199
|
+
const kind = search.get("kind");
|
|
3200
|
+
const nodes = subjectsOf(c).filter((s) => !kind || s.kind === kind).sort((a, b) => a.kind.localeCompare(b.kind) || Number(b.is_default) - Number(a.is_default) || (b.last_used_at ?? "").localeCompare(a.last_used_at ?? ""));
|
|
3201
|
+
return { body: { nodes: nodes.map(publicSubject) }, cache: "private" };
|
|
3202
|
+
});
|
|
3203
|
+
route("POST", "/customer/subjects", "customer:write", ({ headers, body }) => {
|
|
3204
|
+
const c = requireCustomer(headers);
|
|
3205
|
+
const kind = kinds().find((k) => k.key === body.kind);
|
|
3206
|
+
if (!kind) throw new HttpError(422, "validation", "This store has no such kind", "kind");
|
|
3207
|
+
const attrs = body.attributes;
|
|
3208
|
+
if (!attrs || typeof attrs !== "object" || Array.isArray(attrs)) throw new HttpError(422, "validation", "attributes must be an object", "attributes");
|
|
3209
|
+
const r = resolveOrThrow(kind, attrs);
|
|
3210
|
+
const list = subjectsOf(c);
|
|
3211
|
+
if (list.length >= MAX_SUBJECTS || list.filter((s) => s.kind === kind.key).length >= kind.max_per_account) throw new HttpError(409, "conflict", "Limit reached; delete one first", "kind");
|
|
3212
|
+
if (r.fit_key && list.some((s) => s.kind === kind.key && s.fit_key === r.fit_key)) throw new HttpError(409, "conflict", "You already saved this item", "attributes");
|
|
3213
|
+
const subject = { id: nextId("subj"), kind: kind.key, label: r.label, nickname: cleanNickname(body.nickname), fit_key: r.fit_key, attributes: r.attributes, private: r.private, is_default: false, last_used_at: null, created_at: now() };
|
|
3214
|
+
state.subjects.set(c.id, [...list, subject]);
|
|
3215
|
+
if (!list.some((s) => s.kind === kind.key) || body.is_default === true) setDefaultSubject(c, subject.id);
|
|
3216
|
+
return { status: 201, body: publicSubject(ownSubject(c, subject.id)), cache: "private" };
|
|
3217
|
+
});
|
|
3218
|
+
route("PATCH", "/customer/subjects/:id", "customer:write", ({ headers, params, body }) => {
|
|
3219
|
+
const c = requireCustomer(headers);
|
|
3220
|
+
const cur = ownSubject(c, params[0]);
|
|
3221
|
+
if (body.is_default === false && cur.is_default) throw new HttpError(422, "validation", "Make another item the default instead", "is_default");
|
|
3222
|
+
let next = { ...cur };
|
|
3223
|
+
if ("nickname" in body) next.nickname = cleanNickname(body.nickname);
|
|
3224
|
+
if ("attributes" in body) {
|
|
3225
|
+
const kind = kinds().find((k) => k.key === cur.kind);
|
|
3226
|
+
if (!kind) throw new HttpError(422, "validation", "This store no longer offers this kind", "kind");
|
|
3227
|
+
const sent = body.attributes ?? {};
|
|
3228
|
+
const merged = { ...cur.attributes, ...cur.private };
|
|
3229
|
+
for (const [k, v] of Object.entries(sent)) {
|
|
3230
|
+
if (k in cur.private && isMasked(v)) continue;
|
|
3231
|
+
if (v === null) delete merged[k];
|
|
3232
|
+
else merged[k] = v;
|
|
3233
|
+
}
|
|
3234
|
+
const r = resolveOrThrow(kind, merged);
|
|
3235
|
+
if (r.fit_key && subjectsOf(c).some((s) => s.id !== cur.id && s.kind === cur.kind && s.fit_key === r.fit_key)) throw new HttpError(409, "conflict", "You already saved this item", "attributes");
|
|
3236
|
+
next = { ...next, label: r.label, fit_key: r.fit_key, attributes: r.attributes, private: r.private };
|
|
3237
|
+
}
|
|
3238
|
+
state.subjects.set(c.id, subjectsOf(c).map((s) => s.id === cur.id ? next : s));
|
|
3239
|
+
if (body.is_default === true && !cur.is_default) setDefaultSubject(c, cur.id);
|
|
3240
|
+
return { body: publicSubject(ownSubject(c, cur.id)), cache: "private" };
|
|
3241
|
+
});
|
|
3242
|
+
route("DELETE", "/customer/subjects/:id", "customer:write", ({ headers, params }) => {
|
|
3243
|
+
const c = requireCustomer(headers);
|
|
3244
|
+
const cur = ownSubject(c, params[0]);
|
|
3245
|
+
state.subjects.set(c.id, subjectsOf(c).filter((s) => s.id !== cur.id));
|
|
3246
|
+
const heir = subjectsOf(c).filter((s) => s.kind === cur.kind).sort((a, b) => (b.last_used_at ?? "").localeCompare(a.last_used_at ?? ""))[0];
|
|
3247
|
+
if (cur.is_default && heir) setDefaultSubject(c, heir.id);
|
|
3248
|
+
return { status: 204 };
|
|
3249
|
+
});
|
|
3005
3250
|
route("GET", "/customer/addresses", "customer:read", ({ headers }) => {
|
|
3006
3251
|
const c = requireCustomer(headers);
|
|
3007
3252
|
return { body: { nodes: state.addresses.get(c.id) ?? [] }, cache: "private" };
|
|
@@ -3159,6 +3404,7 @@ exports.MOCK_IDENTITY_DOCUMENT_MX_CSF = MOCK_IDENTITY_DOCUMENT_MX_CSF;
|
|
|
3159
3404
|
exports.MOCK_IMAGE_URL = MOCK_IMAGE_URL;
|
|
3160
3405
|
exports.MOCK_POSTAL_CENTROIDS = MOCK_POSTAL_CENTROIDS;
|
|
3161
3406
|
exports.MOCK_REGION_MX = MOCK_REGION_MX;
|
|
3407
|
+
exports.MOCK_SUBJECT_KINDS = MOCK_SUBJECT_KINDS;
|
|
3162
3408
|
exports.createMockStorefront = createMockStorefront;
|
|
3163
3409
|
//# sourceMappingURL=mock.cjs.map
|
|
3164
3410
|
//# sourceMappingURL=mock.cjs.map
|