@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 CHANGED
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * Runs four sweeps inside a 90-second wall-clock budget:
6
6
  *
7
- * 1. npm audit — known CVE check against the installed dependency tree (warn only)
7
+ * 1. npm audit — known CVE check against the installed dependency tree
8
8
  * 2. gitleaks — credential / secret scanning (git log + staged)
9
9
  * 3. vitest — full test suite with coverage threshold enforcement
10
10
  * 4. bundle — size-limit or custom bundle-size script (if configured)
11
11
  *
12
- * Any sweep failure except npm audit exits 1, blocking the push.
12
+ * Any sweep failure exits 1, blocking the push.
13
13
  * Budget overrun also exits 1.
14
14
  *
15
15
  * Install as Husky pre-push hook:
@@ -81,10 +81,9 @@ checkBudget('npm audit');
81
81
 
82
82
  const auditResult = run('npm audit --audit-level=high');
83
83
  if (auditResult.status !== 0) {
84
- warn('npm audit found high or critical vulnerabilities. Run `npm audit` for details.');
85
- } else {
86
- ok('npm audit: no high/critical vulnerabilities.');
84
+ fail('npm audit found high or critical vulnerabilities. Run `npm audit` for details.');
87
85
  }
86
+ ok('npm audit: no high/critical vulnerabilities.');
88
87
 
89
88
  // ── 2. gitleaks ───────────────────────────────────────────────────────────────
90
89
 
package/dist/index.d.mts CHANGED
@@ -224,7 +224,8 @@ declare enum InventorySpecificActionType {
224
224
  APPLIED_FROM_WOO = "APPLIED_FROM_WOO",
225
225
  PO_RECEIVED = "PO_RECEIVED",
226
226
  EXTERNAL_SALE = "EXTERNAL_SALE",
227
- EXTERNAL_RESTOCK = "EXTERNAL_RESTOCK"
227
+ EXTERNAL_RESTOCK = "EXTERNAL_RESTOCK",
228
+ CUSTOM = "CUSTOM"
228
229
  }
