@fas-core/shared-types 1.0.107 → 1.0.108

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
@@ -82,6 +82,7 @@ interface ISummaryPricing {
82
82
  discountAmount: number;
83
83
  taxAmount: number;
84
84
  shippingAmount: number;
85
+ handlingAmount?: number;
85
86
  feesAmount?: number;
86
87
  appliedFees?: IAppliedFee[];
87
88
  totalAmount: number;
@@ -134,6 +135,25 @@ interface IShippingRate {
134
135
  deliveryDays: number | null;
135
136
  estimatedDelivery: string | null;
136
137
  }
138
+ interface RateAddress {
139
+ addressee?: string;
140
+ addr1?: string;
141
+ addr2?: string;
142
+ city?: string;
143
+ state?: string;
144
+ zip?: string;
145
+ countryCode?: string;
146
+ isResidential?: boolean;
147
+ }
148
+ interface RatedShippingMethod {
149
+ id: string;
150
+ name: string;
151
+ shipping: number;
152
+ handling: number;
153
+ total: number;
154
+ free: boolean;
155
+ estimated: boolean;
156
+ }
137
157
 
138
158
  interface IStoreSettings {
139
159
  logo: string;
@@ -707,8 +727,22 @@ type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
707
727
  declare const ORDER_STATUS_VALUES: ("CANCELLED" | "REFUNDED" | "PARTIALLY_REFUNDED" | "CREATED" | "PAYMENT_FAILED" | "PENDING_APPROVAL" | "PENDING_FULFILLMENT" | "PARTIALLY_FULFILLED" | "PENDING_BILLING" | "BILLED" | "CLOSED" | "PENDING_RECEIPT" | "PENDING_REFUND" | "QUOTE_REQUESTED" | "QUOTE_OPEN" | "QUOTE_APPROVED" | "QUOTE_PROCESSED" | "QUOTE_CLOSED" | "QUOTE_VOIDED" | "QUOTE_EXPIRED")[];
708
728
  declare const statusColors: Record<OrderStatusEnum, string>;
709
729
  declare const PURCHASE_ORDER_STATUSES: OrderStatusEnum[];
730
+ declare const PLACED_OPEN_ORDER_STATUSES: OrderStatusEnum[];
731
+ declare const UNPLACED_ORDER_STATUSES: OrderStatusEnum[];
710
732
  declare const OPEN_ORDER_STATUSES: OrderStatusEnum[];
711
733
  declare const QUOTE_ORDER_STATUSES: OrderStatusEnum[];
734
+ declare const StatusToneEnum: {
735
+ readonly DONE: "done";
736
+ readonly MOVING: "moving";
737
+ readonly WAITING: "waiting";
738
+ readonly STOPPED: "stopped";
739
+ readonly CLOSED: "closed";
740
+ };
741
+ type StatusToneEnum = (typeof StatusToneEnum)[keyof typeof StatusToneEnum];
742
+ declare const STATUS_TONE_VALUES: ("done" | "moving" | "waiting" | "stopped" | "closed")[];
743
+ declare const statusTones: Record<OrderStatusEnum, StatusToneEnum>;
744
+ declare const statusTone: (status?: string) => StatusToneEnum;
745
+ declare const netsuiteStatusLabel: (status?: string, netsuiteStatusText?: string) => string;
712
746
  interface IOrder extends BaseEntity {
713
747
  orderId: string;
714
748
  orderItems: IOrderItem[];
@@ -720,6 +754,11 @@ interface IOrder extends BaseEntity {
720
754
  sourceQuote?: IOrder | string;
721
755
  convertedOrder?: IOrder | string;
722
756
  quoteValidUntil?: Date;
757
+ quotePricedAt?: Date;
758
+ quoteApprovedAt?: Date;
759
+ quoteReadyEmailedAt?: Date;
760
+ quoteReadyEmailedTotal?: number;
761
+ quoteReadyEmailedLines?: string;
723
762
  paymentStatus: PaymentStatusEnum;
724
763
  paymentMethod: PaymentMethodEnum;
725
764
  paymentGateway: PaymentGatewayEnum;
@@ -730,6 +769,7 @@ interface IOrder extends BaseEntity {
730
769
  tax?: AppliedTax | null;
731
770
  acceptedTermsAt: Date;
732
771
  customerNote: string;
772
+ poNumber?: string;
733
773
  netsuite?: INetsuiteOrderLink | null;
734
774
  netsuiteLastError?: {
735
775
  message: string;
@@ -744,6 +784,7 @@ interface IOrder extends BaseEntity {
744
784
 
745
785
  interface ICustomer extends BaseEntity {
746
786
  netsuiteId: string;
787
+ netsuiteEntityId: string;
747
788
  firstName: string;
748
789
  lastName: string;
749
790
  profileImage: string;
@@ -1454,6 +1495,9 @@ interface IPaymentLink extends BaseEntity {
1454
1495
  createdBy?: string;
1455
1496
  baseUrl: string;
1456
1497
  }
1498
+ interface PaymentLinkView extends IPaymentLink {
1499
+ url: string;
1500
+ }
1457
1501
 
1458
1502
  declare const SubscriptionChannelEnum: {
1459
1503
  readonly EMAIL: "EMAIL";
@@ -6040,10 +6084,9 @@ interface NetsuiteLinkResult {
6040
6084
  declare const NetsuiteRecordTypeEnum: {
6041
6085
  readonly SALES_ORDER: "salesOrder";
6042
6086
  readonly ESTIMATE: "estimate";
6043
- readonly CASH_SALE: "cashSale";
6044
6087
  };
6045
6088
  type NetsuiteRecordTypeEnum = (typeof NetsuiteRecordTypeEnum)[keyof typeof NetsuiteRecordTypeEnum];
6046
- declare const NETSUITE_RECORD_TYPE_VALUES: ("salesOrder" | "estimate" | "cashSale")[];
6089
+ declare const NETSUITE_RECORD_TYPE_VALUES: ("salesOrder" | "estimate")[];
6047
6090
  declare const PushCheckStatusEnum: {
6048
6091
  readonly PASS: "pass";
6049
6092
  readonly WARN: "warn";
@@ -6147,41 +6190,35 @@ interface NetsuiteSyncDefinition {
6147
6190
  fields: string[];
6148
6191
  source: string;
6149
6192
  }
6150
- interface NetsuiteCashSaleCheck {
6151
- key: string;
6152
- label: string;
6153
- status: "pass" | "fail";
6154
- detail?: string;
6155
- }
6156
- interface NetsuiteCashSaleReceipt {
6157
- id: string;
6158
- tranId?: string;
6159
- status?: string;
6160
- total?: number;
6161
- postingPeriod?: string;
6162
- paymentReference?: string;
6163
- createdFrom?: string;
6164
- recordUrl?: string;
6193
+ interface NetsuitePushAttempt {
6194
+ attempt: number;
6195
+ status: "ok" | "retrying" | "failed";
6196
+ ms: number;
6165
6197
  httpStatus?: number;
6166
- pushedAt?: Date | string;
6167
- checks?: NetsuiteCashSaleCheck[];
6168
- totalMismatch?: {
6169
- charged: number;
6170
- landed: number;
6171
- drift: number;
6172
- };
6173
- lastError?: {
6174
- message: string;
6175
- failedAt?: Date | string;
6176
- };
6198
+ error?: string;
6177
6199
  }
6178
- interface NetsuiteCashSalePreview {
6200
+ interface NetsuitePushOutcome {
6179
6201
  orderId: string;
6180
- checks: NetsuiteCashSaleCheck[];
6181
- blockers: string[];
6182
- canBill: boolean;
6183
- writesEnabled: boolean;
6184
- alreadyBilled: NetsuiteCashSaleReceipt | null;
6202
+ recordType: string;
6203
+ netsuiteId?: string;
6204
+ receipt?: NetsuiteReceipt;
6205
+ skipped?: string;
6206
+ payload?: Record<string, unknown>;
6207
+ attempts?: NetsuitePushAttempt[];
6208
+ }
6209
+ interface NetsuiteStatusChange {
6210
+ orderId: string;
6211
+ netsuiteId: string;
6212
+ from?: string;
6213
+ to: string;
6214
+ localStatus?: string;
6215
+ }
6216
+ interface NetsuiteStatusSyncResult {
6217
+ checked: number;
6218
+ changed: number;
6219
+ statusChanges: NetsuiteStatusChange[];
6220
+ shipmentsUpdated: number;
6221
+ fulfillments: number;
6185
6222
  }
6186
6223
 
6187
6224
  interface RevalidationResult {
@@ -6231,6 +6268,7 @@ interface CheckoutPayload {
6231
6268
  shippingMethod?: string;
6232
6269
  acceptedTerms: boolean;
6233
6270
  customerNote?: string;
6271
+ poNumber?: string;
6234
6272
  }
6235
6273
  interface CheckoutResult {
6236
6274
  order: IOrder;
@@ -6287,4 +6325,4 @@ interface IWishlist extends BaseEntity {
6287
6325
  items: IWishlistItem[];
6288
6326
  }
6289
6327
 
6290
- export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ACTIONS, ADMIN_AUDIT_ACTIONS, ADMIN_RESOURCES, ADMIN_RESOURCE_LIST, ALL_STORES, AWAITING_PAYMENT_STATUSES, type AddonAmountInput, type AddonGroupNetsuiteLink, type AddonNetsuiteLink, type AddonSelectionRef, type AddonSnapshot, type ApiResponse, type AppliedTax, BRAND_FIELDS, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_STATUS_VALUES, CATEGORY_FIELDS, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, type CacheStatus, type CacheStoreTarget, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CategoryImportSummary, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, type CouponNetsuiteLink, DEFAULT_SUBSCRIPTION_TOPICS, DISCOUNT_TYPE_VALUES, DiscountTypeEnum, EMAIL_PARAM_MISMATCH_KIND_VALUES, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EMPTY_ACCESS, type EffectiveAccess, type EmailParamMismatch, EmailParamMismatchKindEnum, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type FieldMap, type FieldMapping, type FieldSource, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminAction, type IAdminAuditAction, type IAdminAuditLog, type IAdminBaseAction, type IAdminPermission, type IAdminResource, type IAdminRole, type IAdminRoleCreate, type IAdminSafe, type IAdminStoreAccess, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICartServicePlanSnapshot, type ICategory, type ICategorySubcategory, 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 ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INetsuiteEvent, type INetsuiteOrderLink, type INetsuiteQueueEntry, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderShipment, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, 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 IServicePlan, 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 ITaxRate, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type LineChargeInput, type MatchResult, type Metadata, NETSUITE_EVENT_STATE_VALUES, NETSUITE_OWNED_FIELDS, NETSUITE_RECORD_TYPE_VALUES, NETSUITE_RELATION_GROUPS, NOTIFICATION_TYPE_VALUES, type NetsuiteCashSaleCheck, type NetsuiteCashSalePreview, type NetsuiteCashSaleReceipt, NetsuiteEventStateEnum, NetsuiteFieldProvider, type NetsuiteLinkResult, type NetsuiteOrderPreview, type NetsuiteOwnedEntity, type NetsuitePreviewLine, type NetsuiteReceipt, NetsuiteRecordTypeEnum, type NetsuiteRelationSource, type NetsuiteSyncDefinition, NotificationTypeEnum, OPEN_ORDER_STATUSES, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, type OfferedAddon, type OfferedAddonGroup, type OfferedServicePlan, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PRICING_TYPE_VALUES, PRODUCT_FIELDS, PRODUCT_VARIANT_TYPE_VALUES, PROVIDERS, PURCHASE_ORDER_STATUSES, PUSH_CHECK_STATUS_VALUES, PaymentGatewayEnum, PaymentLinkStatusEnum, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductServicePlanScope, type ProductVariantType, ProductVariantTypeEnum, type PromotionSyncResult, type PushCheck, PushCheckStatusEnum, type PushField, QUOTE_ORDER_STATUSES, RELATION_FIELDS, RESOURCE_OPERATIONS, RETIRED_CART_STATUSES, type RedirectTargetType, type ResolveAccessInput, type ResolvedAddonSelection, type RevalidationResult, SALE_TYPE_VALUES, SERVICE_PLAN_ELIGIBILITY_FIELD, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SelectedShippingMethod, type ServicePlanNetsuiteLink, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StoreAccessCheckInput, type StoreScopeInput, SubscriptionChannelEnum, SubscriptionTopicEnum, type SyncPolicy, type SyncRisk, TAX_RATE_SOURCE_VALUES, TRANSACTION_TYPE_VALUES, TaxRateSourceEnum, type TaxSyncResult, TransactionTypeEnum, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, actionsForResource, addonFields, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, blogAuthorFields, blogCategoryFields, blogPostFields, brandFields, can, canAny, canonicalizePath, canonicalizeSlug, categoryFields, chargesOfLine, conditionHolds, couponFields, demandByKey, evaluateConfigurator, feeHint, formatMoney, grantedPermissions, groupHasDefaultAddon, hasStoreAccess, isConfigurationValid, isNetsuiteOwned, isNonEmptyString, isQuoteOnlyItem, isValidAction, isValidEmail, missingGrants, netsuiteFieldCaution, netsuiteFieldConditional, netsuiteFieldNote, netsuiteFieldRisk, netsuiteFieldSource, netsuiteRelationSource, normalizeLineQuantity, normalizeNumber, normalizePath, orderLogTypeColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, podcastFields, productFields, readMapped, resolveAddonSelections, resolveEffectivePermissions, resolveProductAddonGroups, resolveProductServicePlans, resolveStoreScope, roundMoney, saleTypeOf, servicePlanFields, statusColors, stockVerdict, syncOwnerFor, toIdString, typeColorMap };
6328
+ export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ACTIONS, ADMIN_AUDIT_ACTIONS, ADMIN_RESOURCES, ADMIN_RESOURCE_LIST, ALL_STORES, AWAITING_PAYMENT_STATUSES, type AddonAmountInput, type AddonGroupNetsuiteLink, type AddonNetsuiteLink, type AddonSelectionRef, type AddonSnapshot, type ApiResponse, type AppliedTax, BRAND_FIELDS, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_STATUS_VALUES, CATEGORY_FIELDS, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, type CacheStatus, type CacheStoreTarget, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CategoryImportSummary, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, type CouponNetsuiteLink, DEFAULT_SUBSCRIPTION_TOPICS, DISCOUNT_TYPE_VALUES, DiscountTypeEnum, EMAIL_PARAM_MISMATCH_KIND_VALUES, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EMPTY_ACCESS, type EffectiveAccess, type EmailParamMismatch, EmailParamMismatchKindEnum, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type FieldMap, type FieldMapping, type FieldSource, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminAction, type IAdminAuditAction, type IAdminAuditLog, type IAdminBaseAction, type IAdminPermission, type IAdminResource, type IAdminRole, type IAdminRoleCreate, type IAdminSafe, type IAdminStoreAccess, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICartServicePlanSnapshot, type ICategory, type ICategorySubcategory, 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 ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INetsuiteEvent, type INetsuiteOrderLink, type INetsuiteQueueEntry, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderShipment, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, 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 IServicePlan, 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 ITaxRate, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type LineChargeInput, type MatchResult, type Metadata, NETSUITE_EVENT_STATE_VALUES, NETSUITE_OWNED_FIELDS, NETSUITE_RECORD_TYPE_VALUES, NETSUITE_RELATION_GROUPS, NOTIFICATION_TYPE_VALUES, NetsuiteEventStateEnum, NetsuiteFieldProvider, type NetsuiteLinkResult, type NetsuiteOrderPreview, type NetsuiteOwnedEntity, type NetsuitePreviewLine, type NetsuitePushAttempt, type NetsuitePushOutcome, type NetsuiteReceipt, NetsuiteRecordTypeEnum, type NetsuiteRelationSource, type NetsuiteStatusChange, type NetsuiteStatusSyncResult, type NetsuiteSyncDefinition, NotificationTypeEnum, OPEN_ORDER_STATUSES, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, type OfferedAddon, type OfferedAddonGroup, type OfferedServicePlan, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PLACED_OPEN_ORDER_STATUSES, PRICING_TYPE_VALUES, PRODUCT_FIELDS, PRODUCT_VARIANT_TYPE_VALUES, PROVIDERS, PURCHASE_ORDER_STATUSES, PUSH_CHECK_STATUS_VALUES, PaymentGatewayEnum, PaymentLinkStatusEnum, type PaymentLinkView, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductServicePlanScope, type ProductVariantType, ProductVariantTypeEnum, type PromotionSyncResult, type PushCheck, PushCheckStatusEnum, type PushField, QUOTE_ORDER_STATUSES, RELATION_FIELDS, RESOURCE_OPERATIONS, RETIRED_CART_STATUSES, type RateAddress, type RatedShippingMethod, type RedirectTargetType, type ResolveAccessInput, type ResolvedAddonSelection, type RevalidationResult, SALE_TYPE_VALUES, SERVICE_PLAN_ELIGIBILITY_FIELD, STATUS_TONE_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SelectedShippingMethod, type ServicePlanNetsuiteLink, StatusToneEnum, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StoreAccessCheckInput, type StoreScopeInput, SubscriptionChannelEnum, SubscriptionTopicEnum, type SyncPolicy, type SyncRisk, TAX_RATE_SOURCE_VALUES, TRANSACTION_TYPE_VALUES, TaxRateSourceEnum, type TaxSyncResult, TransactionTypeEnum, UNPLACED_ORDER_STATUSES, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, actionsForResource, addonFields, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, blogAuthorFields, blogCategoryFields, blogPostFields, brandFields, can, canAny, canonicalizePath, canonicalizeSlug, categoryFields, chargesOfLine, conditionHolds, couponFields, demandByKey, evaluateConfigurator, feeHint, formatMoney, grantedPermissions, groupHasDefaultAddon, hasStoreAccess, isConfigurationValid, isNetsuiteOwned, isNonEmptyString, isQuoteOnlyItem, isValidAction, isValidEmail, missingGrants, netsuiteFieldCaution, netsuiteFieldConditional, netsuiteFieldNote, netsuiteFieldRisk, netsuiteFieldSource, netsuiteRelationSource, netsuiteStatusLabel, normalizeLineQuantity, normalizeNumber, normalizePath, orderLogTypeColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, podcastFields, productFields, readMapped, resolveAddonSelections, resolveEffectivePermissions, resolveProductAddonGroups, resolveProductServicePlans, resolveStoreScope, roundMoney, saleTypeOf, servicePlanFields, statusColors, statusTone, statusTones, stockVerdict, syncOwnerFor, toIdString, typeColorMap };
package/dist/index.d.ts CHANGED
@@ -82,6 +82,7 @@ interface ISummaryPricing {
82
82
  discountAmount: number;
83
83
  taxAmount: number;
84
84
  shippingAmount: number;
85
+ handlingAmount?: number;
85
86
  feesAmount?: number;
86
87
  appliedFees?: IAppliedFee[];
87
88
  totalAmount: number;
@@ -134,6 +135,25 @@ interface IShippingRate {
134
135
  deliveryDays: number | null;
135
136
  estimatedDelivery: string | null;
136
137
  }
138
+ interface RateAddress {
139
+ addressee?: string;
140
+ addr1?: string;
141
+ addr2?: string;
142
+ city?: string;
143
+ state?: string;
144
+ zip?: string;
145
+ countryCode?: string;
146
+ isResidential?: boolean;
147
+ }
148
+ interface RatedShippingMethod {
149
+ id: string;
150
+ name: string;
151
+ shipping: number;
152
+ handling: number;
153
+ total: number;
154
+ free: boolean;
155
+ estimated: boolean;
156
+ }
137
157
 
138
158
  interface IStoreSettings {
139
159
  logo: string;
@@ -707,8 +727,22 @@ type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];
707
727
  declare const ORDER_STATUS_VALUES: ("CANCELLED" | "REFUNDED" | "PARTIALLY_REFUNDED" | "CREATED" | "PAYMENT_FAILED" | "PENDING_APPROVAL" | "PENDING_FULFILLMENT" | "PARTIALLY_FULFILLED" | "PENDING_BILLING" | "BILLED" | "CLOSED" | "PENDING_RECEIPT" | "PENDING_REFUND" | "QUOTE_REQUESTED" | "QUOTE_OPEN" | "QUOTE_APPROVED" | "QUOTE_PROCESSED" | "QUOTE_CLOSED" | "QUOTE_VOIDED" | "QUOTE_EXPIRED")[];
708
728
  declare const statusColors: Record<OrderStatusEnum, string>;
709
729
  declare const PURCHASE_ORDER_STATUSES: OrderStatusEnum[];
730
+ declare const PLACED_OPEN_ORDER_STATUSES: OrderStatusEnum[];
731
+ declare const UNPLACED_ORDER_STATUSES: OrderStatusEnum[];
710
732
  declare const OPEN_ORDER_STATUSES: OrderStatusEnum[];
711
733
  declare const QUOTE_ORDER_STATUSES: OrderStatusEnum[];
734
+ declare const StatusToneEnum: {
735
+ readonly DONE: "done";
736
+ readonly MOVING: "moving";
737
+ readonly WAITING: "waiting";
738
+ readonly STOPPED: "stopped";
739
+ readonly CLOSED: "closed";
740
+ };
741
+ type StatusToneEnum = (typeof StatusToneEnum)[keyof typeof StatusToneEnum];
742
+ declare const STATUS_TONE_VALUES: ("done" | "moving" | "waiting" | "stopped" | "closed")[];
743
+ declare const statusTones: Record<OrderStatusEnum, StatusToneEnum>;
744
+ declare const statusTone: (status?: string) => StatusToneEnum;
745
+ declare const netsuiteStatusLabel: (status?: string, netsuiteStatusText?: string) => string;
712
746
  interface IOrder extends BaseEntity {
713
747
  orderId: string;
714
748
  orderItems: IOrderItem[];
@@ -720,6 +754,11 @@ interface IOrder extends BaseEntity {
720
754
  sourceQuote?: IOrder | string;
721
755
  convertedOrder?: IOrder | string;
722
756
  quoteValidUntil?: Date;
757
+ quotePricedAt?: Date;
758
+ quoteApprovedAt?: Date;
759
+ quoteReadyEmailedAt?: Date;
760
+ quoteReadyEmailedTotal?: number;
761
+ quoteReadyEmailedLines?: string;
723
762
  paymentStatus: PaymentStatusEnum;
724
763
  paymentMethod: PaymentMethodEnum;
725
764
  paymentGateway: PaymentGatewayEnum;
@@ -730,6 +769,7 @@ interface IOrder extends BaseEntity {
730
769
  tax?: AppliedTax | null;
731
770
  acceptedTermsAt: Date;
732
771
  customerNote: string;
772
+ poNumber?: string;
733
773
  netsuite?: INetsuiteOrderLink | null;
734
774
  netsuiteLastError?: {
735
775
  message: string;
@@ -744,6 +784,7 @@ interface IOrder extends BaseEntity {
744
784
 
745
785
  interface ICustomer extends BaseEntity {
746
786
  netsuiteId: string;
787
+ netsuiteEntityId: string;
747
788
  firstName: string;
748
789
  lastName: string;
749
790
  profileImage: string;
@@ -1454,6 +1495,9 @@ interface IPaymentLink extends BaseEntity {
1454
1495
  createdBy?: string;
1455
1496
  baseUrl: string;
1456
1497
  }
1498
+ interface PaymentLinkView extends IPaymentLink {
1499
+ url: string;
1500
+ }
1457
1501
 
1458
1502
  declare const SubscriptionChannelEnum: {
1459
1503
  readonly EMAIL: "EMAIL";
@@ -6040,10 +6084,9 @@ interface NetsuiteLinkResult {
6040
6084
  declare const NetsuiteRecordTypeEnum: {
6041
6085
  readonly SALES_ORDER: "salesOrder";
6042
6086
  readonly ESTIMATE: "estimate";
6043
- readonly CASH_SALE: "cashSale";
6044
6087
  };
6045
6088
  type NetsuiteRecordTypeEnum = (typeof NetsuiteRecordTypeEnum)[keyof typeof NetsuiteRecordTypeEnum];
6046
- declare const NETSUITE_RECORD_TYPE_VALUES: ("salesOrder" | "estimate" | "cashSale")[];
6089
+ declare const NETSUITE_RECORD_TYPE_VALUES: ("salesOrder" | "estimate")[];
6047
6090
  declare const PushCheckStatusEnum: {
6048
6091
  readonly PASS: "pass";
6049
6092
  readonly WARN: "warn";
@@ -6147,41 +6190,35 @@ interface NetsuiteSyncDefinition {
6147
6190
  fields: string[];
6148
6191
  source: string;
6149
6192
  }
6150
- interface NetsuiteCashSaleCheck {
6151
- key: string;
6152
- label: string;
6153
- status: "pass" | "fail";
6154
- detail?: string;
6155
- }
6156
- interface NetsuiteCashSaleReceipt {
6157
- id: string;
6158
- tranId?: string;
6159
- status?: string;
6160
- total?: number;
6161
- postingPeriod?: string;
6162
- paymentReference?: string;
6163
- createdFrom?: string;
6164
- recordUrl?: string;
6193
+ interface NetsuitePushAttempt {
6194
+ attempt: number;
6195
+ status: "ok" | "retrying" | "failed";
6196
+ ms: number;
6165
6197
  httpStatus?: number;
6166
- pushedAt?: Date | string;
6167
- checks?: NetsuiteCashSaleCheck[];
6168
- totalMismatch?: {
6169
- charged: number;
6170
- landed: number;
6171
- drift: number;
6172
- };
6173
- lastError?: {
6174
- message: string;
6175
- failedAt?: Date | string;
6176
- };
6198
+ error?: string;
6177
6199
  }
6178
- interface NetsuiteCashSalePreview {
6200
+ interface NetsuitePushOutcome {
6179
6201
  orderId: string;
6180
- checks: NetsuiteCashSaleCheck[];
6181
- blockers: string[];
6182
- canBill: boolean;
6183
- writesEnabled: boolean;
6184
- alreadyBilled: NetsuiteCashSaleReceipt | null;
6202
+ recordType: string;
6203
+ netsuiteId?: string;
6204
+ receipt?: NetsuiteReceipt;
6205
+ skipped?: string;
6206
+ payload?: Record<string, unknown>;
6207
+ attempts?: NetsuitePushAttempt[];
6208
+ }
6209
+ interface NetsuiteStatusChange {
6210
+ orderId: string;
6211
+ netsuiteId: string;
6212
+ from?: string;
6213
+ to: string;
6214
+ localStatus?: string;
6215
+ }
6216
+ interface NetsuiteStatusSyncResult {
6217
+ checked: number;
6218
+ changed: number;
6219
+ statusChanges: NetsuiteStatusChange[];
6220
+ shipmentsUpdated: number;
6221
+ fulfillments: number;
6185
6222
  }
6186
6223
 
6187
6224
  interface RevalidationResult {
@@ -6231,6 +6268,7 @@ interface CheckoutPayload {
6231
6268
  shippingMethod?: string;
6232
6269
  acceptedTerms: boolean;
6233
6270
  customerNote?: string;
6271
+ poNumber?: string;
6234
6272
  }
6235
6273
  interface CheckoutResult {
6236
6274
  order: IOrder;
@@ -6287,4 +6325,4 @@ interface IWishlist extends BaseEntity {
6287
6325
  items: IWishlistItem[];
6288
6326
  }
6289
6327
 
6290
- export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ACTIONS, ADMIN_AUDIT_ACTIONS, ADMIN_RESOURCES, ADMIN_RESOURCE_LIST, ALL_STORES, AWAITING_PAYMENT_STATUSES, type AddonAmountInput, type AddonGroupNetsuiteLink, type AddonNetsuiteLink, type AddonSelectionRef, type AddonSnapshot, type ApiResponse, type AppliedTax, BRAND_FIELDS, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_STATUS_VALUES, CATEGORY_FIELDS, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, type CacheStatus, type CacheStoreTarget, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CategoryImportSummary, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, type CouponNetsuiteLink, DEFAULT_SUBSCRIPTION_TOPICS, DISCOUNT_TYPE_VALUES, DiscountTypeEnum, EMAIL_PARAM_MISMATCH_KIND_VALUES, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EMPTY_ACCESS, type EffectiveAccess, type EmailParamMismatch, EmailParamMismatchKindEnum, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type FieldMap, type FieldMapping, type FieldSource, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminAction, type IAdminAuditAction, type IAdminAuditLog, type IAdminBaseAction, type IAdminPermission, type IAdminResource, type IAdminRole, type IAdminRoleCreate, type IAdminSafe, type IAdminStoreAccess, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICartServicePlanSnapshot, type ICategory, type ICategorySubcategory, 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 ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INetsuiteEvent, type INetsuiteOrderLink, type INetsuiteQueueEntry, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderShipment, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, 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 IServicePlan, 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 ITaxRate, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type LineChargeInput, type MatchResult, type Metadata, NETSUITE_EVENT_STATE_VALUES, NETSUITE_OWNED_FIELDS, NETSUITE_RECORD_TYPE_VALUES, NETSUITE_RELATION_GROUPS, NOTIFICATION_TYPE_VALUES, type NetsuiteCashSaleCheck, type NetsuiteCashSalePreview, type NetsuiteCashSaleReceipt, NetsuiteEventStateEnum, NetsuiteFieldProvider, type NetsuiteLinkResult, type NetsuiteOrderPreview, type NetsuiteOwnedEntity, type NetsuitePreviewLine, type NetsuiteReceipt, NetsuiteRecordTypeEnum, type NetsuiteRelationSource, type NetsuiteSyncDefinition, NotificationTypeEnum, OPEN_ORDER_STATUSES, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, type OfferedAddon, type OfferedAddonGroup, type OfferedServicePlan, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PRICING_TYPE_VALUES, PRODUCT_FIELDS, PRODUCT_VARIANT_TYPE_VALUES, PROVIDERS, PURCHASE_ORDER_STATUSES, PUSH_CHECK_STATUS_VALUES, PaymentGatewayEnum, PaymentLinkStatusEnum, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductServicePlanScope, type ProductVariantType, ProductVariantTypeEnum, type PromotionSyncResult, type PushCheck, PushCheckStatusEnum, type PushField, QUOTE_ORDER_STATUSES, RELATION_FIELDS, RESOURCE_OPERATIONS, RETIRED_CART_STATUSES, type RedirectTargetType, type ResolveAccessInput, type ResolvedAddonSelection, type RevalidationResult, SALE_TYPE_VALUES, SERVICE_PLAN_ELIGIBILITY_FIELD, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SelectedShippingMethod, type ServicePlanNetsuiteLink, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StoreAccessCheckInput, type StoreScopeInput, SubscriptionChannelEnum, SubscriptionTopicEnum, type SyncPolicy, type SyncRisk, TAX_RATE_SOURCE_VALUES, TRANSACTION_TYPE_VALUES, TaxRateSourceEnum, type TaxSyncResult, TransactionTypeEnum, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, actionsForResource, addonFields, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, blogAuthorFields, blogCategoryFields, blogPostFields, brandFields, can, canAny, canonicalizePath, canonicalizeSlug, categoryFields, chargesOfLine, conditionHolds, couponFields, demandByKey, evaluateConfigurator, feeHint, formatMoney, grantedPermissions, groupHasDefaultAddon, hasStoreAccess, isConfigurationValid, isNetsuiteOwned, isNonEmptyString, isQuoteOnlyItem, isValidAction, isValidEmail, missingGrants, netsuiteFieldCaution, netsuiteFieldConditional, netsuiteFieldNote, netsuiteFieldRisk, netsuiteFieldSource, netsuiteRelationSource, normalizeLineQuantity, normalizeNumber, normalizePath, orderLogTypeColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, podcastFields, productFields, readMapped, resolveAddonSelections, resolveEffectivePermissions, resolveProductAddonGroups, resolveProductServicePlans, resolveStoreScope, roundMoney, saleTypeOf, servicePlanFields, statusColors, stockVerdict, syncOwnerFor, toIdString, typeColorMap };
6328
+ export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ACTIONS, ADMIN_AUDIT_ACTIONS, ADMIN_RESOURCES, ADMIN_RESOURCE_LIST, ALL_STORES, AWAITING_PAYMENT_STATUSES, type AddonAmountInput, type AddonGroupNetsuiteLink, type AddonNetsuiteLink, type AddonSelectionRef, type AddonSnapshot, type ApiResponse, type AppliedTax, BRAND_FIELDS, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_STATUS_VALUES, CATEGORY_FIELDS, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, type CacheStatus, type CacheStoreTarget, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CategoryImportSummary, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, type CouponNetsuiteLink, DEFAULT_SUBSCRIPTION_TOPICS, DISCOUNT_TYPE_VALUES, DiscountTypeEnum, EMAIL_PARAM_MISMATCH_KIND_VALUES, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EMPTY_ACCESS, type EffectiveAccess, type EmailParamMismatch, EmailParamMismatchKindEnum, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type FieldMap, type FieldMapping, type FieldSource, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminAction, type IAdminAuditAction, type IAdminAuditLog, type IAdminBaseAction, type IAdminPermission, type IAdminResource, type IAdminRole, type IAdminRoleCreate, type IAdminSafe, type IAdminStoreAccess, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICartServicePlanSnapshot, type ICategory, type ICategorySubcategory, 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 ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INetsuiteEvent, type INetsuiteOrderLink, type INetsuiteQueueEntry, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderShipment, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, 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 IServicePlan, 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 ITaxRate, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type LineChargeInput, type MatchResult, type Metadata, NETSUITE_EVENT_STATE_VALUES, NETSUITE_OWNED_FIELDS, NETSUITE_RECORD_TYPE_VALUES, NETSUITE_RELATION_GROUPS, NOTIFICATION_TYPE_VALUES, NetsuiteEventStateEnum, NetsuiteFieldProvider, type NetsuiteLinkResult, type NetsuiteOrderPreview, type NetsuiteOwnedEntity, type NetsuitePreviewLine, type NetsuitePushAttempt, type NetsuitePushOutcome, type NetsuiteReceipt, NetsuiteRecordTypeEnum, type NetsuiteRelationSource, type NetsuiteStatusChange, type NetsuiteStatusSyncResult, type NetsuiteSyncDefinition, NotificationTypeEnum, OPEN_ORDER_STATUSES, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, type OfferedAddon, type OfferedAddonGroup, type OfferedServicePlan, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PLACED_OPEN_ORDER_STATUSES, PRICING_TYPE_VALUES, PRODUCT_FIELDS, PRODUCT_VARIANT_TYPE_VALUES, PROVIDERS, PURCHASE_ORDER_STATUSES, PUSH_CHECK_STATUS_VALUES, PaymentGatewayEnum, PaymentLinkStatusEnum, type PaymentLinkView, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductServicePlanScope, type ProductVariantType, ProductVariantTypeEnum, type PromotionSyncResult, type PushCheck, PushCheckStatusEnum, type PushField, QUOTE_ORDER_STATUSES, RELATION_FIELDS, RESOURCE_OPERATIONS, RETIRED_CART_STATUSES, type RateAddress, type RatedShippingMethod, type RedirectTargetType, type ResolveAccessInput, type ResolvedAddonSelection, type RevalidationResult, SALE_TYPE_VALUES, SERVICE_PLAN_ELIGIBILITY_FIELD, STATUS_TONE_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SelectedShippingMethod, type ServicePlanNetsuiteLink, StatusToneEnum, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StoreAccessCheckInput, type StoreScopeInput, SubscriptionChannelEnum, SubscriptionTopicEnum, type SyncPolicy, type SyncRisk, TAX_RATE_SOURCE_VALUES, TRANSACTION_TYPE_VALUES, TaxRateSourceEnum, type TaxSyncResult, TransactionTypeEnum, UNPLACED_ORDER_STATUSES, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, actionsForResource, addonFields, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, blogAuthorFields, blogCategoryFields, blogPostFields, brandFields, can, canAny, canonicalizePath, canonicalizeSlug, categoryFields, chargesOfLine, conditionHolds, couponFields, demandByKey, evaluateConfigurator, feeHint, formatMoney, grantedPermissions, groupHasDefaultAddon, hasStoreAccess, isConfigurationValid, isNetsuiteOwned, isNonEmptyString, isQuoteOnlyItem, isValidAction, isValidEmail, missingGrants, netsuiteFieldCaution, netsuiteFieldConditional, netsuiteFieldNote, netsuiteFieldRisk, netsuiteFieldSource, netsuiteRelationSource, netsuiteStatusLabel, normalizeLineQuantity, normalizeNumber, normalizePath, orderLogTypeColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, podcastFields, productFields, readMapped, resolveAddonSelections, resolveEffectivePermissions, resolveProductAddonGroups, resolveProductServicePlans, resolveStoreScope, roundMoney, saleTypeOf, servicePlanFields, statusColors, statusTone, statusTones, stockVerdict, syncOwnerFor, toIdString, typeColorMap };
package/dist/index.js CHANGED
@@ -76,6 +76,7 @@ __export(index_exports, {
76
76
  PAYMENT_LINK_STATUS_VALUES: () => PAYMENT_LINK_STATUS_VALUES,
77
77
  PAYMENT_METHOD_VALUES: () => PAYMENT_METHOD_VALUES,
78
78
  PAYMENT_STATUS_VALUES: () => PAYMENT_STATUS_VALUES,
79
+ PLACED_OPEN_ORDER_STATUSES: () => PLACED_OPEN_ORDER_STATUSES,
79
80
  PRICING_TYPE_VALUES: () => PRICING_TYPE_VALUES,
80
81
  PRODUCT_FIELDS: () => PRODUCT_FIELDS,
81
82
  PRODUCT_VARIANT_TYPE_VALUES: () => PRODUCT_VARIANT_TYPE_VALUES,
@@ -96,10 +97,12 @@ __export(index_exports, {
96
97
  RETIRED_CART_STATUSES: () => RETIRED_CART_STATUSES,
97
98
  SALE_TYPE_VALUES: () => SALE_TYPE_VALUES,
98
99
  SERVICE_PLAN_ELIGIBILITY_FIELD: () => SERVICE_PLAN_ELIGIBILITY_FIELD,
100
+ STATUS_TONE_VALUES: () => STATUS_TONE_VALUES,
99
101
  SUBSCRIPTION_CHANNEL_VALUES: () => SUBSCRIPTION_CHANNEL_VALUES,
100
102
  SUBSCRIPTION_TOPIC_LABELS: () => SUBSCRIPTION_TOPIC_LABELS,
101
103
  SUBSCRIPTION_TOPIC_VALUES: () => SUBSCRIPTION_TOPIC_VALUES,
102
104
  SaleTypeEnum: () => SaleTypeEnum,
105
+ StatusToneEnum: () => StatusToneEnum,
103
106
  StockStatusEnum: () => StockStatusEnum,
104
107
  StockVerdictEnum: () => StockVerdictEnum,
105
108
  SubscriptionChannelEnum: () => SubscriptionChannelEnum,
@@ -108,6 +111,7 @@ __export(index_exports, {
108
111
  TRANSACTION_TYPE_VALUES: () => TRANSACTION_TYPE_VALUES,
109
112
  TaxRateSourceEnum: () => TaxRateSourceEnum,
110
113
  TransactionTypeEnum: () => TransactionTypeEnum,
114
+ UNPLACED_ORDER_STATUSES: () => UNPLACED_ORDER_STATUSES,
111
115
  WIRED_EMAIL_TEMPLATE_EVENTS: () => WIRED_EMAIL_TEMPLATE_EVENTS,
112
116
  actionsForResource: () => actionsForResource,
113
117
  addonFields: () => addonFields,
@@ -149,6 +153,7 @@ __export(index_exports, {
149
153
  netsuiteFieldRisk: () => netsuiteFieldRisk,
150
154
  netsuiteFieldSource: () => netsuiteFieldSource,
151
155
  netsuiteRelationSource: () => netsuiteRelationSource,
156
+ netsuiteStatusLabel: () => netsuiteStatusLabel,
152
157
  normalizeLineQuantity: () => normalizeLineQuantity,
153
158
  normalizeNumber: () => normalizeNumber,
154
159
  normalizePath: () => normalizePath,
@@ -168,6 +173,8 @@ __export(index_exports, {
168
173
  saleTypeOf: () => saleTypeOf,
169
174
  servicePlanFields: () => servicePlanFields,
170
175
  statusColors: () => statusColors,
176
+ statusTone: () => statusTone,
177
+ statusTones: () => statusTones,
171
178
  stockVerdict: () => stockVerdict,
172
179
  syncOwnerFor: () => syncOwnerFor,
173
180
  toIdString: () => toIdString,
@@ -2174,6 +2181,16 @@ var PURCHASE_ORDER_STATUSES = [
2174
2181
  OrderStatusEnum.REFUNDED,
2175
2182
  OrderStatusEnum.PARTIALLY_REFUNDED
2176
2183
  ];
2184
+ var PLACED_OPEN_ORDER_STATUSES = [
2185
+ OrderStatusEnum.PENDING_APPROVAL,
2186
+ OrderStatusEnum.PENDING_FULFILLMENT,
2187
+ OrderStatusEnum.PARTIALLY_FULFILLED,
2188
+ OrderStatusEnum.PENDING_BILLING
2189
+ ];
2190
+ var UNPLACED_ORDER_STATUSES = [
2191
+ OrderStatusEnum.CREATED,
2192
+ OrderStatusEnum.PAYMENT_FAILED
2193
+ ];
2177
2194
  var OPEN_ORDER_STATUSES = [
2178
2195
  OrderStatusEnum.CREATED,
2179
2196
  OrderStatusEnum.PENDING_APPROVAL,
@@ -2191,6 +2208,42 @@ var QUOTE_ORDER_STATUSES = [
2191
2208
  OrderStatusEnum.QUOTE_EXPIRED,
2192
2209
  OrderStatusEnum.CANCELLED
2193
2210
  ];
2211
+ var StatusToneEnum = {
2212
+ DONE: "done",
2213
+ MOVING: "moving",
2214
+ WAITING: "waiting",
2215
+ STOPPED: "stopped",
2216
+ CLOSED: "closed"
2217
+ };
2218
+ var STATUS_TONE_VALUES = Object.values(StatusToneEnum);
2219
+ var statusTones = {
2220
+ [OrderStatusEnum.CREATED]: StatusToneEnum.WAITING,
2221
+ [OrderStatusEnum.PAYMENT_FAILED]: StatusToneEnum.STOPPED,
2222
+ [OrderStatusEnum.PENDING_APPROVAL]: StatusToneEnum.WAITING,
2223
+ [OrderStatusEnum.PENDING_FULFILLMENT]: StatusToneEnum.MOVING,
2224
+ [OrderStatusEnum.PARTIALLY_FULFILLED]: StatusToneEnum.MOVING,
2225
+ [OrderStatusEnum.PENDING_BILLING]: StatusToneEnum.MOVING,
2226
+ [OrderStatusEnum.BILLED]: StatusToneEnum.DONE,
2227
+ [OrderStatusEnum.CLOSED]: StatusToneEnum.CLOSED,
2228
+ [OrderStatusEnum.CANCELLED]: StatusToneEnum.STOPPED,
2229
+ [OrderStatusEnum.PENDING_RECEIPT]: StatusToneEnum.WAITING,
2230
+ [OrderStatusEnum.PENDING_REFUND]: StatusToneEnum.CLOSED,
2231
+ [OrderStatusEnum.REFUNDED]: StatusToneEnum.CLOSED,
2232
+ [OrderStatusEnum.PARTIALLY_REFUNDED]: StatusToneEnum.CLOSED,
2233
+ [OrderStatusEnum.QUOTE_REQUESTED]: StatusToneEnum.WAITING,
2234
+ [OrderStatusEnum.QUOTE_OPEN]: StatusToneEnum.MOVING,
2235
+ [OrderStatusEnum.QUOTE_APPROVED]: StatusToneEnum.DONE,
2236
+ [OrderStatusEnum.QUOTE_PROCESSED]: StatusToneEnum.DONE,
2237
+ [OrderStatusEnum.QUOTE_CLOSED]: StatusToneEnum.STOPPED,
2238
+ [OrderStatusEnum.QUOTE_VOIDED]: StatusToneEnum.STOPPED,
2239
+ [OrderStatusEnum.QUOTE_EXPIRED]: StatusToneEnum.CLOSED
2240
+ };
2241
+ var statusTone = (status) => statusTones[status] ?? StatusToneEnum.WAITING;
2242
+ var netsuiteStatusLabel = (status, netsuiteStatusText) => {
2243
+ const fromNetsuite = (netsuiteStatusText ?? "").trim();
2244
+ if (fromNetsuite) return fromNetsuite;
2245
+ return String(status ?? "").replace(/^QUOTE_/, "").replace(/_/g, " ").trim();
2246
+ };
2194
2247
 
2195
2248
  // src/orderLog/interface.ts
2196
2249
  var OrderLogTypeEnum = {
@@ -2341,8 +2394,7 @@ var TAX_RATE_SOURCE_VALUES = Object.values(TaxRateSourceEnum);
2341
2394
  // src/netsuitePush/interface.ts
2342
2395
  var NetsuiteRecordTypeEnum = {
2343
2396
  SALES_ORDER: "salesOrder",
2344
- ESTIMATE: "estimate",
2345
- CASH_SALE: "cashSale"
2397
+ ESTIMATE: "estimate"
2346
2398
  };
2347
2399
  var NETSUITE_RECORD_TYPE_VALUES = Object.values(NetsuiteRecordTypeEnum);
2348
2400
  var PushCheckStatusEnum = {