@fas-core/shared-types 1.0.92 → 1.0.94

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 CHANGED
@@ -441,11 +441,6 @@ interface IOrderItem extends BaseEntity {
441
441
  variant?: IVariant;
442
442
  pricing: ILinePricing;
443
443
  metaData: Metadata;
444
- bundleId?: string | null;
445
- bundleTitle?: string | null;
446
- bundleConfiguratorKey?: string | null;
447
- bundleQuantity?: number;
448
- bundleUnitQuantity?: number | null;
449
444
  note?: string;
450
445
  }
451
446
 
@@ -542,11 +537,6 @@ declare const ORDER_STATUS_VALUES: ("PENDING" | "PROCESSING" | "FAILED" | "REFUN
542
537
  declare const statusColors: Record<OrderStatusEnum, string>;
543
538
  declare const PURCHASE_ORDER_STATUSES: OrderStatusEnum[];
544
539
  declare const QUOTE_ORDER_STATUSES: OrderStatusEnum[];
545
- interface IOrderTracking {
546
- number: string;
547
- url: string;
548
- carrier: string;
549
- }
550
540
  interface IOrder extends BaseEntity {
551
541
  orderId: string;
552
542
  orderItems: IOrderItem[];
@@ -564,7 +554,6 @@ interface IOrder extends BaseEntity {
564
554
  shippingAddress: IAddress;
565
555
  billingAddress: IAddress;
566
556
  shippingMethod: string;
567
- tracking: IOrderTracking;
568
557
  acceptedTermsAt: Date;
569
558
  customerNote: string;
570
559
  metaData: Metadata;
@@ -740,13 +729,14 @@ declare const EmailTemplateEventEnum: {
740
729
  readonly QUOTE: "QUOTE";
741
730
  readonly QUOTE_REQUESTED: "QUOTE_REQUESTED";
742
731
  readonly QUOTE_SENT: "QUOTE_SENT";
732
+ readonly QUOTE_DECLINED: "QUOTE_DECLINED";
743
733
  readonly INVOICE: "INVOICE";
744
734
  readonly PROMOTIONAL: "PROMOTIONAL";
745
735
  readonly CONTACT_US: "CONTACT_US";
746
736
  readonly NOTIFICATION: "NOTIFICATION";
747
737
  };
748
738
  type EmailTemplateEventEnum = (typeof EmailTemplateEventEnum)[keyof typeof EmailTemplateEventEnum];
749
- declare const EMAIL_TEMPLATE_EVENT_VALUES: ("QUOTE" | "QUOTE_REQUESTED" | "ORDER_RECEIVED" | "ORDER_CANCELLED" | "WELCOME" | "PASSWORD_RESET" | "QUOTE_SENT" | "INVOICE" | "PROMOTIONAL" | "CONTACT_US" | "NOTIFICATION")[];
739
+ declare const EMAIL_TEMPLATE_EVENT_VALUES: ("QUOTE" | "QUOTE_REQUESTED" | "QUOTE_DECLINED" | "ORDER_RECEIVED" | "ORDER_CANCELLED" | "WELCOME" | "PASSWORD_RESET" | "QUOTE_SENT" | "INVOICE" | "PROMOTIONAL" | "CONTACT_US" | "NOTIFICATION")[];
750
740
  declare const WIRED_EMAIL_TEMPLATE_EVENTS: EmailTemplateEventEnum[];
751
741
  declare const EMAIL_TEMPLATE_VARIABLES_BY_EVENT: Partial<Record<EmailTemplateEventEnum, string[]>>;
752
742
  interface IEmailTemplate extends BaseEntity {
@@ -1032,58 +1022,10 @@ interface ICartItem extends BaseEntity {
1032
1022
  variant?: IVariant;
1033
1023
  pricing: ILinePricing;
1034
1024
  metaData: Metadata;
1035
- /**
1036
- * Groups the lines produced by one configurator build so the cart renders and removes
1037
- * them as a unit. Part of the line dedupe key — two bundles holding the same product
1038
- * must stay separate lines rather than merging into one.
1039
- */
1040
- bundleId?: string | null;
1041
- bundleTitle?: string | null;
1042
- /**
1043
- * Which configurator produced this bundle. Required once more than one can be published:
1044
- * the server validates a bundle against THIS configurator's rules, and the cart's reconfigure
1045
- * link reopens THIS one. Validating against "whichever is active" would check a build against
1046
- * the wrong rulebook.
1047
- */
1048
- bundleConfiguratorKey?: string | null;
1049
- /**
1050
- * How many copies of the whole configuration the customer ordered. `quantity` stays the
1051
- * EFFECTIVE figure so pricing, stock and orders need no change; `bundleUnitQuantity` keeps
1052
- * the per-bundle figure so the stepper can re-multiply without walking the wizard again.
1053
- */
1054
- bundleQuantity?: number;
1055
- bundleUnitQuantity?: number | null;
1056
1025
  /** Buyer-entered line note. Survives to the order and appears on the confirmation. */
1057
1026
  note?: string;
1058
1027
  }
1059
1028
 
1060
- declare const MAX_BUNDLE_QUANTITY = 99;
1061
- declare const normalizeBundleQuantity: (value: unknown) => number;
1062
- declare const bundleLineQuantity: (unitQuantity: number, bundleQuantity: number) => number;
1063
- declare const bundleUnitFrom: (line: {
1064
- bundleUnitQuantity?: number | null;
1065
- quantity: number;
1066
- bundleQuantity?: number | null;
1067
- }) => number;
1068
- interface BundleLine {
1069
- bundleId?: string | null;
1070
- bundleTitle?: string | null;
1071
- bundleQuantity?: number;
1072
- bundleUnitQuantity?: number | null;
1073
- pricing?: {
1074
- totalAmount?: number;
1075
- };
1076
- }
1077
- interface BundleGroup {
1078
- bundleId: string;
1079
- title: string;
1080
- quantity: number;
1081
- lines: number;
1082
- total: number;
1083
- }
1084
- declare const bundleGroupsOf: (items: BundleLine[]) => BundleGroup[];
1085
- declare const orderByBundle: <T extends BundleLine>(items: T[]) => T[];
1086
-
1087
1029
  interface StockDemandLine {
1088
1030
  key: string;
1089
1031
  quantity: number;
@@ -1441,4 +1383,4 @@ interface IWishlist extends BaseEntity {
1441
1383
  items: IWishlistItem[];
1442
1384
  }
1443
1385
 
1444
- export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ROLES, type AddonAmountInput, type AddonSelectionRef, type ApiResponse, type BaseEntity, type BundleGroup, type BundleLine, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_ISSUE_TYPE_VALUES, CART_STATUS_VALUES, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_ERROR_CODE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, DEFAULT_SUBSCRIPTION_TOPICS, DiscountTypeEnum, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogCitation, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICategory, type ICompliance, type IConfigurator, type IConfiguratorCondition, type IConfiguratorEffect, type IConfiguratorFacet, type IConfiguratorFacetValue, type IConfiguratorOption, type IConfiguratorPriceAdjustment, type IConfiguratorQuery, type IConfiguratorRule, type IConfiguratorSection, type IConfiguratorStep, type IConfiguratorTarget, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderTracking, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, type IProductOptionGroup, type IProductOptionValue, type IProductRelationGroup, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRedirect, type IRedirectSuggestion, type IRefundTransaction, type IRelationGroup, type ISEOMetaData, type ISelectableFee, type IShipFromAddress, type IShipping, type IShippingRate, type IState, type IStock, type IStore, type IStoreFee, type IStoreSettings, type ISubscriber, type ISubscriberConsent, type ISubscription, type ISummaryPricing, type ITechSpec, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, MAX_BUNDLE_QUANTITY, type Metadata, NOTIFICATION_TYPE_VALUES, NotificationTypeEnum, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PRICING_TYPE_VALUES, PRODUCT_EVENT_TYPE_VALUES, PURCHASE_ORDER_STATUSES, type Paginated, PaymentGatewayEnum, PaymentLinkStatusEnum, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductVariantType, QUOTE_ORDER_STATUSES, RETIRED_CART_STATUSES, type RedirectTargetType, type ResolvedAddonSelection, SALE_TYPE_VALUES, STOCK_STATUS_VALUES, STOCK_VERDICT_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SoftDeleteFilter, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StockVerdictType, SubscriptionChannelEnum, SubscriptionTopicEnum, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, bundleGroupsOf, bundleLineQuantity, bundleUnitFrom, canonicalizePath, canonicalizeSlug, conditionHolds, demandByKey, evaluateConfigurator, feeHint, formatMoney, groupHasDefaultAddon, isConfigurationValid, isQuoteOnlyItem, normalizeBundleQuantity, normalizeLineQuantity, normalizePath, notificationTypeColorMap, orderByBundle, orderLogTypeColorMap, paymentGatewayColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, resolveAddonSelections, resolveProductAddonGroups, roundMoney, saleTypeOf, statusColors, stockVerdict, toIdString, typeColorMap };
1386
+ export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ROLES, type AddonAmountInput, type AddonSelectionRef, type ApiResponse, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_ISSUE_TYPE_VALUES, CART_STATUS_VALUES, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_ERROR_CODE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, DEFAULT_SUBSCRIPTION_TOPICS, DiscountTypeEnum, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogCitation, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICategory, type ICompliance, type IConfigurator, type IConfiguratorCondition, type IConfiguratorEffect, type IConfiguratorFacet, type IConfiguratorFacetValue, type IConfiguratorOption, type IConfiguratorPriceAdjustment, type IConfiguratorQuery, type IConfiguratorRule, type IConfiguratorSection, type IConfiguratorStep, type IConfiguratorTarget, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, type IProductOptionGroup, type IProductOptionValue, type IProductRelationGroup, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRedirect, type IRedirectSuggestion, type IRefundTransaction, type IRelationGroup, type ISEOMetaData, type ISelectableFee, type IShipFromAddress, type IShipping, type IShippingRate, type IState, type IStock, type IStore, type IStoreFee, type IStoreSettings, type ISubscriber, type ISubscriberConsent, type ISubscription, type ISummaryPricing, type ITechSpec, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type Metadata, NOTIFICATION_TYPE_VALUES, NotificationTypeEnum, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PRICING_TYPE_VALUES, PRODUCT_EVENT_TYPE_VALUES, PURCHASE_ORDER_STATUSES, type Paginated, PaymentGatewayEnum, PaymentLinkStatusEnum, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductVariantType, QUOTE_ORDER_STATUSES, RETIRED_CART_STATUSES, type RedirectTargetType, type ResolvedAddonSelection, SALE_TYPE_VALUES, STOCK_STATUS_VALUES, STOCK_VERDICT_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SoftDeleteFilter, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StockVerdictType, SubscriptionChannelEnum, SubscriptionTopicEnum, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, canonicalizePath, canonicalizeSlug, conditionHolds, demandByKey, evaluateConfigurator, feeHint, formatMoney, groupHasDefaultAddon, isConfigurationValid, isQuoteOnlyItem, normalizeLineQuantity, normalizePath, notificationTypeColorMap, orderLogTypeColorMap, paymentGatewayColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, resolveAddonSelections, resolveProductAddonGroups, roundMoney, saleTypeOf, statusColors, stockVerdict, toIdString, typeColorMap };
package/dist/index.d.ts CHANGED
@@ -441,11 +441,6 @@ interface IOrderItem extends BaseEntity {
441
441
  variant?: IVariant;
442
442
  pricing: ILinePricing;
443
443
  metaData: Metadata;
444
- bundleId?: string | null;
445
- bundleTitle?: string | null;
446
- bundleConfiguratorKey?: string | null;
447
- bundleQuantity?: number;
448
- bundleUnitQuantity?: number | null;
449
444
  note?: string;
450
445
  }
451
446
 
@@ -542,11 +537,6 @@ declare const ORDER_STATUS_VALUES: ("PENDING" | "PROCESSING" | "FAILED" | "REFUN
542
537
  declare const statusColors: Record<OrderStatusEnum, string>;
543
538
  declare const PURCHASE_ORDER_STATUSES: OrderStatusEnum[];
544
539
  declare const QUOTE_ORDER_STATUSES: OrderStatusEnum[];
545
- interface IOrderTracking {
546
- number: string;
547
- url: string;
548
- carrier: string;
549
- }
550
540
  interface IOrder extends BaseEntity {
551
541
  orderId: string;
552
542
  orderItems: IOrderItem[];
@@ -564,7 +554,6 @@ interface IOrder extends BaseEntity {
564
554
  shippingAddress: IAddress;
565
555
  billingAddress: IAddress;
566
556
  shippingMethod: string;
567
- tracking: IOrderTracking;
568
557
  acceptedTermsAt: Date;
569
558
  customerNote: string;
570
559
  metaData: Metadata;
@@ -740,13 +729,14 @@ declare const EmailTemplateEventEnum: {
740
729
  readonly QUOTE: "QUOTE";
741
730
  readonly QUOTE_REQUESTED: "QUOTE_REQUESTED";
742
731
  readonly QUOTE_SENT: "QUOTE_SENT";
732
+ readonly QUOTE_DECLINED: "QUOTE_DECLINED";
743
733
  readonly INVOICE: "INVOICE";
744
734
  readonly PROMOTIONAL: "PROMOTIONAL";
745
735
  readonly CONTACT_US: "CONTACT_US";
746
736
  readonly NOTIFICATION: "NOTIFICATION";
747
737
  };
748
738
  type EmailTemplateEventEnum = (typeof EmailTemplateEventEnum)[keyof typeof EmailTemplateEventEnum];
749
- declare const EMAIL_TEMPLATE_EVENT_VALUES: ("QUOTE" | "QUOTE_REQUESTED" | "ORDER_RECEIVED" | "ORDER_CANCELLED" | "WELCOME" | "PASSWORD_RESET" | "QUOTE_SENT" | "INVOICE" | "PROMOTIONAL" | "CONTACT_US" | "NOTIFICATION")[];
739
+ declare const EMAIL_TEMPLATE_EVENT_VALUES: ("QUOTE" | "QUOTE_REQUESTED" | "QUOTE_DECLINED" | "ORDER_RECEIVED" | "ORDER_CANCELLED" | "WELCOME" | "PASSWORD_RESET" | "QUOTE_SENT" | "INVOICE" | "PROMOTIONAL" | "CONTACT_US" | "NOTIFICATION")[];
750
740
  declare const WIRED_EMAIL_TEMPLATE_EVENTS: EmailTemplateEventEnum[];
751
741
  declare const EMAIL_TEMPLATE_VARIABLES_BY_EVENT: Partial<Record<EmailTemplateEventEnum, string[]>>;
752
742
  interface IEmailTemplate extends BaseEntity {
@@ -1032,58 +1022,10 @@ interface ICartItem extends BaseEntity {
1032
1022
  variant?: IVariant;
1033
1023
  pricing: ILinePricing;
1034
1024
  metaData: Metadata;
1035
- /**
1036
- * Groups the lines produced by one configurator build so the cart renders and removes
1037
- * them as a unit. Part of the line dedupe key — two bundles holding the same product
1038
- * must stay separate lines rather than merging into one.
1039
- */
1040
- bundleId?: string | null;
1041
- bundleTitle?: string | null;
1042
- /**
1043
- * Which configurator produced this bundle. Required once more than one can be published:
1044
- * the server validates a bundle against THIS configurator's rules, and the cart's reconfigure
1045
- * link reopens THIS one. Validating against "whichever is active" would check a build against
1046
- * the wrong rulebook.
1047
- */
1048
- bundleConfiguratorKey?: string | null;
1049
- /**
1050
- * How many copies of the whole configuration the customer ordered. `quantity` stays the
1051
- * EFFECTIVE figure so pricing, stock and orders need no change; `bundleUnitQuantity` keeps
1052
- * the per-bundle figure so the stepper can re-multiply without walking the wizard again.
1053
- */
1054
- bundleQuantity?: number;
1055
- bundleUnitQuantity?: number | null;
1056
1025
  /** Buyer-entered line note. Survives to the order and appears on the confirmation. */
1057
1026
  note?: string;
1058
1027
  }
1059
1028
 
1060
- declare const MAX_BUNDLE_QUANTITY = 99;
1061
- declare const normalizeBundleQuantity: (value: unknown) => number;
1062
- declare const bundleLineQuantity: (unitQuantity: number, bundleQuantity: number) => number;
1063
- declare const bundleUnitFrom: (line: {
1064
- bundleUnitQuantity?: number | null;
1065
- quantity: number;
1066
- bundleQuantity?: number | null;
1067
- }) => number;
1068
- interface BundleLine {
1069
- bundleId?: string | null;
1070
- bundleTitle?: string | null;
1071
- bundleQuantity?: number;
1072
- bundleUnitQuantity?: number | null;
1073
- pricing?: {
1074
- totalAmount?: number;
1075
- };
1076
- }
1077
- interface BundleGroup {
1078
- bundleId: string;
1079
- title: string;
1080
- quantity: number;
1081
- lines: number;
1082
- total: number;
1083
- }
1084
- declare const bundleGroupsOf: (items: BundleLine[]) => BundleGroup[];
1085
- declare const orderByBundle: <T extends BundleLine>(items: T[]) => T[];
1086
-
1087
1029
  interface StockDemandLine {
1088
1030
  key: string;
1089
1031
  quantity: number;
@@ -1441,4 +1383,4 @@ interface IWishlist extends BaseEntity {
1441
1383
  items: IWishlistItem[];
1442
1384
  }
1443
1385
 
1444
- export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ROLES, type AddonAmountInput, type AddonSelectionRef, type ApiResponse, type BaseEntity, type BundleGroup, type BundleLine, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_ISSUE_TYPE_VALUES, CART_STATUS_VALUES, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_ERROR_CODE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, DEFAULT_SUBSCRIPTION_TOPICS, DiscountTypeEnum, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogCitation, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICategory, type ICompliance, type IConfigurator, type IConfiguratorCondition, type IConfiguratorEffect, type IConfiguratorFacet, type IConfiguratorFacetValue, type IConfiguratorOption, type IConfiguratorPriceAdjustment, type IConfiguratorQuery, type IConfiguratorRule, type IConfiguratorSection, type IConfiguratorStep, type IConfiguratorTarget, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderTracking, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, type IProductOptionGroup, type IProductOptionValue, type IProductRelationGroup, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRedirect, type IRedirectSuggestion, type IRefundTransaction, type IRelationGroup, type ISEOMetaData, type ISelectableFee, type IShipFromAddress, type IShipping, type IShippingRate, type IState, type IStock, type IStore, type IStoreFee, type IStoreSettings, type ISubscriber, type ISubscriberConsent, type ISubscription, type ISummaryPricing, type ITechSpec, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, MAX_BUNDLE_QUANTITY, type Metadata, NOTIFICATION_TYPE_VALUES, NotificationTypeEnum, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PRICING_TYPE_VALUES, PRODUCT_EVENT_TYPE_VALUES, PURCHASE_ORDER_STATUSES, type Paginated, PaymentGatewayEnum, PaymentLinkStatusEnum, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductVariantType, QUOTE_ORDER_STATUSES, RETIRED_CART_STATUSES, type RedirectTargetType, type ResolvedAddonSelection, SALE_TYPE_VALUES, STOCK_STATUS_VALUES, STOCK_VERDICT_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SoftDeleteFilter, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StockVerdictType, SubscriptionChannelEnum, SubscriptionTopicEnum, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, bundleGroupsOf, bundleLineQuantity, bundleUnitFrom, canonicalizePath, canonicalizeSlug, conditionHolds, demandByKey, evaluateConfigurator, feeHint, formatMoney, groupHasDefaultAddon, isConfigurationValid, isQuoteOnlyItem, normalizeBundleQuantity, normalizeLineQuantity, normalizePath, notificationTypeColorMap, orderByBundle, orderLogTypeColorMap, paymentGatewayColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, resolveAddonSelections, resolveProductAddonGroups, roundMoney, saleTypeOf, statusColors, stockVerdict, toIdString, typeColorMap };
1386
+ export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ROLES, type AddonAmountInput, type AddonSelectionRef, type ApiResponse, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_ISSUE_TYPE_VALUES, CART_STATUS_VALUES, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_ERROR_CODE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, DEFAULT_SUBSCRIPTION_TOPICS, DiscountTypeEnum, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogCitation, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICategory, type ICompliance, type IConfigurator, type IConfiguratorCondition, type IConfiguratorEffect, type IConfiguratorFacet, type IConfiguratorFacetValue, type IConfiguratorOption, type IConfiguratorPriceAdjustment, type IConfiguratorQuery, type IConfiguratorRule, type IConfiguratorSection, type IConfiguratorStep, type IConfiguratorTarget, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, type IProductOptionGroup, type IProductOptionValue, type IProductRelationGroup, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRedirect, type IRedirectSuggestion, type IRefundTransaction, type IRelationGroup, type ISEOMetaData, type ISelectableFee, type IShipFromAddress, type IShipping, type IShippingRate, type IState, type IStock, type IStore, type IStoreFee, type IStoreSettings, type ISubscriber, type ISubscriberConsent, type ISubscription, type ISummaryPricing, type ITechSpec, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type Metadata, NOTIFICATION_TYPE_VALUES, NotificationTypeEnum, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PRICING_TYPE_VALUES, PRODUCT_EVENT_TYPE_VALUES, PURCHASE_ORDER_STATUSES, type Paginated, PaymentGatewayEnum, PaymentLinkStatusEnum, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductVariantType, QUOTE_ORDER_STATUSES, RETIRED_CART_STATUSES, type RedirectTargetType, type ResolvedAddonSelection, SALE_TYPE_VALUES, STOCK_STATUS_VALUES, STOCK_VERDICT_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SoftDeleteFilter, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StockVerdictType, SubscriptionChannelEnum, SubscriptionTopicEnum, TRANSACTION_TYPE_VALUES, TransactionTypeEnum, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, canonicalizePath, canonicalizeSlug, conditionHolds, demandByKey, evaluateConfigurator, feeHint, formatMoney, groupHasDefaultAddon, isConfigurationValid, isQuoteOnlyItem, normalizeLineQuantity, normalizePath, notificationTypeColorMap, orderLogTypeColorMap, paymentGatewayColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, resolveAddonSelections, resolveProductAddonGroups, roundMoney, saleTypeOf, statusColors, stockVerdict, toIdString, typeColorMap };
package/dist/index.js CHANGED
@@ -49,7 +49,6 @@ __export(index_exports, {
49
49
  FeeAppliesToEnum: () => FeeAppliesToEnum,
50
50
  INVENTORY_POLICY_VALUES: () => INVENTORY_POLICY_VALUES,
51
51
  InventoryPolicyEnum: () => InventoryPolicyEnum,
52
- MAX_BUNDLE_QUANTITY: () => MAX_BUNDLE_QUANTITY,
53
52
  NOTIFICATION_TYPE_VALUES: () => NOTIFICATION_TYPE_VALUES,
54
53
  NotificationTypeEnum: () => NotificationTypeEnum,
55
54
  ORDER_LOG_TYPE_VALUES: () => ORDER_LOG_TYPE_VALUES,
@@ -91,9 +90,6 @@ __export(index_exports, {
91
90
  adjustmentsFor: () => adjustmentsFor,
92
91
  applyPriceAdjustments: () => applyPriceAdjustments,
93
92
  baseUnitPriceOfLine: () => baseUnitPriceOfLine,
94
- bundleGroupsOf: () => bundleGroupsOf,
95
- bundleLineQuantity: () => bundleLineQuantity,
96
- bundleUnitFrom: () => bundleUnitFrom,
97
93
  canonicalizePath: () => canonicalizePath,
98
94
  canonicalizeSlug: () => canonicalizeSlug,
99
95
  conditionHolds: () => conditionHolds,
@@ -104,11 +100,9 @@ __export(index_exports, {
104
100
  groupHasDefaultAddon: () => groupHasDefaultAddon,
105
101
  isConfigurationValid: () => isConfigurationValid,
106
102
  isQuoteOnlyItem: () => isQuoteOnlyItem,
107
- normalizeBundleQuantity: () => normalizeBundleQuantity,
108
103
  normalizeLineQuantity: () => normalizeLineQuantity,
109
104
  normalizePath: () => normalizePath,
110
105
  notificationTypeColorMap: () => notificationTypeColorMap,
111
- orderByBundle: () => orderByBundle,
112
106
  orderLogTypeColorMap: () => orderLogTypeColorMap,
113
107
  paymentGatewayColorMap: () => paymentGatewayColorMap,
114
108
  paymentLinkStatusColorMap: () => paymentLinkStatusColorMap,
@@ -224,6 +218,7 @@ var EmailTemplateEventEnum = {
224
218
  QUOTE: "QUOTE",
225
219
  QUOTE_REQUESTED: "QUOTE_REQUESTED",
226
220
  QUOTE_SENT: "QUOTE_SENT",
221
+ QUOTE_DECLINED: "QUOTE_DECLINED",
227
222
  INVOICE: "INVOICE",
228
223
  PROMOTIONAL: "PROMOTIONAL",
229
224
  CONTACT_US: "CONTACT_US",
@@ -236,6 +231,7 @@ var WIRED_EMAIL_TEMPLATE_EVENTS = [
236
231
  EmailTemplateEventEnum.QUOTE,
237
232
  EmailTemplateEventEnum.QUOTE_REQUESTED,
238
233
  EmailTemplateEventEnum.QUOTE_SENT,
234
+ EmailTemplateEventEnum.QUOTE_DECLINED,
239
235
  EmailTemplateEventEnum.INVOICE,
240
236
  EmailTemplateEventEnum.WELCOME,
241
237
  EmailTemplateEventEnum.PASSWORD_RESET,
@@ -256,8 +252,7 @@ var EMAIL_TEMPLATE_VARIABLES_BY_EVENT = {
256
252
  "shippingAddress",
257
253
  "billingAddress",
258
254
  "shippingMethod",
259
- "paymentMethod",
260
- "trackingUrl"
255
+ "paymentMethod"
261
256
  ],
262
257
  [EmailTemplateEventEnum.ORDER_CANCELLED]: ["customerName", "orderId", "reason", "refundAmount"],
263
258
  [EmailTemplateEventEnum.QUOTE]: [
@@ -311,6 +306,7 @@ var EMAIL_TEMPLATE_VARIABLES_BY_EVENT = {
311
306
  "shippingAddress",
312
307
  "customerNote"
313
308
  ],
309
+ [EmailTemplateEventEnum.QUOTE_DECLINED]: ["customerName", "quoteId", "reason"],
314
310
  [EmailTemplateEventEnum.NOTIFICATION]: ["recipientName", "title", "message", "ctaLabel", "ctaUrl"],
315
311
  [EmailTemplateEventEnum.PROMOTIONAL]: ["recipientName", "headline", "body", "ctaLabel", "ctaUrl", "unsubscribeUrl"]
316
312
  };
@@ -699,7 +695,7 @@ var normalizePath = (input) => {
699
695
  };
700
696
  var canonicalizeSlug = (input) => {
701
697
  if (!input || typeof input !== "string") return "";
702
- return input.trim().toLowerCase().replace(/[\s_]+/g, "-").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "");
698
+ return input.trim().toLowerCase().replace(/\s+/g, "-").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "");
703
699
  };
704
700
  var canonicalizePath = (input) => {
705
701
  if (!input || typeof input !== "string") return "/";
@@ -851,47 +847,6 @@ var CartIssueTypes = {
851
847
  };
852
848
  var CART_ISSUE_TYPE_VALUES = Object.values(CartIssueTypes);
853
849
 
854
- // src/cartItem/bundle.ts
855
- var MAX_BUNDLE_QUANTITY = 99;
856
- var normalizeBundleQuantity = (value) => {
857
- const n = Math.floor(Number(value));
858
- if (!Number.isFinite(n) || n < 1) return 1;
859
- return Math.min(n, MAX_BUNDLE_QUANTITY);
860
- };
861
- var bundleLineQuantity = (unitQuantity, bundleQuantity) => Math.max(1, Math.floor(unitQuantity)) * normalizeBundleQuantity(bundleQuantity);
862
- var bundleUnitFrom = (line) => {
863
- if (line.bundleUnitQuantity != null) return Math.max(1, Math.floor(line.bundleUnitQuantity));
864
- const copies = normalizeBundleQuantity(line.bundleQuantity ?? 1);
865
- return Math.max(1, Math.floor(line.quantity / copies));
866
- };
867
- var bundleGroupsOf = (items) => {
868
- const byId = /* @__PURE__ */ new Map();
869
- for (const item of items) {
870
- const bundleId = item.bundleId;
871
- if (!bundleId) continue;
872
- const existing = byId.get(bundleId);
873
- if (existing) {
874
- existing.lines += 1;
875
- existing.total += item.pricing?.totalAmount ?? 0;
876
- continue;
877
- }
878
- byId.set(bundleId, {
879
- bundleId,
880
- title: item.bundleTitle || "Configured build",
881
- quantity: item.bundleQuantity ?? 1,
882
- lines: 1,
883
- total: item.pricing?.totalAmount ?? 0
884
- });
885
- }
886
- return [...byId.values()];
887
- };
888
- var orderByBundle = (items) => [...items].sort((a, b) => {
889
- const left = a.bundleId ?? "";
890
- const right = b.bundleId ?? "";
891
- if (!left !== !right) return left ? -1 : 1;
892
- return left.localeCompare(right);
893
- });
894
-
895
850
  // src/cartItem/stock.ts
896
851
  var demandByKey = (lines) => {
897
852
  const totals = /* @__PURE__ */ new Map();