@thorprovider/types 7.8.0 → 7.10.0
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/.turbo/turbo-build.log +18 -18
- package/.turbo/turbo-type-check.log +0 -0
- package/CHANGELOG.md +25 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.mts +644 -12
- package/dist/index.d.ts +644 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/publish.log +60 -0
- package/src/auth.ts +35 -1
- package/src/cart.ts +9 -2
- package/src/checkout.ts +13 -0
- package/src/commerce-provider.ts +69 -10
- package/src/customer.ts +50 -0
- package/src/index.ts +78 -0
- package/src/order.ts +672 -0
- package/src/product.ts +53 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @thorprovider/types v1.0\n * Shared TypeScript types for Thor Commerce ecosystem\n * \n * Pure type definitions with zero runtime dependencies.\n * Foundation for type-safe commerce operations following SOLID principles.\n */\n\n// ============================================\n// Common Types\n// ============================================\nexport type {\n Money,\n Image,\n SEO,\n Connection,\n Edge,\n PaginationOptions,\n SortOptions,\n Country,\n PromotionKind,\n PromotionScope,\n PromotionSummary,\n} from './common';\n\n// ============================================\n// Commerce Contracts (single-store context + guest shapes)\n// ============================================\nexport type {\n StoreContext,\n ShopperIdentity,\n CartSession,\n OrderReceipt,\n} from './commerce';\n\n// ============================================\n// Checkout Contracts (type-only)\n// ============================================\nexport type {\n CheckoutReadState,\n CheckoutAddressOption,\n CheckoutAddressLevel,\n CheckoutLocationOptions,\n CheckoutAddressValues,\n CheckoutContactValues,\n GuestContact,\n CheckoutGuestContact,\n CheckoutCustomerIdentity,\n CheckoutSavedAddress,\n CheckoutShippingOption,\n CheckoutShippingGroup,\n CheckoutShippingGroupItem,\n CheckoutAdjustmentPayment,\n CheckoutInterruptionKind,\n CheckoutInterruptionAction,\n CheckoutInterruption,\n CheckoutSubmission,\n} from './checkout';\n\n// ============================================\n// Grouped Shipping Contracts (type-only)\n// ============================================\nexport type {\n ShippingGroupLocation,\n ShippingGroupOption,\n ShippingGroupItem,\n ShippingGroup,\n ShippingGroupQuote,\n ShippingGroupSelection,\n} from './shipping';\n\nexport type {\n AuthorConfig,\n BrandConfig,\n ModulesConfig,\n NavigationItem,\n SiteConfig,\n SocialConfig,\n} from './site-config';\n\nexport type { SiteConfigLabels } from './site-config-labels';\n\n// ============================================\n// Unified Query Types\n// ============================================\nexport type {\n QuerySortDirection,\n QueryEntityInput,\n QueryEntitiesInput,\n QueryMeta,\n QueryErrors,\n QueryResponse,\n} from './query';\n\n// ============================================\n// Catalog Query & Facet Support Types\n// ============================================\nexport type {\n CatalogSortKey,\n CatalogQuery,\n CatalogAppliedFilters,\n CatalogFacetId,\n CatalogFacetDemonstrationSource,\n FacetSupport,\n CatalogResults,\n CatalogQueryFailureCode,\n CatalogQueryFailureRepair,\n CatalogQueryFailure,\n CatalogQueryOutcome,\n} from './catalog';\n\n// ============================================\n// Product Types\n// ============================================\nexport type {\n Product,\n ProductOption,\n ProductVariant,\n SelectedOption,\n PriceRange,\n GetProductsOptions,\n ActiveFilter,\n SortOption,\n FilterSection,\n FilterOption,\n ProductPreview,\n Review,\n CompareProduct,\n AdminProductVariant,\n AdminProduct,\n AdvancedSearchProductsOptions,\n SearchResultMeta,\n FilterConfig,\n} from './product';\n\n// ============================================\n// Cart Types\n// ============================================\nexport type {\n Cart,\n CartItem,\n CartProduct,\n CartCost,\n CartLineInput,\n CartLineUpdate,\n ShippingMethod,\n DiscountCode,\n PriceTier,\n CheckoutLineProjection,\n CheckoutLineProjectionLine,\n} from './cart';\n\n// ============================================\n// Inventory & Fulfillment Types\n// ============================================\nexport type {\n StockLocation,\n InventoryLevel,\n FulfillmentSet,\n FulfillmentOption,\n StockStatus,\n StockValidation,\n} from './stock-location';\n\n// ============================================\n// Collection Types\n// ============================================\nexport type {\n Collection,\n CollectionProductsOptions,\n GetCollectionsOptions,\n} from './collection';\n\n// ============================================\n// Category Types\n// ============================================\nexport type {\n ProductCategory,\n GetCategoriesOptions,\n GetCategoriesCallback,\n} from './category';\n\n// ============================================\n// Customer Types\n// ============================================\nexport type {\n Customer,\n Address,\n GetCustomersOptions,\n GetCustomersCallback,\n} from './customer';\n\n// ============================================\n// Region Types\n// ============================================\nexport type {\n Region,\n} from './region';\n\n// ============================================\n// Order Types\n// ============================================\nexport type {\n Order,\n OrderDeliveryGroup,\n OrderItem,\n OrderPayment,\n OrderPaymentStatus,\n OrderStatus,\n PaymentStatus,\n FulfillmentStatus,\n GetOrdersOptions,\n GetOrdersCallback,\n GetCustomerOrdersPageOptions,\n CustomerOrdersPage,\n} from './order';\n\n// ============================================\n// Provider Types (L1 - type-only)\n// Runtime provider registry lives in @thorprovider/adapters\n// ============================================\nexport type { ProviderTypeString } from './provider';\n\n// ============================================\n// Storefront Types\n// ============================================\nexport type {\n StorefrontContext,\n StorefrontPlatformType,\n} from './storefront';\n\n// ============================================\n// Storefront Configuration Types\n// ============================================\nexport type {\n StorefrontConfig,\n StorefrontSeoDefaults,\n} from './storefront-config';\n\n// ============================================\n// Designer Configuration Types\n// ============================================\nexport type {\n DesignerConfig,\n DesignerThemeConfig,\n DesignerThemePreset,\n DesignerNavItem,\n DesignerHistoryEntry,\n} from './designer-config';\n\n// ============================================\n// Auth Types\n// ============================================\nexport type {\n AuthProvider,\n AuthConfig,\n AuthMethod,\n AuthStorage,\n LoginCredentials,\n RegisterData,\n AuthResponse,\n UpdateCustomerData,\n CreateAddressData,\n PasswordResetRequest,\n PasswordResetConfirm,\n TokenVerifyState,\n TokenVerifyResult,\n RecoveryConfirmResult,\n SalesChannelType,\n InterestCategory,\n RequestedProfile,\n SubmitApplicationSalesChannel,\n SubmitApplicationBody,\n SubmitApplicationCreated,\n SubmitApplicationConflictApplication,\n SubmitApplicationResponse,\n SubmitApplicationResult,\n} from './auth';\n\n// ============================================\n// Payment Types\n// ============================================\nexport type {\n PaymentMethod,\n PaymentMethodType,\n PaymentMethodFeatures,\n PaymentMethodsOptions,\n CachedPaymentMethods,\n CheckoutCapturePolicy,\n CheckoutPaymentPlanItem,\n GiftCardValidationResult,\n StoreCreditAccountSummary,\n CheckoutPaymentSummary,\n CheckoutPaymentSummaryPayment,\n CheckoutPaymentSummaryStatus,\n} from './payment';\n\n// ============================================\n// Commerce Provider Interface\n// ============================================\nexport type {\n CommerceProvider,\n BackendCapabilities,\n ProviderConfig,\n} from './commerce-provider';\n\n// ============================================\n// Admin Types\n// ============================================\nexport type {\n AdminUser,\n AuditLog,\n DashboardConfig,\n DashboardMetrics,\n SalesMetrics,\n OrdersMetrics,\n ProductsMetrics,\n ChartDataPoint,\n DashboardMetricsAdapter,\n DashboardOrdersAdapter,\n DashboardProductsAdapter,\n AuditLogAdapter,\n SiteConfigMetadata,\n ConfigHistoryEntry,\n // Multi-tenant admin types\n AdminChannelCustomer,\n GetChannelCustomersResponse,\n GetChannelCustomersOptions,\n AdminApiKey,\n GetChannelApiKeysResponse,\n AdminChannelCategory,\n GetChannelCategoriesResponse,\n GetChannelCategoriesOptions,\n AdminSalesChannelRef,\n GetCategorySalesChannelsResponse,\n AssignCategoriesToChannelsBody,\n AssignCategoriesToChannelsResponse,\n UnassignCategoriesFromChannelsBody,\n UnassignCategoriesFromChannelsResponse,\n GetCollectionSalesChannelsResponse,\n AssignCollectionsToChannelsBody,\n AssignCollectionsToChannelsResponse,\n UnassignCollectionsFromChannelsBody,\n UnassignCollectionsFromChannelsResponse,\n AdminStorefrontSeoDefaults,\n AdminStorefrontConfig,\n GetAdminStorefrontConfigResponse,\n UpdateStorefrontConfigBody,\n UpdateStorefrontConfigResponse,\n AdminSiteConfigHistoryEntry,\n AdminSiteConfig,\n GetAdminSiteConfigResponse,\n UpdateSiteConfigBody,\n UpdateSiteConfigResponse,\n AdminSiteConfigHistoryEntryFull,\n GetAdminSiteConfigHistoryResponse,\n GetAdminSiteConfigHistoryOptions,\n RestoreSiteConfigResponse,\n LinkCustomerToChannelResponse,\n // Dropshipping types\n DropshipperAccountRef,\n DropshipperCostTier,\n DropshipperSaleTier,\n OnboardDropshipperBody,\n OnboardDropshipperResponse,\n DropshipperVariant,\n DropshipperProduct,\n DropshipperProductImage,\n DropshipperProductAttachment,\n DropshipperProductPrivateMedia,\n GetDropshipperProductsOptions,\n GetDropshipperProductsResponse,\n ValidateCheckoutItemsRequest,\n ValidatedCheckoutItem,\n ValidateCheckoutItemsResponse,\n UpdateDropshipperProductStatusBody,\n UpdateDropshipperProductStatusResponse,\n DropshipperPriceTier,\n DropshipperPriceItem,\n UpdateDropshipperPricesBody,\n UpdateDropshipperPricesResponse,\n DropshipperOrderCustomer,\n DropshipperOrder,\n GetDropshipperOrdersOptions,\n GetDropshipperOrdersResponse,\n DropshipperShippingOption,\n DropshipperShippingGroupOption,\n DropshipperShippingGroup,\n ShippingGroupInput,\n GetDropshipperShippingOptionsBody,\n GetDropshipperShippingOptionsResponse,\n DropshipperOrderShippingAddress,\n DropshipperOrderItem,\n DropshipperOrderTotals,\n DropshipperOrderTaxLine,\n DropshipperOrderTimelineEvent,\n DropshipperOrderDetail,\n GetDropshipperOrderDetailResponse,\n CreateOrderItem,\n CreateDropshipperOrderBody,\n CreateDropshipperOrderResponse,\n ExtendedCreateDropshipperOrderBody,\n ExtendedCreateDropshipperOrderResponse,\n SetPaymentCollectorBody,\n SetPaymentCollectorResponse,\n SetPaymentMethodBody,\n SetPaymentMethodResponse,\n ValidateGiftCardBody,\n ValidateGiftCardResponse,\n DropshipperCategory,\n GetDropshipperCategoriesOptions,\n GetDropshipperCategoriesResponse,\n CreateDropshipperCategoryBody,\n UpdateDropshipperCategoryBody,\n DeleteDropshipperCategoryResponse,\n ProviderCategory,\n GetProviderCategoriesResponse,\n GetCategoryMappingsOptions,\n CategoryMapping,\n GetCategoryMappingsResponse,\n CreateCategoryMappingBody,\n CreateCategoryMappingResponse,\n DeleteCategoryMappingResponse,\n DropshipperCustomer,\n DropshipperCustomerStats,\n DropshipperCustomerFinancial,\n DropshipperCustomerAddress,\n DropshipperCustomerDetail,\n GetDropshipperCustomersOptions,\n GetDropshipperCustomersResponse,\n GetDropshipperCustomerDetailResponse,\n CreateDropshipperCustomerBody,\n CreateDropshipperCustomerResponse,\n UpdateDropshipperCustomerBody,\n UpdateDropshipperCustomerResponse,\n DropshipperBalance,\n DropshipperPendingOrders,\n DropshipperPaymentMethodConfig,\n DropshipperAccount,\n GetDropshipperAccountResponse,\n DropshipperPayableOrder,\n GetDropshipperPayableResponse,\n DropshipperReceivableOrder,\n GetDropshipperReceivableResponse,\n SettlementRecord,\n GetSettlementsOptions,\n GetSettlementsResponse,\n GetSettlementDetailResponse,\n CreateSettlementBody,\n CreateSettlementResponse,\n ConfirmSettlementBody,\n CancelSettlementBody,\n UpdateSettlementStatusResponse,\n AdminDropshipperAccount,\n AdminDropshipperBalance,\n GetAdminDropshipperAccountsResponse,\n GetAdminAccountBalanceResponse,\n GetAdminPriceListsResponse,\n GetUserChannelResponse,\n DropshipperPromotion,\n GetDropshipperPromotionsOptions,\n GetDropshipperPromotionsResponse,\n PromotionRule,\n CreateDropshipperPromotionBody,\n UpdateDropshipperPromotionBody,\n DeleteDropshipperPromotionResponse,\n GetDashboardStatsOptions,\n DashboardPeriodMetrics,\n DashboardChanges,\n DashboardTopProduct,\n DashboardStats,\n GetDashboardStatsResponse,\n GetStorefrontDropshipperCategoriesResponse,\n OrderNote,\n CreateOrderNoteBody,\n GetOrderNotesResponse,\n CreateOrderNoteResponse,\n DeleteOrderNoteResponse,\n // Order cancel and edits\n CancelDropshipperOrderResponse,\n CreateOrderEditBody,\n CreateOrderEditResponse,\n AddOrderEditItemBody,\n AddOrderEditItemResponse,\n ConfirmOrderEditResponse,\n // Draft Orders\n DropshipperDraftOrderItem,\n DropshipperDraftOrder,\n GetDropshipperDraftOrdersOptions,\n GetDropshipperDraftOrdersResponse,\n CreateDropshipperDraftOrderBody,\n CreateDropshipperDraftOrderResponse,\n GetDropshipperDraftOrderDetailResponse,\n UpdateDropshipperDraftOrderBody,\n UpdateDropshipperDraftOrderResponse,\n ConvertDropshipperDraftOrderBody,\n ConvertDropshipperDraftOrderResponse,\n DeleteDropshipperDraftOrderResponse,\n // Order totals preview\n PreviewDropshipperOrderItem,\n PreviewDropshipperOrderTotalsBody,\n PreviewDropshipperOrderTotalsResponse,\n // Dropshipper addresses (channel-scoped)\n DropshipperAddressBody,\n DropshipperAddressResponse,\n GetDropshipperAddressesResponse,\n // Financial Endpoints — Group A\n SettlementStatus,\n GetDropshipperAccountBalanceResponse,\n GetDropshipperAccountOrdersOptions,\n GetDropshipperAccountOrdersResponse,\n GetAdminDropshipperAccountOrdersResponse,\n GetAdminDropshipperAccountSettlementsOptions,\n GetAdminDropshipperAccountSettlementsResponse,\n ResolveGuaranteeBody,\n ResolveGuaranteeResponse,\n CreateCompensacionBody,\n CreateCompensacionResponse,\n CreateAjusteBody,\n CreateAjusteResponse,\n // Financial Endpoints — Group B\n CreateCobroBody,\n CreateCobroResponse,\n CreatePagoBody,\n CreatePagoResponse,\n CreateReversoBody,\n CreateReversoResponse,\n ConfirmMovementBody,\n ConfirmMovementResponse,\n CancelMovementBody,\n CancelMovementResponse,\n GetFinancialAnalysisResponse,\n RegisterPaymentBody,\n RegisterPaymentResponse,\n // Dashboard Capabilities\n DropshipperDashboardCapabilities,\n // AI Assistant Chat\n ChatMessage,\n ChatRequest,\n ChatIntent,\n ChatSource,\n ChatSourceVariant,\n ChatResponse,\n ChatAssistantHealthResponse,\n // Geo-reference\n GeoCountry,\n GeoProvince,\n GeoCity,\n GetGeoCountriesResponse,\n GetGeoProvincesResponse,\n GetGeoCitiesResponse,\n // Product Attributes\n DropshipperProductAttribute,\n DropshipperProductAttributeValue,\n GetProductAttributesResponse,\n DropshipperAttributeDefinition,\n DropshipperAttributeDefinitionValue,\n GetDropshipperAttributesResponse,\n DropshipperProductOption,\n DropshipperProductOptionValue,\n // Dropshipper Profile\n DropshipperProfile,\n GetMyProfileResponse,\n // Cost Price Changes Detection\n CostPriceChangesCheckResponse,\n CostPriceChangeItem,\n CostPriceChangesResponse,\n AcknowledgeCostPriceChangesResponse,\n // Notifications\n NotificationData,\n PriceUpdatedNotificationData,\n ProductAssignedNotificationData,\n StockChangeNotificationData,\n ManualAdminNotificationData,\n RawNotification,\n GetNotificationsOptions,\n GetNotificationsResponse,\n // Notification preferences\n DropshipperNotificationEventType,\n DropshipperNotificationPreference,\n UpdateNotificationPreferencesBody,\n GetNotificationPreferencesResponse,\n } from './admin';\n\n// ============================================\n// Dropshipper Business Policy Types\n// ============================================\nexport type {\n GetBusinessPolicyResponse,\n UpdateBusinessPolicyBody,\n UpdateBusinessPolicyResponse,\n} from './dropshipper-business-policy';\n\n// ============================================\n// Header Configuration Types\n// ============================================\nexport type {\n IconConfig,\n NavigationCalloutItem,\n NavigationLinkItem,\n DynamicSource,\n HeaderLinkItem,\n AccountMenuItem,\n AccountDropdownConfig,\n SearchBarConfig,\n HeaderNavigationConfig,\n} from './header-config';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @thorprovider/types v1.0\n * Shared TypeScript types for Thor Commerce ecosystem\n * \n * Pure type definitions with zero runtime dependencies.\n * Foundation for type-safe commerce operations following SOLID principles.\n */\n\n// ============================================\n// Common Types\n// ============================================\nexport type {\n Money,\n Image,\n SEO,\n Connection,\n Edge,\n PaginationOptions,\n SortOptions,\n Country,\n PromotionKind,\n PromotionScope,\n PromotionSummary,\n} from './common';\n\n// ============================================\n// Commerce Contracts (single-store context + guest shapes)\n// ============================================\nexport type {\n StoreContext,\n ShopperIdentity,\n CartSession,\n OrderReceipt,\n} from './commerce';\n\n// ============================================\n// Checkout Contracts (type-only)\n// ============================================\nexport type {\n CheckoutReadState,\n CheckoutAddressOption,\n CheckoutAddressLevel,\n CheckoutLocationOptions,\n CheckoutAddressValues,\n CheckoutContactValues,\n GuestContact,\n CheckoutGuestContact,\n CheckoutCustomerIdentity,\n CheckoutSavedAddress,\n CheckoutShippingOption,\n CheckoutShippingGroup,\n CheckoutShippingGroupItem,\n CheckoutAdjustmentPayment,\n CheckoutOrderClaimRequestResult,\n CheckoutOrderClaimAcceptResult,\n CheckoutInterruptionKind,\n CheckoutInterruptionAction,\n CheckoutInterruption,\n CheckoutSubmission,\n} from './checkout';\n\n// ============================================\n// Grouped Shipping Contracts (type-only)\n// ============================================\nexport type {\n ShippingGroupLocation,\n ShippingGroupOption,\n ShippingGroupItem,\n ShippingGroup,\n ShippingGroupQuote,\n ShippingGroupSelection,\n} from './shipping';\n\nexport type {\n AuthorConfig,\n BrandConfig,\n ModulesConfig,\n NavigationItem,\n SiteConfig,\n SocialConfig,\n} from './site-config';\n\nexport type { SiteConfigLabels } from './site-config-labels';\n\n// ============================================\n// Unified Query Types\n// ============================================\nexport type {\n QuerySortDirection,\n QueryEntityInput,\n QueryEntitiesInput,\n QueryMeta,\n QueryErrors,\n QueryResponse,\n} from './query';\n\n// ============================================\n// Catalog Query & Facet Support Types\n// ============================================\nexport type {\n CatalogSortKey,\n CatalogQuery,\n CatalogAppliedFilters,\n CatalogFacetId,\n CatalogFacetDemonstrationSource,\n FacetSupport,\n CatalogResults,\n CatalogQueryFailureCode,\n CatalogQueryFailureRepair,\n CatalogQueryFailure,\n CatalogQueryOutcome,\n} from './catalog';\n\n// ============================================\n// Product Types\n// ============================================\nexport type {\n Product,\n ProductOption,\n ProductVariant,\n SelectedOption,\n PriceRange,\n ProductHighlight,\n ProductAttribute,\n ProductAttributeGroup,\n ProductAttachment,\n GetProductsOptions,\n ActiveFilter,\n SortOption,\n FilterSection,\n FilterOption,\n ProductPreview,\n Review,\n CompareProduct,\n AdminProductVariant,\n AdminProduct,\n AdvancedSearchProductsOptions,\n SearchResultMeta,\n FilterConfig,\n} from './product';\n\n// ============================================\n// Cart Types\n// ============================================\nexport type {\n Cart,\n CartItem,\n CartProduct,\n CartCost,\n CartLineInput,\n CartLineUpdate,\n ShippingMethod,\n DiscountCode,\n PriceTier,\n CheckoutLineProjection,\n CheckoutLineProjectionLine,\n} from './cart';\n\n// ============================================\n// Inventory & Fulfillment Types\n// ============================================\nexport type {\n StockLocation,\n InventoryLevel,\n FulfillmentSet,\n FulfillmentOption,\n StockStatus,\n StockValidation,\n} from './stock-location';\n\n// ============================================\n// Collection Types\n// ============================================\nexport type {\n Collection,\n CollectionProductsOptions,\n GetCollectionsOptions,\n} from './collection';\n\n// ============================================\n// Category Types\n// ============================================\nexport type {\n ProductCategory,\n GetCategoriesOptions,\n GetCategoriesCallback,\n} from './category';\n\n// ============================================\n// Customer Types\n// ============================================\nexport type {\n Customer,\n Address,\n AddressFilter,\n AddressSort,\n AddressListQuery,\n AddressListResult,\n GetCustomersOptions,\n GetCustomersCallback,\n} from './customer';\n\n// ============================================\n// Region Types\n// ============================================\nexport type {\n Region,\n} from './region';\n\n// ============================================\n// Order Types\n// ============================================\nexport type {\n Order,\n OrderDeliveryGroup,\n OrderItem,\n OrderPayment,\n OrderPaymentStatus,\n OrderStatus,\n PaymentStatus,\n FulfillmentStatus,\n GetOrdersOptions,\n GetOrdersCallback,\n GetCustomerOrdersPageOptions,\n CustomerOrdersPage,\n CustomerOrderAction,\n CustomerOrderPaymentStatus,\n CustomerOrderFulfillmentStatus,\n CustomerOrderFulfillmentItemStatus,\n CustomerOrderHistoryQuick,\n CustomerOrderHistorySort,\n CustomerOrderHistoryDatePreset,\n CustomerOrderHistoryCommercialStatus,\n CustomerOrderHistoryCommercialFilter,\n CustomerOrderHistoryPaymentFilter,\n CustomerOrderHistoryRefundFilter,\n CustomerOrderHistoryFulfilmentFilter,\n CustomerOrderHistoryDeliveryMode,\n CustomerOrderHistoryReturnStatus,\n CustomerOrderHistoryFilters,\n CustomerOrderHistoryQuery,\n CustomerOrderHistoryOptions,\n CustomerOrderHistoryShipment,\n CustomerOrderHistoryRecord,\n CustomerOrderHistoryPage,\n CustomerOrderDetail,\n CustomerOrderDetailAction,\n CustomerOrderDetailAdjustment,\n CustomerOrderDetailAdjustmentDirection,\n CustomerOrderDetailAdjustmentScope,\n CustomerOrderDetailAdjustmentSource,\n CustomerOrderDetailAllocation,\n CustomerOrderDetailApprovalStatus,\n CustomerOrderDetailAttachment,\n CustomerOrderDetailAttribute,\n CustomerOrderDetailAttributeKind,\n CustomerOrderDetailBusiness,\n CustomerOrderDetailCase,\n CustomerOrderDetailCaseLine,\n CustomerOrderDetailCaseStatus,\n CustomerOrderDetailCaseType,\n CustomerOrderDetailDocument,\n CustomerOrderDetailDocumentKind,\n CustomerOrderDetailFulfillment,\n CustomerOrderDetailFulfillmentItemStatus,\n CustomerOrderDetailFulfillmentStatus,\n CustomerOrderDetailGroup,\n CustomerOrderDetailInvoiceStatus,\n CustomerOrderDetailIssue,\n CustomerOrderDetailLine,\n CustomerOrderDetailLinePrice,\n CustomerOrderDetailOrder,\n CustomerOrderDetailPackage,\n CustomerOrderDetailPaymentStatus,\n CustomerOrderDetailPickup,\n CustomerOrderDetailPickupStatus,\n CustomerOrderDetailPriceKind,\n CustomerOrderDetailProductKind,\n CustomerOrderDetailPromotion,\n CustomerOrderDetailPromotionApplication,\n CustomerOrderDetailPromotionNominal,\n CustomerOrderDetailPromotionScope,\n CustomerOrderDetailRevision,\n CustomerOrderDetailRevisionKind,\n CustomerOrderDetailSection,\n CustomerOrderDetailShippingMethod,\n CustomerOrderDetailSnapshot,\n CustomerOrderDetailTaxLine,\n CustomerOrderDetailTotals,\n CustomerOrderDetailTransaction,\n CustomerOrderDetailTransactionKind,\n CustomerOrderDetailTransactionMethod,\n CustomerOrderDetailTransactionStatus,\n} from './order';\n\n// ============================================\n// Provider Types (L1 - type-only)\n// Runtime provider registry lives in @thorprovider/adapters\n// ============================================\nexport type { ProviderTypeString } from './provider';\n\n// ============================================\n// Storefront Types\n// ============================================\nexport type {\n StorefrontContext,\n StorefrontPlatformType,\n} from './storefront';\n\n// ============================================\n// Storefront Configuration Types\n// ============================================\nexport type {\n StorefrontConfig,\n StorefrontSeoDefaults,\n} from './storefront-config';\n\n// ============================================\n// Designer Configuration Types\n// ============================================\nexport type {\n DesignerConfig,\n DesignerThemeConfig,\n DesignerThemePreset,\n DesignerNavItem,\n DesignerHistoryEntry,\n} from './designer-config';\n\n// ============================================\n// Auth Types\n// ============================================\nexport type {\n AuthProvider,\n AuthConfig,\n AuthMethod,\n AuthStorage,\n LoginCredentials,\n RegisterData,\n AuthResponse,\n UpdateCustomerData,\n CreateAddressData,\n PasswordResetRequest,\n PasswordResetConfirm,\n TokenVerifyState,\n TokenVerifyResult,\n RecoveryConfirmResult,\n SalesChannelType,\n InterestCategory,\n RequestedProfile,\n SubmitApplicationSalesChannel,\n SubmitApplicationBody,\n SubmitApplicationCreated,\n SubmitApplicationConflictApplication,\n SubmitApplicationResponse,\n SubmitApplicationResult,\n} from './auth';\n\n// ============================================\n// Payment Types\n// ============================================\nexport type {\n PaymentMethod,\n PaymentMethodType,\n PaymentMethodFeatures,\n PaymentMethodsOptions,\n CachedPaymentMethods,\n CheckoutCapturePolicy,\n CheckoutPaymentPlanItem,\n GiftCardValidationResult,\n StoreCreditAccountSummary,\n CheckoutPaymentSummary,\n CheckoutPaymentSummaryPayment,\n CheckoutPaymentSummaryStatus,\n} from './payment';\n\n// ============================================\n// Commerce Provider Interface\n// ============================================\nexport type {\n CommerceProvider,\n BackendCapabilities,\n ProviderConfig,\n} from './commerce-provider';\n\n// ============================================\n// Admin Types\n// ============================================\nexport type {\n AdminUser,\n AuditLog,\n DashboardConfig,\n DashboardMetrics,\n SalesMetrics,\n OrdersMetrics,\n ProductsMetrics,\n ChartDataPoint,\n DashboardMetricsAdapter,\n DashboardOrdersAdapter,\n DashboardProductsAdapter,\n AuditLogAdapter,\n SiteConfigMetadata,\n ConfigHistoryEntry,\n // Multi-tenant admin types\n AdminChannelCustomer,\n GetChannelCustomersResponse,\n GetChannelCustomersOptions,\n AdminApiKey,\n GetChannelApiKeysResponse,\n AdminChannelCategory,\n GetChannelCategoriesResponse,\n GetChannelCategoriesOptions,\n AdminSalesChannelRef,\n GetCategorySalesChannelsResponse,\n AssignCategoriesToChannelsBody,\n AssignCategoriesToChannelsResponse,\n UnassignCategoriesFromChannelsBody,\n UnassignCategoriesFromChannelsResponse,\n GetCollectionSalesChannelsResponse,\n AssignCollectionsToChannelsBody,\n AssignCollectionsToChannelsResponse,\n UnassignCollectionsFromChannelsBody,\n UnassignCollectionsFromChannelsResponse,\n AdminStorefrontSeoDefaults,\n AdminStorefrontConfig,\n GetAdminStorefrontConfigResponse,\n UpdateStorefrontConfigBody,\n UpdateStorefrontConfigResponse,\n AdminSiteConfigHistoryEntry,\n AdminSiteConfig,\n GetAdminSiteConfigResponse,\n UpdateSiteConfigBody,\n UpdateSiteConfigResponse,\n AdminSiteConfigHistoryEntryFull,\n GetAdminSiteConfigHistoryResponse,\n GetAdminSiteConfigHistoryOptions,\n RestoreSiteConfigResponse,\n LinkCustomerToChannelResponse,\n // Dropshipping types\n DropshipperAccountRef,\n DropshipperCostTier,\n DropshipperSaleTier,\n OnboardDropshipperBody,\n OnboardDropshipperResponse,\n DropshipperVariant,\n DropshipperProduct,\n DropshipperProductImage,\n DropshipperProductAttachment,\n DropshipperProductPrivateMedia,\n GetDropshipperProductsOptions,\n GetDropshipperProductsResponse,\n ValidateCheckoutItemsRequest,\n ValidatedCheckoutItem,\n ValidateCheckoutItemsResponse,\n UpdateDropshipperProductStatusBody,\n UpdateDropshipperProductStatusResponse,\n DropshipperPriceTier,\n DropshipperPriceItem,\n UpdateDropshipperPricesBody,\n UpdateDropshipperPricesResponse,\n DropshipperOrderCustomer,\n DropshipperOrder,\n GetDropshipperOrdersOptions,\n GetDropshipperOrdersResponse,\n DropshipperShippingOption,\n DropshipperShippingGroupOption,\n DropshipperShippingGroup,\n ShippingGroupInput,\n GetDropshipperShippingOptionsBody,\n GetDropshipperShippingOptionsResponse,\n DropshipperOrderShippingAddress,\n DropshipperOrderItem,\n DropshipperOrderTotals,\n DropshipperOrderTaxLine,\n DropshipperOrderTimelineEvent,\n DropshipperOrderDetail,\n GetDropshipperOrderDetailResponse,\n CreateOrderItem,\n CreateDropshipperOrderBody,\n CreateDropshipperOrderResponse,\n ExtendedCreateDropshipperOrderBody,\n ExtendedCreateDropshipperOrderResponse,\n SetPaymentCollectorBody,\n SetPaymentCollectorResponse,\n SetPaymentMethodBody,\n SetPaymentMethodResponse,\n ValidateGiftCardBody,\n ValidateGiftCardResponse,\n DropshipperCategory,\n GetDropshipperCategoriesOptions,\n GetDropshipperCategoriesResponse,\n CreateDropshipperCategoryBody,\n UpdateDropshipperCategoryBody,\n DeleteDropshipperCategoryResponse,\n ProviderCategory,\n GetProviderCategoriesResponse,\n GetCategoryMappingsOptions,\n CategoryMapping,\n GetCategoryMappingsResponse,\n CreateCategoryMappingBody,\n CreateCategoryMappingResponse,\n DeleteCategoryMappingResponse,\n DropshipperCustomer,\n DropshipperCustomerStats,\n DropshipperCustomerFinancial,\n DropshipperCustomerAddress,\n DropshipperCustomerDetail,\n GetDropshipperCustomersOptions,\n GetDropshipperCustomersResponse,\n GetDropshipperCustomerDetailResponse,\n CreateDropshipperCustomerBody,\n CreateDropshipperCustomerResponse,\n UpdateDropshipperCustomerBody,\n UpdateDropshipperCustomerResponse,\n DropshipperBalance,\n DropshipperPendingOrders,\n DropshipperPaymentMethodConfig,\n DropshipperAccount,\n GetDropshipperAccountResponse,\n DropshipperPayableOrder,\n GetDropshipperPayableResponse,\n DropshipperReceivableOrder,\n GetDropshipperReceivableResponse,\n SettlementRecord,\n GetSettlementsOptions,\n GetSettlementsResponse,\n GetSettlementDetailResponse,\n CreateSettlementBody,\n CreateSettlementResponse,\n ConfirmSettlementBody,\n CancelSettlementBody,\n UpdateSettlementStatusResponse,\n AdminDropshipperAccount,\n AdminDropshipperBalance,\n GetAdminDropshipperAccountsResponse,\n GetAdminAccountBalanceResponse,\n GetAdminPriceListsResponse,\n GetUserChannelResponse,\n DropshipperPromotion,\n GetDropshipperPromotionsOptions,\n GetDropshipperPromotionsResponse,\n PromotionRule,\n CreateDropshipperPromotionBody,\n UpdateDropshipperPromotionBody,\n DeleteDropshipperPromotionResponse,\n GetDashboardStatsOptions,\n DashboardPeriodMetrics,\n DashboardChanges,\n DashboardTopProduct,\n DashboardStats,\n GetDashboardStatsResponse,\n GetStorefrontDropshipperCategoriesResponse,\n OrderNote,\n CreateOrderNoteBody,\n GetOrderNotesResponse,\n CreateOrderNoteResponse,\n DeleteOrderNoteResponse,\n // Order cancel and edits\n CancelDropshipperOrderResponse,\n CreateOrderEditBody,\n CreateOrderEditResponse,\n AddOrderEditItemBody,\n AddOrderEditItemResponse,\n ConfirmOrderEditResponse,\n // Draft Orders\n DropshipperDraftOrderItem,\n DropshipperDraftOrder,\n GetDropshipperDraftOrdersOptions,\n GetDropshipperDraftOrdersResponse,\n CreateDropshipperDraftOrderBody,\n CreateDropshipperDraftOrderResponse,\n GetDropshipperDraftOrderDetailResponse,\n UpdateDropshipperDraftOrderBody,\n UpdateDropshipperDraftOrderResponse,\n ConvertDropshipperDraftOrderBody,\n ConvertDropshipperDraftOrderResponse,\n DeleteDropshipperDraftOrderResponse,\n // Order totals preview\n PreviewDropshipperOrderItem,\n PreviewDropshipperOrderTotalsBody,\n PreviewDropshipperOrderTotalsResponse,\n // Dropshipper addresses (channel-scoped)\n DropshipperAddressBody,\n DropshipperAddressResponse,\n GetDropshipperAddressesResponse,\n // Financial Endpoints — Group A\n SettlementStatus,\n GetDropshipperAccountBalanceResponse,\n GetDropshipperAccountOrdersOptions,\n GetDropshipperAccountOrdersResponse,\n GetAdminDropshipperAccountOrdersResponse,\n GetAdminDropshipperAccountSettlementsOptions,\n GetAdminDropshipperAccountSettlementsResponse,\n ResolveGuaranteeBody,\n ResolveGuaranteeResponse,\n CreateCompensacionBody,\n CreateCompensacionResponse,\n CreateAjusteBody,\n CreateAjusteResponse,\n // Financial Endpoints — Group B\n CreateCobroBody,\n CreateCobroResponse,\n CreatePagoBody,\n CreatePagoResponse,\n CreateReversoBody,\n CreateReversoResponse,\n ConfirmMovementBody,\n ConfirmMovementResponse,\n CancelMovementBody,\n CancelMovementResponse,\n GetFinancialAnalysisResponse,\n RegisterPaymentBody,\n RegisterPaymentResponse,\n // Dashboard Capabilities\n DropshipperDashboardCapabilities,\n // AI Assistant Chat\n ChatMessage,\n ChatRequest,\n ChatIntent,\n ChatSource,\n ChatSourceVariant,\n ChatResponse,\n ChatAssistantHealthResponse,\n // Geo-reference\n GeoCountry,\n GeoProvince,\n GeoCity,\n GetGeoCountriesResponse,\n GetGeoProvincesResponse,\n GetGeoCitiesResponse,\n // Product Attributes\n DropshipperProductAttribute,\n DropshipperProductAttributeValue,\n GetProductAttributesResponse,\n DropshipperAttributeDefinition,\n DropshipperAttributeDefinitionValue,\n GetDropshipperAttributesResponse,\n DropshipperProductOption,\n DropshipperProductOptionValue,\n // Dropshipper Profile\n DropshipperProfile,\n GetMyProfileResponse,\n // Cost Price Changes Detection\n CostPriceChangesCheckResponse,\n CostPriceChangeItem,\n CostPriceChangesResponse,\n AcknowledgeCostPriceChangesResponse,\n // Notifications\n NotificationData,\n PriceUpdatedNotificationData,\n ProductAssignedNotificationData,\n StockChangeNotificationData,\n ManualAdminNotificationData,\n RawNotification,\n GetNotificationsOptions,\n GetNotificationsResponse,\n // Notification preferences\n DropshipperNotificationEventType,\n DropshipperNotificationPreference,\n UpdateNotificationPreferencesBody,\n GetNotificationPreferencesResponse,\n } from './admin';\n\n// ============================================\n// Dropshipper Business Policy Types\n// ============================================\nexport type {\n GetBusinessPolicyResponse,\n UpdateBusinessPolicyBody,\n UpdateBusinessPolicyResponse,\n} from './dropshipper-business-policy';\n\n// ============================================\n// Header Configuration Types\n// ============================================\nexport type {\n IconConfig,\n NavigationCalloutItem,\n NavigationLinkItem,\n DynamicSource,\n HeaderLinkItem,\n AccountMenuItem,\n AccountDropdownConfig,\n SearchBarConfig,\n HeaderNavigationConfig,\n} from './header-config';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/package.json
CHANGED
package/publish.log
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
npm warn Unknown project config "network-concurrency". This will stop working in the next major version of npm.
|
|
2
|
+
npm warn publish npm auto-corrected some errors in your package.json when publishing. Please run "npm pkg fix" to address these errors.
|
|
3
|
+
npm warn publish errors corrected:
|
|
4
|
+
npm warn publish "repository.url" was normalized to "git+https://github.com/thorprovider/thor-commerce.git"
|
|
5
|
+
npm notice
|
|
6
|
+
npm notice 📦 @thor/types@2.0.1
|
|
7
|
+
npm notice Tarball Contents
|
|
8
|
+
npm notice 277B AGENTS.md
|
|
9
|
+
npm notice 1.6kB CHANGELOG.md
|
|
10
|
+
npm notice 6.4kB README.md
|
|
11
|
+
npm notice 101.2kB dist/index.d.mts
|
|
12
|
+
npm notice 101.2kB dist/index.d.ts
|
|
13
|
+
npm notice 3.2kB dist/index.js
|
|
14
|
+
npm notice 14.3kB dist/index.js.map
|
|
15
|
+
npm notice 1.9kB dist/index.mjs
|
|
16
|
+
npm notice 14.2kB dist/index.mjs.map
|
|
17
|
+
npm notice 832B package.json
|
|
18
|
+
npm notice 724B src/admin/AdminUser.ts
|
|
19
|
+
npm notice 946B src/admin/AuditLog.ts
|
|
20
|
+
npm notice 2.0kB src/admin/DashboardConfig.ts
|
|
21
|
+
npm notice 1.5kB src/admin/DashboardMetrics.ts
|
|
22
|
+
npm notice 268B src/admin/index.ts
|
|
23
|
+
npm notice 1.2kB src/admin/SiteConfigMetadata.ts
|
|
24
|
+
npm notice 6.5kB src/auth.ts
|
|
25
|
+
npm notice 2.8kB src/cart.ts
|
|
26
|
+
npm notice 3.0kB src/category.ts
|
|
27
|
+
npm notice 733B src/collection.ts
|
|
28
|
+
npm notice 35.3kB src/commerce-provider.ts
|
|
29
|
+
npm notice 2.1kB src/common.ts
|
|
30
|
+
npm notice 4.6kB src/customer.ts
|
|
31
|
+
npm notice 2.5kB src/designer-config.ts
|
|
32
|
+
npm notice 7.3kB src/header-config.README.md
|
|
33
|
+
npm notice 4.6kB src/header-config.ts
|
|
34
|
+
npm notice 5.5kB src/index.ts
|
|
35
|
+
npm notice 5.0kB src/order.ts
|
|
36
|
+
npm notice 6.0kB src/payment.ts
|
|
37
|
+
npm notice 10.7kB src/product.ts
|
|
38
|
+
npm notice 3.8kB src/provider.ts
|
|
39
|
+
npm notice 1.4kB src/region.ts
|
|
40
|
+
npm notice 2.1kB src/site-config-labels.ts
|
|
41
|
+
npm notice 3.0kB src/site-config.ts
|
|
42
|
+
npm notice 1.3kB src/stock-location.ts
|
|
43
|
+
npm notice 1.5kB src/storefront-config.ts
|
|
44
|
+
npm notice 3.3kB src/storefront.ts
|
|
45
|
+
npm notice 333B tsconfig.json
|
|
46
|
+
npm notice 303B tsup.config.ts
|
|
47
|
+
npm notice Tarball Details
|
|
48
|
+
npm notice name: @thor/types
|
|
49
|
+
npm notice version: 2.0.1
|
|
50
|
+
npm notice filename: thor-types-2.0.1.tgz
|
|
51
|
+
npm notice package size: 87.7 kB
|
|
52
|
+
npm notice unpacked size: 365.5 kB
|
|
53
|
+
npm notice shasum: 45a0c68b20d21a5446a471abb9077f2dd59cdd0d
|
|
54
|
+
npm notice integrity: sha512-AJRNa0Gs1osFo[...]RLXmlsHuMfinQ==
|
|
55
|
+
npm notice total files: 39
|
|
56
|
+
npm notice
|
|
57
|
+
npm notice Publishing to https://npm.pkg.github.com with tag latest and restricted access
|
|
58
|
+
npm error code E401
|
|
59
|
+
npm error 401 Unauthorized - PUT https://npm.pkg.github.com/@thor%2ftypes - unauthenticated: User cannot be authenticated with the token provided.
|
|
60
|
+
npm error A complete log of this run can be found in: /home/nelson/.npm/_logs/2026-04-16T15_45_29_457Z-debug-0.log
|
package/src/auth.ts
CHANGED
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
* Follows Thor Commerce principles: decoupling, agnostic configuration.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
Customer,
|
|
11
|
+
Address,
|
|
12
|
+
AddressListQuery,
|
|
13
|
+
AddressListResult,
|
|
14
|
+
} from './customer';
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* Authentication method configuration
|
|
@@ -352,6 +357,26 @@ export interface AuthProvider {
|
|
|
352
357
|
*/
|
|
353
358
|
resetPassword(token: string, password: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
354
359
|
|
|
360
|
+
/**
|
|
361
|
+
* Request a verification code for the authenticated customer's email.
|
|
362
|
+
* Optional: providers that cannot verify omit it, and their
|
|
363
|
+
* `BackendCapabilities.verifyEmail` stays false.
|
|
364
|
+
*/
|
|
365
|
+
requestEmailVerification?(): Promise<void>;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Verify the authenticated customer's email with a provider-issued code.
|
|
369
|
+
* Optional, paired with `requestEmailVerification`.
|
|
370
|
+
*/
|
|
371
|
+
verifyEmail?(code: string): Promise<void>;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Check a reset code without consuming it, so a multi-step form can keep the
|
|
375
|
+
* shopper on the code step. Optional: providers without it validate the code
|
|
376
|
+
* only when `resetPassword` runs.
|
|
377
|
+
*/
|
|
378
|
+
verifyPasswordResetCode?(code: string): Promise<boolean>;
|
|
379
|
+
|
|
355
380
|
// ========================================
|
|
356
381
|
// Session Management
|
|
357
382
|
// ========================================
|
|
@@ -398,6 +423,15 @@ export interface AuthProvider {
|
|
|
398
423
|
* @returns List of customer addresses
|
|
399
424
|
*/
|
|
400
425
|
getAddresses(): Promise<Address[]>;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Read one server-filtered page of the customer's address book.
|
|
429
|
+
*
|
|
430
|
+
* Optional so existing providers keep compiling; a provider that cannot
|
|
431
|
+
* serve the query must omit it rather than return a partial or locally
|
|
432
|
+
* filtered page.
|
|
433
|
+
*/
|
|
434
|
+
listAddresses?(query: AddressListQuery): Promise<AddressListResult>;
|
|
401
435
|
|
|
402
436
|
/**
|
|
403
437
|
* Create new address for current customer
|
package/src/cart.ts
CHANGED
|
@@ -190,8 +190,7 @@ export interface Cart {
|
|
|
190
190
|
*/
|
|
191
191
|
guestContact?: GuestContact;
|
|
192
192
|
/** Backend id of the applied shipping method, when one is selected. */
|
|
193
|
-
selectedShippingMethodId?: string;
|
|
194
|
-
/**
|
|
193
|
+
selectedShippingMethodId?: string; /**
|
|
195
194
|
* Backend id of the shipping option the applied method was created from.
|
|
196
195
|
*
|
|
197
196
|
* This is the identity the checkout shipping UI selects (the value passed to
|
|
@@ -206,6 +205,14 @@ export interface Cart {
|
|
|
206
205
|
promotions?: PromotionSummary[];
|
|
207
206
|
/** Platform-specific backend metadata, carried through unchanged. */
|
|
208
207
|
metadata?: Record<string, unknown>;
|
|
208
|
+
/**
|
|
209
|
+
* Buyer email the backend holds on the cart.
|
|
210
|
+
*
|
|
211
|
+
* Authoritative for the guest checkout: the backend requires `cart.email`
|
|
212
|
+
* before a guest order can be completed. Absent when the cart has no contact
|
|
213
|
+
* email yet, which is the state the host must resolve before payment.
|
|
214
|
+
*/
|
|
215
|
+
contactEmail?: string;
|
|
209
216
|
}
|
|
210
217
|
|
|
211
218
|
/**
|
package/src/checkout.ts
CHANGED
|
@@ -127,6 +127,19 @@ export interface CheckoutShippingGroupItem {
|
|
|
127
127
|
quantity?: number;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
/** Outcome of requesting a guest-order claim (transfer) for a registered customer. */
|
|
131
|
+
export interface CheckoutOrderClaimRequestResult {
|
|
132
|
+
/** True once the backend accepted the transfer request. */
|
|
133
|
+
requested: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Outcome of accepting a guest-order claim with the email token. */
|
|
137
|
+
export interface CheckoutOrderClaimAcceptResult {
|
|
138
|
+
accepted: boolean;
|
|
139
|
+
/** The order the transfer was applied to. */
|
|
140
|
+
orderId: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
130
143
|
export interface CheckoutAdjustmentPayment {
|
|
131
144
|
id: string;
|
|
132
145
|
kind: 'gift-card' | 'store-credit';
|
package/src/commerce-provider.ts
CHANGED
|
@@ -38,6 +38,9 @@ import type {
|
|
|
38
38
|
GetOrdersOptions,
|
|
39
39
|
GetCustomerOrdersPageOptions,
|
|
40
40
|
CustomerOrdersPage,
|
|
41
|
+
CustomerOrderHistoryOptions,
|
|
42
|
+
CustomerOrderHistoryPage,
|
|
43
|
+
CustomerOrderDetailSnapshot,
|
|
41
44
|
} from './order';
|
|
42
45
|
import type { Region } from './region';
|
|
43
46
|
import type {
|
|
@@ -46,7 +49,11 @@ import type {
|
|
|
46
49
|
GiftCardValidationResult,
|
|
47
50
|
StoreCreditAccountSummary,
|
|
48
51
|
} from './payment';
|
|
49
|
-
import type {
|
|
52
|
+
import type {
|
|
53
|
+
CheckoutGuestContact,
|
|
54
|
+
CheckoutOrderClaimAcceptResult,
|
|
55
|
+
CheckoutOrderClaimRequestResult,
|
|
56
|
+
} from './checkout';
|
|
50
57
|
import type { AuthProvider } from './auth';
|
|
51
58
|
import type { StorefrontContext } from './storefront';
|
|
52
59
|
import type { StockLocation, InventoryLevel, StockValidation, FulfillmentOption } from './stock-location';
|
|
@@ -92,6 +99,9 @@ export interface BackendCapabilities {
|
|
|
92
99
|
/** Can request password reset via email */
|
|
93
100
|
changePasswordViaEmail: boolean;
|
|
94
101
|
|
|
102
|
+
/** Can verify a customer's email address (code or link) */
|
|
103
|
+
verifyEmail: boolean;
|
|
104
|
+
|
|
95
105
|
/** Can delete customer account (self-service) */
|
|
96
106
|
deleteAccount: boolean;
|
|
97
107
|
|
|
@@ -780,6 +790,33 @@ export interface CommerceProvider {
|
|
|
780
790
|
* @throws {ProviderAPIError} If the backend fails or returns an invalid projection
|
|
781
791
|
*/
|
|
782
792
|
getCheckoutLineProjection?(cartId: string): Promise<CheckoutLineProjection>;
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Read the backend's own capability flags, awaited (OPTIONAL).
|
|
796
|
+
*
|
|
797
|
+
* The synchronous `capabilities` property is a snapshot that returns static
|
|
798
|
+
* defaults until a provider's discovery fetch resolves, and those defaults are
|
|
799
|
+
* not authoritative. A caller that gates behaviour on a flag (guest checkout,
|
|
800
|
+
* for example) must use this method so an unread or failed flag can be treated
|
|
801
|
+
* as off.
|
|
802
|
+
*/
|
|
803
|
+
getCapabilities?(): Promise<BackendCapabilities>;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Request the transfer of a guest order to the authenticated customer
|
|
807
|
+
* (OPTIONAL). The backend emails an acceptance token; nothing moves until it
|
|
808
|
+
* is accepted.
|
|
809
|
+
*/
|
|
810
|
+
requestOrderClaim?(orderId: string): Promise<CheckoutOrderClaimRequestResult>;
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Accept a previously requested guest-order transfer with its email token
|
|
814
|
+
* (OPTIONAL). Requires no customer session.
|
|
815
|
+
*/
|
|
816
|
+
acceptOrderClaim?(
|
|
817
|
+
orderId: string,
|
|
818
|
+
token: string,
|
|
819
|
+
): Promise<CheckoutOrderClaimAcceptResult>;
|
|
783
820
|
|
|
784
821
|
/**
|
|
785
822
|
* Initiate payment session with provider
|
|
@@ -992,23 +1029,45 @@ export interface CommerceProvider {
|
|
|
992
1029
|
customerOrdersPage?(options: GetCustomerOrdersPageOptions): Promise<CustomerOrdersPage>;
|
|
993
1030
|
|
|
994
1031
|
/**
|
|
995
|
-
* Resolve ONE order for the authenticated customer (OPTIONAL,
|
|
1032
|
+
* Resolve ONE order for the authenticated customer (OPTIONAL, legacy/mock).
|
|
996
1033
|
*
|
|
997
1034
|
* Ownership is enforced by the provider: an order that belongs to another
|
|
998
1035
|
* customer, another channel, or no customer resolves as `undefined` — the
|
|
999
|
-
* caller must not learn whether it exists.
|
|
1000
|
-
* this method (a backend without a customer detail endpoint) fails closed at
|
|
1001
|
-
* the runtime boundary; the storefront never derives the detail from the
|
|
1002
|
-
* order-list payload.
|
|
1003
|
-
*
|
|
1004
|
-
* `options.salesChannelId` is the store's explicitly configured channel. A
|
|
1005
|
-
* provider that can scope by channel MUST reject a foreign order as
|
|
1006
|
-
* `undefined`.
|
|
1036
|
+
* caller must not learn whether it exists.
|
|
1007
1037
|
*/
|
|
1008
1038
|
customerOrderDetail?(
|
|
1009
1039
|
orderId: string,
|
|
1010
1040
|
options?: { salesChannelId?: string },
|
|
1011
1041
|
): Promise<Order | undefined>;
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* Read one server-side Order History page (OPTIONAL, additive).
|
|
1045
|
+
*
|
|
1046
|
+
* The backend applies search, filters, date, amount, sort and pagination to
|
|
1047
|
+
* the authenticated customer + sales channel set and returns the real total,
|
|
1048
|
+
* `totalAll`, `pageCount` and optional quick-filter counts. Native payment and
|
|
1049
|
+
* fulfillment statuses are preserved; the host maps them to the block
|
|
1050
|
+
* contract.
|
|
1051
|
+
*/
|
|
1052
|
+
customerOrderHistory?(
|
|
1053
|
+
options: CustomerOrderHistoryOptions,
|
|
1054
|
+
): Promise<CustomerOrderHistoryPage>;
|
|
1055
|
+
|
|
1056
|
+
/**
|
|
1057
|
+
* Read one authenticated customer's order detail snapshot (OPTIONAL).
|
|
1058
|
+
*
|
|
1059
|
+
* The backend enforces customer ownership and sales-channel scope before
|
|
1060
|
+
* returning any data. A foreign, unknown or other-channel order must fail
|
|
1061
|
+
* closed; the provider never receives a partial payload for those cases.
|
|
1062
|
+
*
|
|
1063
|
+
* The snapshot carries a per-section `issues` map and a non-blocking
|
|
1064
|
+
* `warning` for a partial load. A provider without this method (for example
|
|
1065
|
+
* the mock data source) fails closed at the runtime boundary.
|
|
1066
|
+
*/
|
|
1067
|
+
customerOrderDetailSnapshot?(
|
|
1068
|
+
orderId: string,
|
|
1069
|
+
options?: { signal?: AbortSignal },
|
|
1070
|
+
): Promise<CustomerOrderDetailSnapshot>;
|
|
1012
1071
|
|
|
1013
1072
|
// ============================================
|
|
1014
1073
|
// Payment Operations
|
package/src/customer.ts
CHANGED
|
@@ -34,6 +34,56 @@ export interface Address {
|
|
|
34
34
|
isDefaultBilling?: boolean; // Whether this is the default billing address
|
|
35
35
|
isDefaultShipping?: boolean; // Whether this is the default shipping address
|
|
36
36
|
metadata?: Record<string, unknown>; // Flexible storage for platform-specific extras (label, etc.)
|
|
37
|
+
createdAt?: string; // ISO 8601 timestamp
|
|
38
|
+
updatedAt?: string; // ISO 8601 timestamp; the address book sorts by it
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Filters the address book can request from the provider. */
|
|
42
|
+
export type AddressFilter =
|
|
43
|
+
| 'all'
|
|
44
|
+
| 'personal'
|
|
45
|
+
| 'business'
|
|
46
|
+
| 'default-shipping'
|
|
47
|
+
| 'default-billing'
|
|
48
|
+
| 'verified'
|
|
49
|
+
| 'needs-review'
|
|
50
|
+
| 'delivery-available';
|
|
51
|
+
|
|
52
|
+
/** Server-side ordering supported by the address book. */
|
|
53
|
+
export type AddressSort =
|
|
54
|
+
| 'default-first'
|
|
55
|
+
| 'recent'
|
|
56
|
+
| 'oldest'
|
|
57
|
+
| 'alphabetical'
|
|
58
|
+
| 'city'
|
|
59
|
+
| 'country'
|
|
60
|
+
| 'company';
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* One page of the authenticated customer's address book.
|
|
64
|
+
*
|
|
65
|
+
* `total` is the filtered total of the customer's scope, never the page
|
|
66
|
+
* length. `serverQuery` is intentionally absent: it is a presentation fact the
|
|
67
|
+
* host knows, not a domain field.
|
|
68
|
+
*/
|
|
69
|
+
export interface AddressListQuery {
|
|
70
|
+
/** Free-text match over label, recipient, company, postal lines and phone. */
|
|
71
|
+
search?: string;
|
|
72
|
+
filter?: AddressFilter;
|
|
73
|
+
sort?: AddressSort;
|
|
74
|
+
/** 1-based page index. */
|
|
75
|
+
page?: number;
|
|
76
|
+
/** Page size requested from the provider. */
|
|
77
|
+
pageSize?: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Result of a server-side address list query. */
|
|
81
|
+
export interface AddressListResult {
|
|
82
|
+
items: Address[];
|
|
83
|
+
total: number;
|
|
84
|
+
page: number;
|
|
85
|
+
pageSize: number;
|
|
86
|
+
hasMore: boolean;
|
|
37
87
|
}
|
|
38
88
|
|
|
39
89
|
/**
|
package/src/index.ts
CHANGED
|
@@ -51,6 +51,8 @@ export type {
|
|
|
51
51
|
CheckoutShippingGroup,
|
|
52
52
|
CheckoutShippingGroupItem,
|
|
53
53
|
CheckoutAdjustmentPayment,
|
|
54
|
+
CheckoutOrderClaimRequestResult,
|
|
55
|
+
CheckoutOrderClaimAcceptResult,
|
|
54
56
|
CheckoutInterruptionKind,
|
|
55
57
|
CheckoutInterruptionAction,
|
|
56
58
|
CheckoutInterruption,
|
|
@@ -118,6 +120,10 @@ export type {
|
|
|
118
120
|
ProductVariant,
|
|
119
121
|
SelectedOption,
|
|
120
122
|
PriceRange,
|
|
123
|
+
ProductHighlight,
|
|
124
|
+
ProductAttribute,
|
|
125
|
+
ProductAttributeGroup,
|
|
126
|
+
ProductAttachment,
|
|
121
127
|
GetProductsOptions,
|
|
122
128
|
ActiveFilter,
|
|
123
129
|
SortOption,
|
|
@@ -186,6 +192,10 @@ export type {
|
|
|
186
192
|
export type {
|
|
187
193
|
Customer,
|
|
188
194
|
Address,
|
|
195
|
+
AddressFilter,
|
|
196
|
+
AddressSort,
|
|
197
|
+
AddressListQuery,
|
|
198
|
+
AddressListResult,
|
|
189
199
|
GetCustomersOptions,
|
|
190
200
|
GetCustomersCallback,
|
|
191
201
|
} from './customer';
|
|
@@ -213,6 +223,74 @@ export type {
|
|
|
213
223
|
GetOrdersCallback,
|
|
214
224
|
GetCustomerOrdersPageOptions,
|
|
215
225
|
CustomerOrdersPage,
|
|
226
|
+
CustomerOrderAction,
|
|
227
|
+
CustomerOrderPaymentStatus,
|
|
228
|
+
CustomerOrderFulfillmentStatus,
|
|
229
|
+
CustomerOrderFulfillmentItemStatus,
|
|
230
|
+
CustomerOrderHistoryQuick,
|
|
231
|
+
CustomerOrderHistorySort,
|
|
232
|
+
CustomerOrderHistoryDatePreset,
|
|
233
|
+
CustomerOrderHistoryCommercialStatus,
|
|
234
|
+
CustomerOrderHistoryCommercialFilter,
|
|
235
|
+
CustomerOrderHistoryPaymentFilter,
|
|
236
|
+
CustomerOrderHistoryRefundFilter,
|
|
237
|
+
CustomerOrderHistoryFulfilmentFilter,
|
|
238
|
+
CustomerOrderHistoryDeliveryMode,
|
|
239
|
+
CustomerOrderHistoryReturnStatus,
|
|
240
|
+
CustomerOrderHistoryFilters,
|
|
241
|
+
CustomerOrderHistoryQuery,
|
|
242
|
+
CustomerOrderHistoryOptions,
|
|
243
|
+
CustomerOrderHistoryShipment,
|
|
244
|
+
CustomerOrderHistoryRecord,
|
|
245
|
+
CustomerOrderHistoryPage,
|
|
246
|
+
CustomerOrderDetail,
|
|
247
|
+
CustomerOrderDetailAction,
|
|
248
|
+
CustomerOrderDetailAdjustment,
|
|
249
|
+
CustomerOrderDetailAdjustmentDirection,
|
|
250
|
+
CustomerOrderDetailAdjustmentScope,
|
|
251
|
+
CustomerOrderDetailAdjustmentSource,
|
|
252
|
+
CustomerOrderDetailAllocation,
|
|
253
|
+
CustomerOrderDetailApprovalStatus,
|
|
254
|
+
CustomerOrderDetailAttachment,
|
|
255
|
+
CustomerOrderDetailAttribute,
|
|
256
|
+
CustomerOrderDetailAttributeKind,
|
|
257
|
+
CustomerOrderDetailBusiness,
|
|
258
|
+
CustomerOrderDetailCase,
|
|
259
|
+
CustomerOrderDetailCaseLine,
|
|
260
|
+
CustomerOrderDetailCaseStatus,
|
|
261
|
+
CustomerOrderDetailCaseType,
|
|
262
|
+
CustomerOrderDetailDocument,
|
|
263
|
+
CustomerOrderDetailDocumentKind,
|
|
264
|
+
CustomerOrderDetailFulfillment,
|
|
265
|
+
CustomerOrderDetailFulfillmentItemStatus,
|
|
266
|
+
CustomerOrderDetailFulfillmentStatus,
|
|
267
|
+
CustomerOrderDetailGroup,
|
|
268
|
+
CustomerOrderDetailInvoiceStatus,
|
|
269
|
+
CustomerOrderDetailIssue,
|
|
270
|
+
CustomerOrderDetailLine,
|
|
271
|
+
CustomerOrderDetailLinePrice,
|
|
272
|
+
CustomerOrderDetailOrder,
|
|
273
|
+
CustomerOrderDetailPackage,
|
|
274
|
+
CustomerOrderDetailPaymentStatus,
|
|
275
|
+
CustomerOrderDetailPickup,
|
|
276
|
+
CustomerOrderDetailPickupStatus,
|
|
277
|
+
CustomerOrderDetailPriceKind,
|
|
278
|
+
CustomerOrderDetailProductKind,
|
|
279
|
+
CustomerOrderDetailPromotion,
|
|
280
|
+
CustomerOrderDetailPromotionApplication,
|
|
281
|
+
CustomerOrderDetailPromotionNominal,
|
|
282
|
+
CustomerOrderDetailPromotionScope,
|
|
283
|
+
CustomerOrderDetailRevision,
|
|
284
|
+
CustomerOrderDetailRevisionKind,
|
|
285
|
+
CustomerOrderDetailSection,
|
|
286
|
+
CustomerOrderDetailShippingMethod,
|
|
287
|
+
CustomerOrderDetailSnapshot,
|
|
288
|
+
CustomerOrderDetailTaxLine,
|
|
289
|
+
CustomerOrderDetailTotals,
|
|
290
|
+
CustomerOrderDetailTransaction,
|
|
291
|
+
CustomerOrderDetailTransactionKind,
|
|
292
|
+
CustomerOrderDetailTransactionMethod,
|
|
293
|
+
CustomerOrderDetailTransactionStatus,
|
|
216
294
|
} from './order';
|
|
217
295
|
|
|
218
296
|
// ============================================
|