@juo/blocks 2.0.0-alpha.3 → 2.0.0-alpha.5
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/core.js +508 -100
- package/dist/services/customer/adapter.d.ts +2 -1
- package/dist/services/customer/adapter.d.ts.map +1 -1
- package/dist/services/customer/customerService.d.ts.map +1 -1
- package/dist/services/customer/customerService.test.d.ts +2 -0
- package/dist/services/customer/customerService.test.d.ts.map +1 -0
- package/dist/services/customer/index.d.ts +1 -1
- package/dist/services/customer/index.d.ts.map +1 -1
- package/dist/services/customer/types.d.ts +16 -0
- package/dist/services/customer/types.d.ts.map +1 -1
- package/dist/services/product/adapter.d.ts +42 -0
- package/dist/services/product/adapter.d.ts.map +1 -1
- package/dist/services/product/index.d.ts +1 -1
- package/dist/services/product/index.d.ts.map +1 -1
- package/dist/services/subscription/adapter.d.ts +47 -1
- package/dist/services/subscription/adapter.d.ts.map +1 -1
- package/dist/services/subscription/index.d.ts +1 -1
- package/dist/services/subscription/index.d.ts.map +1 -1
- package/dist/services/subscription/paymentInstrument.d.ts +9 -0
- package/dist/services/subscription/paymentInstrument.d.ts.map +1 -1
- package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
- package/dist/services/subscription/types.d.ts +147 -5
- package/dist/services/subscription/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -273,15 +273,140 @@ function createCustomerService(options) {
|
|
|
273
273
|
const result = await options.adapter.getCurrent();
|
|
274
274
|
if (result._tag === "Success") current.value = result.data;
|
|
275
275
|
return result;
|
|
276
|
+
},
|
|
277
|
+
createPaymentMethod(params) {
|
|
278
|
+
return options.adapter.createPaymentMethod(params);
|
|
276
279
|
}
|
|
277
280
|
};
|
|
278
281
|
}
|
|
279
282
|
const CustomerServiceContext = createContext("services/customer");
|
|
283
|
+
const PAYMENT_INSTRUMENT_TYPES = [
|
|
284
|
+
"credit_card",
|
|
285
|
+
"paypal",
|
|
286
|
+
"shop_pay",
|
|
287
|
+
"sepa_direct_debit",
|
|
288
|
+
"blik",
|
|
289
|
+
"mbway",
|
|
290
|
+
"bacs"
|
|
291
|
+
];
|
|
292
|
+
const INSTRUMENT_TYPE_TO_NAME = {
|
|
293
|
+
credit_card: null,
|
|
294
|
+
paypal: "PayPal",
|
|
295
|
+
blik: "BLIK",
|
|
296
|
+
sepa_direct_debit: "SEPA",
|
|
297
|
+
mbway: "MB WAY",
|
|
298
|
+
shop_pay: "Shop Pay",
|
|
299
|
+
bacs: "Bacs"
|
|
300
|
+
};
|
|
301
|
+
function getPaymentInstrumentName(instrument) {
|
|
302
|
+
const name = INSTRUMENT_TYPE_TO_NAME[instrument.type] ?? null;
|
|
303
|
+
if (name != null) return name;
|
|
304
|
+
return instrument.type === "credit_card" ? instrument.brand || instrument.type : instrument.type;
|
|
305
|
+
}
|
|
306
|
+
function getPaymentInstrumentDigits(instrument) {
|
|
307
|
+
switch (instrument.type) {
|
|
308
|
+
case "credit_card":
|
|
309
|
+
case "shop_pay":
|
|
310
|
+
case "bacs":
|
|
311
|
+
return instrument.maskedNumber.slice(-4) || null;
|
|
312
|
+
case "sepa_direct_debit":
|
|
313
|
+
return instrument.consumerAccount.slice(-4) || null;
|
|
314
|
+
default:
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
function getPaymentInstrumentDetail(instrument) {
|
|
319
|
+
switch (instrument.type) {
|
|
320
|
+
case "paypal":
|
|
321
|
+
return instrument.paypalAccountEmail ?? null;
|
|
322
|
+
case "sepa_direct_debit":
|
|
323
|
+
return instrument.consumerName ?? null;
|
|
324
|
+
case "blik":
|
|
325
|
+
return instrument.label ?? null;
|
|
326
|
+
case "mbway":
|
|
327
|
+
return instrument.phone ?? null;
|
|
328
|
+
default:
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function getPaymentInstrumentExpiry(instrument, now = /* @__PURE__ */ new Date()) {
|
|
333
|
+
if (instrument.type !== "credit_card" && instrument.type !== "shop_pay") {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
const { expiryMonth: month, expiryYear: year } = instrument;
|
|
337
|
+
if (month == null || year == null) return null;
|
|
338
|
+
const nowYear = now.getFullYear();
|
|
339
|
+
const nowMonth = now.getMonth() + 1;
|
|
340
|
+
const expiresThisMonth = year === nowYear && month === nowMonth;
|
|
341
|
+
const isExpired = year < nowYear || year === nowYear && month < nowMonth;
|
|
342
|
+
return { month, year, isExpired, expiresThisMonth };
|
|
343
|
+
}
|
|
344
|
+
function serializeV1PaymentInstrument(raw) {
|
|
345
|
+
if (raw == null || typeof raw !== "object") return null;
|
|
346
|
+
const r2 = raw;
|
|
347
|
+
if (typeof r2.type !== "string") return null;
|
|
348
|
+
switch (r2.type) {
|
|
349
|
+
case "credit-card":
|
|
350
|
+
return {
|
|
351
|
+
type: "credit_card",
|
|
352
|
+
brand: r2.brand ?? "",
|
|
353
|
+
maskedNumber: r2.maskedNumber ?? "",
|
|
354
|
+
...r2.expiryMonth != null ? { expiryMonth: r2.expiryMonth } : {},
|
|
355
|
+
...r2.expiryYear != null ? { expiryYear: r2.expiryYear } : {},
|
|
356
|
+
...r2.cardholderName != null ? { cardholderName: r2.cardholderName } : {}
|
|
357
|
+
};
|
|
358
|
+
case "paypal":
|
|
359
|
+
return { type: "paypal", paypalAccountEmail: r2.paypalAccountEmail ?? null };
|
|
360
|
+
case "shop-pay":
|
|
361
|
+
return {
|
|
362
|
+
type: "shop_pay",
|
|
363
|
+
maskedNumber: r2.maskedNumber ?? "",
|
|
364
|
+
...r2.expiryMonth != null ? { expiryMonth: r2.expiryMonth } : {},
|
|
365
|
+
...r2.expiryYear != null ? { expiryYear: r2.expiryYear } : {},
|
|
366
|
+
...r2.cardholderName != null ? { cardholderName: r2.cardholderName } : {}
|
|
367
|
+
};
|
|
368
|
+
case "sepa-direct-debit":
|
|
369
|
+
return {
|
|
370
|
+
type: "sepa_direct_debit",
|
|
371
|
+
consumerName: r2.consumerName ?? "",
|
|
372
|
+
consumerBic: r2.consumerBic ?? null,
|
|
373
|
+
consumerAccount: r2.maskedConsumerAccount ?? ""
|
|
374
|
+
};
|
|
375
|
+
case "blik":
|
|
376
|
+
return { type: "blik" };
|
|
377
|
+
case "mbway":
|
|
378
|
+
return { type: "mbway", ...r2.phone != null ? { phone: r2.phone } : {} };
|
|
379
|
+
case "bacs":
|
|
380
|
+
return { type: "bacs", maskedNumber: r2.maskedNumber ?? "" };
|
|
381
|
+
default:
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
280
385
|
function createMockCustomerAdapter() {
|
|
281
386
|
const customer = { id: "customer-1", name: "Customer 1" };
|
|
282
387
|
return {
|
|
283
388
|
async getCurrent() {
|
|
284
389
|
return { _tag: "Success", data: customer };
|
|
390
|
+
},
|
|
391
|
+
async createPaymentMethod(params) {
|
|
392
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
393
|
+
if (params.provider === "shopify") {
|
|
394
|
+
return {
|
|
395
|
+
_tag: "Success",
|
|
396
|
+
data: {
|
|
397
|
+
kind: "email_sent",
|
|
398
|
+
paymentMethodId: "pm_mock_1",
|
|
399
|
+
instrument: { type: "credit_card", brand: "visa", maskedNumber: "•••• 4242" }
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
if (params.provider === "mollie") {
|
|
404
|
+
return {
|
|
405
|
+
_tag: "Success",
|
|
406
|
+
data: { kind: "redirect", redirectUrl: params.returnUrl }
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
return { _tag: "Failure", error: new Error(`Payment provider "${params.provider}" is not supported`) };
|
|
285
410
|
}
|
|
286
411
|
};
|
|
287
412
|
}
|
|
@@ -300,6 +425,41 @@ function createApiCustomerAdapter(fetcher) {
|
|
|
300
425
|
} catch (e) {
|
|
301
426
|
return { _tag: "Failure", error: e };
|
|
302
427
|
}
|
|
428
|
+
},
|
|
429
|
+
async createPaymentMethod(params) {
|
|
430
|
+
try {
|
|
431
|
+
if (params.provider === "shopify") {
|
|
432
|
+
const res = await fetcher("/customer/v1/payment-methods", {
|
|
433
|
+
method: "POST"
|
|
434
|
+
});
|
|
435
|
+
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
436
|
+
const body = await res.json();
|
|
437
|
+
return {
|
|
438
|
+
_tag: "Success",
|
|
439
|
+
data: {
|
|
440
|
+
kind: "email_sent",
|
|
441
|
+
paymentMethodId: body.id,
|
|
442
|
+
instrument: serializeV1PaymentInstrument(body.instrument) ?? void 0
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
if (params.provider === "mollie") {
|
|
447
|
+
const res = await fetcher("/customer/payment-methods", {
|
|
448
|
+
method: "POST",
|
|
449
|
+
headers: { "Content-Type": "application/json" },
|
|
450
|
+
body: JSON.stringify({ redirectUrl: params.returnUrl })
|
|
451
|
+
});
|
|
452
|
+
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
453
|
+
const body = await res.json();
|
|
454
|
+
return {
|
|
455
|
+
_tag: "Success",
|
|
456
|
+
data: { kind: "redirect", redirectUrl: body.redirectUrl }
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
return { _tag: "Failure", error: new Error(`Payment provider "${params.provider}" is not supported`) };
|
|
460
|
+
} catch (e) {
|
|
461
|
+
return { _tag: "Failure", error: e };
|
|
462
|
+
}
|
|
303
463
|
}
|
|
304
464
|
};
|
|
305
465
|
}
|
|
@@ -1064,6 +1224,13 @@ function mapVariant(variant, currencyCode) {
|
|
|
1064
1224
|
} : {}
|
|
1065
1225
|
};
|
|
1066
1226
|
}
|
|
1227
|
+
const IDENTIFIER = String.raw`[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*`;
|
|
1228
|
+
const VALUE = String.raw`(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|${IDENTIFIER})`;
|
|
1229
|
+
const TERM = String.raw`(?:NOT\s+|-)?${IDENTIFIER}:(?:>=|<=|>|<)?${VALUE}`;
|
|
1230
|
+
const FILTER_QUERY = new RegExp(String.raw`^${TERM}(?:\s+(?:AND|OR)\s+${TERM})*$`);
|
|
1231
|
+
function isFilterQuery(query) {
|
|
1232
|
+
return FILTER_QUERY.test(query);
|
|
1233
|
+
}
|
|
1067
1234
|
function mapProduct(product, currencyCode) {
|
|
1068
1235
|
return {
|
|
1069
1236
|
id: product.id,
|
|
@@ -1116,7 +1283,11 @@ function createApiProductAdapter(fetcher, opts = { currencyCode: "USD" }) {
|
|
|
1116
1283
|
try {
|
|
1117
1284
|
const params = new URLSearchParams();
|
|
1118
1285
|
if (opts2 == null ? void 0 : opts2.query) {
|
|
1119
|
-
|
|
1286
|
+
const trimmed = opts2.query.trim();
|
|
1287
|
+
params.set(
|
|
1288
|
+
"query",
|
|
1289
|
+
isFilterQuery(trimmed) ? trimmed : `"${trimmed.replace(/"/g, '\\"')}"`
|
|
1290
|
+
);
|
|
1120
1291
|
}
|
|
1121
1292
|
if (opts2 == null ? void 0 : opts2.pagination) {
|
|
1122
1293
|
if ("after" in opts2.pagination)
|
|
@@ -1310,6 +1481,39 @@ const DISCOUNT_REJECTION_REASONS = [
|
|
|
1310
1481
|
function toAttributeArray(next) {
|
|
1311
1482
|
return Object.entries(next).map(([key, value]) => ({ key, value }));
|
|
1312
1483
|
}
|
|
1484
|
+
const MOCK_SHIPPING_METHODS = [
|
|
1485
|
+
{
|
|
1486
|
+
handle: "standard-shipping",
|
|
1487
|
+
title: "Standard shipping",
|
|
1488
|
+
price: { amount: "0.00", currencyCode: "EUR" }
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
handle: "dhl-express",
|
|
1492
|
+
title: "DHL Express",
|
|
1493
|
+
price: { amount: "9.99", currencyCode: "EUR" }
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
handle: "next-day",
|
|
1497
|
+
title: "Next day delivery",
|
|
1498
|
+
price: { amount: "14.99", currencyCode: "EUR" }
|
|
1499
|
+
}
|
|
1500
|
+
];
|
|
1501
|
+
function toShippingAddressBody(address) {
|
|
1502
|
+
return {
|
|
1503
|
+
firstName: address.firstName,
|
|
1504
|
+
lastName: address.lastName,
|
|
1505
|
+
address1: address.address1,
|
|
1506
|
+
zip: address.zip,
|
|
1507
|
+
city: address.city,
|
|
1508
|
+
...address.address2 ? { address2: address.address2 } : {},
|
|
1509
|
+
...address.province ? { province: address.province } : {},
|
|
1510
|
+
...address.phone ? { phone: address.phone } : {},
|
|
1511
|
+
...address.company ? { company: address.company } : {}
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
function isStaleSubscriptionMessage(message) {
|
|
1515
|
+
return message ? message.toLowerCase().includes("changed since last fetch") : false;
|
|
1516
|
+
}
|
|
1313
1517
|
function toNonEmptyAttributeArray(next) {
|
|
1314
1518
|
if (next == null) return [];
|
|
1315
1519
|
return toAttributeArray(next).filter(
|
|
@@ -1379,7 +1583,24 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1379
1583
|
renewal: { id: renewalId, isInActiveProcessState: false },
|
|
1380
1584
|
lastPaymentStatus: "succeeded",
|
|
1381
1585
|
pausePeriod: null,
|
|
1382
|
-
isEditable: true
|
|
1586
|
+
isEditable: true,
|
|
1587
|
+
// Shaped like the v1 mapping produces it: one option slot filled, no
|
|
1588
|
+
// presentmentTitle (v1 has no such field). Previews would otherwise render
|
|
1589
|
+
// ContractSelect's address / method rows as "-".
|
|
1590
|
+
deliveryMethod: {
|
|
1591
|
+
address: {
|
|
1592
|
+
firstName: "Ada",
|
|
1593
|
+
lastName: "Lovelace",
|
|
1594
|
+
address1: "Wilcza 12/4",
|
|
1595
|
+
zip: "00-538",
|
|
1596
|
+
city: "Warsaw",
|
|
1597
|
+
country: "Poland",
|
|
1598
|
+
countryCode: "PL"
|
|
1599
|
+
},
|
|
1600
|
+
shippingOption: { title: "Standard shipping" },
|
|
1601
|
+
pickupOption: null,
|
|
1602
|
+
localDeliveryOption: null
|
|
1603
|
+
}
|
|
1383
1604
|
});
|
|
1384
1605
|
const mockSubscriptions = [
|
|
1385
1606
|
{
|
|
@@ -1448,6 +1669,20 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1448
1669
|
lastPaymentStatus: "succeeded",
|
|
1449
1670
|
pausePeriod: null,
|
|
1450
1671
|
isEditable: true,
|
|
1672
|
+
deliveryMethod: {
|
|
1673
|
+
address: {
|
|
1674
|
+
firstName: "Ada",
|
|
1675
|
+
lastName: "Lovelace",
|
|
1676
|
+
address1: "Wilcza 12/4",
|
|
1677
|
+
zip: "00-538",
|
|
1678
|
+
city: "Warsaw",
|
|
1679
|
+
country: "Poland",
|
|
1680
|
+
countryCode: "PL"
|
|
1681
|
+
},
|
|
1682
|
+
shippingOption: { title: "DHL Express" },
|
|
1683
|
+
pickupOption: null,
|
|
1684
|
+
localDeliveryOption: null
|
|
1685
|
+
},
|
|
1451
1686
|
customAttributes: [
|
|
1452
1687
|
{ key: "subscription_tier", value: "premium" },
|
|
1453
1688
|
{ key: "gift_message", value: "Enjoy your skincare routine!" }
|
|
@@ -1479,6 +1714,14 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1479
1714
|
frequency: "2 WEEK",
|
|
1480
1715
|
createdAt: "2024-09-15T00:00:00Z",
|
|
1481
1716
|
updatedAt: "2024-10-10T00:00:00Z",
|
|
1717
|
+
// Pickup, with no address — the other branch of the option coalescing in
|
|
1718
|
+
// ContractSelect's delivery-method label.
|
|
1719
|
+
deliveryMethod: {
|
|
1720
|
+
address: null,
|
|
1721
|
+
shippingOption: null,
|
|
1722
|
+
pickupOption: { title: "Pickup in store" },
|
|
1723
|
+
localDeliveryOption: null
|
|
1724
|
+
},
|
|
1482
1725
|
customAttributes: []
|
|
1483
1726
|
},
|
|
1484
1727
|
// Per-status fixtures: groundwork for the deferred editor preview picker
|
|
@@ -1752,6 +1995,92 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1752
1995
|
subscription.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1753
1996
|
return { _tag: "Success", data: { ...subscription } };
|
|
1754
1997
|
},
|
|
1998
|
+
async updateDeliveryAddress({
|
|
1999
|
+
subscriptionId,
|
|
2000
|
+
address
|
|
2001
|
+
}) {
|
|
2002
|
+
var _a;
|
|
2003
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
2004
|
+
const subscription = mockSubscriptions.find(
|
|
2005
|
+
(sub) => sub.id === subscriptionId
|
|
2006
|
+
);
|
|
2007
|
+
if (!subscription) {
|
|
2008
|
+
return { _tag: "Failure", error: { kind: "SUBSCRIPTION_NOT_FOUND" } };
|
|
2009
|
+
}
|
|
2010
|
+
const previous = (_a = subscription.deliveryMethod) == null ? void 0 : _a.address;
|
|
2011
|
+
subscription.deliveryMethod = {
|
|
2012
|
+
...subscription.deliveryMethod,
|
|
2013
|
+
address: {
|
|
2014
|
+
firstName: address.firstName,
|
|
2015
|
+
lastName: address.lastName,
|
|
2016
|
+
address1: address.address1,
|
|
2017
|
+
zip: address.zip,
|
|
2018
|
+
city: address.city,
|
|
2019
|
+
...address.address2 ? { address2: address.address2 } : {},
|
|
2020
|
+
...address.province ? { province: address.province } : {},
|
|
2021
|
+
...address.phone ? { phone: address.phone } : {},
|
|
2022
|
+
...address.company ? { company: address.company } : {},
|
|
2023
|
+
...(previous == null ? void 0 : previous.country) != null ? { country: previous.country } : {},
|
|
2024
|
+
...(previous == null ? void 0 : previous.countryCode) != null ? { countryCode: previous.countryCode } : {}
|
|
2025
|
+
}
|
|
2026
|
+
};
|
|
2027
|
+
subscription.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
2028
|
+
return { _tag: "Success", data: void 0 };
|
|
2029
|
+
},
|
|
2030
|
+
async getAvailableShippingMethods({
|
|
2031
|
+
subscriptionId
|
|
2032
|
+
}) {
|
|
2033
|
+
var _a, _b, _c;
|
|
2034
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
2035
|
+
const subscription = mockSubscriptions.find(
|
|
2036
|
+
(sub) => sub.id === subscriptionId
|
|
2037
|
+
);
|
|
2038
|
+
if (!subscription) {
|
|
2039
|
+
return { _tag: "Failure", error: "Subscription not found" };
|
|
2040
|
+
}
|
|
2041
|
+
const currentTitle = (_b = (_a = subscription.deliveryMethod) == null ? void 0 : _a.shippingOption) == null ? void 0 : _b.title;
|
|
2042
|
+
const currencyCode = ((_c = subscription.items[0]) == null ? void 0 : _c.price.currencyCode) ?? "EUR";
|
|
2043
|
+
return {
|
|
2044
|
+
_tag: "Success",
|
|
2045
|
+
data: MOCK_SHIPPING_METHODS.map((method) => ({
|
|
2046
|
+
...method,
|
|
2047
|
+
price: { ...method.price, currencyCode },
|
|
2048
|
+
isActive: method.title === currentTitle
|
|
2049
|
+
}))
|
|
2050
|
+
};
|
|
2051
|
+
},
|
|
2052
|
+
async updateDeliveryMethod({
|
|
2053
|
+
subscriptionId,
|
|
2054
|
+
shippingMethodHandle
|
|
2055
|
+
}) {
|
|
2056
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
2057
|
+
const subscription = mockSubscriptions.find(
|
|
2058
|
+
(sub) => sub.id === subscriptionId
|
|
2059
|
+
);
|
|
2060
|
+
if (!subscription) {
|
|
2061
|
+
return { _tag: "Failure", error: { kind: "SUBSCRIPTION_NOT_FOUND" } };
|
|
2062
|
+
}
|
|
2063
|
+
const method = MOCK_SHIPPING_METHODS.find(
|
|
2064
|
+
(m2) => m2.handle === shippingMethodHandle
|
|
2065
|
+
);
|
|
2066
|
+
if (!method) {
|
|
2067
|
+
return {
|
|
2068
|
+
_tag: "Failure",
|
|
2069
|
+
error: {
|
|
2070
|
+
kind: "UNKNOWN",
|
|
2071
|
+
message: `Provided shipping method handle "${shippingMethodHandle}" is not available`
|
|
2072
|
+
}
|
|
2073
|
+
};
|
|
2074
|
+
}
|
|
2075
|
+
subscription.deliveryMethod = {
|
|
2076
|
+
...subscription.deliveryMethod,
|
|
2077
|
+
shippingOption: { title: method.title },
|
|
2078
|
+
pickupOption: null,
|
|
2079
|
+
localDeliveryOption: null
|
|
2080
|
+
};
|
|
2081
|
+
subscription.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
2082
|
+
return { _tag: "Success", data: void 0 };
|
|
2083
|
+
},
|
|
1755
2084
|
async resume(params) {
|
|
1756
2085
|
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
1757
2086
|
const subscription = mockSubscriptions.find(
|
|
@@ -1885,43 +2214,7 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1885
2214
|
};
|
|
1886
2215
|
}
|
|
1887
2216
|
function mapV1Instrument(raw) {
|
|
1888
|
-
|
|
1889
|
-
switch (raw.type) {
|
|
1890
|
-
case "credit-card":
|
|
1891
|
-
return {
|
|
1892
|
-
type: "credit_card",
|
|
1893
|
-
brand: raw.brand ?? "",
|
|
1894
|
-
maskedNumber: raw.maskedNumber ?? "",
|
|
1895
|
-
...raw.expiryMonth != null ? { expiryMonth: raw.expiryMonth } : {},
|
|
1896
|
-
...raw.expiryYear != null ? { expiryYear: raw.expiryYear } : {},
|
|
1897
|
-
...raw.cardholderName != null ? { cardholderName: raw.cardholderName } : {}
|
|
1898
|
-
};
|
|
1899
|
-
case "paypal":
|
|
1900
|
-
return { type: "paypal", paypalAccountEmail: raw.paypalAccountEmail ?? null };
|
|
1901
|
-
case "shop-pay":
|
|
1902
|
-
return {
|
|
1903
|
-
type: "shop_pay",
|
|
1904
|
-
maskedNumber: raw.maskedNumber ?? "",
|
|
1905
|
-
...raw.expiryMonth != null ? { expiryMonth: raw.expiryMonth } : {},
|
|
1906
|
-
...raw.expiryYear != null ? { expiryYear: raw.expiryYear } : {},
|
|
1907
|
-
...raw.cardholderName != null ? { cardholderName: raw.cardholderName } : {}
|
|
1908
|
-
};
|
|
1909
|
-
case "sepa-direct-debit":
|
|
1910
|
-
return {
|
|
1911
|
-
type: "sepa_direct_debit",
|
|
1912
|
-
consumerName: raw.consumerName ?? "",
|
|
1913
|
-
consumerBic: raw.consumerBic ?? null,
|
|
1914
|
-
consumerAccount: raw.maskedConsumerAccount ?? ""
|
|
1915
|
-
};
|
|
1916
|
-
case "blik":
|
|
1917
|
-
return { type: "blik" };
|
|
1918
|
-
case "mbway":
|
|
1919
|
-
return { type: "mbway", ...raw.phone != null ? { phone: raw.phone } : {} };
|
|
1920
|
-
case "bacs":
|
|
1921
|
-
return { type: "bacs", maskedNumber: raw.maskedNumber ?? "" };
|
|
1922
|
-
default:
|
|
1923
|
-
return null;
|
|
1924
|
-
}
|
|
2217
|
+
return serializeV1PaymentInstrument(raw);
|
|
1925
2218
|
}
|
|
1926
2219
|
function mapV1BillingAddress(raw) {
|
|
1927
2220
|
if (raw == null || typeof raw !== "object") return null;
|
|
@@ -1941,6 +2234,41 @@ function mapV1BillingAddress(raw) {
|
|
|
1941
2234
|
};
|
|
1942
2235
|
return Object.values(address).some((v3) => v3 != null) ? address : null;
|
|
1943
2236
|
}
|
|
2237
|
+
function mapV1DeliveryAddress(raw) {
|
|
2238
|
+
if (raw == null || typeof raw !== "object") return null;
|
|
2239
|
+
const address = {
|
|
2240
|
+
...raw.firstName != null ? { firstName: raw.firstName } : {},
|
|
2241
|
+
...raw.lastName != null ? { lastName: raw.lastName } : {},
|
|
2242
|
+
...raw.address1 != null ? { address1: raw.address1 } : {},
|
|
2243
|
+
...raw.address2 != null ? { address2: raw.address2 } : {},
|
|
2244
|
+
...raw.zip != null ? { zip: raw.zip } : {},
|
|
2245
|
+
...raw.city != null ? { city: raw.city } : {},
|
|
2246
|
+
...raw.country != null ? { country: raw.country } : {},
|
|
2247
|
+
...raw.countryCode != null ? { countryCode: raw.countryCode } : {},
|
|
2248
|
+
...raw.province != null ? { province: raw.province } : {},
|
|
2249
|
+
...raw.provinceCode != null ? { provinceCode: raw.provinceCode } : {},
|
|
2250
|
+
...raw.phone != null ? { phone: raw.phone } : {},
|
|
2251
|
+
...raw.company != null ? { company: raw.company } : {}
|
|
2252
|
+
};
|
|
2253
|
+
return Object.keys(address).length > 0 ? address : null;
|
|
2254
|
+
}
|
|
2255
|
+
function mapV1DeliveryMethod(raw) {
|
|
2256
|
+
const address = mapV1DeliveryAddress(raw == null ? void 0 : raw.deliveryAddress);
|
|
2257
|
+
const method = raw == null ? void 0 : raw.deliveryMethod;
|
|
2258
|
+
if (address == null && (method == null || typeof method !== "object")) {
|
|
2259
|
+
return null;
|
|
2260
|
+
}
|
|
2261
|
+
const option = method != null && typeof method === "object" ? {
|
|
2262
|
+
...method.title != null ? { title: method.title } : {},
|
|
2263
|
+
...method.description != null ? { description: method.description } : {}
|
|
2264
|
+
} : null;
|
|
2265
|
+
return {
|
|
2266
|
+
address,
|
|
2267
|
+
shippingOption: (method == null ? void 0 : method.type) === "shipping" ? option : null,
|
|
2268
|
+
pickupOption: (method == null ? void 0 : method.type) === "pickup" ? option : null,
|
|
2269
|
+
localDeliveryOption: (method == null ? void 0 : method.type) === "local-delivery" ? option : null
|
|
2270
|
+
};
|
|
2271
|
+
}
|
|
1944
2272
|
function mapPaymentMethod(rawPm) {
|
|
1945
2273
|
if (!rawPm) return null;
|
|
1946
2274
|
if (typeof rawPm === "string") {
|
|
@@ -2006,6 +2334,8 @@ function mapSubscription(raw) {
|
|
|
2006
2334
|
// Map customerPaymentMethod — expanded to an object (id + instrument) via the
|
|
2007
2335
|
// adapter's ?expand=paymentMethod request; mapPaymentMethod tolerates a bare id too.
|
|
2008
2336
|
customerPaymentMethod: mapPaymentMethod(raw.paymentMethod),
|
|
2337
|
+
// v1 returns deliveryAddress + deliveryMethod on every read, no expand needed.
|
|
2338
|
+
deliveryMethod: mapV1DeliveryMethod(raw),
|
|
2009
2339
|
frequency,
|
|
2010
2340
|
createdAt: raw.createdAt,
|
|
2011
2341
|
updatedAt: raw.updatedAt,
|
|
@@ -2305,6 +2635,121 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2305
2635
|
return { _tag: "Failure", error: e };
|
|
2306
2636
|
}
|
|
2307
2637
|
},
|
|
2638
|
+
// Legacy endpoint on purpose — see SubscriptionAdapter.updateDeliveryAddress
|
|
2639
|
+
// for why the documented v1 `deliveryAddress` patch is not used here.
|
|
2640
|
+
async updateDeliveryAddress({ subscriptionId, address }) {
|
|
2641
|
+
try {
|
|
2642
|
+
const res = await fetcher(
|
|
2643
|
+
`/customer/subscriptions/${subscriptionId}/shipping-address`,
|
|
2644
|
+
{
|
|
2645
|
+
method: "PUT",
|
|
2646
|
+
headers: { "Content-Type": "application/json" },
|
|
2647
|
+
body: JSON.stringify(toShippingAddressBody(address))
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
if (!res.ok) {
|
|
2651
|
+
if (res.status === 403) {
|
|
2652
|
+
return { _tag: "Failure", error: { kind: "NOT_ALLOWED" } };
|
|
2653
|
+
}
|
|
2654
|
+
if (res.status === 404) {
|
|
2655
|
+
return {
|
|
2656
|
+
_tag: "Failure",
|
|
2657
|
+
error: { kind: "SUBSCRIPTION_NOT_FOUND" }
|
|
2658
|
+
};
|
|
2659
|
+
}
|
|
2660
|
+
if (res.status === 400) {
|
|
2661
|
+
const body = await readErrorBody(res);
|
|
2662
|
+
const message = typeof body.message === "string" ? body.message : void 0;
|
|
2663
|
+
if (isStaleSubscriptionMessage(message)) {
|
|
2664
|
+
return { _tag: "Failure", error: { kind: "STALE" } };
|
|
2665
|
+
}
|
|
2666
|
+
return {
|
|
2667
|
+
_tag: "Failure",
|
|
2668
|
+
error: {
|
|
2669
|
+
kind: "INVALID_ADDRESS",
|
|
2670
|
+
...message ? { message } : {}
|
|
2671
|
+
}
|
|
2672
|
+
};
|
|
2673
|
+
}
|
|
2674
|
+
return {
|
|
2675
|
+
_tag: "Failure",
|
|
2676
|
+
error: { kind: "UNKNOWN", message: `HTTP ${res.status}` }
|
|
2677
|
+
};
|
|
2678
|
+
}
|
|
2679
|
+
return { _tag: "Success", data: void 0 };
|
|
2680
|
+
} catch (e) {
|
|
2681
|
+
return {
|
|
2682
|
+
_tag: "Failure",
|
|
2683
|
+
error: {
|
|
2684
|
+
kind: "NETWORK",
|
|
2685
|
+
message: e instanceof Error ? e.message : void 0
|
|
2686
|
+
}
|
|
2687
|
+
};
|
|
2688
|
+
}
|
|
2689
|
+
},
|
|
2690
|
+
// Legacy endpoint — no /customer/v1 equivalent exists yet.
|
|
2691
|
+
async getAvailableShippingMethods({ subscriptionId }) {
|
|
2692
|
+
try {
|
|
2693
|
+
const res = await fetcher(
|
|
2694
|
+
`/customer/subscriptions/${subscriptionId}/available-shipping-methods`
|
|
2695
|
+
);
|
|
2696
|
+
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2697
|
+
const data = await res.json();
|
|
2698
|
+
return { _tag: "Success", data };
|
|
2699
|
+
} catch (e) {
|
|
2700
|
+
return { _tag: "Failure", error: e };
|
|
2701
|
+
}
|
|
2702
|
+
},
|
|
2703
|
+
// Legacy endpoint — no /customer/v1 equivalent exists yet. No `extra` is
|
|
2704
|
+
// sent: pickup points are out of scope, and omitting it is what tells the
|
|
2705
|
+
// endpoint to leave any existing parcel-locker attributes alone.
|
|
2706
|
+
async updateDeliveryMethod({ subscriptionId, shippingMethodHandle }) {
|
|
2707
|
+
try {
|
|
2708
|
+
const res = await fetcher(
|
|
2709
|
+
`/customer/subscriptions/${subscriptionId}/shipping-method`,
|
|
2710
|
+
{
|
|
2711
|
+
method: "POST",
|
|
2712
|
+
headers: { "Content-Type": "application/json" },
|
|
2713
|
+
body: JSON.stringify({ shippingMethodHandle })
|
|
2714
|
+
}
|
|
2715
|
+
);
|
|
2716
|
+
if (!res.ok) {
|
|
2717
|
+
if (res.status === 403) {
|
|
2718
|
+
return { _tag: "Failure", error: { kind: "NOT_ALLOWED" } };
|
|
2719
|
+
}
|
|
2720
|
+
if (res.status === 404) {
|
|
2721
|
+
return {
|
|
2722
|
+
_tag: "Failure",
|
|
2723
|
+
error: { kind: "SUBSCRIPTION_NOT_FOUND" }
|
|
2724
|
+
};
|
|
2725
|
+
}
|
|
2726
|
+
if (res.status === 400) {
|
|
2727
|
+
const body = await readErrorBody(res);
|
|
2728
|
+
const message = typeof body.message === "string" ? body.message : void 0;
|
|
2729
|
+
if (isStaleSubscriptionMessage(message)) {
|
|
2730
|
+
return { _tag: "Failure", error: { kind: "STALE" } };
|
|
2731
|
+
}
|
|
2732
|
+
return {
|
|
2733
|
+
_tag: "Failure",
|
|
2734
|
+
error: { kind: "UNKNOWN", ...message ? { message } : {} }
|
|
2735
|
+
};
|
|
2736
|
+
}
|
|
2737
|
+
return {
|
|
2738
|
+
_tag: "Failure",
|
|
2739
|
+
error: { kind: "UNKNOWN", message: `HTTP ${res.status}` }
|
|
2740
|
+
};
|
|
2741
|
+
}
|
|
2742
|
+
return { _tag: "Success", data: void 0 };
|
|
2743
|
+
} catch (e) {
|
|
2744
|
+
return {
|
|
2745
|
+
_tag: "Failure",
|
|
2746
|
+
error: {
|
|
2747
|
+
kind: "NETWORK",
|
|
2748
|
+
message: e instanceof Error ? e.message : void 0
|
|
2749
|
+
}
|
|
2750
|
+
};
|
|
2751
|
+
}
|
|
2752
|
+
},
|
|
2308
2753
|
async resume({ subscriptionId }) {
|
|
2309
2754
|
try {
|
|
2310
2755
|
const res = await fetcher(
|
|
@@ -3340,6 +3785,27 @@ function createSubscriptionService(adapter) {
|
|
|
3340
3785
|
},
|
|
3341
3786
|
reschedule: (subscriptionId, newDate) => adapter.reschedule({ subscriptionId, newDate }),
|
|
3342
3787
|
updateCustomAttributes: (subscriptionId, customAttributes) => adapter.updateCustomAttributes({ subscriptionId, customAttributes }),
|
|
3788
|
+
updateDeliveryAddress: async (subscriptionId, address) => {
|
|
3789
|
+
const result = await adapter.updateDeliveryAddress({
|
|
3790
|
+
subscriptionId,
|
|
3791
|
+
address
|
|
3792
|
+
});
|
|
3793
|
+
if (result._tag === "Success") {
|
|
3794
|
+
await reload();
|
|
3795
|
+
}
|
|
3796
|
+
return result;
|
|
3797
|
+
},
|
|
3798
|
+
getAvailableShippingMethods: (subscriptionId) => adapter.getAvailableShippingMethods({ subscriptionId }),
|
|
3799
|
+
updateDeliveryMethod: async (subscriptionId, shippingMethodHandle) => {
|
|
3800
|
+
const result = await adapter.updateDeliveryMethod({
|
|
3801
|
+
subscriptionId,
|
|
3802
|
+
shippingMethodHandle
|
|
3803
|
+
});
|
|
3804
|
+
if (result._tag === "Success") {
|
|
3805
|
+
await reload();
|
|
3806
|
+
}
|
|
3807
|
+
return result;
|
|
3808
|
+
},
|
|
3343
3809
|
resume: (subscriptionId) => adapter.resume({ subscriptionId }),
|
|
3344
3810
|
pause: (subscriptionId) => adapter.pause({ subscriptionId }),
|
|
3345
3811
|
reactivate: (subscriptionId) => adapter.reactivate({ subscriptionId }),
|
|
@@ -3354,67 +3820,6 @@ function createSubscriptionService(adapter) {
|
|
|
3354
3820
|
};
|
|
3355
3821
|
return service;
|
|
3356
3822
|
}
|
|
3357
|
-
const PAYMENT_INSTRUMENT_TYPES = [
|
|
3358
|
-
"credit_card",
|
|
3359
|
-
"paypal",
|
|
3360
|
-
"shop_pay",
|
|
3361
|
-
"sepa_direct_debit",
|
|
3362
|
-
"blik",
|
|
3363
|
-
"mbway",
|
|
3364
|
-
"bacs"
|
|
3365
|
-
];
|
|
3366
|
-
const INSTRUMENT_TYPE_TO_NAME = {
|
|
3367
|
-
credit_card: null,
|
|
3368
|
-
paypal: "PayPal",
|
|
3369
|
-
blik: "BLIK",
|
|
3370
|
-
sepa_direct_debit: "SEPA",
|
|
3371
|
-
mbway: "MB WAY",
|
|
3372
|
-
shop_pay: "Shop Pay",
|
|
3373
|
-
bacs: "Bacs"
|
|
3374
|
-
};
|
|
3375
|
-
function getPaymentInstrumentName(instrument) {
|
|
3376
|
-
const name = INSTRUMENT_TYPE_TO_NAME[instrument.type] ?? null;
|
|
3377
|
-
if (name != null) return name;
|
|
3378
|
-
return instrument.type === "credit_card" ? instrument.brand || instrument.type : instrument.type;
|
|
3379
|
-
}
|
|
3380
|
-
function getPaymentInstrumentDigits(instrument) {
|
|
3381
|
-
switch (instrument.type) {
|
|
3382
|
-
case "credit_card":
|
|
3383
|
-
case "shop_pay":
|
|
3384
|
-
case "bacs":
|
|
3385
|
-
return instrument.maskedNumber.slice(-4) || null;
|
|
3386
|
-
case "sepa_direct_debit":
|
|
3387
|
-
return instrument.consumerAccount.slice(-4) || null;
|
|
3388
|
-
default:
|
|
3389
|
-
return null;
|
|
3390
|
-
}
|
|
3391
|
-
}
|
|
3392
|
-
function getPaymentInstrumentDetail(instrument) {
|
|
3393
|
-
switch (instrument.type) {
|
|
3394
|
-
case "paypal":
|
|
3395
|
-
return instrument.paypalAccountEmail ?? null;
|
|
3396
|
-
case "sepa_direct_debit":
|
|
3397
|
-
return instrument.consumerName ?? null;
|
|
3398
|
-
case "blik":
|
|
3399
|
-
return instrument.label ?? null;
|
|
3400
|
-
case "mbway":
|
|
3401
|
-
return instrument.phone ?? null;
|
|
3402
|
-
default:
|
|
3403
|
-
return null;
|
|
3404
|
-
}
|
|
3405
|
-
}
|
|
3406
|
-
function getPaymentInstrumentExpiry(instrument, now = /* @__PURE__ */ new Date()) {
|
|
3407
|
-
if (instrument.type !== "credit_card" && instrument.type !== "shop_pay") {
|
|
3408
|
-
return null;
|
|
3409
|
-
}
|
|
3410
|
-
const { expiryMonth: month, expiryYear: year } = instrument;
|
|
3411
|
-
if (month == null || year == null) return null;
|
|
3412
|
-
const nowYear = now.getFullYear();
|
|
3413
|
-
const nowMonth = now.getMonth() + 1;
|
|
3414
|
-
const expiresThisMonth = year === nowYear && month === nowMonth;
|
|
3415
|
-
const isExpired = year < nowYear || year === nowYear && month < nowMonth;
|
|
3416
|
-
return { month, year, isExpired, expiresThisMonth };
|
|
3417
|
-
}
|
|
3418
3823
|
function getDefaultBlockForAction(actionType, actionConfig, blockId) {
|
|
3419
3824
|
const blockName = `action:${actionType}`;
|
|
3420
3825
|
const definedBlocks = getDefinedBlocks();
|
|
@@ -4478,6 +4883,8 @@ export {
|
|
|
4478
4883
|
i as injectContext,
|
|
4479
4884
|
insertRectRelative,
|
|
4480
4885
|
H as isEditorPreview,
|
|
4886
|
+
isFilterQuery,
|
|
4887
|
+
isStaleSubscriptionMessage,
|
|
4481
4888
|
b as isStubDefinition,
|
|
4482
4889
|
t2 as layoutScopeSelector,
|
|
4483
4890
|
I as layoutSystemEnabled,
|
|
@@ -4495,6 +4902,7 @@ export {
|
|
|
4495
4902
|
resetBreakpoint,
|
|
4496
4903
|
r as resolveLayout,
|
|
4497
4904
|
k as serializeBlocks,
|
|
4905
|
+
serializeV1PaymentInstrument,
|
|
4498
4906
|
setActiveSurfaceContext,
|
|
4499
4907
|
K as setDevtoolsBlockProp,
|
|
4500
4908
|
setLayoutCommandDispatcher,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Customer } from './types';
|
|
1
|
+
import { Customer, CreatePaymentMethodParams, CreatePaymentMethodOutcome } from './types';
|
|
2
2
|
import { ApiFetcher, Result } from '../../utils';
|
|
3
3
|
export interface CustomerAdapter {
|
|
4
4
|
getCurrent(): Promise<Result<Customer | null>>;
|
|
5
|
+
createPaymentMethod(params: CreatePaymentMethodParams): Promise<Result<CreatePaymentMethodOutcome>>;
|
|
5
6
|
}
|
|
6
7
|
export declare function createMockCustomerAdapter(): CustomerAdapter;
|
|
7
8
|
export declare function createApiCustomerAdapter(fetcher: ApiFetcher): CustomerAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/customer/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/customer/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGtD,MAAM,WAAW,eAAe;IAC9B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/C,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;CACrG;AAED,wBAAgB,yBAAyB,IAAI,eAAe,CA2B3D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,UAAU,GAAG,eAAe,CA4D7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customerService.d.ts","sourceRoot":"","sources":["../../../src/services/customer/customerService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,eAAe,
|
|
1
|
+
{"version":3,"file":"customerService.d.ts","sourceRoot":"","sources":["../../../src/services/customer/customerService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,eAAe,CAgBjB;AAED,eAAO,MAAM,sBAAsB;;CACkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customerService.test.d.ts","sourceRoot":"","sources":["../../../src/services/customer/customerService.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type CustomerService, type Customer } from './types';
|
|
1
|
+
export { type CustomerService, type Customer, type CreatePaymentMethodParams, type CreatePaymentMethodOutcome } from './types';
|
|
2
2
|
export { createCustomerService, CustomerServiceContext, } from './customerService';
|
|
3
3
|
export { type CustomerAdapter, createMockCustomerAdapter, createApiCustomerAdapter, } from './adapter';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/customer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/customer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,yBAAyB,EAAE,KAAK,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC/H,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,WAAW,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Signal } from '@preact/signals-core';
|
|
2
2
|
import { Result } from '../../utils';
|
|
3
|
+
import { SubscriptionPaymentInstrument } from '../subscription/paymentInstrument';
|
|
3
4
|
/** Signed-in customer identity for blocks such as Header (name / email display). */
|
|
4
5
|
export type Customer = {
|
|
5
6
|
id: string;
|
|
@@ -7,9 +8,24 @@ export type Customer = {
|
|
|
7
8
|
email?: string;
|
|
8
9
|
metadata?: Record<string, unknown>;
|
|
9
10
|
};
|
|
11
|
+
export type CreatePaymentMethodParams = {
|
|
12
|
+
provider: "shopify";
|
|
13
|
+
} | {
|
|
14
|
+
provider: "mollie" | "stripe";
|
|
15
|
+
returnUrl: string;
|
|
16
|
+
};
|
|
17
|
+
export type CreatePaymentMethodOutcome = {
|
|
18
|
+
kind: "email_sent";
|
|
19
|
+
paymentMethodId: string;
|
|
20
|
+
instrument?: SubscriptionPaymentInstrument;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "redirect";
|
|
23
|
+
redirectUrl: string;
|
|
24
|
+
};
|
|
10
25
|
export type CustomerService = {
|
|
11
26
|
current: Signal<Customer | null>;
|
|
12
27
|
getCurrent(): Promise<Result<Customer | null>>;
|
|
28
|
+
createPaymentMethod(params: CreatePaymentMethodParams): Promise<Result<CreatePaymentMethodOutcome>>;
|
|
13
29
|
accountOrdersUrl: Signal<string>;
|
|
14
30
|
};
|
|
15
31
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/customer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/customer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAEvF,oFAAoF;AACpF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GACjC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GACvB;IAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,MAAM,MAAM,0BAA0B,GAClC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,6BAA6B,CAAA;CAAE,GAC3F;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACjC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/C,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACpG,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC"}
|
|
@@ -7,6 +7,36 @@ import { AvailableProduct, Box, Product, WithVariants } from './types';
|
|
|
7
7
|
export interface ProductAdapter {
|
|
8
8
|
getById(id: string): Promise<WithVariants<Product> | null>;
|
|
9
9
|
getByVariantId(variantId: string): Promise<WithVariants<Product> | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Search products.
|
|
12
|
+
*
|
|
13
|
+
* `query` accepts either plain text (full-text search) or field:value filter
|
|
14
|
+
* syntax parsed by the backend grammar. Detection is automatic:
|
|
15
|
+
*
|
|
16
|
+
* - Plain text (`"coffee beans"`): wrapped in double quotes by the adapter
|
|
17
|
+
* and sent as a full-text search term.
|
|
18
|
+
* - Filter syntax (`"collections.handle:featured"`, `"id:abc OR id:def"`,
|
|
19
|
+
* `"status:active"`): passed through unquoted so the backend parses it
|
|
20
|
+
* into structured filters.
|
|
21
|
+
*
|
|
22
|
+
* Detection is anchored: the *entire* query must be a filter expression —
|
|
23
|
+
* `field:value` terms, optionally negated with `-`/`NOT` and joined by
|
|
24
|
+
* `AND`/`OR`. Plain text that merely contains a colon (`"size:large shoes"`)
|
|
25
|
+
* is treated as text, not as a filter on an unknown `size` field.
|
|
26
|
+
*
|
|
27
|
+
* Values containing anything other than letters, digits and dots must be
|
|
28
|
+
* quoted by the caller — `collections.handle:"summer-sale"`, not
|
|
29
|
+
* `collections.handle:summer-sale`, since the grammar's identifier rule
|
|
30
|
+
* excludes hyphens. An unquoted value falls back to full-text search.
|
|
31
|
+
*
|
|
32
|
+
* A single-token query like `"time:10"` is genuinely ambiguous and is read
|
|
33
|
+
* as a filter. Pass free text through a search box only if that is
|
|
34
|
+
* acceptable.
|
|
35
|
+
*
|
|
36
|
+
* Filterable fields depend on the endpoint. Unknown fields produce a 400
|
|
37
|
+
* `INVALID_QUERY_FIELDS`; malformed syntax produces a 400
|
|
38
|
+
* `INVALID_SEARCH_QUERY`.
|
|
39
|
+
*/
|
|
10
40
|
search(opts?: {
|
|
11
41
|
query?: string;
|
|
12
42
|
pagination?: {
|
|
@@ -39,6 +69,18 @@ export interface ProductAdapter {
|
|
|
39
69
|
}): Promise<Box | null>;
|
|
40
70
|
}
|
|
41
71
|
export declare function createMockProductAdapter(): ProductAdapter;
|
|
72
|
+
/**
|
|
73
|
+
* Whether `query` is a complete field:value filter expression rather than
|
|
74
|
+
* plain text.
|
|
75
|
+
*
|
|
76
|
+
* The match is anchored: the *whole* string must be a filter expression.
|
|
77
|
+
* Plain text that merely contains a colon (`"size:large shoes"`) is not a
|
|
78
|
+
* filter query and is sent as full-text search, which is what the caller
|
|
79
|
+
* meant and what the backend can actually parse.
|
|
80
|
+
*
|
|
81
|
+
* Parenthesised groups are not recognised and fall back to full-text search.
|
|
82
|
+
*/
|
|
83
|
+
export declare function isFilterQuery(query: string): boolean;
|
|
42
84
|
export declare function createApiProductAdapter(fetcher: ApiFetcher, opts?: {
|
|
43
85
|
currencyCode: string;
|
|
44
86
|
}): ProductAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/product/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,OAAO,EAAkB,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5F;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAE3D,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAEzE,MAAM,CAAC,IAAI,CAAC,EAAE;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,GAAG;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KACrD,GAAG,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAElD,gBAAgB,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAEhE,cAAc,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE/F,oBAAoB,CAAC,MAAM,EAAE;QAC3B,cAAc,EAAE,MAAM,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,CAAC,CAAC,EAAE,MAAM,CAA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,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAEhE,cAAc,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE/F,oBAAoB,CAAC,MAAM,EAAE;QAC3B,cAAc,EAAE,MAAM,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC;QACzC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC;QACvB,UAAU,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,GAAG;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KACrD,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAEhC,MAAM,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;CACrD;AAED,wBAAgB,wBAAwB,IAAI,cAAc,CAmRzD;AAwDD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAwBD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,EACnB,IAAI,GAAE;IAAE,YAAY,EAAE,MAAM,CAAA;CAA4B,GACvD,cAAc,CAmKhB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { ProductAdapter } from './adapter';
|
|
2
|
-
export { createMockProductAdapter, createApiProductAdapter } from './adapter';
|
|
2
|
+
export { createMockProductAdapter, createApiProductAdapter, isFilterQuery, } from './adapter';
|
|
3
3
|
export { createProductService, ProductServiceContext } from './productService';
|
|
4
4
|
export * from './types';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/product/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/product/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,GACd,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,cAAc,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiFetcher, PaginatedList, Result } from '../../utils';
|
|
2
|
-
import { Subscription, SellingPlan, SellingPlanInterval, SearchOptions, PostableSubscriptionItem, UpdateSubscriptionItem, UpdateBoxItem, LastOrder, RenewNowResult, UpsellProduct } from './types';
|
|
2
|
+
import { Subscription, SellingPlan, SellingPlanInterval, SearchOptions, PostableSubscriptionItem, UpdateSubscriptionItem, UpdateBoxItem, LastOrder, RenewNowResult, UpsellProduct, UpdateDeliveryAddress, UpdateDeliveryAddressError, UpdateDeliveryMethodError, ShippingMethodOption } from './types';
|
|
3
3
|
import { ApplyDiscountError, DiscountRejectionReason, RemoveDiscountError } from './discountErrors';
|
|
4
4
|
import { ProductAdapter } from '../product/adapter';
|
|
5
5
|
/**
|
|
@@ -76,6 +76,45 @@ export interface SubscriptionAdapter {
|
|
|
76
76
|
subscriptionId: string;
|
|
77
77
|
customAttributes: Record<string, string>;
|
|
78
78
|
}): Promise<Result<Subscription>>;
|
|
79
|
+
/**
|
|
80
|
+
* Replace the subscription's delivery address (full replacement).
|
|
81
|
+
*
|
|
82
|
+
* The real adapter uses the legacy PUT
|
|
83
|
+
* /customer/subscriptions/{id}/shipping-address rather than PATCH
|
|
84
|
+
* /customer/v1/subscriptions/{id} with `deliveryAddress`. Only the legacy
|
|
85
|
+
* route preserves the delivery-method type — the v1 handler hardcodes
|
|
86
|
+
* `shipping`, so it converts a local-delivery contract and puts an address on
|
|
87
|
+
* a pickup one — and only it resolves `province` to a province code, honours
|
|
88
|
+
* the merchant's address-editing setting, and turns Shopify's address
|
|
89
|
+
* validation errors into a readable 400.
|
|
90
|
+
*/
|
|
91
|
+
updateDeliveryAddress(params: {
|
|
92
|
+
subscriptionId: string;
|
|
93
|
+
address: UpdateDeliveryAddress;
|
|
94
|
+
}): Promise<Result<void, UpdateDeliveryAddressError>>;
|
|
95
|
+
/**
|
|
96
|
+
* Shipping methods the subscription can move to. The one it is currently on
|
|
97
|
+
* is included and flagged `isActive` — every entry is selectable, so this is
|
|
98
|
+
* not a filter.
|
|
99
|
+
*/
|
|
100
|
+
getAvailableShippingMethods(params: {
|
|
101
|
+
subscriptionId: string;
|
|
102
|
+
}): Promise<Result<ShippingMethodOption[]>>;
|
|
103
|
+
/**
|
|
104
|
+
* Switch the subscription to another shipping method.
|
|
105
|
+
*
|
|
106
|
+
* Pickup points are out of scope: no parcel-locker payload is sent, which the
|
|
107
|
+
* endpoint reads as "preserve the existing pickup-point attributes".
|
|
108
|
+
*
|
|
109
|
+
* The handle must be one the subscription currently offers — the endpoint
|
|
110
|
+
* re-derives the list server-side and a stale handle fails the assertion as a
|
|
111
|
+
* 500, not a 4xx, so it surfaces as `UNKNOWN`. Re-read
|
|
112
|
+
* `getAvailableShippingMethods` before retrying.
|
|
113
|
+
*/
|
|
114
|
+
updateDeliveryMethod(params: {
|
|
115
|
+
subscriptionId: string;
|
|
116
|
+
shippingMethodHandle: string;
|
|
117
|
+
}): Promise<Result<void, UpdateDeliveryMethodError>>;
|
|
79
118
|
resume(params: {
|
|
80
119
|
subscriptionId: string;
|
|
81
120
|
}): Promise<Result<Subscription>>;
|
|
@@ -137,6 +176,13 @@ export interface MockSubscriptionAdapterOptions {
|
|
|
137
176
|
*/
|
|
138
177
|
productAdapter?: Pick<ProductAdapter, "getByVariantId" | "getById">;
|
|
139
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Recognises the optimistic-concurrency rejection the legacy customer
|
|
181
|
+
* subscription routes raise from a scope-wide `preValidation` hook when the
|
|
182
|
+
* caller sends a stale `X-Last-Updated-At`. It answers 400, the same status as
|
|
183
|
+
* a rejected address, so the message is the only discriminator.
|
|
184
|
+
*/
|
|
185
|
+
export declare function isStaleSubscriptionMessage(message: string | undefined): boolean;
|
|
140
186
|
export declare function createMockSubscriptionAdapter(options?: MockSubscriptionAdapterOptions): SubscriptionAdapter;
|
|
141
187
|
export declare function createApiSubscriptionAdapter(fetcher: ApiFetcher): SubscriptionAdapter;
|
|
142
188
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EACV,YAAY,EAIZ,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EAEb,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAI1B,OA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GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAIT;AAkBD,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,8BAAmC,GAC3C,mBAAmB,CAwxBrB;AAkOD,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,UAAU,GAClB,mBAAmB,CA6pBrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { SubscriptionAdapter, MockSubscriptionAdapterOptions } from './adapter';
|
|
2
|
-
export { createMockSubscriptionAdapter, createApiSubscriptionAdapter } from './adapter';
|
|
2
|
+
export { createMockSubscriptionAdapter, createApiSubscriptionAdapter, isStaleSubscriptionMessage, } from './adapter';
|
|
3
3
|
export { createSubscriptionService, SubscriptionServiceContext } from './subscriptionService';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export * from './discountErrors';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE9F,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
|
@@ -100,4 +100,13 @@ export interface PaymentInstrumentExpiry {
|
|
|
100
100
|
* compares month boundaries rather than exact dates.
|
|
101
101
|
*/
|
|
102
102
|
export declare function getPaymentInstrumentExpiry(instrument: SubscriptionPaymentInstrument, now?: Date): PaymentInstrumentExpiry | null;
|
|
103
|
+
/**
|
|
104
|
+
* Maps a v1 payment-instrument wire shape (hyphen tags, `maskedConsumerAccount`)
|
|
105
|
+
* to the canonical `SubscriptionPaymentInstrument` union.
|
|
106
|
+
*
|
|
107
|
+
* Input is `unknown` because blocks/core must not depend on SDK types; the
|
|
108
|
+
* function narrows internally by tag. Returns `null` for unrecognised or
|
|
109
|
+
* absent instruments.
|
|
110
|
+
*/
|
|
111
|
+
export declare function serializeV1PaymentInstrument(raw: unknown): SubscriptionPaymentInstrument | null;
|
|
103
112
|
//# sourceMappingURL=paymentInstrument.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymentInstrument.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/paymentInstrument.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,0DAA0D;AAC1D,eAAO,MAAM,wBAAwB,8FAQ3B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GACrC;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACtD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACD;IACE,IAAI,EAAE,mBAAmB,CAAC;IAC1B,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,sEAAsE;IACtE,eAAe,EAAE,MAAM,CAAC;CACzB,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAa3C;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,6BAA6B,GACxC,MAAM,CAQR;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,6BAA6B,GACxC,MAAM,GAAG,IAAI,CAWf;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,6BAA6B,GACxC,MAAM,GAAG,IAAI,CAaf;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,6BAA6B,EACzC,GAAG,GAAE,IAAiB,GACrB,uBAAuB,GAAG,IAAI,CAahC"}
|
|
1
|
+
{"version":3,"file":"paymentInstrument.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/paymentInstrument.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,0DAA0D;AAC1D,eAAO,MAAM,wBAAwB,8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E,6BAA6B,GACxC,MAAM,GAAG,IAAI,CAWf;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,6BAA6B,GACxC,MAAM,GAAG,IAAI,CAaf;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,6BAA6B,EACzC,GAAG,GAAE,IAAiB,GACrB,uBAAuB,GAAG,IAAI,CAahC;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,OAAO,GACX,6BAA6B,GAAG,IAAI,CAwCtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptionService.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/subscriptionService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAMV,mBAAmB,
|
|
1
|
+
{"version":3,"file":"subscriptionService.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/subscriptionService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAMV,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,0BAA0B;;CACsB,CAAC;AA2B9D,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,GAC3B,mBAAmB,CA6NrB"}
|
|
@@ -100,6 +100,13 @@ export interface ShippingMethodOption {
|
|
|
100
100
|
handle: string;
|
|
101
101
|
title: string;
|
|
102
102
|
price?: PriceWithCurrency;
|
|
103
|
+
/**
|
|
104
|
+
* True for the method the subscription is CURRENTLY on — not "selectable".
|
|
105
|
+
* Every option returned is available; this one marks the current selection,
|
|
106
|
+
* so do not filter on it. Absent when the source cannot say (the
|
|
107
|
+
* `DeliveryMethodConflict` payload does not carry it).
|
|
108
|
+
*/
|
|
109
|
+
isActive?: boolean;
|
|
103
110
|
}
|
|
104
111
|
export interface DeliveryMethodConflict {
|
|
105
112
|
code: "DELIVERY_METHOD_CONFLICT";
|
|
@@ -184,6 +191,11 @@ export interface SubscriptionBillingAddress {
|
|
|
184
191
|
phone?: string | null;
|
|
185
192
|
company?: string | null;
|
|
186
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* A subscription's delivery address. Fields are optional and never null: both
|
|
196
|
+
* sources may omit any of them, and the adapters normalise a null to absent so
|
|
197
|
+
* consumers can test one field rather than each key.
|
|
198
|
+
*/
|
|
187
199
|
export interface SubscriptionDeliveryAddress {
|
|
188
200
|
firstName?: string;
|
|
189
201
|
lastName?: string;
|
|
@@ -191,18 +203,123 @@ export interface SubscriptionDeliveryAddress {
|
|
|
191
203
|
address2?: string;
|
|
192
204
|
zip?: string;
|
|
193
205
|
city?: string;
|
|
206
|
+
/** Resolved display name, e.g. "Germany". v1-sourced only. */
|
|
207
|
+
country?: string;
|
|
194
208
|
countryCode?: string;
|
|
209
|
+
/** Resolved display name, e.g. "Bavaria". */
|
|
210
|
+
province?: string;
|
|
211
|
+
/** v1-sourced only — the legacy address has no province code. */
|
|
212
|
+
provinceCode?: string;
|
|
213
|
+
phone?: string;
|
|
214
|
+
company?: string;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The write shape for a subscription's delivery address.
|
|
218
|
+
*
|
|
219
|
+
* Deliberately NOT `SubscriptionDeliveryAddress` — reads and writes are not
|
|
220
|
+
* symmetric here:
|
|
221
|
+
* - The write is a full replacement, so `firstName`, `lastName`, `address1`,
|
|
222
|
+
* `zip` and `city` are required; an omitted optional field is CLEARED, not
|
|
223
|
+
* left alone.
|
|
224
|
+
* - There is no `countryCode`: the endpoint rejects it and derives the country
|
|
225
|
+
* from the contract, so the country cannot be changed on this path.
|
|
226
|
+
* - `province` is the display NAME (e.g. "Bavaria"); the server resolves it to
|
|
227
|
+
* a code. There is no `provinceCode`, and no `country`.
|
|
228
|
+
*
|
|
229
|
+
* Callers must BUILD this object field by field. Handing over a
|
|
230
|
+
* `SubscriptionDeliveryAddress` with `countryCode` stripped would carry
|
|
231
|
+
* `country` / `provinceCode` along, and the endpoint forwards unknown keys
|
|
232
|
+
* verbatim into Shopify's address input, which declares neither.
|
|
233
|
+
*/
|
|
234
|
+
export interface UpdateDeliveryAddress {
|
|
235
|
+
firstName: string;
|
|
236
|
+
lastName: string;
|
|
237
|
+
address1: string;
|
|
238
|
+
zip: string;
|
|
239
|
+
city: string;
|
|
240
|
+
address2?: string;
|
|
241
|
+
/** Province/state display name, e.g. "Bavaria" — the server resolves the code. */
|
|
195
242
|
province?: string;
|
|
243
|
+
phone?: string;
|
|
244
|
+
company?: string;
|
|
245
|
+
}
|
|
246
|
+
/** Failure modes of `updateDeliveryAddress`. */
|
|
247
|
+
export type UpdateDeliveryAddressError =
|
|
248
|
+
/**
|
|
249
|
+
* The merchant has customer address editing switched off. A block should
|
|
250
|
+
* hide or disable its control rather than surface this as an error.
|
|
251
|
+
*/
|
|
252
|
+
{
|
|
253
|
+
kind: "NOT_ALLOWED";
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Rejected either by the subscription's state (no delivery method at all, or
|
|
257
|
+
* a pickup method that cannot carry an address) or by Shopify's address
|
|
258
|
+
* validation. `message` is the endpoint's human-readable text, safe to show.
|
|
259
|
+
*/
|
|
260
|
+
| {
|
|
261
|
+
kind: "INVALID_ADDRESS";
|
|
262
|
+
message?: string;
|
|
196
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* The subscription changed since it was read, so the write was refused
|
|
266
|
+
* (optimistic concurrency). Only possible when the host's fetcher sends an
|
|
267
|
+
* `X-Last-Updated-At` header, as the customer portal's does. Reload and let
|
|
268
|
+
* the customer retry rather than showing this as an address problem.
|
|
269
|
+
*/
|
|
270
|
+
| {
|
|
271
|
+
kind: "STALE";
|
|
272
|
+
} | {
|
|
273
|
+
kind: "SUBSCRIPTION_NOT_FOUND";
|
|
274
|
+
} | {
|
|
275
|
+
kind: "NETWORK";
|
|
276
|
+
message?: string;
|
|
277
|
+
} | {
|
|
278
|
+
kind: "UNKNOWN";
|
|
279
|
+
message?: string;
|
|
280
|
+
};
|
|
281
|
+
/** Failure modes of `updateDeliveryMethod`. */
|
|
282
|
+
export type UpdateDeliveryMethodError =
|
|
283
|
+
/**
|
|
284
|
+
* Refused: either the merchant has customer delivery-method editing switched
|
|
285
|
+
* off, or the subscription contains a membership product. The endpoint
|
|
286
|
+
* answers both the same way, so they cannot be told apart here.
|
|
287
|
+
*/
|
|
288
|
+
{
|
|
289
|
+
kind: "NOT_ALLOWED";
|
|
290
|
+
}
|
|
291
|
+
/** See the note on `UpdateDeliveryAddressError`'s `STALE`. */
|
|
292
|
+
| {
|
|
293
|
+
kind: "STALE";
|
|
294
|
+
} | {
|
|
295
|
+
kind: "SUBSCRIPTION_NOT_FOUND";
|
|
296
|
+
} | {
|
|
297
|
+
kind: "NETWORK";
|
|
298
|
+
message?: string;
|
|
299
|
+
} | {
|
|
300
|
+
kind: "UNKNOWN";
|
|
301
|
+
message?: string;
|
|
302
|
+
};
|
|
197
303
|
export interface SubscriptionDeliveryOption {
|
|
198
304
|
title?: string;
|
|
305
|
+
/**
|
|
306
|
+
* Customer-facing title where it differs from the internal one. Legacy-sourced
|
|
307
|
+
* only — v1 carries a single `title`, so consumers must read
|
|
308
|
+
* `presentmentTitle ?? title`.
|
|
309
|
+
*/
|
|
199
310
|
presentmentTitle?: string;
|
|
200
311
|
description?: string;
|
|
201
312
|
}
|
|
202
313
|
/**
|
|
203
|
-
* Delivery method for a subscription
|
|
204
|
-
*
|
|
205
|
-
*
|
|
314
|
+
* Delivery method for a subscription: the address plus whichever of the three
|
|
315
|
+
* option slots applies (exactly one — shipping, pickup, or local delivery).
|
|
316
|
+
*
|
|
317
|
+
* The real adapter maps this from the v1 subscription resource's `deliveryAddress`
|
|
318
|
+
* and `deliveryMethod`, both returned by default (no `expand` needed), so it is
|
|
319
|
+
* populated by every read — `search` and `getById` alike. `null` means the
|
|
320
|
+
* subscription genuinely has no delivery method; `undefined` means the host's
|
|
321
|
+
* adapter does not supply one. Used by ContractSelect to show the delivery
|
|
322
|
+
* address and method.
|
|
206
323
|
*/
|
|
207
324
|
export interface SubscriptionDeliveryMethod {
|
|
208
325
|
address?: SubscriptionDeliveryAddress | null;
|
|
@@ -256,8 +373,9 @@ export interface Subscription {
|
|
|
256
373
|
*/
|
|
257
374
|
serial?: string;
|
|
258
375
|
/**
|
|
259
|
-
* Delivery address + shipping/pickup option. Populated by the
|
|
260
|
-
*
|
|
376
|
+
* Delivery address + shipping/pickup/local-delivery option. Populated by the
|
|
377
|
+
* real adapter from the v1 subscription resource (`deliveryAddress` +
|
|
378
|
+
* `deliveryMethod`). Used by ContractSelect.
|
|
261
379
|
*/
|
|
262
380
|
deliveryMethod?: SubscriptionDeliveryMethod | null;
|
|
263
381
|
}
|
|
@@ -371,6 +489,30 @@ export type SubscriptionService = {
|
|
|
371
489
|
* reserved keys are preserved server-side and must not be included.
|
|
372
490
|
*/
|
|
373
491
|
updateCustomAttributes(subscriptionId: string, customAttributes: Record<string, string>): Promise<Result<Subscription>>;
|
|
492
|
+
/**
|
|
493
|
+
* Replace the subscription's delivery address. A full replacement — see
|
|
494
|
+
* `UpdateDeliveryAddress` for why the write shape is not the read shape and
|
|
495
|
+
* why the country cannot be changed here. Refreshes `current` on success.
|
|
496
|
+
*/
|
|
497
|
+
updateDeliveryAddress(subscriptionId: string, address: UpdateDeliveryAddress): Promise<Result<void, UpdateDeliveryAddressError>>;
|
|
498
|
+
/**
|
|
499
|
+
* Shipping methods the subscription can move to, including the one it is
|
|
500
|
+
* already on (flagged `isActive`). Also the way to recover from a
|
|
501
|
+
* `DeliveryMethodConflict` when its payload is not enough.
|
|
502
|
+
*/
|
|
503
|
+
getAvailableShippingMethods(subscriptionId: string): Promise<Result<ShippingMethodOption[]>>;
|
|
504
|
+
/**
|
|
505
|
+
* Switch the subscription to `shippingMethodHandle`, one of the handles from
|
|
506
|
+
* `getAvailableShippingMethods`. Refreshes `current` on success.
|
|
507
|
+
*
|
|
508
|
+
* PICKUP POINTS ARE OUT OF SCOPE: no parcel-locker selection is sent, which
|
|
509
|
+
* the endpoint reads as "leave the existing pickup-point attributes alone".
|
|
510
|
+
* Switching a subscription off a parcel-locker method therefore leaves its
|
|
511
|
+
* locker attributes in place — deliberately, since clearing data this service
|
|
512
|
+
* cannot set back would be worse. Hosts that manage pickup points (the
|
|
513
|
+
* customer portal, via its own widgets) must keep doing so themselves.
|
|
514
|
+
*/
|
|
515
|
+
updateDeliveryMethod(subscriptionId: string, shippingMethodHandle: string): Promise<Result<void, UpdateDeliveryMethodError>>;
|
|
374
516
|
resume(subscriptionId: string): Promise<Result<Subscription>>;
|
|
375
517
|
pause(subscriptionId: string): Promise<Result<Subscription>>;
|
|
376
518
|
reactivate(subscriptionId: string): Promise<Result<Subscription>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEzE,YAAY,EAAE,6BAA6B,EAAE,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC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