229
230
  declare enum ExtensionCategory {
230
231
  SYNC = "sync",
@@ -843,7 +844,7 @@ interface OrderContext {
843
844
  paymentMethods: OrderPaymentMethod[];
844
845
  refunds: OrderRefund[];
845
846
  lineItems: OrderLineItem[];
846
- reservations?: OrderReservationForContext[];
847
+ reservations: OrderReservationForContext[];
847
848
  };
848
849
  computed: {
849
850
  balance: number;
@@ -1401,23 +1402,6 @@ declare const holdExpiresAt: (rule: BookingRulesInput, now: Date) => Date;
1401
1402
 
1402
1403
  declare const ADYEN_ROLLOUT_COUNTRY_CODES: Set<string>;
1403
1404
  declare function isAdyenRolloutCountry(alpha2: string): boolean;
1404
- declare const ADYEN_STORE_STATE_PROVINCE_COUNTRIES: Set<string>;
1405
- declare function adyenStoreRequiresStateOrProvince(alpha2: string | undefined): boolean;
1406
- declare const ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES: Set<string>;
1407
- declare function adyenLegalEntityRequiresStateOrProvince(alpha2: string | undefined): boolean;
1408
- declare const ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES: Set<string>;
1409
- declare function adyenSupportsTaxNumberAbsent(alpha2: string | undefined): boolean;
1410
- declare const ADYEN_TAX_NUMBER_FORMATS: Record<string, {
1411
- pattern: RegExp;
1412
- length: number;
1413
- }>;
1414
- declare function adyenTaxNumberFormat(alpha2: string | undefined): {
1415
- pattern: RegExp;
1416
- length: number;
1417
- } | undefined;
1418
- declare const ADYEN_TAX_NUMBER_MIN_LENGTH = 5;
1419
- declare const ADYEN_JOB_TITLE_ASSOCIATION_TYPES: readonly string[];
1420
- declare function adyenRequiresJobTitle(associationType: string): boolean;
1421
1405
 
1422
1406
  interface CurrencyRate {
1423
1407
  rate: number;
@@ -1430,4 +1414,4 @@ declare const EUFixedRates: Record<string, CurrencyRate>;
1430
1414
  declare const OtherFixedRates: Record<string, CurrencyRate>;
1431
1415
  declare const COUNTRY_CURRENCIES: Record<string, string>;
1432
1416
 
1433
- export { ADYEN_JOB_TITLE_ASSOCIATION_TYPES, ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES, ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES, ADYEN_ROLLOUT_COUNTRY_CODES, ADYEN_STORE_STATE_PROVINCE_COUNTRIES, ADYEN_TAX_NUMBER_FORMATS, ADYEN_TAX_NUMBER_MIN_LENGTH, type Amount, AttributeType, type AvailabilityInput, type AvailabilitySlot, type AvailableTransition, type BookingOccupancy, BookingRatePeriod, type BookingResourceInput, BookingResourceKind, BookingResourceStatus, BookingRulesError, type BookingRulesInput, BookingType, type BusyWindow, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, CompanyType, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_HOLD_MINUTES, DEFAULT_RESOLVED_CONFIG, DEFAULT_UNIT_ID, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, DualWriteStrategy, EUFixedRates, EUROPE, type EndOfSessionReport, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, type GridSlot, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LegacyWriteStrategy, LibraryItemType, MAX_PRECISION, type Measurable, type MeasurementBase, type MeasurementUnit, type MeasurementUnitFamily, MenuProject, type ModifiersBreakdown, type ModifiersTuple, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForContext, type OrderLikeForLegacyInference, type OrderLineItem, type OrderMutationData, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderReservationForContext, type OrderStateEventPayload, type OrderStateWritable, type OrderWriteStrategy, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, PaymentMethod, PaymentProcessor, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, type PlanWindowInput, Platform, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, type ProductDiscountBucket, type ProductFeeBucket, ProductStatus, ProductType, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, ReservationStatus, ResidualPaymentMethod, ResidualStatus, type ResolveTemplateResult, type ResourceAvailability, ResourceAvailabilityState, type ResourceInWindow, type ResourcePresenceRow, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, SYSTEM_FAMILIES, SYSTEM_FAMILY_IDS, SYSTEM_UNITS, SYSTEM_UNIT_IDS, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementBuckets, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UserTypes, type WeeklyHours, addAmounts, adyenLegalEntityRequiresStateOrProvince, adyenRequiresJobTitle, adyenStoreRequiresStateOrProvince, adyenSupportsTaxNumberAbsent, adyenTaxNumberFormat, amountToString, assertUnitSane, availableIn, baseFor, baseFulfillmentDefinitions, baseOf, basePaymentDefinitions, buildAvailability, buildGrid, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, canTransition, conditionSummary, convertFixedFeeToLocalCurrency, createAmount, crossAxisRuleApplies, deriveDisplayState, deriveFamilyCode, deriveUnitId, displayRuleMatchesPair, divideAmount, evaluateCondition, evaluateConditionSet, extendPrice, extendPriceFor, formatCurrency, formatInUnit, formatMinorUnitsToString, formatQuantity, fromBase, fromMinorUnits, generateMongoID, getAvailableTransitions, getCashAmountDue, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getGoodsPortion, getLineSubtotal, getMinorUnitMultiplier, getMinorUnits, getPaymentLegTotal, getPricingRegionFromCountry, getSettlementTotal, getTotalCollected, holdExpiresAt, inferStatesFromLegacyStatus, isAdyenRolloutCountry, isConditionOperator, isFulfillmentState, isPaymentState, isSupportedCurrency, isSystemFamilyCode, isValidQuantity, isWhole, mapToLegacyStatus, maxPrecisionFor, mergeFragment, multiplyAmount, normalizeMongoIdString, occupancyIn, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, planWindow, presentAt, removeFragment, resolveFamily, resolveTemplate, resolveUnit, roundToPrecision, sameFamily, setOrderState, shopDayKey, shopDayRange, signReportForDisplay, slotsForWindow, stringifyMinorUnits, subtractAmounts, toBase, toMinorUnits, validateConfig, validateFragmentCompatibility, violatesFinancialInvariant, windowEndsAt, withinPresence };
1417
+ export { ADYEN_ROLLOUT_COUNTRY_CODES, type Amount, AttributeType, type AvailabilityInput, type AvailabilitySlot, type AvailableTransition, type BookingOccupancy, BookingRatePeriod, type BookingResourceInput, BookingResourceKind, BookingResourceStatus, BookingRulesError, type BookingRulesInput, BookingType, type BusyWindow, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, CompanyType, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_HOLD_MINUTES, DEFAULT_RESOLVED_CONFIG, DEFAULT_UNIT_ID, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, DualWriteStrategy, EUFixedRates, EUROPE, type EndOfSessionReport, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, type GridSlot, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LegacyWriteStrategy, LibraryItemType, MAX_PRECISION, type Measurable, type MeasurementBase, type MeasurementUnit, type MeasurementUnitFamily, MenuProject, type ModifiersBreakdown, type ModifiersTuple, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForContext, type OrderLikeForLegacyInference, type OrderLineItem, type OrderMutationData, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderReservationForContext, type OrderStateEventPayload, type OrderStateWritable, type OrderWriteStrategy, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, PaymentMethod, PaymentProcessor, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, type PlanWindowInput, Platform, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, type ProductDiscountBucket, type ProductFeeBucket, ProductStatus, ProductType, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, ReservationStatus, ResidualPaymentMethod, ResidualStatus, type ResolveTemplateResult, type ResourceAvailability, ResourceAvailabilityState, type ResourceInWindow, type ResourcePresenceRow, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, SYSTEM_FAMILIES, SYSTEM_FAMILY_IDS, SYSTEM_UNITS, SYSTEM_UNIT_IDS, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementBuckets, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UserTypes, type WeeklyHours, addAmounts, amountToString, assertUnitSane, availableIn, baseFor, baseFulfillmentDefinitions, baseOf, basePaymentDefinitions, buildAvailability, buildGrid, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, canTransition, conditionSummary, convertFixedFeeToLocalCurrency, createAmount, crossAxisRuleApplies, deriveDisplayState, deriveFamilyCode, deriveUnitId, displayRuleMatchesPair, divideAmount, evaluateCondition, evaluateConditionSet, extendPrice, extendPriceFor, formatCurrency, formatInUnit, formatMinorUnitsToString, formatQuantity, fromBase, fromMinorUnits, generateMongoID, getAvailableTransitions, getCashAmountDue, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getGoodsPortion, getLineSubtotal, getMinorUnitMultiplier, getMinorUnits, getPaymentLegTotal, getPricingRegionFromCountry, getSettlementTotal, getTotalCollected, holdExpiresAt, inferStatesFromLegacyStatus, isAdyenRolloutCountry, isConditionOperator, isFulfillmentState, isPaymentState, isSupportedCurrency, isSystemFamilyCode, isValidQuantity, isWhole, mapToLegacyStatus, maxPrecisionFor, mergeFragment, multiplyAmount, normalizeMongoIdString, occupancyIn, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, planWindow, presentAt, removeFragment, resolveFamily, resolveTemplate, resolveUnit, roundToPrecision, sameFamily, setOrderState, shopDayKey, shopDayRange, signReportForDisplay, slotsForWindow, stringifyMinorUnits, subtractAmounts, toBase, toMinorUnits, validateConfig, validateFragmentCompatibility, violatesFinancialInvariant, windowEndsAt, withinPresence };
package/dist/index.d.ts CHANGED
@@ -224,7 +224,8 @@ declare enum InventorySpecificActionType {
224
224
  APPLIED_FROM_WOO = "APPLIED_FROM_WOO",
225
225
  PO_RECEIVED = "PO_RECEIVED",
226
226
  EXTERNAL_SALE = "EXTERNAL_SALE",
227
- EXTERNAL_RESTOCK = "EXTERNAL_RESTOCK"
227
+ EXTERNAL_RESTOCK = "EXTERNAL_RESTOCK",
228
+ CUSTOM = "CUSTOM"
228
229
  }
229
230
  declare enum ExtensionCategory {
230
231
  SYNC = "sync",
@@ -843,7 +844,7 @@ interface OrderContext {
843
844
  paymentMethods: OrderPaymentMethod[];
844
845
  refunds: OrderRefund[];
845
846
  lineItems: OrderLineItem[];
846
- reservations?: OrderReservationForContext[];
847
+ reservations: OrderReservationForContext[];
847
848
  };
848
849
  computed: {
849
850
  balance: number;
@@ -1401,23 +1402,6 @@ declare const holdExpiresAt: (rule: BookingRulesInput, now: Date) => Date;
1401
1402
 
1402
1403
  declare const ADYEN_ROLLOUT_COUNTRY_CODES: Set<string>;
1403
1404
  declare function isAdyenRolloutCountry(alpha2: string): boolean;
1404
- declare const ADYEN_STORE_STATE_PROVINCE_COUNTRIES: Set<string>;
1405
- declare function adyenStoreRequiresStateOrProvince(alpha2: string | undefined): boolean;
1406
- declare const ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES: Set<string>;
1407
- declare function adyenLegalEntityRequiresStateOrProvince(alpha2: string | undefined): boolean;
1408
- declare const ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES: Set<string>;
1409
- declare function adyenSupportsTaxNumberAbsent(alpha2: string | undefined): boolean;
1410
- declare const ADYEN_TAX_NUMBER_FORMATS: Record<string, {
1411
- pattern: RegExp;
1412
- length: number;
1413
- }>;
1414
- declare function adyenTaxNumberFormat(alpha2: string | undefined): {
1415
- pattern: RegExp;
1416
- length: number;
1417
- } | undefined;
1418
- declare const ADYEN_TAX_NUMBER_MIN_LENGTH = 5;
1419
- declare const ADYEN_JOB_TITLE_ASSOCIATION_TYPES: readonly string[];
1420
- declare function adyenRequiresJobTitle(associationType: string): boolean;
1421
1405
 
1422
1406
  interface CurrencyRate {
1423
1407
  rate: number;
@@ -1430,4 +1414,4 @@ declare const EUFixedRates: Record<string, CurrencyRate>;
1430
1414
  declare const OtherFixedRates: Record<string, CurrencyRate>;
1431
1415
  declare const COUNTRY_CURRENCIES: Record<string, string>;
1432
1416
 
1433
- export { ADYEN_JOB_TITLE_ASSOCIATION_TYPES, ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES, ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES, ADYEN_ROLLOUT_COUNTRY_CODES, ADYEN_STORE_STATE_PROVINCE_COUNTRIES, ADYEN_TAX_NUMBER_FORMATS, ADYEN_TAX_NUMBER_MIN_LENGTH, type Amount, AttributeType, type AvailabilityInput, type AvailabilitySlot, type AvailableTransition, type BookingOccupancy, BookingRatePeriod, type BookingResourceInput, BookingResourceKind, BookingResourceStatus, BookingRulesError, type BookingRulesInput, BookingType, type BusyWindow, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, CompanyType, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_HOLD_MINUTES, DEFAULT_RESOLVED_CONFIG, DEFAULT_UNIT_ID, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, DualWriteStrategy, EUFixedRates, EUROPE, type EndOfSessionReport, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, type GridSlot, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LegacyWriteStrategy, LibraryItemType, MAX_PRECISION, type Measurable, type MeasurementBase, type MeasurementUnit, type MeasurementUnitFamily, MenuProject, type ModifiersBreakdown, type ModifiersTuple, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForContext, type OrderLikeForLegacyInference, type OrderLineItem, type OrderMutationData, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderReservationForContext, type OrderStateEventPayload, type OrderStateWritable, type OrderWriteStrategy, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, PaymentMethod, PaymentProcessor, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, type PlanWindowInput, Platform, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, type ProductDiscountBucket, type ProductFeeBucket, ProductStatus, ProductType, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, ReservationStatus, ResidualPaymentMethod, ResidualStatus, type ResolveTemplateResult, type ResourceAvailability, ResourceAvailabilityState, type ResourceInWindow, type ResourcePresenceRow, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, SYSTEM_FAMILIES, SYSTEM_FAMILY_IDS, SYSTEM_UNITS, SYSTEM_UNIT_IDS, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementBuckets, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UserTypes, type WeeklyHours, addAmounts, adyenLegalEntityRequiresStateOrProvince, adyenRequiresJobTitle, adyenStoreRequiresStateOrProvince, adyenSupportsTaxNumberAbsent, adyenTaxNumberFormat, amountToString, assertUnitSane, availableIn, baseFor, baseFulfillmentDefinitions, baseOf, basePaymentDefinitions, buildAvailability, buildGrid, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, canTransition, conditionSummary, convertFixedFeeToLocalCurrency, createAmount, crossAxisRuleApplies, deriveDisplayState, deriveFamilyCode, deriveUnitId, displayRuleMatchesPair, divideAmount, evaluateCondition, evaluateConditionSet, extendPrice, extendPriceFor, formatCurrency, formatInUnit, formatMinorUnitsToString, formatQuantity, fromBase, fromMinorUnits, generateMongoID, getAvailableTransitions, getCashAmountDue, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getGoodsPortion, getLineSubtotal, getMinorUnitMultiplier, getMinorUnits, getPaymentLegTotal, getPricingRegionFromCountry, getSettlementTotal, getTotalCollected, holdExpiresAt, inferStatesFromLegacyStatus, isAdyenRolloutCountry, isConditionOperator, isFulfillmentState, isPaymentState, isSupportedCurrency, isSystemFamilyCode, isValidQuantity, isWhole, mapToLegacyStatus, maxPrecisionFor, mergeFragment, multiplyAmount, normalizeMongoIdString, occupancyIn, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, planWindow, presentAt, removeFragment, resolveFamily, resolveTemplate, resolveUnit, roundToPrecision, sameFamily, setOrderState, shopDayKey, shopDayRange, signReportForDisplay, slotsForWindow, stringifyMinorUnits, subtractAmounts, toBase, toMinorUnits, validateConfig, validateFragmentCompatibility, violatesFinancialInvariant, windowEndsAt, withinPresence };
1417
+ export { ADYEN_ROLLOUT_COUNTRY_CODES, type Amount, AttributeType, type AvailabilityInput, type AvailabilitySlot, type AvailableTransition, type BookingOccupancy, BookingRatePeriod, type BookingResourceInput, BookingResourceKind, BookingResourceStatus, BookingRulesError, type BookingRulesInput, BookingType, type BusyWindow, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, CompanyType, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_HOLD_MINUTES, DEFAULT_RESOLVED_CONFIG, DEFAULT_UNIT_ID, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, DualWriteStrategy, EUFixedRates, EUROPE, type EndOfSessionReport, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, type GridSlot, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LegacyWriteStrategy, LibraryItemType, MAX_PRECISION, type Measurable, type MeasurementBase, type MeasurementUnit, type MeasurementUnitFamily, MenuProject, type ModifiersBreakdown, type ModifiersTuple, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForContext, type OrderLikeForLegacyInference, type OrderLineItem, type OrderMutationData, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderReservationForContext, type OrderStateEventPayload, type OrderStateWritable, type OrderWriteStrategy, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, PaymentMethod, PaymentProcessor, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, type PlanWindowInput, Platform, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, type ProductDiscountBucket, type ProductFeeBucket, ProductStatus, ProductType, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, ReservationStatus, ResidualPaymentMethod, ResidualStatus, type ResolveTemplateResult, type ResourceAvailability, ResourceAvailabilityState, type ResourceInWindow, type ResourcePresenceRow, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, SYSTEM_FAMILIES, SYSTEM_FAMILY_IDS, SYSTEM_UNITS, SYSTEM_UNIT_IDS, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementBuckets, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UserTypes, type WeeklyHours, addAmounts, amountToString, assertUnitSane, availableIn, baseFor, baseFulfillmentDefinitions, baseOf, basePaymentDefinitions, buildAvailability, buildGrid, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, canTransition, conditionSummary, convertFixedFeeToLocalCurrency, createAmount, crossAxisRuleApplies, deriveDisplayState, deriveFamilyCode, deriveUnitId, displayRuleMatchesPair, divideAmount, evaluateCondition, evaluateConditionSet, extendPrice, extendPriceFor, formatCurrency, formatInUnit, formatMinorUnitsToString, formatQuantity, fromBase, fromMinorUnits, generateMongoID, getAvailableTransitions, getCashAmountDue, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getGoodsPortion, getLineSubtotal, getMinorUnitMultiplier, getMinorUnits, getPaymentLegTotal, getPricingRegionFromCountry, getSettlementTotal, getTotalCollected, holdExpiresAt, inferStatesFromLegacyStatus, isAdyenRolloutCountry, isConditionOperator, isFulfillmentState, isPaymentState, isSupportedCurrency, isSystemFamilyCode, isValidQuantity, isWhole, mapToLegacyStatus, maxPrecisionFor, mergeFragment, multiplyAmount, normalizeMongoIdString, occupancyIn, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, planWindow, presentAt, removeFragment, resolveFamily, resolveTemplate, resolveUnit, roundToPrecision, sameFamily, setOrderState, shopDayKey, shopDayRange, signReportForDisplay, slotsForWindow, stringifyMinorUnits, subtractAmounts, toBase, toMinorUnits, validateConfig, validateFragmentCompatibility, violatesFinancialInvariant, windowEndsAt, withinPresence };
package/dist/index.js CHANGED
@@ -19,13 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // index.ts
20
20
  var index_exports = {};
21
21
  __export(index_exports, {
22
- ADYEN_JOB_TITLE_ASSOCIATION_TYPES: () => ADYEN_JOB_TITLE_ASSOCIATION_TYPES,
23
- ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES: () => ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES,
24
- ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES: () => ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES,
25
22
  ADYEN_ROLLOUT_COUNTRY_CODES: () => ADYEN_ROLLOUT_COUNTRY_CODES,
26
- ADYEN_STORE_STATE_PROVINCE_COUNTRIES: () => ADYEN_STORE_STATE_PROVINCE_COUNTRIES,
27
- ADYEN_TAX_NUMBER_FORMATS: () => ADYEN_TAX_NUMBER_FORMATS,
28
- ADYEN_TAX_NUMBER_MIN_LENGTH: () => ADYEN_TAX_NUMBER_MIN_LENGTH,
29
23
  AttributeType: () => AttributeType,
30
24
  BookingRatePeriod: () => BookingRatePeriod,
31
25
  BookingResourceKind: () => BookingResourceKind,
@@ -103,11 +97,6 @@ __export(index_exports, {
103
97
  TopMetericsSort: () => TopMetericsSort,
104
98
  UserTypes: () => UserTypes,
105
99
  addAmounts: () => addAmounts,
106
- adyenLegalEntityRequiresStateOrProvince: () => adyenLegalEntityRequiresStateOrProvince,
107
- adyenRequiresJobTitle: () => adyenRequiresJobTitle,
108
- adyenStoreRequiresStateOrProvince: () => adyenStoreRequiresStateOrProvince,
109
- adyenSupportsTaxNumberAbsent: () => adyenSupportsTaxNumberAbsent,
110
- adyenTaxNumberFormat: () => adyenTaxNumberFormat,
111
100
  amountToString: () => amountToString,
112
101
  assertUnitSane: () => assertUnitSane,
113
102
  availableIn: () => availableIn,
@@ -439,6 +428,7 @@ var InventorySpecificActionType = /* @__PURE__ */ ((InventorySpecificActionType2
439
428
  InventorySpecificActionType2["PO_RECEIVED"] = "PO_RECEIVED";
440
429
  InventorySpecificActionType2["EXTERNAL_SALE"] = "EXTERNAL_SALE";
441
430
  InventorySpecificActionType2["EXTERNAL_RESTOCK"] = "EXTERNAL_RESTOCK";
431
+ InventorySpecificActionType2["CUSTOM"] = "CUSTOM";
442
432
  return InventorySpecificActionType2;
443
433
  })(InventorySpecificActionType || {});
444
434
  var ExtensionCategory = /* @__PURE__ */ ((ExtensionCategory2) => {
@@ -3204,9 +3194,7 @@ function buildGrid(rule, timeZone, from, to, now, busy = []) {
3204
3194
  const start = startAt.getTime();
3205
3195
  if (start < askedFrom || start >= askedTo) return false;
3206
3196
  if (start < notBefore || start > notAfter) return false;
3207
- return !blocked.some(
3208
- ({ from: blockFrom, to: blockTo }) => start < blockTo && bufferEndAt.getTime() > blockFrom
3209
- );
3197
+ return !blocked.some(({ from: blockFrom, to: blockTo }) => start < blockTo && bufferEndAt.getTime() > blockFrom);
3210
3198
  }).sort((first, second) => +first.startAt - +second.startAt);
3211
3199
  }
3212
3200
  function slotsForWindow(grid, startAt, endAt) {
@@ -3325,14 +3313,7 @@ function buildAvailability({
3325
3313
  for (const slot of slots2) {
3326
3314
  const { taken, foreignProductId } = occupancyIn(mine, productId, slot.startAt, slot.bufferEndAt, shared);
3327
3315
  const free = foreignProductId ? 0 : Math.max(capacity - taken, 0);
3328
- const entry = byInstant.get(+slot.startAt) ?? {
3329
- ...slot,
3330
- capacity: 0,
3331
- booked: 0,
3332
- free: 0,
3333
- resources: [],
3334
- dayKey: shopDayKey(slot.startAt, resource.timeZone)
3335
- };
3316
+ const entry = byInstant.get(+slot.startAt) ?? { ...slot, capacity: 0, booked: 0, free: 0, resources: [], dayKey: shopDayKey(slot.startAt, resource.timeZone) };
3336
3317
  entry.capacity += capacity;
3337
3318
  entry.booked += foreignProductId ? capacity : taken;
3338
3319
  entry.free += free;
@@ -3410,38 +3391,9 @@ var ADYEN_ROLLOUT_COUNTRY_CODES = /* @__PURE__ */ new Set(["CA"]);
3410
3391
  function isAdyenRolloutCountry(alpha2) {
3411
3392
  return ADYEN_ROLLOUT_COUNTRY_CODES.has(alpha2);
3412
3393
  }
3413
- var ADYEN_STORE_STATE_PROVINCE_COUNTRIES = /* @__PURE__ */ new Set(["AU", "BR", "CA", "IN", "MX", "NZ", "US"]);
3414
- function adyenStoreRequiresStateOrProvince(alpha2) {
3415
- return !!alpha2 && ADYEN_STORE_STATE_PROVINCE_COUNTRIES.has(alpha2);
3416
- }
3417
- var ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES = /* @__PURE__ */ new Set(["AU", "BR", "CA", "IN", "MX", "NZ", "US"]);
3418
- function adyenLegalEntityRequiresStateOrProvince(alpha2) {
3419
- return !!alpha2 && ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES.has(alpha2);
3420
- }
3421
- var ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES = /* @__PURE__ */ new Set(["CA"]);
3422
- function adyenSupportsTaxNumberAbsent(alpha2) {
3423
- return !!alpha2 && !ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES.has(alpha2);
3424
- }
3425
- var ADYEN_TAX_NUMBER_FORMATS = {
3426
- CA: { pattern: /^\d{9}$/, length: 9 }
3427
- };
3428
- function adyenTaxNumberFormat(alpha2) {
3429
- return alpha2 ? ADYEN_TAX_NUMBER_FORMATS[alpha2] : void 0;
3430
- }
3431
- var ADYEN_TAX_NUMBER_MIN_LENGTH = 5;
3432
- var ADYEN_JOB_TITLE_ASSOCIATION_TYPES = ["signatory", "uboThroughControl"];
3433
- function adyenRequiresJobTitle(associationType) {
3434
- return ADYEN_JOB_TITLE_ASSOCIATION_TYPES.includes(associationType);
3435
- }
3436
3394
  // Annotate the CommonJS export names for ESM import in node:
3437
3395
  0 && (module.exports = {
3438
- ADYEN_JOB_TITLE_ASSOCIATION_TYPES,
3439
- ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES,
3440
- ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES,
3441
3396
  ADYEN_ROLLOUT_COUNTRY_CODES,
3442
- ADYEN_STORE_STATE_PROVINCE_COUNTRIES,
3443
- ADYEN_TAX_NUMBER_FORMATS,
3444
- ADYEN_TAX_NUMBER_MIN_LENGTH,
3445
3397
  AttributeType,
3446
3398
  BookingRatePeriod,
3447
3399
  BookingResourceKind,
@@ -3519,11 +3471,6 @@ function adyenRequiresJobTitle(associationType) {
3519
3471
  TopMetericsSort,
3520
3472
  UserTypes,
3521
3473
  addAmounts,
3522
- adyenLegalEntityRequiresStateOrProvince,
3523
- adyenRequiresJobTitle,
3524
- adyenStoreRequiresStateOrProvince,
3525
- adyenSupportsTaxNumberAbsent,
3526
- adyenTaxNumberFormat,
3527
3474
  amountToString,
3528
3475
  assertUnitSane,
3529
3476
  availableIn,