@final-commerce/common 2.4.1-staging2.2 → 2.5.0-preprod.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/bin/gate-done.mjs +4 -5
- package/dist/index.d.mts +4 -20
- package/dist/index.d.ts +4 -20
- package/dist/index.js +3 -56
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -45
- package/dist/index.mjs.map +1 -1
- package/dist/pos-types/index.d.mts +14 -4
- package/dist/pos-types/index.d.ts +14 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -237,6 +237,7 @@ var InventorySpecificActionType = /* @__PURE__ */ ((InventorySpecificActionType2
|
|
|
237
237
|
InventorySpecificActionType2["PO_RECEIVED"] = "PO_RECEIVED";
|
|
238
238
|
InventorySpecificActionType2["EXTERNAL_SALE"] = "EXTERNAL_SALE";
|
|
239
239
|
InventorySpecificActionType2["EXTERNAL_RESTOCK"] = "EXTERNAL_RESTOCK";
|
|
240
|
+
InventorySpecificActionType2["CUSTOM"] = "CUSTOM";
|
|
240
241
|
return InventorySpecificActionType2;
|
|
241
242
|
})(InventorySpecificActionType || {});
|
|
242
243
|
var ExtensionCategory = /* @__PURE__ */ ((ExtensionCategory2) => {
|
|
@@ -3002,9 +3003,7 @@ 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
|
-
({ from: blockFrom, to: blockTo }) => start < blockTo && bufferEndAt.getTime() > blockFrom
|
|
3007
|
-
);
|
|
3006
|
+
return !blocked.some(({ from: blockFrom, to: blockTo }) => start < blockTo && bufferEndAt.getTime() > blockFrom);
|
|
3008
3007
|
}).sort((first, second) => +first.startAt - +second.startAt);
|
|
3009
3008
|
}
|
|
3010
3009
|
function slotsForWindow(grid, startAt, endAt) {
|
|
@@ -3123,14 +3122,7 @@ function buildAvailability({
|
|
|
3123
3122
|
for (const slot of slots2) {
|
|
3124
3123
|
const { taken, foreignProductId } = occupancyIn(mine, productId, slot.startAt, slot.bufferEndAt, shared);
|
|
3125
3124
|
const free = foreignProductId ? 0 : Math.max(capacity - taken, 0);
|
|
3126
|
-
const entry = byInstant.get(+slot.startAt) ?? {
|
|
3127
|
-
...slot,
|
|
3128
|
-
capacity: 0,
|
|
3129
|
-
booked: 0,
|
|
3130
|
-
free: 0,
|
|
3131
|
-
resources: [],
|
|
3132
|
-
dayKey: shopDayKey(slot.startAt, resource.timeZone)
|
|
3133
|
-
};
|
|
3125
|
+
const entry = byInstant.get(+slot.startAt) ?? { ...slot, capacity: 0, booked: 0, free: 0, resources: [], dayKey: shopDayKey(slot.startAt, resource.timeZone) };
|
|
3134
3126
|
entry.capacity += capacity;
|
|
3135
3127
|
entry.booked += foreignProductId ? capacity : taken;
|
|
3136
3128
|
entry.free += free;
|
|
@@ -3208,37 +3200,8 @@ var ADYEN_ROLLOUT_COUNTRY_CODES = /* @__PURE__ */ new Set(["CA"]);
|
|
|
3208
3200
|
function isAdyenRolloutCountry(alpha2) {
|
|
3209
3201
|
return ADYEN_ROLLOUT_COUNTRY_CODES.has(alpha2);
|
|
3210
3202
|
}
|
|
3211
|
-
var ADYEN_STORE_STATE_PROVINCE_COUNTRIES = /* @__PURE__ */ new Set(["AU", "BR", "CA", "IN", "MX", "NZ", "US"]);
|
|
3212
|
-
function adyenStoreRequiresStateOrProvince(alpha2) {
|
|
3213
|
-
return !!alpha2 && ADYEN_STORE_STATE_PROVINCE_COUNTRIES.has(alpha2);
|
|
3214
|
-
}
|
|
3215
|
-
var ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES = /* @__PURE__ */ new Set(["AU", "BR", "CA", "IN", "MX", "NZ", "US"]);
|
|
3216
|
-
function adyenLegalEntityRequiresStateOrProvince(alpha2) {
|
|
3217
|
-
return !!alpha2 && ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES.has(alpha2);
|
|
3218
|
-
}
|
|
3219
|
-
var ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES = /* @__PURE__ */ new Set(["CA"]);
|
|
3220
|
-
function adyenSupportsTaxNumberAbsent(alpha2) {
|
|
3221
|
-
return !!alpha2 && !ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES.has(alpha2);
|
|
3222
|
-
}
|
|
3223
|
-
var ADYEN_TAX_NUMBER_FORMATS = {
|
|
3224
|
-
CA: { pattern: /^\d{9}$/, length: 9 }
|
|
3225
|
-
};
|
|
3226
|
-
function adyenTaxNumberFormat(alpha2) {
|
|
3227
|
-
return alpha2 ? ADYEN_TAX_NUMBER_FORMATS[alpha2] : void 0;
|
|
3228
|
-
}
|
|
3229
|
-
var ADYEN_TAX_NUMBER_MIN_LENGTH = 5;
|
|
3230
|
-
var ADYEN_JOB_TITLE_ASSOCIATION_TYPES = ["signatory", "uboThroughControl"];
|
|
3231
|
-
function adyenRequiresJobTitle(associationType) {
|
|
3232
|
-
return ADYEN_JOB_TITLE_ASSOCIATION_TYPES.includes(associationType);
|
|
3233
|
-
}
|
|
3234
3203
|
export {
|
|
3235
|
-
ADYEN_JOB_TITLE_ASSOCIATION_TYPES,
|
|
3236
|
-
ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES,
|
|
3237
|
-
ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES,
|
|
3238
3204
|
ADYEN_ROLLOUT_COUNTRY_CODES,
|
|
3239
|
-
ADYEN_STORE_STATE_PROVINCE_COUNTRIES,
|
|
3240
|
-
ADYEN_TAX_NUMBER_FORMATS,
|
|
3241
|
-
ADYEN_TAX_NUMBER_MIN_LENGTH,
|
|
3242
3205
|
AttributeType,
|
|
3243
3206
|
BookingRatePeriod,
|
|
3244
3207
|
BookingResourceKind,
|
|
@@ -3316,11 +3279,6 @@ export {
|
|
|
3316
3279
|
TopMetericsSort,
|
|
3317
3280
|
UserTypes,
|
|
3318
3281
|
addAmounts,
|
|
3319
|
-
adyenLegalEntityRequiresStateOrProvince,
|
|
3320
|
-
adyenRequiresJobTitle,
|
|
3321
|
-
adyenStoreRequiresStateOrProvince,
|
|
3322
|
-
adyenSupportsTaxNumberAbsent,
|
|
3323
|
-
adyenTaxNumberFormat,
|
|
3324
3282
|
amountToString,
|
|
3325
3283
|
assertUnitSane,
|
|
3326
3284
|
availableIn,
|