@final-commerce/common 2.4.0-staging.2 → 2.4.1-online.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/index.mjs CHANGED
@@ -200,6 +200,7 @@ var OrderPlatform = /* @__PURE__ */ ((OrderPlatform2) => {
200
200
  OrderPlatform2["POS"] = "in-store";
201
201
  OrderPlatform2["WOO_COMMERCE"] = "woo-commerce";
202
202
  OrderPlatform2["PUBLIC_API"] = "public-api";
203
+ OrderPlatform2["ONLINE_STORE"] = "online-store";
203
204
  return OrderPlatform2;
204
205
  })(OrderPlatform || {});
205
206
  var CustomerPlatform = /* @__PURE__ */ ((CustomerPlatform2) => {
@@ -3057,11 +3058,19 @@ function shopDayKey(instant, timeZone) {
3057
3058
  return `${year}-${pad(month)}-${pad(day)}`;
3058
3059
  }
3059
3060
  function shopDayRange(fromDayKey, count, timeZone) {
3060
- const [year, month, day] = fromDayKey.split("-").map(Number);
3061
- return {
3062
- from: instantFromLocal(year, month, day, 0, timeZone),
3063
- to: instantFromLocal(year, month, day + Math.max(1, count), 0, timeZone)
3064
- };
3061
+ const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(fromDayKey ?? "");
3062
+ if (!match) {
3063
+ throw new BookingRulesError(`Booking rules: "${fromDayKey}" is not a shop day (YYYY-MM-DD)`);
3064
+ }
3065
+ if (!Number.isInteger(count) || count < 1) {
3066
+ throw new BookingRulesError(`Booking rules: "${count}" is not a number of days`);
3067
+ }
3068
+ const [, year, month, day] = match.map(Number);
3069
+ const from = instantFromLocal(year, month, day, 0, timeZone);
3070
+ if (shopDayKey(from, timeZone) !== fromDayKey) {
3071
+ throw new BookingRulesError(`Booking rules: "${fromDayKey}" is not a real day`);
3072
+ }
3073
+ return { from, to: instantFromLocal(year, month, day + count, 0, timeZone) };
3065
3074
  }
3066
3075
  function buildAvailability({
3067
3076
  productId,
@@ -3191,8 +3200,30 @@ var ADYEN_ROLLOUT_COUNTRY_CODES = /* @__PURE__ */ new Set(["CA"]);
3191
3200
  function isAdyenRolloutCountry(alpha2) {
3192
3201
  return ADYEN_ROLLOUT_COUNTRY_CODES.has(alpha2);
3193
3202
  }
3203
+ var AFFIRM_PRICE_PLANS = ["core", "standard", "signature"];
3204
+ function isAffirmPricePlan(value) {
3205
+ return typeof value === "string" && AFFIRM_PRICE_PLANS.includes(value);
3206
+ }
3207
+
3208
+ // pos-types/active/ProcessorType.ts
3209
+ var ProcessorType = /* @__PURE__ */ ((ProcessorType2) => {
3210
+ ProcessorType2["FINAL_PAY"] = "Terminal";
3211
+ ProcessorType2["TAP_TO_PAY"] = "TapToPay";
3212
+ ProcessorType2["MOTO"] = "Moto";
3213
+ ProcessorType2["CLOUD"] = "Cloud";
3214
+ ProcessorType2["BLUETOOTH"] = "Bluetooth";
3215
+ ProcessorType2["CASH"] = "Cash";
3216
+ ProcessorType2["CUSTOM_PAY"] = "CustomPay";
3217
+ ProcessorType2["VENDARA"] = "Vendara";
3218
+ ProcessorType2["REDEEM"] = "Redeem";
3219
+ ProcessorType2["INTEGRATION"] = "Integration";
3220
+ ProcessorType2["PAYMENT_LINK"] = "PaymentLink";
3221
+ ProcessorType2["ONLINE_PAYMENT"] = "OnlinePayment";
3222
+ return ProcessorType2;
3223
+ })(ProcessorType || {});
3194
3224
  export {
3195
3225
  ADYEN_ROLLOUT_COUNTRY_CODES,
3226
+ AFFIRM_PRICE_PLANS,
3196
3227
  AttributeType,
3197
3228
  BookingRatePeriod,
3198
3229
  BookingResourceKind,
@@ -3245,6 +3276,7 @@ export {
3245
3276
  PricingLevel,
3246
3277
  PricingPlanEnum,
3247
3278
  PricingRegionEnum,
3279
+ ProcessorType,
3248
3280
  ProductStatus,
3249
3281
  ProductType,
3250
3282
  PublicationAvailability,
@@ -3321,6 +3353,7 @@ export {
3321
3353
  holdExpiresAt,
3322
3354
  inferStatesFromLegacyStatus,
3323
3355
  isAdyenRolloutCountry,
3356
+ isAffirmPricePlan,
3324
3357
  isConditionOperator,
3325
3358
  isFulfillmentState,
3326
3359
  isPaymentState,