@fas-core/shared-types 1.0.93 → 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 +1 -60
- package/dist/index.d.ts +1 -60
- package/dist/index.js +2 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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;
|
|
@@ -1033,58 +1022,10 @@ interface ICartItem extends BaseEntity {
|
|
|
1033
1022
|
variant?: IVariant;
|
|
1034
1023
|
pricing: ILinePricing;
|
|
1035
1024
|
metaData: Metadata;
|
|
1036
|
-
/**
|
|
1037
|
-
* Groups the lines produced by one configurator build so the cart renders and removes
|
|
1038
|
-
* them as a unit. Part of the line dedupe key — two bundles holding the same product
|
|
1039
|
-
* must stay separate lines rather than merging into one.
|
|
1040
|
-
*/
|
|
1041
|
-
bundleId?: string | null;
|
|
1042
|
-
bundleTitle?: string | null;
|
|
1043
|
-
/**
|
|
1044
|
-
* Which configurator produced this bundle. Required once more than one can be published:
|
|
1045
|
-
* the server validates a bundle against THIS configurator's rules, and the cart's reconfigure
|
|
1046
|
-
* link reopens THIS one. Validating against "whichever is active" would check a build against
|
|
1047
|
-
* the wrong rulebook.
|
|
1048
|
-
*/
|
|
1049
|
-
bundleConfiguratorKey?: string | null;
|
|
1050
|
-
/**
|
|
1051
|
-
* How many copies of the whole configuration the customer ordered. `quantity` stays the
|
|
1052
|
-
* EFFECTIVE figure so pricing, stock and orders need no change; `bundleUnitQuantity` keeps
|
|
1053
|
-
* the per-bundle figure so the stepper can re-multiply without walking the wizard again.
|
|
1054
|
-
*/
|
|
1055
|
-
bundleQuantity?: number;
|
|
1056
|
-
bundleUnitQuantity?: number | null;
|
|
1057
1025
|
/** Buyer-entered line note. Survives to the order and appears on the confirmation. */
|
|
1058
1026
|
note?: string;
|
|
1059
1027
|
}
|
|
1060
1028
|
|
|
1061
|
-
declare const MAX_BUNDLE_QUANTITY = 99;
|
|
1062
|
-
declare const normalizeBundleQuantity: (value: unknown) => number;
|
|
1063
|
-
declare const bundleLineQuantity: (unitQuantity: number, bundleQuantity: number) => number;
|
|
1064
|
-
declare const bundleUnitFrom: (line: {
|
|
1065
|
-
bundleUnitQuantity?: number | null;
|
|
1066
|
-
quantity: number;
|
|
1067
|
-
bundleQuantity?: number | null;
|
|
1068
|
-
}) => number;
|
|
1069
|
-
interface BundleLine {
|
|
1070
|
-
bundleId?: string | null;
|
|
1071
|
-
bundleTitle?: string | null;
|
|
1072
|
-
bundleQuantity?: number;
|
|
1073
|
-
bundleUnitQuantity?: number | null;
|
|
1074
|
-
pricing?: {
|
|
1075
|
-
totalAmount?: number;
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
interface BundleGroup {
|
|
1079
|
-
bundleId: string;
|
|
1080
|
-
title: string;
|
|
1081
|
-
quantity: number;
|
|
1082
|
-
lines: number;
|
|
1083
|
-
total: number;
|
|
1084
|
-
}
|
|
1085
|
-
declare const bundleGroupsOf: (items: BundleLine[]) => BundleGroup[];
|
|
1086
|
-
declare const orderByBundle: <T extends BundleLine>(items: T[]) => T[];
|
|
1087
|
-
|
|
1088
1029
|
interface StockDemandLine {
|
|
1089
1030
|
key: string;
|
|
1090
1031
|
quantity: number;
|
|
@@ -1442,4 +1383,4 @@ interface IWishlist extends BaseEntity {
|
|
|
1442
1383
|
items: IWishlistItem[];
|
|
1443
1384
|
}
|
|
1444
1385
|
|
|
1445
|
-
export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ROLES, type AddonAmountInput, type AddonSelectionRef, type ApiResponse, type BaseEntity,
|
|
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;
|
|
@@ -1033,58 +1022,10 @@ interface ICartItem extends BaseEntity {
|
|
|
1033
1022
|
variant?: IVariant;
|
|
1034
1023
|
pricing: ILinePricing;
|
|
1035
1024
|
metaData: Metadata;
|
|
1036
|
-
/**
|
|
1037
|
-
* Groups the lines produced by one configurator build so the cart renders and removes
|
|
1038
|
-
* them as a unit. Part of the line dedupe key — two bundles holding the same product
|
|
1039
|
-
* must stay separate lines rather than merging into one.
|
|
1040
|
-
*/
|
|
1041
|
-
bundleId?: string | null;
|
|
1042
|
-
bundleTitle?: string | null;
|
|
1043
|
-
/**
|
|
1044
|
-
* Which configurator produced this bundle. Required once more than one can be published:
|
|
1045
|
-
* the server validates a bundle against THIS configurator's rules, and the cart's reconfigure
|
|
1046
|
-
* link reopens THIS one. Validating against "whichever is active" would check a build against
|
|
1047
|
-
* the wrong rulebook.
|
|
1048
|
-
*/
|
|
1049
|
-
bundleConfiguratorKey?: string | null;
|
|
1050
|
-
/**
|
|
1051
|
-
* How many copies of the whole configuration the customer ordered. `quantity` stays the
|
|
1052
|
-
* EFFECTIVE figure so pricing, stock and orders need no change; `bundleUnitQuantity` keeps
|
|
1053
|
-
* the per-bundle figure so the stepper can re-multiply without walking the wizard again.
|
|
1054
|
-
*/
|
|
1055
|
-
bundleQuantity?: number;
|
|
1056
|
-
bundleUnitQuantity?: number | null;
|
|
1057
1025
|
/** Buyer-entered line note. Survives to the order and appears on the confirmation. */
|
|
1058
1026
|
note?: string;
|
|
1059
1027
|
}
|
|
1060
1028
|
|
|
1061
|
-
declare const MAX_BUNDLE_QUANTITY = 99;
|
|
1062
|
-
declare const normalizeBundleQuantity: (value: unknown) => number;
|
|
1063
|
-
declare const bundleLineQuantity: (unitQuantity: number, bundleQuantity: number) => number;
|
|
1064
|
-
declare const bundleUnitFrom: (line: {
|
|
1065
|
-
bundleUnitQuantity?: number | null;
|
|
1066
|
-
quantity: number;
|
|
1067
|
-
bundleQuantity?: number | null;
|
|
1068
|
-
}) => number;
|
|
1069
|
-
interface BundleLine {
|
|
1070
|
-
bundleId?: string | null;
|
|
1071
|
-
bundleTitle?: string | null;
|
|
1072
|
-
bundleQuantity?: number;
|
|
1073
|
-
bundleUnitQuantity?: number | null;
|
|
1074
|
-
pricing?: {
|
|
1075
|
-
totalAmount?: number;
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
interface BundleGroup {
|
|
1079
|
-
bundleId: string;
|
|
1080
|
-
title: string;
|
|
1081
|
-
quantity: number;
|
|
1082
|
-
lines: number;
|
|
1083
|
-
total: number;
|
|
1084
|
-
}
|
|
1085
|
-
declare const bundleGroupsOf: (items: BundleLine[]) => BundleGroup[];
|
|
1086
|
-
declare const orderByBundle: <T extends BundleLine>(items: T[]) => T[];
|
|
1087
|
-
|
|
1088
1029
|
interface StockDemandLine {
|
|
1089
1030
|
key: string;
|
|
1090
1031
|
quantity: number;
|
|
@@ -1442,4 +1383,4 @@ interface IWishlist extends BaseEntity {
|
|
|
1442
1383
|
items: IWishlistItem[];
|
|
1443
1384
|
}
|
|
1444
1385
|
|
|
1445
|
-
export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ROLES, type AddonAmountInput, type AddonSelectionRef, type ApiResponse, type BaseEntity,
|
|
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,
|
|
@@ -258,8 +252,7 @@ var EMAIL_TEMPLATE_VARIABLES_BY_EVENT = {
|
|
|
258
252
|
"shippingAddress",
|
|
259
253
|
"billingAddress",
|
|
260
254
|
"shippingMethod",
|
|
261
|
-
"paymentMethod"
|
|
262
|
-
"trackingUrl"
|
|
255
|
+
"paymentMethod"
|
|
263
256
|
],
|
|
264
257
|
[EmailTemplateEventEnum.ORDER_CANCELLED]: ["customerName", "orderId", "reason", "refundAmount"],
|
|
265
258
|
[EmailTemplateEventEnum.QUOTE]: [
|
|
@@ -702,7 +695,7 @@ var normalizePath = (input) => {
|
|
|
702
695
|
};
|
|
703
696
|
var canonicalizeSlug = (input) => {
|
|
704
697
|
if (!input || typeof input !== "string") return "";
|
|
705
|
-
return input.trim().toLowerCase().replace(
|
|
698
|
+
return input.trim().toLowerCase().replace(/\s+/g, "-").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "");
|
|
706
699
|
};
|
|
707
700
|
var canonicalizePath = (input) => {
|
|
708
701
|
if (!input || typeof input !== "string") return "/";
|
|
@@ -854,47 +847,6 @@ var CartIssueTypes = {
|
|
|
854
847
|
};
|
|
855
848
|
var CART_ISSUE_TYPE_VALUES = Object.values(CartIssueTypes);
|
|
856
849
|
|
|
857
|
-
// src/cartItem/bundle.ts
|
|
858
|
-
var MAX_BUNDLE_QUANTITY = 99;
|
|
859
|
-
var normalizeBundleQuantity = (value) => {
|
|
860
|
-
const n = Math.floor(Number(value));
|
|
861
|
-
if (!Number.isFinite(n) || n < 1) return 1;
|
|
862
|
-
return Math.min(n, MAX_BUNDLE_QUANTITY);
|
|
863
|
-
};
|
|
864
|
-
var bundleLineQuantity = (unitQuantity, bundleQuantity) => Math.max(1, Math.floor(unitQuantity)) * normalizeBundleQuantity(bundleQuantity);
|
|
865
|
-
var bundleUnitFrom = (line) => {
|
|
866
|
-
if (line.bundleUnitQuantity != null) return Math.max(1, Math.floor(line.bundleUnitQuantity));
|
|
867
|
-
const copies = normalizeBundleQuantity(line.bundleQuantity ?? 1);
|
|
868
|
-
return Math.max(1, Math.floor(line.quantity / copies));
|
|
869
|
-
};
|
|
870
|
-
var bundleGroupsOf = (items) => {
|
|
871
|
-
const byId = /* @__PURE__ */ new Map();
|
|
872
|
-
for (const item of items) {
|
|
873
|
-
const bundleId = item.bundleId;
|
|
874
|
-
if (!bundleId) continue;
|
|
875
|
-
const existing = byId.get(bundleId);
|
|
876
|
-
if (existing) {
|
|
877
|
-
existing.lines += 1;
|
|
878
|
-
existing.total += item.pricing?.totalAmount ?? 0;
|
|
879
|
-
continue;
|
|
880
|
-
}
|
|
881
|
-
byId.set(bundleId, {
|
|
882
|
-
bundleId,
|
|
883
|
-
title: item.bundleTitle || "Configured build",
|
|
884
|
-
quantity: item.bundleQuantity ?? 1,
|
|
885
|
-
lines: 1,
|
|
886
|
-
total: item.pricing?.totalAmount ?? 0
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
return [...byId.values()];
|
|
890
|
-
};
|
|
891
|
-
var orderByBundle = (items) => [...items].sort((a, b) => {
|
|
892
|
-
const left = a.bundleId ?? "";
|
|
893
|
-
const right = b.bundleId ?? "";
|
|
894
|
-
if (!left !== !right) return left ? -1 : 1;
|
|
895
|
-
return left.localeCompare(right);
|
|
896
|
-
});
|
|
897
|
-
|
|
898
850
|
// src/cartItem/stock.ts
|
|
899
851
|
var demandByKey = (lines) => {
|
|
900
852
|
const totals = /* @__PURE__ */ new Map();
|