@final-commerce/common 2.5.0 → 2.5.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.d.mts +58 -5
- package/dist/index.d.ts +58 -5
- package/dist/index.js +68 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -2
- package/dist/index.mjs.map +1 -1
- package/dist/pos-types/index.d.mts +10 -1
- package/dist/pos-types/index.d.ts +10 -1
- package/dist/pos-types/index.js +1 -0
- package/dist/pos-types/index.js.map +1 -1
- package/dist/pos-types/index.mjs +1 -0
- package/dist/pos-types/index.mjs.map +1 -1
- package/package.json +1 -1
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) => {
|
|
@@ -3003,7 +3004,9 @@ function buildGrid(rule, timeZone, from, to, now, busy = []) {
|
|
|
3003
3004
|
const start = startAt.getTime();
|
|
3004
3005
|
if (start < askedFrom || start >= askedTo) return false;
|
|
3005
3006
|
if (start < notBefore || start > notAfter) return false;
|
|
3006
|
-
return !blocked.some(
|
|
3007
|
+
return !blocked.some(
|
|
3008
|
+
({ from: blockFrom, to: blockTo }) => start < blockTo && bufferEndAt.getTime() > blockFrom
|
|
3009
|
+
);
|
|
3007
3010
|
}).sort((first, second) => +first.startAt - +second.startAt);
|
|
3008
3011
|
}
|
|
3009
3012
|
function slotsForWindow(grid, startAt, endAt) {
|
|
@@ -3122,7 +3125,14 @@ function buildAvailability({
|
|
|
3122
3125
|
for (const slot of slots2) {
|
|
3123
3126
|
const { taken, foreignProductId } = occupancyIn(mine, productId, slot.startAt, slot.bufferEndAt, shared);
|
|
3124
3127
|
const free = foreignProductId ? 0 : Math.max(capacity - taken, 0);
|
|
3125
|
-
const entry = byInstant.get(+slot.startAt) ?? {
|
|
3128
|
+
const entry = byInstant.get(+slot.startAt) ?? {
|
|
3129
|
+
...slot,
|
|
3130
|
+
capacity: 0,
|
|
3131
|
+
booked: 0,
|
|
3132
|
+
free: 0,
|
|
3133
|
+
resources: [],
|
|
3134
|
+
dayKey: shopDayKey(slot.startAt, resource.timeZone)
|
|
3135
|
+
};
|
|
3126
3136
|
entry.capacity += capacity;
|
|
3127
3137
|
entry.booked += foreignProductId ? capacity : taken;
|
|
3128
3138
|
entry.free += free;
|
|
@@ -3200,9 +3210,53 @@ var ADYEN_ROLLOUT_COUNTRY_CODES = /* @__PURE__ */ new Set(["CA"]);
|
|
|
3200
3210
|
function isAdyenRolloutCountry(alpha2) {
|
|
3201
3211
|
return ADYEN_ROLLOUT_COUNTRY_CODES.has(alpha2);
|
|
3202
3212
|
}
|
|
3213
|
+
var AFFIRM_PRICE_PLANS = ["core", "standard", "signature"];
|
|
3214
|
+
function isAffirmPricePlan(value) {
|
|
3215
|
+
return typeof value === "string" && AFFIRM_PRICE_PLANS.includes(value);
|
|
3216
|
+
}
|
|
3217
|
+
var AFFIRM_COUNTRY_CODES = /* @__PURE__ */ new Set(["CA"]);
|
|
3218
|
+
function isAffirmCountry(alpha2) {
|
|
3219
|
+
return !!alpha2 && AFFIRM_COUNTRY_CODES.has(alpha2.toUpperCase());
|
|
3220
|
+
}
|
|
3221
|
+
var BNPL_METHOD_STATUS = {
|
|
3222
|
+
ACTIVE: "active",
|
|
3223
|
+
PENDING: "pending",
|
|
3224
|
+
UNAVAILABLE: "unavailable",
|
|
3225
|
+
UNKNOWN: "unknown"
|
|
3226
|
+
};
|
|
3227
|
+
var BNPL_SKIP_REASON = {
|
|
3228
|
+
PENDING: "pending",
|
|
3229
|
+
NO_SUPPORT_EMAIL: "no_support_email",
|
|
3230
|
+
NO_CURRENCY: "no_currency",
|
|
3231
|
+
NO_BUSINESS_LINE: "no_business_line"
|
|
3232
|
+
};
|
|
3233
|
+
|
|
3234
|
+
// pos-types/active/ProcessorType.ts
|
|
3235
|
+
var ProcessorType = /* @__PURE__ */ ((ProcessorType2) => {
|
|
3236
|
+
ProcessorType2["FINAL_PAY"] = "Terminal";
|
|
3237
|
+
ProcessorType2["TAP_TO_PAY"] = "TapToPay";
|
|
3238
|
+
ProcessorType2["MOTO"] = "Moto";
|
|
3239
|
+
ProcessorType2["CLOUD"] = "Cloud";
|
|
3240
|
+
ProcessorType2["BLUETOOTH"] = "Bluetooth";
|
|
3241
|
+
ProcessorType2["CASH"] = "Cash";
|
|
3242
|
+
ProcessorType2["CUSTOM_PAY"] = "CustomPay";
|
|
3243
|
+
ProcessorType2["VENDARA"] = "Vendara";
|
|
3244
|
+
ProcessorType2["REDEEM"] = "Redeem";
|
|
3245
|
+
ProcessorType2["INTEGRATION"] = "Integration";
|
|
3246
|
+
ProcessorType2["PAYMENT_LINK"] = "PaymentLink";
|
|
3247
|
+
ProcessorType2["ONLINE_PAYMENT"] = "OnlinePayment";
|
|
3248
|
+
return ProcessorType2;
|
|
3249
|
+
})(ProcessorType || {});
|
|
3250
|
+
|
|
3251
|
+
// constants/payment-channel.constants.ts
|
|
3252
|
+
var PAYMENT_CHANNELS = ["inPerson", "online"];
|
|
3203
3253
|
export {
|
|
3204
3254
|
ADYEN_ROLLOUT_COUNTRY_CODES,
|
|
3255
|
+
AFFIRM_COUNTRY_CODES,
|
|
3256
|
+
AFFIRM_PRICE_PLANS,
|
|
3205
3257
|
AttributeType,
|
|
3258
|
+
BNPL_METHOD_STATUS,
|
|
3259
|
+
BNPL_SKIP_REASON,
|
|
3206
3260
|
BookingRatePeriod,
|
|
3207
3261
|
BookingResourceKind,
|
|
3208
3262
|
BookingResourceStatus,
|
|
@@ -3245,6 +3299,7 @@ export {
|
|
|
3245
3299
|
OtherFixedRates,
|
|
3246
3300
|
OwnerType,
|
|
3247
3301
|
PATH_MODES,
|
|
3302
|
+
PAYMENT_CHANNELS,
|
|
3248
3303
|
PAYMENT_STATES,
|
|
3249
3304
|
POS_VALID_INITIAL_STATES,
|
|
3250
3305
|
PaymentMethod,
|
|
@@ -3254,6 +3309,7 @@ export {
|
|
|
3254
3309
|
PricingLevel,
|
|
3255
3310
|
PricingPlanEnum,
|
|
3256
3311
|
PricingRegionEnum,
|
|
3312
|
+
ProcessorType,
|
|
3257
3313
|
ProductStatus,
|
|
3258
3314
|
ProductType,
|
|
3259
3315
|
PublicationAvailability,
|
|
@@ -3330,6 +3386,8 @@ export {
|
|
|
3330
3386
|
holdExpiresAt,
|
|
3331
3387
|
inferStatesFromLegacyStatus,
|
|
3332
3388
|
isAdyenRolloutCountry,
|
|
3389
|
+
isAffirmCountry,
|
|
3390
|
+
isAffirmPricePlan,
|
|
3333
3391
|
isConditionOperator,
|
|
3334
3392
|
isFulfillmentState,
|
|
3335
3393
|
isPaymentState,
|