@final-commerce/common 2.4.0 → 2.4.1-online.2
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 +24 -2
- package/dist/index.d.ts +24 -2
- package/dist/index.js +44 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -2
- package/dist/index.mjs.map +1 -1
- package/dist/pos-types/index.d.mts +2 -1
- package/dist/pos-types/index.d.ts +2 -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) => {
|
|
@@ -3002,7 +3003,9 @@ function buildGrid(rule, timeZone, from, to, now, busy = []) {
|
|
|
3002
3003
|
const start = startAt.getTime();
|
|
3003
3004
|
if (start < askedFrom || start >= askedTo) return false;
|
|
3004
3005
|
if (start < notBefore || start > notAfter) return false;
|
|
3005
|
-
return !blocked.some(
|
|
3006
|
+
return !blocked.some(
|
|
3007
|
+
({ from: blockFrom, to: blockTo }) => start < blockTo && bufferEndAt.getTime() > blockFrom
|
|
3008
|
+
);
|
|
3006
3009
|
}).sort((first, second) => +first.startAt - +second.startAt);
|
|
3007
3010
|
}
|
|
3008
3011
|
function slotsForWindow(grid, startAt, endAt) {
|
|
@@ -3121,7 +3124,14 @@ function buildAvailability({
|
|
|
3121
3124
|
for (const slot of slots2) {
|
|
3122
3125
|
const { taken, foreignProductId } = occupancyIn(mine, productId, slot.startAt, slot.bufferEndAt, shared);
|
|
3123
3126
|
const free = foreignProductId ? 0 : Math.max(capacity - taken, 0);
|
|
3124
|
-
const entry = byInstant.get(+slot.startAt) ?? {
|
|
3127
|
+
const entry = byInstant.get(+slot.startAt) ?? {
|
|
3128
|
+
...slot,
|
|
3129
|
+
capacity: 0,
|
|
3130
|
+
booked: 0,
|
|
3131
|
+
free: 0,
|
|
3132
|
+
resources: [],
|
|
3133
|
+
dayKey: shopDayKey(slot.startAt, resource.timeZone)
|
|
3134
|
+
};
|
|
3125
3135
|
entry.capacity += capacity;
|
|
3126
3136
|
entry.booked += foreignProductId ? capacity : taken;
|
|
3127
3137
|
entry.free += free;
|
|
@@ -3199,8 +3209,33 @@ var ADYEN_ROLLOUT_COUNTRY_CODES = /* @__PURE__ */ new Set(["CA"]);
|
|
|
3199
3209
|
function isAdyenRolloutCountry(alpha2) {
|
|
3200
3210
|
return ADYEN_ROLLOUT_COUNTRY_CODES.has(alpha2);
|
|
3201
3211
|
}
|
|
3212
|
+
var AFFIRM_PRICE_PLANS = ["core", "standard", "signature"];
|
|
3213
|
+
function isAffirmPricePlan(value) {
|
|
3214
|
+
return typeof value === "string" && AFFIRM_PRICE_PLANS.includes(value);
|
|
3215
|
+
}
|
|
3216
|
+
|
|
3217
|
+
// pos-types/active/ProcessorType.ts
|
|
3218
|
+
var ProcessorType = /* @__PURE__ */ ((ProcessorType2) => {
|
|
3219
|
+
ProcessorType2["FINAL_PAY"] = "Terminal";
|
|
3220
|
+
ProcessorType2["TAP_TO_PAY"] = "TapToPay";
|
|
3221
|
+
ProcessorType2["MOTO"] = "Moto";
|
|
3222
|
+
ProcessorType2["CLOUD"] = "Cloud";
|
|
3223
|
+
ProcessorType2["BLUETOOTH"] = "Bluetooth";
|
|
3224
|
+
ProcessorType2["CASH"] = "Cash";
|
|
3225
|
+
ProcessorType2["CUSTOM_PAY"] = "CustomPay";
|
|
3226
|
+
ProcessorType2["VENDARA"] = "Vendara";
|
|
3227
|
+
ProcessorType2["REDEEM"] = "Redeem";
|
|
3228
|
+
ProcessorType2["INTEGRATION"] = "Integration";
|
|
3229
|
+
ProcessorType2["PAYMENT_LINK"] = "PaymentLink";
|
|
3230
|
+
ProcessorType2["ONLINE_PAYMENT"] = "OnlinePayment";
|
|
3231
|
+
return ProcessorType2;
|
|
3232
|
+
})(ProcessorType || {});
|
|
3233
|
+
|
|
3234
|
+
// constants/payment-channel.constants.ts
|
|
3235
|
+
var PAYMENT_CHANNELS = ["inPerson", "online"];
|
|
3202
3236
|
export {
|
|
3203
3237
|
ADYEN_ROLLOUT_COUNTRY_CODES,
|
|
3238
|
+
AFFIRM_PRICE_PLANS,
|
|
3204
3239
|
AttributeType,
|
|
3205
3240
|
BookingRatePeriod,
|
|
3206
3241
|
BookingResourceKind,
|
|
@@ -3244,6 +3279,7 @@ export {
|
|
|
3244
3279
|
OtherFixedRates,
|
|
3245
3280
|
OwnerType,
|
|
3246
3281
|
PATH_MODES,
|
|
3282
|
+
PAYMENT_CHANNELS,
|
|
3247
3283
|
PAYMENT_STATES,
|
|
3248
3284
|
POS_VALID_INITIAL_STATES,
|
|
3249
3285
|
PaymentMethod,
|
|
@@ -3253,6 +3289,7 @@ export {
|
|
|
3253
3289
|
PricingLevel,
|
|
3254
3290
|
PricingPlanEnum,
|
|
3255
3291
|
PricingRegionEnum,
|
|
3292
|
+
ProcessorType,
|
|
3256
3293
|
ProductStatus,
|
|
3257
3294
|
ProductType,
|
|
3258
3295
|
PublicationAvailability,
|
|
@@ -3329,6 +3366,7 @@ export {
|
|
|
3329
3366
|
holdExpiresAt,
|
|
3330
3367
|
inferStatesFromLegacyStatus,
|
|
3331
3368
|
isAdyenRolloutCountry,
|
|
3369
|
+
isAffirmPricePlan,
|
|
3332
3370
|
isConditionOperator,
|
|
3333
3371
|
isFulfillmentState,
|
|
3334
3372
|
isPaymentState,
|