@thorprovider/types 5.1.6 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -4160,6 +4160,19 @@ interface DropshipperOrderDetail {
4160
4160
  name: string;
4161
4161
  amount: number;
4162
4162
  shipping_option_id: string | null;
4163
+ /** Fulfillment intent of the underlying shipping option: 'delivery' | 'pickup' | 'shipping' | null */
4164
+ fulfillment_set_type?: string | null;
4165
+ pickup_location?: {
4166
+ id: string;
4167
+ name: string;
4168
+ address: {
4169
+ address_1: string;
4170
+ city: string | null;
4171
+ province: string | null;
4172
+ postal_code: string | null;
4173
+ country_code: string;
4174
+ } | null;
4175
+ } | null;
4163
4176
  } | null;
4164
4177
  payment_collected_by: 'dropshipper' | 'provider' | null;
4165
4178
  payment_method?: {
@@ -4409,6 +4422,11 @@ interface ConvertDropshipperDraftOrderResponse {
4409
4422
  message: string;
4410
4423
  draft_id: string;
4411
4424
  }
4425
+ /** Response for `DELETE /admin/thor/dropshipper/draft-orders/:id` */
4426
+ interface DeleteDropshipperDraftOrderResponse {
4427
+ id: string;
4428
+ deleted: boolean;
4429
+ }
4412
4430
  /** A dropshipper custom category node */
4413
4431
  interface DropshipperCategory {
4414
4432
  id: string;
@@ -5431,6 +5449,8 @@ interface RegisterPaymentResponse {
5431
5449
  interface DropshipperDashboardCapabilities {
5432
5450
  /** Core navigation — always expected to be true */
5433
5451
  dashboard: boolean;
5452
+ /** AI assistant chat (catalog intelligence) */
5453
+ aiAssistant: boolean;
5434
5454
  orders: boolean;
5435
5455
  products: boolean;
5436
5456
  prices: boolean;
@@ -5448,6 +5468,46 @@ interface DropshipperDashboardCapabilities {
5448
5468
  integrations: boolean;
5449
5469
  team: boolean;
5450
5470
  }
5471
+ /** A single turn in the stateless chat history sent with each request */
5472
+ interface ChatMessage {
5473
+ role: 'user' | 'assistant';
5474
+ content: string;
5475
+ }
5476
+ /** Request body for `POST /admin/thor/dropshipper/ai/chat` */
5477
+ interface ChatRequest {
5478
+ messages: ChatMessage[];
5479
+ model?: string;
5480
+ }
5481
+ /** Semantic intent extracted by the backend classifier */
5482
+ type ChatIntent = 'catalog_search' | 'greeting' | 'other';
5483
+ /** Summarized variant attached to a chat source product */
5484
+ interface ChatSourceVariant {
5485
+ id: string;
5486
+ title: string;
5487
+ sku: string;
5488
+ sale_price: number;
5489
+ margin_percent: number;
5490
+ available_quantity: number;
5491
+ }
5492
+ /** A catalog product referenced by the assistant answer */
5493
+ interface ChatSource {
5494
+ product_id: string;
5495
+ title: string;
5496
+ handle: string;
5497
+ thumbnail: string | null;
5498
+ sale_price: number;
5499
+ cost_price: number | null;
5500
+ margin_percent: number | null;
5501
+ available_quantity: number;
5502
+ variants_summary: ChatSourceVariant[];
5503
+ }
5504
+ /** Response from `POST /admin/thor/dropshipper/ai/chat` */
5505
+ interface ChatResponse {
5506
+ answer: string;
5507
+ intent: ChatIntent;
5508
+ model_used: string;
5509
+ sources: ChatSource[];
5510
+ }
5451
5511
  /** A geo-reference country */
5452
5512
  interface GeoCountry {
5453
5513
  id: string;
@@ -5567,6 +5627,48 @@ interface CostPriceChangesResponse {
5567
5627
  interface AcknowledgeCostPriceChangesResponse {
5568
5628
  acknowledged: boolean;
5569
5629
  }
5630
+ /** Payload de `precio_actualizado`: solo lleva el costo vigente, nunca el anterior. */
5631
+ interface PriceUpdatedNotificationData {
5632
+ type: 'price_updated';
5633
+ product_id?: string;
5634
+ product_title?: string;
5635
+ variant_id?: string;
5636
+ variant_title?: string;
5637
+ current_price?: string | number;
5638
+ currency_code?: string;
5639
+ /** Margen del dropshipper, % FIJO sobre el costo. */
5640
+ margin_percent?: string | number;
5641
+ }
5642
+ /** Payload de `producto_asignado`. */
5643
+ interface ProductAssignedNotificationData {
5644
+ type: 'product_assigned';
5645
+ product_id?: string;
5646
+ product_title?: string;
5647
+ channel_name?: string;
5648
+ cost?: string | number;
5649
+ /** Margen del dropshipper, % FIJO sobre el costo. */
5650
+ margin_percent?: string | number;
5651
+ }
5652
+ /** Payload de `producto_agotado` / `producto_reabastecido`. */
5653
+ interface StockChangeNotificationData {
5654
+ type: 'restock' | 'out_of_stock';
5655
+ product_id?: string;
5656
+ product_title?: string;
5657
+ variant_id?: string;
5658
+ variant_title?: string;
5659
+ inventory_item_id?: string;
5660
+ stocked_quantity?: string | number;
5661
+ }
5662
+ /** Payload de `manual-admin-notification` (aviso directo). */
5663
+ interface ManualAdminNotificationData {
5664
+ type: 'manual';
5665
+ subject?: string;
5666
+ message?: string;
5667
+ admin_name?: string;
5668
+ admin_id?: string;
5669
+ }
5670
+ /** Datos tipados del payload de una notificación, discriminados por `type`. */
5671
+ type NotificationData = PriceUpdatedNotificationData | ProductAssignedNotificationData | StockChangeNotificationData | ManualAdminNotificationData;
5570
5672
  /**
5571
5673
  * Raw notification record from Medusa's Notification module.
5572
5674
  * A minimal shape of the fields consumed by the dashboard.
@@ -5577,7 +5679,7 @@ interface RawNotification {
5577
5679
  to: string;
5578
5680
  channel: string;
5579
5681
  template: string;
5580
- data: Record<string, unknown> | null;
5682
+ data: NotificationData | null;
5581
5683
  trigger_type: string | null;
5582
5684
  receiver_id: string | null;
5583
5685
  created_at: string;
@@ -5593,4 +5695,4 @@ interface GetNotificationsResponse {
5593
5695
  count: number;
5594
5696
  }
5595
5697
 
5596
- export { type AccountDropdownConfig, type AccountMenuItem, type AcknowledgeCostPriceChangesResponse, type ActiveFilter, type AddOrderEditItemBody, type AddOrderEditItemResponse, type Address, type AdminApiKey, type AdminChannelCategory, type AdminChannelCustomer, type AdminDropshipperAccount, type AdminDropshipperBalance, type AdminProduct, type AdminProductVariant, type AdminSalesChannelRef, type AdminSiteConfig, type AdminSiteConfigHistoryEntry, type AdminSiteConfigHistoryEntryFull, type AdminStorefrontConfig, type AdminStorefrontSeoDefaults, type AdminUser, type AdvancedSearchProductsOptions, type AssignCategoriesToChannelsBody, type AssignCategoriesToChannelsResponse, type AssignCollectionsToChannelsBody, type AssignCollectionsToChannelsResponse, type AuditLog, type AuditLogAdapter, type AuthConfig, type AuthMethod, type AuthProvider, type AuthResponse, type AuthStorage, type AuthorConfig, type BackendCapabilities, type BatchVariantCostItem, type BatchVariantCostsBody, type BatchVariantCostsResponse, type BrandConfig, type CachedPaymentMethods, type CancelDropshipperOrderResponse, type CancelMovementBody, type CancelMovementResponse, type CancelSettlementBody, type Cart, type CartCost, type CartItem, type CartLineInput, type CartLineUpdate, type CartProduct, type CategoryMapping, type ChartDataPoint, type Collection, type CollectionProductsOptions, type CommerceProvider, type CompareProduct, type ConfigHistoryEntry, type ConfirmMovementBody, type ConfirmMovementResponse, type ConfirmOrderEditResponse, type ConfirmSettlementBody, type Connection, type ConvertDropshipperDraftOrderBody, type ConvertDropshipperDraftOrderResponse, type CostPriceChangeItem, type CostPriceChangesCheckResponse, type CostPriceChangesResponse, type Country, type CreateAddressData, type CreateAjusteBody, type CreateAjusteResponse, type CreateCategoryMappingBody, type CreateCategoryMappingResponse, type CreateCobroBody, type CreateCobroResponse, type CreateCompensacionBody, type CreateCompensacionResponse, type CreateDropshipperCategoryBody, type CreateDropshipperCustomerBody, type CreateDropshipperCustomerResponse, type CreateDropshipperDraftOrderBody, type CreateDropshipperDraftOrderResponse, type CreateDropshipperOrderBody, type CreateDropshipperOrderResponse, type CreateDropshipperPromotionBody, type CreateOrderEditBody, type CreateOrderEditResponse, type CreateOrderItem, type CreateOrderNoteBody, type CreateOrderNoteResponse, type CreatePagoBody, type CreatePagoResponse, type CreateReversoBody, type CreateReversoResponse, type CreateSettlementBody, type CreateSettlementResponse, type CreateVariantCostBody, type CreateVariantCostResponse, type Customer, type DashboardChanges, type DashboardConfig, type DashboardMetrics, type DashboardMetricsAdapter, type DashboardOrdersAdapter, type DashboardPeriodMetrics, type DashboardProductsAdapter, type DashboardStats, type DashboardTopProduct, type DeleteCategoryMappingResponse, type DeleteDropshipperCategoryResponse, type DeleteDropshipperPromotionResponse, type DeleteOrderNoteResponse, type DeleteVariantCostResponse, type DesignerConfig, type DesignerHistoryEntry, type DesignerNavItem, type DesignerThemeConfig, type DesignerThemePreset, type DiscountCode, type DropshipperAccount, type DropshipperAccountRef, type DropshipperAddressBody, type DropshipperAddressResponse, type DropshipperAttributeDefinition, type DropshipperAttributeDefinitionValue, type DropshipperBalance, type DropshipperCategory, type DropshipperCostTier, type DropshipperCustomer, type DropshipperCustomerDetail, type DropshipperCustomerOrderRef, type DropshipperCustomerStats, type DropshipperDashboardCapabilities, type DropshipperDraftOrder, type DropshipperDraftOrderItem, type DropshipperOrder, type DropshipperOrderCustomer, type DropshipperOrderDetail, type DropshipperOrderItem, type DropshipperOrderShippingAddress, type DropshipperOrderTimelineEvent, type DropshipperOrderTotals, type DropshipperPayableOrder, type DropshipperPaymentMethodConfig, type DropshipperPendingOrders, type DropshipperPriceItem, type DropshipperProduct, type DropshipperProductAttachment, type DropshipperProductAttribute, type DropshipperProductAttributeValue, type DropshipperProductImage, type DropshipperProductMarginItem, type DropshipperProductOption, type DropshipperProductOptionValue, type DropshipperProductPrivateMedia, type DropshipperProfile, type DropshipperPromotion, type DropshipperReceivableOrder, type DropshipperSaleTier, type DropshipperShippingOption, type DropshipperVariant, type DropshipperVariantMarginOverride, type DynamicSource, type Edge, type ExtendedCreateDropshipperOrderBody, type ExtendedCreateDropshipperOrderResponse, type FilterConfig, type FilterOption, type FilterSection, type FulfillmentOption, type FulfillmentSet, type FulfillmentStatus, type GeoCity, type GeoCountry, type GeoProvince, type GetAdminAccountBalanceResponse, type GetAdminDropshipperAccountOrdersResponse, type GetAdminDropshipperAccountSettlementsOptions, type GetAdminDropshipperAccountSettlementsResponse, type GetAdminDropshipperAccountsResponse, type GetAdminPriceListsResponse, type GetAdminSiteConfigHistoryOptions, type GetAdminSiteConfigHistoryResponse, type GetAdminSiteConfigResponse, type GetAdminStorefrontConfigResponse, type GetCategoriesCallback, type GetCategoriesOptions, type GetCategoryMappingsOptions, type GetCategoryMappingsResponse, type GetCategorySalesChannelsResponse, type GetChannelApiKeysResponse, type GetChannelCategoriesOptions, type GetChannelCategoriesResponse, type GetChannelCustomersOptions, type GetChannelCustomersResponse, type GetCollectionSalesChannelsResponse, type GetCollectionsOptions, type GetCustomersCallback, type GetCustomersOptions, type GetDashboardStatsOptions, type GetDashboardStatsResponse, type GetDropshipperAccountBalanceResponse, type GetDropshipperAccountOrdersOptions, type GetDropshipperAccountOrdersResponse, type GetDropshipperAccountResponse, type GetDropshipperAddressesResponse, type GetDropshipperAttributesResponse, type GetDropshipperCategoriesOptions, type GetDropshipperCategoriesResponse, type GetDropshipperCustomerDetailResponse, type GetDropshipperCustomersOptions, type GetDropshipperCustomersResponse, type GetDropshipperDraftOrderDetailResponse, type GetDropshipperDraftOrdersOptions, type GetDropshipperDraftOrdersResponse, type GetDropshipperOrderDetailResponse, type GetDropshipperOrdersOptions, type GetDropshipperOrdersResponse, type GetDropshipperPayableResponse, type GetDropshipperProductsOptions, type GetDropshipperProductsResponse, type GetDropshipperPromotionsOptions, type GetDropshipperPromotionsResponse, type GetDropshipperReceivableResponse, type GetDropshipperShippingOptionsParams, type GetDropshipperShippingOptionsResponse, type GetFinancialAnalysisResponse, type GetGeoCitiesResponse, type GetGeoCountriesResponse, type GetGeoProvincesResponse, type GetMyProfileResponse, type GetNotificationsOptions, type GetNotificationsResponse, type GetOrderNotesResponse, type GetOrdersCallback, type GetOrdersOptions, type GetProductAttributesResponse, type GetProductsOptions, type GetProviderCategoriesResponse, type GetSettlementDetailResponse, type GetSettlementsOptions, type GetSettlementsResponse, type GetStorefrontDropshipperCategoriesResponse, type GetUserChannelResponse, type GetVariantCostsOptions, type GetVariantCostsResponse, type HeaderLinkItem, type HeaderNavigationConfig, type IconConfig, type Image, type InventoryLevel, type LinkCustomerToChannelResponse, type LoginCredentials, type ModulesConfig, type Money, type NavigationCalloutItem, type NavigationItem, type NavigationLinkItem, type OnboardDropshipperBody, type OnboardDropshipperResponse, type Order, type OrderItem, type OrderNote, type OrderStatus, type OrdersMetrics, PROVIDER_METADATA, type PaginationOptions, type PasswordResetConfirm, type PasswordResetRequest, type PaymentMethod$1 as PaymentMethod, type PaymentMethodFeatures, type PaymentMethodType, type PaymentMethodsOptions, type PaymentStatus, type PriceRange, type Product, type ProductCategory, type ProductOption, type ProductPreview, type ProductVariant, type ProductsMetrics, type PromotionRule, type ProviderCategory, type ProviderConfig, type ProviderTypeString, type RawNotification, type Region, type RegisterData, type RegisterPaymentBody, type RegisterPaymentResponse, type ResolveGuaranteeBody, type ResolveGuaranteeResponse, type RestoreSiteConfigResponse, type Review, type SEO, type SalesMetrics, type SearchBarConfig, type SearchResultMeta, type SelectedOption, type SetPaymentCollectorBody, type SetPaymentCollectorResponse, type SetPaymentMethodBody, type SetPaymentMethodResponse, type SettlementRecord, type SettlementStatus, type ShippingMethod, type SiteConfig, type SiteConfigLabels, type SiteConfigMetadata, type SocialConfig, type SortOption, type SortOptions, type StockLocation, type StockStatus, type StockValidation, type StorefrontConfig, StorefrontConfigError, type StorefrontContext, type StorefrontPlatformType, type StorefrontSeoDefaults, SupportedProviderType, type UnassignCategoriesFromChannelsBody, type UnassignCategoriesFromChannelsResponse, type UnassignCollectionsFromChannelsBody, type UnassignCollectionsFromChannelsResponse, type UpdateCustomerData, type UpdateDropshipperCategoryBody, type UpdateDropshipperCustomerBody, type UpdateDropshipperCustomerResponse, type UpdateDropshipperDraftOrderBody, type UpdateDropshipperDraftOrderResponse, type UpdateDropshipperPricesBody, type UpdateDropshipperPricesResponse, type UpdateDropshipperProductStatusBody, type UpdateDropshipperProductStatusResponse, type UpdateDropshipperPromotionBody, type UpdateSettlementStatusResponse, type UpdateSiteConfigBody, type UpdateSiteConfigResponse, type UpdateStorefrontConfigBody, type UpdateStorefrontConfigResponse, type ValidateCheckoutItemsRequest, type ValidateCheckoutItemsResponse, type ValidatedCheckoutItem, type VariantCost, getProviderMetadata, isSupportedProviderType };
5698
+ export { type AccountDropdownConfig, type AccountMenuItem, type AcknowledgeCostPriceChangesResponse, type ActiveFilter, type AddOrderEditItemBody, type AddOrderEditItemResponse, type Address, type AdminApiKey, type AdminChannelCategory, type AdminChannelCustomer, type AdminDropshipperAccount, type AdminDropshipperBalance, type AdminProduct, type AdminProductVariant, type AdminSalesChannelRef, type AdminSiteConfig, type AdminSiteConfigHistoryEntry, type AdminSiteConfigHistoryEntryFull, type AdminStorefrontConfig, type AdminStorefrontSeoDefaults, type AdminUser, type AdvancedSearchProductsOptions, type AssignCategoriesToChannelsBody, type AssignCategoriesToChannelsResponse, type AssignCollectionsToChannelsBody, type AssignCollectionsToChannelsResponse, type AuditLog, type AuditLogAdapter, type AuthConfig, type AuthMethod, type AuthProvider, type AuthResponse, type AuthStorage, type AuthorConfig, type BackendCapabilities, type BatchVariantCostItem, type BatchVariantCostsBody, type BatchVariantCostsResponse, type BrandConfig, type CachedPaymentMethods, type CancelDropshipperOrderResponse, type CancelMovementBody, type CancelMovementResponse, type CancelSettlementBody, type Cart, type CartCost, type CartItem, type CartLineInput, type CartLineUpdate, type CartProduct, type CategoryMapping, type ChartDataPoint, type ChatIntent, type ChatMessage, type ChatRequest, type ChatResponse, type ChatSource, type ChatSourceVariant, type Collection, type CollectionProductsOptions, type CommerceProvider, type CompareProduct, type ConfigHistoryEntry, type ConfirmMovementBody, type ConfirmMovementResponse, type ConfirmOrderEditResponse, type ConfirmSettlementBody, type Connection, type ConvertDropshipperDraftOrderBody, type ConvertDropshipperDraftOrderResponse, type CostPriceChangeItem, type CostPriceChangesCheckResponse, type CostPriceChangesResponse, type Country, type CreateAddressData, type CreateAjusteBody, type CreateAjusteResponse, type CreateCategoryMappingBody, type CreateCategoryMappingResponse, type CreateCobroBody, type CreateCobroResponse, type CreateCompensacionBody, type CreateCompensacionResponse, type CreateDropshipperCategoryBody, type CreateDropshipperCustomerBody, type CreateDropshipperCustomerResponse, type CreateDropshipperDraftOrderBody, type CreateDropshipperDraftOrderResponse, type CreateDropshipperOrderBody, type CreateDropshipperOrderResponse, type CreateDropshipperPromotionBody, type CreateOrderEditBody, type CreateOrderEditResponse, type CreateOrderItem, type CreateOrderNoteBody, type CreateOrderNoteResponse, type CreatePagoBody, type CreatePagoResponse, type CreateReversoBody, type CreateReversoResponse, type CreateSettlementBody, type CreateSettlementResponse, type CreateVariantCostBody, type CreateVariantCostResponse, type Customer, type DashboardChanges, type DashboardConfig, type DashboardMetrics, type DashboardMetricsAdapter, type DashboardOrdersAdapter, type DashboardPeriodMetrics, type DashboardProductsAdapter, type DashboardStats, type DashboardTopProduct, type DeleteCategoryMappingResponse, type DeleteDropshipperCategoryResponse, type DeleteDropshipperDraftOrderResponse, type DeleteDropshipperPromotionResponse, type DeleteOrderNoteResponse, type DeleteVariantCostResponse, type DesignerConfig, type DesignerHistoryEntry, type DesignerNavItem, type DesignerThemeConfig, type DesignerThemePreset, type DiscountCode, type DropshipperAccount, type DropshipperAccountRef, type DropshipperAddressBody, type DropshipperAddressResponse, type DropshipperAttributeDefinition, type DropshipperAttributeDefinitionValue, type DropshipperBalance, type DropshipperCategory, type DropshipperCostTier, type DropshipperCustomer, type DropshipperCustomerDetail, type DropshipperCustomerOrderRef, type DropshipperCustomerStats, type DropshipperDashboardCapabilities, type DropshipperDraftOrder, type DropshipperDraftOrderItem, type DropshipperOrder, type DropshipperOrderCustomer, type DropshipperOrderDetail, type DropshipperOrderItem, type DropshipperOrderShippingAddress, type DropshipperOrderTimelineEvent, type DropshipperOrderTotals, type DropshipperPayableOrder, type DropshipperPaymentMethodConfig, type DropshipperPendingOrders, type DropshipperPriceItem, type DropshipperProduct, type DropshipperProductAttachment, type DropshipperProductAttribute, type DropshipperProductAttributeValue, type DropshipperProductImage, type DropshipperProductMarginItem, type DropshipperProductOption, type DropshipperProductOptionValue, type DropshipperProductPrivateMedia, type DropshipperProfile, type DropshipperPromotion, type DropshipperReceivableOrder, type DropshipperSaleTier, type DropshipperShippingOption, type DropshipperVariant, type DropshipperVariantMarginOverride, type DynamicSource, type Edge, type ExtendedCreateDropshipperOrderBody, type ExtendedCreateDropshipperOrderResponse, type FilterConfig, type FilterOption, type FilterSection, type FulfillmentOption, type FulfillmentSet, type FulfillmentStatus, type GeoCity, type GeoCountry, type GeoProvince, type GetAdminAccountBalanceResponse, type GetAdminDropshipperAccountOrdersResponse, type GetAdminDropshipperAccountSettlementsOptions, type GetAdminDropshipperAccountSettlementsResponse, type GetAdminDropshipperAccountsResponse, type GetAdminPriceListsResponse, type GetAdminSiteConfigHistoryOptions, type GetAdminSiteConfigHistoryResponse, type GetAdminSiteConfigResponse, type GetAdminStorefrontConfigResponse, type GetCategoriesCallback, type GetCategoriesOptions, type GetCategoryMappingsOptions, type GetCategoryMappingsResponse, type GetCategorySalesChannelsResponse, type GetChannelApiKeysResponse, type GetChannelCategoriesOptions, type GetChannelCategoriesResponse, type GetChannelCustomersOptions, type GetChannelCustomersResponse, type GetCollectionSalesChannelsResponse, type GetCollectionsOptions, type GetCustomersCallback, type GetCustomersOptions, type GetDashboardStatsOptions, type GetDashboardStatsResponse, type GetDropshipperAccountBalanceResponse, type GetDropshipperAccountOrdersOptions, type GetDropshipperAccountOrdersResponse, type GetDropshipperAccountResponse, type GetDropshipperAddressesResponse, type GetDropshipperAttributesResponse, type GetDropshipperCategoriesOptions, type GetDropshipperCategoriesResponse, type GetDropshipperCustomerDetailResponse, type GetDropshipperCustomersOptions, type GetDropshipperCustomersResponse, type GetDropshipperDraftOrderDetailResponse, type GetDropshipperDraftOrdersOptions, type GetDropshipperDraftOrdersResponse, type GetDropshipperOrderDetailResponse, type GetDropshipperOrdersOptions, type GetDropshipperOrdersResponse, type GetDropshipperPayableResponse, type GetDropshipperProductsOptions, type GetDropshipperProductsResponse, type GetDropshipperPromotionsOptions, type GetDropshipperPromotionsResponse, type GetDropshipperReceivableResponse, type GetDropshipperShippingOptionsParams, type GetDropshipperShippingOptionsResponse, type GetFinancialAnalysisResponse, type GetGeoCitiesResponse, type GetGeoCountriesResponse, type GetGeoProvincesResponse, type GetMyProfileResponse, type GetNotificationsOptions, type GetNotificationsResponse, type GetOrderNotesResponse, type GetOrdersCallback, type GetOrdersOptions, type GetProductAttributesResponse, type GetProductsOptions, type GetProviderCategoriesResponse, type GetSettlementDetailResponse, type GetSettlementsOptions, type GetSettlementsResponse, type GetStorefrontDropshipperCategoriesResponse, type GetUserChannelResponse, type GetVariantCostsOptions, type GetVariantCostsResponse, type HeaderLinkItem, type HeaderNavigationConfig, type IconConfig, type Image, type InventoryLevel, type LinkCustomerToChannelResponse, type LoginCredentials, type ManualAdminNotificationData, type ModulesConfig, type Money, type NavigationCalloutItem, type NavigationItem, type NavigationLinkItem, type NotificationData, type OnboardDropshipperBody, type OnboardDropshipperResponse, type Order, type OrderItem, type OrderNote, type OrderStatus, type OrdersMetrics, PROVIDER_METADATA, type PaginationOptions, type PasswordResetConfirm, type PasswordResetRequest, type PaymentMethod$1 as PaymentMethod, type PaymentMethodFeatures, type PaymentMethodType, type PaymentMethodsOptions, type PaymentStatus, type PriceRange, type PriceUpdatedNotificationData, type Product, type ProductAssignedNotificationData, type ProductCategory, type ProductOption, type ProductPreview, type ProductVariant, type ProductsMetrics, type PromotionRule, type ProviderCategory, type ProviderConfig, type ProviderTypeString, type RawNotification, type Region, type RegisterData, type RegisterPaymentBody, type RegisterPaymentResponse, type ResolveGuaranteeBody, type ResolveGuaranteeResponse, type RestoreSiteConfigResponse, type Review, type SEO, type SalesMetrics, type SearchBarConfig, type SearchResultMeta, type SelectedOption, type SetPaymentCollectorBody, type SetPaymentCollectorResponse, type SetPaymentMethodBody, type SetPaymentMethodResponse, type SettlementRecord, type SettlementStatus, type ShippingMethod, type SiteConfig, type SiteConfigLabels, type SiteConfigMetadata, type SocialConfig, type SortOption, type SortOptions, type StockChangeNotificationData, type StockLocation, type StockStatus, type StockValidation, type StorefrontConfig, StorefrontConfigError, type StorefrontContext, type StorefrontPlatformType, type StorefrontSeoDefaults, SupportedProviderType, type UnassignCategoriesFromChannelsBody, type UnassignCategoriesFromChannelsResponse, type UnassignCollectionsFromChannelsBody, type UnassignCollectionsFromChannelsResponse, type UpdateCustomerData, type UpdateDropshipperCategoryBody, type UpdateDropshipperCustomerBody, type UpdateDropshipperCustomerResponse, type UpdateDropshipperDraftOrderBody, type UpdateDropshipperDraftOrderResponse, type UpdateDropshipperPricesBody, type UpdateDropshipperPricesResponse, type UpdateDropshipperProductStatusBody, type UpdateDropshipperProductStatusResponse, type UpdateDropshipperPromotionBody, type UpdateSettlementStatusResponse, type UpdateSiteConfigBody, type UpdateSiteConfigResponse, type UpdateStorefrontConfigBody, type UpdateStorefrontConfigResponse, type ValidateCheckoutItemsRequest, type ValidateCheckoutItemsResponse, type ValidatedCheckoutItem, type VariantCost, getProviderMetadata, isSupportedProviderType };
package/dist/index.d.ts CHANGED
@@ -4160,6 +4160,19 @@ interface DropshipperOrderDetail {
4160
4160
  name: string;
4161
4161
  amount: number;
4162
4162
  shipping_option_id: string | null;
4163
+ /** Fulfillment intent of the underlying shipping option: 'delivery' | 'pickup' | 'shipping' | null */
4164
+ fulfillment_set_type?: string | null;
4165
+ pickup_location?: {
4166
+ id: string;
4167
+ name: string;
4168
+ address: {
4169
+ address_1: string;
4170
+ city: string | null;
4171
+ province: string | null;
4172
+ postal_code: string | null;
4173
+ country_code: string;
4174
+ } | null;
4175
+ } | null;
4163
4176
  } | null;
4164
4177
  payment_collected_by: 'dropshipper' | 'provider' | null;
4165
4178
  payment_method?: {
@@ -4409,6 +4422,11 @@ interface ConvertDropshipperDraftOrderResponse {
4409
4422
  message: string;
4410
4423
  draft_id: string;
4411
4424
  }
4425
+ /** Response for `DELETE /admin/thor/dropshipper/draft-orders/:id` */
4426
+ interface DeleteDropshipperDraftOrderResponse {
4427
+ id: string;
4428
+ deleted: boolean;
4429
+ }
4412
4430
  /** A dropshipper custom category node */
4413
4431
  interface DropshipperCategory {
4414
4432
  id: string;
@@ -5431,6 +5449,8 @@ interface RegisterPaymentResponse {
5431
5449
  interface DropshipperDashboardCapabilities {
5432
5450
  /** Core navigation — always expected to be true */
5433
5451
  dashboard: boolean;
5452
+ /** AI assistant chat (catalog intelligence) */
5453
+ aiAssistant: boolean;
5434
5454
  orders: boolean;
5435
5455
  products: boolean;
5436
5456
  prices: boolean;
@@ -5448,6 +5468,46 @@ interface DropshipperDashboardCapabilities {
5448
5468
  integrations: boolean;
5449
5469
  team: boolean;
5450
5470
  }
5471
+ /** A single turn in the stateless chat history sent with each request */
5472
+ interface ChatMessage {
5473
+ role: 'user' | 'assistant';
5474
+ content: string;
5475
+ }
5476
+ /** Request body for `POST /admin/thor/dropshipper/ai/chat` */
5477
+ interface ChatRequest {
5478
+ messages: ChatMessage[];
5479
+ model?: string;
5480
+ }
5481
+ /** Semantic intent extracted by the backend classifier */
5482
+ type ChatIntent = 'catalog_search' | 'greeting' | 'other';
5483
+ /** Summarized variant attached to a chat source product */
5484
+ interface ChatSourceVariant {
5485
+ id: string;
5486
+ title: string;
5487
+ sku: string;
5488
+ sale_price: number;
5489
+ margin_percent: number;
5490
+ available_quantity: number;
5491
+ }
5492
+ /** A catalog product referenced by the assistant answer */
5493
+ interface ChatSource {
5494
+ product_id: string;
5495
+ title: string;
5496
+ handle: string;
5497
+ thumbnail: string | null;
5498
+ sale_price: number;
5499
+ cost_price: number | null;
5500
+ margin_percent: number | null;
5501
+ available_quantity: number;
5502
+ variants_summary: ChatSourceVariant[];
5503
+ }
5504
+ /** Response from `POST /admin/thor/dropshipper/ai/chat` */
5505
+ interface ChatResponse {
5506
+ answer: string;
5507
+ intent: ChatIntent;
5508
+ model_used: string;
5509
+ sources: ChatSource[];
5510
+ }
5451
5511
  /** A geo-reference country */
5452
5512
  interface GeoCountry {
5453
5513
  id: string;
@@ -5567,6 +5627,48 @@ interface CostPriceChangesResponse {
5567
5627
  interface AcknowledgeCostPriceChangesResponse {
5568
5628
  acknowledged: boolean;
5569
5629
  }
5630
+ /** Payload de `precio_actualizado`: solo lleva el costo vigente, nunca el anterior. */
5631
+ interface PriceUpdatedNotificationData {
5632
+ type: 'price_updated';
5633
+ product_id?: string;
5634
+ product_title?: string;
5635
+ variant_id?: string;
5636
+ variant_title?: string;
5637
+ current_price?: string | number;
5638
+ currency_code?: string;
5639
+ /** Margen del dropshipper, % FIJO sobre el costo. */
5640
+ margin_percent?: string | number;
5641
+ }
5642
+ /** Payload de `producto_asignado`. */
5643
+ interface ProductAssignedNotificationData {
5644
+ type: 'product_assigned';
5645
+ product_id?: string;
5646
+ product_title?: string;
5647
+ channel_name?: string;
5648
+ cost?: string | number;
5649
+ /** Margen del dropshipper, % FIJO sobre el costo. */
5650
+ margin_percent?: string | number;
5651
+ }
5652
+ /** Payload de `producto_agotado` / `producto_reabastecido`. */
5653
+ interface StockChangeNotificationData {
5654
+ type: 'restock' | 'out_of_stock';
5655
+ product_id?: string;
5656
+ product_title?: string;
5657
+ variant_id?: string;
5658
+ variant_title?: string;
5659
+ inventory_item_id?: string;
5660
+ stocked_quantity?: string | number;
5661
+ }
5662
+ /** Payload de `manual-admin-notification` (aviso directo). */
5663
+ interface ManualAdminNotificationData {
5664
+ type: 'manual';
5665
+ subject?: string;
5666
+ message?: string;
5667
+ admin_name?: string;
5668
+ admin_id?: string;
5669
+ }
5670
+ /** Datos tipados del payload de una notificación, discriminados por `type`. */
5671
+ type NotificationData = PriceUpdatedNotificationData | ProductAssignedNotificationData | StockChangeNotificationData | ManualAdminNotificationData;
5570
5672
  /**
5571
5673
  * Raw notification record from Medusa's Notification module.
5572
5674
  * A minimal shape of the fields consumed by the dashboard.
@@ -5577,7 +5679,7 @@ interface RawNotification {
5577
5679
  to: string;
5578
5680
  channel: string;
5579
5681
  template: string;
5580
- data: Record<string, unknown> | null;
5682
+ data: NotificationData | null;
5581
5683
  trigger_type: string | null;
5582
5684
  receiver_id: string | null;
5583
5685
  created_at: string;
@@ -5593,4 +5695,4 @@ interface GetNotificationsResponse {
5593
5695
  count: number;
5594
5696
  }
5595
5697
 
5596
- export { type AccountDropdownConfig, type AccountMenuItem, type AcknowledgeCostPriceChangesResponse, type ActiveFilter, type AddOrderEditItemBody, type AddOrderEditItemResponse, type Address, type AdminApiKey, type AdminChannelCategory, type AdminChannelCustomer, type AdminDropshipperAccount, type AdminDropshipperBalance, type AdminProduct, type AdminProductVariant, type AdminSalesChannelRef, type AdminSiteConfig, type AdminSiteConfigHistoryEntry, type AdminSiteConfigHistoryEntryFull, type AdminStorefrontConfig, type AdminStorefrontSeoDefaults, type AdminUser, type AdvancedSearchProductsOptions, type AssignCategoriesToChannelsBody, type AssignCategoriesToChannelsResponse, type AssignCollectionsToChannelsBody, type AssignCollectionsToChannelsResponse, type AuditLog, type AuditLogAdapter, type AuthConfig, type AuthMethod, type AuthProvider, type AuthResponse, type AuthStorage, type AuthorConfig, type BackendCapabilities, type BatchVariantCostItem, type BatchVariantCostsBody, type BatchVariantCostsResponse, type BrandConfig, type CachedPaymentMethods, type CancelDropshipperOrderResponse, type CancelMovementBody, type CancelMovementResponse, type CancelSettlementBody, type Cart, type CartCost, type CartItem, type CartLineInput, type CartLineUpdate, type CartProduct, type CategoryMapping, type ChartDataPoint, type Collection, type CollectionProductsOptions, type CommerceProvider, type CompareProduct, type ConfigHistoryEntry, type ConfirmMovementBody, type ConfirmMovementResponse, type ConfirmOrderEditResponse, type ConfirmSettlementBody, type Connection, type ConvertDropshipperDraftOrderBody, type ConvertDropshipperDraftOrderResponse, type CostPriceChangeItem, type CostPriceChangesCheckResponse, type CostPriceChangesResponse, type Country, type CreateAddressData, type CreateAjusteBody, type CreateAjusteResponse, type CreateCategoryMappingBody, type CreateCategoryMappingResponse, type CreateCobroBody, type CreateCobroResponse, type CreateCompensacionBody, type CreateCompensacionResponse, type CreateDropshipperCategoryBody, type CreateDropshipperCustomerBody, type CreateDropshipperCustomerResponse, type CreateDropshipperDraftOrderBody, type CreateDropshipperDraftOrderResponse, type CreateDropshipperOrderBody, type CreateDropshipperOrderResponse, type CreateDropshipperPromotionBody, type CreateOrderEditBody, type CreateOrderEditResponse, type CreateOrderItem, type CreateOrderNoteBody, type CreateOrderNoteResponse, type CreatePagoBody, type CreatePagoResponse, type CreateReversoBody, type CreateReversoResponse, type CreateSettlementBody, type CreateSettlementResponse, type CreateVariantCostBody, type CreateVariantCostResponse, type Customer, type DashboardChanges, type DashboardConfig, type DashboardMetrics, type DashboardMetricsAdapter, type DashboardOrdersAdapter, type DashboardPeriodMetrics, type DashboardProductsAdapter, type DashboardStats, type DashboardTopProduct, type DeleteCategoryMappingResponse, type DeleteDropshipperCategoryResponse, type DeleteDropshipperPromotionResponse, type DeleteOrderNoteResponse, type DeleteVariantCostResponse, type DesignerConfig, type DesignerHistoryEntry, type DesignerNavItem, type DesignerThemeConfig, type DesignerThemePreset, type DiscountCode, type DropshipperAccount, type DropshipperAccountRef, type DropshipperAddressBody, type DropshipperAddressResponse, type DropshipperAttributeDefinition, type DropshipperAttributeDefinitionValue, type DropshipperBalance, type DropshipperCategory, type DropshipperCostTier, type DropshipperCustomer, type DropshipperCustomerDetail, type DropshipperCustomerOrderRef, type DropshipperCustomerStats, type DropshipperDashboardCapabilities, type DropshipperDraftOrder, type DropshipperDraftOrderItem, type DropshipperOrder, type DropshipperOrderCustomer, type DropshipperOrderDetail, type DropshipperOrderItem, type DropshipperOrderShippingAddress, type DropshipperOrderTimelineEvent, type DropshipperOrderTotals, type DropshipperPayableOrder, type DropshipperPaymentMethodConfig, type DropshipperPendingOrders, type DropshipperPriceItem, type DropshipperProduct, type DropshipperProductAttachment, type DropshipperProductAttribute, type DropshipperProductAttributeValue, type DropshipperProductImage, type DropshipperProductMarginItem, type DropshipperProductOption, type DropshipperProductOptionValue, type DropshipperProductPrivateMedia, type DropshipperProfile, type DropshipperPromotion, type DropshipperReceivableOrder, type DropshipperSaleTier, type DropshipperShippingOption, type DropshipperVariant, type DropshipperVariantMarginOverride, type DynamicSource, type Edge, type ExtendedCreateDropshipperOrderBody, type ExtendedCreateDropshipperOrderResponse, type FilterConfig, type FilterOption, type FilterSection, type FulfillmentOption, type FulfillmentSet, type FulfillmentStatus, type GeoCity, type GeoCountry, type GeoProvince, type GetAdminAccountBalanceResponse, type GetAdminDropshipperAccountOrdersResponse, type GetAdminDropshipperAccountSettlementsOptions, type GetAdminDropshipperAccountSettlementsResponse, type GetAdminDropshipperAccountsResponse, type GetAdminPriceListsResponse, type GetAdminSiteConfigHistoryOptions, type GetAdminSiteConfigHistoryResponse, type GetAdminSiteConfigResponse, type GetAdminStorefrontConfigResponse, type GetCategoriesCallback, type GetCategoriesOptions, type GetCategoryMappingsOptions, type GetCategoryMappingsResponse, type GetCategorySalesChannelsResponse, type GetChannelApiKeysResponse, type GetChannelCategoriesOptions, type GetChannelCategoriesResponse, type GetChannelCustomersOptions, type GetChannelCustomersResponse, type GetCollectionSalesChannelsResponse, type GetCollectionsOptions, type GetCustomersCallback, type GetCustomersOptions, type GetDashboardStatsOptions, type GetDashboardStatsResponse, type GetDropshipperAccountBalanceResponse, type GetDropshipperAccountOrdersOptions, type GetDropshipperAccountOrdersResponse, type GetDropshipperAccountResponse, type GetDropshipperAddressesResponse, type GetDropshipperAttributesResponse, type GetDropshipperCategoriesOptions, type GetDropshipperCategoriesResponse, type GetDropshipperCustomerDetailResponse, type GetDropshipperCustomersOptions, type GetDropshipperCustomersResponse, type GetDropshipperDraftOrderDetailResponse, type GetDropshipperDraftOrdersOptions, type GetDropshipperDraftOrdersResponse, type GetDropshipperOrderDetailResponse, type GetDropshipperOrdersOptions, type GetDropshipperOrdersResponse, type GetDropshipperPayableResponse, type GetDropshipperProductsOptions, type GetDropshipperProductsResponse, type GetDropshipperPromotionsOptions, type GetDropshipperPromotionsResponse, type GetDropshipperReceivableResponse, type GetDropshipperShippingOptionsParams, type GetDropshipperShippingOptionsResponse, type GetFinancialAnalysisResponse, type GetGeoCitiesResponse, type GetGeoCountriesResponse, type GetGeoProvincesResponse, type GetMyProfileResponse, type GetNotificationsOptions, type GetNotificationsResponse, type GetOrderNotesResponse, type GetOrdersCallback, type GetOrdersOptions, type GetProductAttributesResponse, type GetProductsOptions, type GetProviderCategoriesResponse, type GetSettlementDetailResponse, type GetSettlementsOptions, type GetSettlementsResponse, type GetStorefrontDropshipperCategoriesResponse, type GetUserChannelResponse, type GetVariantCostsOptions, type GetVariantCostsResponse, type HeaderLinkItem, type HeaderNavigationConfig, type IconConfig, type Image, type InventoryLevel, type LinkCustomerToChannelResponse, type LoginCredentials, type ModulesConfig, type Money, type NavigationCalloutItem, type NavigationItem, type NavigationLinkItem, type OnboardDropshipperBody, type OnboardDropshipperResponse, type Order, type OrderItem, type OrderNote, type OrderStatus, type OrdersMetrics, PROVIDER_METADATA, type PaginationOptions, type PasswordResetConfirm, type PasswordResetRequest, type PaymentMethod$1 as PaymentMethod, type PaymentMethodFeatures, type PaymentMethodType, type PaymentMethodsOptions, type PaymentStatus, type PriceRange, type Product, type ProductCategory, type ProductOption, type ProductPreview, type ProductVariant, type ProductsMetrics, type PromotionRule, type ProviderCategory, type ProviderConfig, type ProviderTypeString, type RawNotification, type Region, type RegisterData, type RegisterPaymentBody, type RegisterPaymentResponse, type ResolveGuaranteeBody, type ResolveGuaranteeResponse, type RestoreSiteConfigResponse, type Review, type SEO, type SalesMetrics, type SearchBarConfig, type SearchResultMeta, type SelectedOption, type SetPaymentCollectorBody, type SetPaymentCollectorResponse, type SetPaymentMethodBody, type SetPaymentMethodResponse, type SettlementRecord, type SettlementStatus, type ShippingMethod, type SiteConfig, type SiteConfigLabels, type SiteConfigMetadata, type SocialConfig, type SortOption, type SortOptions, type StockLocation, type StockStatus, type StockValidation, type StorefrontConfig, StorefrontConfigError, type StorefrontContext, type StorefrontPlatformType, type StorefrontSeoDefaults, SupportedProviderType, type UnassignCategoriesFromChannelsBody, type UnassignCategoriesFromChannelsResponse, type UnassignCollectionsFromChannelsBody, type UnassignCollectionsFromChannelsResponse, type UpdateCustomerData, type UpdateDropshipperCategoryBody, type UpdateDropshipperCustomerBody, type UpdateDropshipperCustomerResponse, type UpdateDropshipperDraftOrderBody, type UpdateDropshipperDraftOrderResponse, type UpdateDropshipperPricesBody, type UpdateDropshipperPricesResponse, type UpdateDropshipperProductStatusBody, type UpdateDropshipperProductStatusResponse, type UpdateDropshipperPromotionBody, type UpdateSettlementStatusResponse, type UpdateSiteConfigBody, type UpdateSiteConfigResponse, type UpdateStorefrontConfigBody, type UpdateStorefrontConfigResponse, type ValidateCheckoutItemsRequest, type ValidateCheckoutItemsResponse, type ValidatedCheckoutItem, type VariantCost, getProviderMetadata, isSupportedProviderType };
5698
+ export { type AccountDropdownConfig, type AccountMenuItem, type AcknowledgeCostPriceChangesResponse, type ActiveFilter, type AddOrderEditItemBody, type AddOrderEditItemResponse, type Address, type AdminApiKey, type AdminChannelCategory, type AdminChannelCustomer, type AdminDropshipperAccount, type AdminDropshipperBalance, type AdminProduct, type AdminProductVariant, type AdminSalesChannelRef, type AdminSiteConfig, type AdminSiteConfigHistoryEntry, type AdminSiteConfigHistoryEntryFull, type AdminStorefrontConfig, type AdminStorefrontSeoDefaults, type AdminUser, type AdvancedSearchProductsOptions, type AssignCategoriesToChannelsBody, type AssignCategoriesToChannelsResponse, type AssignCollectionsToChannelsBody, type AssignCollectionsToChannelsResponse, type AuditLog, type AuditLogAdapter, type AuthConfig, type AuthMethod, type AuthProvider, type AuthResponse, type AuthStorage, type AuthorConfig, type BackendCapabilities, type BatchVariantCostItem, type BatchVariantCostsBody, type BatchVariantCostsResponse, type BrandConfig, type CachedPaymentMethods, type CancelDropshipperOrderResponse, type CancelMovementBody, type CancelMovementResponse, type CancelSettlementBody, type Cart, type CartCost, type CartItem, type CartLineInput, type CartLineUpdate, type CartProduct, type CategoryMapping, type ChartDataPoint, type ChatIntent, type ChatMessage, type ChatRequest, type ChatResponse, type ChatSource, type ChatSourceVariant, type Collection, type CollectionProductsOptions, type CommerceProvider, type CompareProduct, type ConfigHistoryEntry, type ConfirmMovementBody, type ConfirmMovementResponse, type ConfirmOrderEditResponse, type ConfirmSettlementBody, type Connection, type ConvertDropshipperDraftOrderBody, type ConvertDropshipperDraftOrderResponse, type CostPriceChangeItem, type CostPriceChangesCheckResponse, type CostPriceChangesResponse, type Country, type CreateAddressData, type CreateAjusteBody, type CreateAjusteResponse, type CreateCategoryMappingBody, type CreateCategoryMappingResponse, type CreateCobroBody, type CreateCobroResponse, type CreateCompensacionBody, type CreateCompensacionResponse, type CreateDropshipperCategoryBody, type CreateDropshipperCustomerBody, type CreateDropshipperCustomerResponse, type CreateDropshipperDraftOrderBody, type CreateDropshipperDraftOrderResponse, type CreateDropshipperOrderBody, type CreateDropshipperOrderResponse, type CreateDropshipperPromotionBody, type CreateOrderEditBody, type CreateOrderEditResponse, type CreateOrderItem, type CreateOrderNoteBody, type CreateOrderNoteResponse, type CreatePagoBody, type CreatePagoResponse, type CreateReversoBody, type CreateReversoResponse, type CreateSettlementBody, type CreateSettlementResponse, type CreateVariantCostBody, type CreateVariantCostResponse, type Customer, type DashboardChanges, type DashboardConfig, type DashboardMetrics, type DashboardMetricsAdapter, type DashboardOrdersAdapter, type DashboardPeriodMetrics, type DashboardProductsAdapter, type DashboardStats, type DashboardTopProduct, type DeleteCategoryMappingResponse, type DeleteDropshipperCategoryResponse, type DeleteDropshipperDraftOrderResponse, type DeleteDropshipperPromotionResponse, type DeleteOrderNoteResponse, type DeleteVariantCostResponse, type DesignerConfig, type DesignerHistoryEntry, type DesignerNavItem, type DesignerThemeConfig, type DesignerThemePreset, type DiscountCode, type DropshipperAccount, type DropshipperAccountRef, type DropshipperAddressBody, type DropshipperAddressResponse, type DropshipperAttributeDefinition, type DropshipperAttributeDefinitionValue, type DropshipperBalance, type DropshipperCategory, type DropshipperCostTier, type DropshipperCustomer, type DropshipperCustomerDetail, type DropshipperCustomerOrderRef, type DropshipperCustomerStats, type DropshipperDashboardCapabilities, type DropshipperDraftOrder, type DropshipperDraftOrderItem, type DropshipperOrder, type DropshipperOrderCustomer, type DropshipperOrderDetail, type DropshipperOrderItem, type DropshipperOrderShippingAddress, type DropshipperOrderTimelineEvent, type DropshipperOrderTotals, type DropshipperPayableOrder, type DropshipperPaymentMethodConfig, type DropshipperPendingOrders, type DropshipperPriceItem, type DropshipperProduct, type DropshipperProductAttachment, type DropshipperProductAttribute, type DropshipperProductAttributeValue, type DropshipperProductImage, type DropshipperProductMarginItem, type DropshipperProductOption, type DropshipperProductOptionValue, type DropshipperProductPrivateMedia, type DropshipperProfile, type DropshipperPromotion, type DropshipperReceivableOrder, type DropshipperSaleTier, type DropshipperShippingOption, type DropshipperVariant, type DropshipperVariantMarginOverride, type DynamicSource, type Edge, type ExtendedCreateDropshipperOrderBody, type ExtendedCreateDropshipperOrderResponse, type FilterConfig, type FilterOption, type FilterSection, type FulfillmentOption, type FulfillmentSet, type FulfillmentStatus, type GeoCity, type GeoCountry, type GeoProvince, type GetAdminAccountBalanceResponse, type GetAdminDropshipperAccountOrdersResponse, type GetAdminDropshipperAccountSettlementsOptions, type GetAdminDropshipperAccountSettlementsResponse, type GetAdminDropshipperAccountsResponse, type GetAdminPriceListsResponse, type GetAdminSiteConfigHistoryOptions, type GetAdminSiteConfigHistoryResponse, type GetAdminSiteConfigResponse, type GetAdminStorefrontConfigResponse, type GetCategoriesCallback, type GetCategoriesOptions, type GetCategoryMappingsOptions, type GetCategoryMappingsResponse, type GetCategorySalesChannelsResponse, type GetChannelApiKeysResponse, type GetChannelCategoriesOptions, type GetChannelCategoriesResponse, type GetChannelCustomersOptions, type GetChannelCustomersResponse, type GetCollectionSalesChannelsResponse, type GetCollectionsOptions, type GetCustomersCallback, type GetCustomersOptions, type GetDashboardStatsOptions, type GetDashboardStatsResponse, type GetDropshipperAccountBalanceResponse, type GetDropshipperAccountOrdersOptions, type GetDropshipperAccountOrdersResponse, type GetDropshipperAccountResponse, type GetDropshipperAddressesResponse, type GetDropshipperAttributesResponse, type GetDropshipperCategoriesOptions, type GetDropshipperCategoriesResponse, type GetDropshipperCustomerDetailResponse, type GetDropshipperCustomersOptions, type GetDropshipperCustomersResponse, type GetDropshipperDraftOrderDetailResponse, type GetDropshipperDraftOrdersOptions, type GetDropshipperDraftOrdersResponse, type GetDropshipperOrderDetailResponse, type GetDropshipperOrdersOptions, type GetDropshipperOrdersResponse, type GetDropshipperPayableResponse, type GetDropshipperProductsOptions, type GetDropshipperProductsResponse, type GetDropshipperPromotionsOptions, type GetDropshipperPromotionsResponse, type GetDropshipperReceivableResponse, type GetDropshipperShippingOptionsParams, type GetDropshipperShippingOptionsResponse, type GetFinancialAnalysisResponse, type GetGeoCitiesResponse, type GetGeoCountriesResponse, type GetGeoProvincesResponse, type GetMyProfileResponse, type GetNotificationsOptions, type GetNotificationsResponse, type GetOrderNotesResponse, type GetOrdersCallback, type GetOrdersOptions, type GetProductAttributesResponse, type GetProductsOptions, type GetProviderCategoriesResponse, type GetSettlementDetailResponse, type GetSettlementsOptions, type GetSettlementsResponse, type GetStorefrontDropshipperCategoriesResponse, type GetUserChannelResponse, type GetVariantCostsOptions, type GetVariantCostsResponse, type HeaderLinkItem, type HeaderNavigationConfig, type IconConfig, type Image, type InventoryLevel, type LinkCustomerToChannelResponse, type LoginCredentials, type ManualAdminNotificationData, type ModulesConfig, type Money, type NavigationCalloutItem, type NavigationItem, type NavigationLinkItem, type NotificationData, type OnboardDropshipperBody, type OnboardDropshipperResponse, type Order, type OrderItem, type OrderNote, type OrderStatus, type OrdersMetrics, PROVIDER_METADATA, type PaginationOptions, type PasswordResetConfirm, type PasswordResetRequest, type PaymentMethod$1 as PaymentMethod, type PaymentMethodFeatures, type PaymentMethodType, type PaymentMethodsOptions, type PaymentStatus, type PriceRange, type PriceUpdatedNotificationData, type Product, type ProductAssignedNotificationData, type ProductCategory, type ProductOption, type ProductPreview, type ProductVariant, type ProductsMetrics, type PromotionRule, type ProviderCategory, type ProviderConfig, type ProviderTypeString, type RawNotification, type Region, type RegisterData, type RegisterPaymentBody, type RegisterPaymentResponse, type ResolveGuaranteeBody, type ResolveGuaranteeResponse, type RestoreSiteConfigResponse, type Review, type SEO, type SalesMetrics, type SearchBarConfig, type SearchResultMeta, type SelectedOption, type SetPaymentCollectorBody, type SetPaymentCollectorResponse, type SetPaymentMethodBody, type SetPaymentMethodResponse, type SettlementRecord, type SettlementStatus, type ShippingMethod, type SiteConfig, type SiteConfigLabels, type SiteConfigMetadata, type SocialConfig, type SortOption, type SortOptions, type StockChangeNotificationData, type StockLocation, type StockStatus, type StockValidation, type StorefrontConfig, StorefrontConfigError, type StorefrontContext, type StorefrontPlatformType, type StorefrontSeoDefaults, SupportedProviderType, type UnassignCategoriesFromChannelsBody, type UnassignCategoriesFromChannelsResponse, type UnassignCollectionsFromChannelsBody, type UnassignCollectionsFromChannelsResponse, type UpdateCustomerData, type UpdateDropshipperCategoryBody, type UpdateDropshipperCustomerBody, type UpdateDropshipperCustomerResponse, type UpdateDropshipperDraftOrderBody, type UpdateDropshipperDraftOrderResponse, type UpdateDropshipperPricesBody, type UpdateDropshipperPricesResponse, type UpdateDropshipperProductStatusBody, type UpdateDropshipperProductStatusResponse, type UpdateDropshipperPromotionBody, type UpdateSettlementStatusResponse, type UpdateSiteConfigBody, type UpdateSiteConfigResponse, type UpdateStorefrontConfigBody, type UpdateStorefrontConfigResponse, type ValidateCheckoutItemsRequest, type ValidateCheckoutItemsResponse, type ValidatedCheckoutItem, type VariantCost, getProviderMetadata, isSupportedProviderType };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/provider.ts","../src/storefront.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} from './common';\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// 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} 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 OrderItem,\n OrderStatus,\n PaymentStatus,\n FulfillmentStatus,\n GetOrdersOptions,\n GetOrdersCallback,\n} from './order';\n\n// ============================================\n// Provider Types (L1 - Source of Truth)\n// ============================================\nexport { SupportedProviderType, type ProviderTypeString } from './provider';\n\nexport {\n isSupportedProviderType,\n getProviderMetadata,\n PROVIDER_METADATA,\n} from './provider';\n\n// ============================================\n// Storefront Types\n// ============================================\nexport type {\n StorefrontContext,\n StorefrontPlatformType,\n} from './storefront';\n\nexport {\n StorefrontConfigError,\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} from './auth';\n\n// ============================================\n// Payment Types\n// ============================================\nexport type {\n PaymentMethod,\n PaymentMethodType,\n PaymentMethodFeatures,\n PaymentMethodsOptions,\n CachedPaymentMethods,\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 VariantCost,\n GetVariantCostsOptions,\n GetVariantCostsResponse,\n CreateVariantCostBody,\n CreateVariantCostResponse,\n BatchVariantCostItem,\n BatchVariantCostsBody,\n BatchVariantCostsResponse,\n DeleteVariantCostResponse,\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 DropshipperVariantMarginOverride,\n DropshipperProductMarginItem,\n DropshipperPriceItem,\n UpdateDropshipperPricesBody,\n UpdateDropshipperPricesResponse,\n DropshipperOrderCustomer,\n DropshipperOrder,\n GetDropshipperOrdersOptions,\n GetDropshipperOrdersResponse,\n DropshipperShippingOption,\n GetDropshipperShippingOptionsParams,\n GetDropshipperShippingOptionsResponse,\n DropshipperOrderShippingAddress,\n DropshipperOrderItem,\n DropshipperOrderTotals,\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 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 DropshipperCustomerOrderRef,\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 // 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 // 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 RawNotification,\n GetNotificationsOptions,\n GetNotificationsResponse,\n } from './admin';\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","/**\n * @thorprovider/types — Supported Providers\n *\n * Centralized list of all supported commerce providers.\n * This is the single source of truth for provider types across the monorepo.\n *\n * @remarks\n * - L1 (Foundation): Defines the contract\n * - L2 (@thorprovider/adapters) imports from here to build the factory\n * - L5 (Starters) uses the factory which is bound to this enum\n *\n * When adding a new provider (e.g., Stel Order):\n * 1. Add to SupportedProviderType enum below\n * 2. Update @thorprovider/adapters factory/index.ts with discriminated union\n * 3. Create packages/adapters/src/providers/shopify/\n * 4. Implement CommerceProvider interface\n * 5. Update StorefrontPlatformType in storefront.ts\n */\n\n/**\n * All supported commerce platform providers.\n * `mock` is the backend-optional runtime provider used for layout/design mode.\n * `medusa` is fully implemented for real backend usage; others are placeholders for future expansion.\n *\n * @remarks Implementation status:\n * - ✅ mock: Fixture-backed provider for backend-optional storefronts\n * - ✅ medusa: Fully implemented\n * - 🟡 stelorder: In progress (ERP adapter v1)\n * - 🟡 shopify: Planned (Phase 2)\n * - 🟡 bigcommerce: Planned (Phase 2)\n * - 🟡 woocommerce: Planned (Phase 3)\n * - 🟡 spree: Planned (Phase 3)\n * - 🟡 magento: Planned (Phase 3)\n */\nexport enum SupportedProviderType {\n Mock = 'mock',\n Medusa = 'medusa',\n StelOrder = 'stelorder',\n Shopify = 'shopify',\n BigCommerce = 'bigcommerce',\n WooCommerce = 'woocommerce',\n Spree = 'spree',\n Magento = 'magento',\n}\n\n/**\n * Union type of all supported provider string values.\n * Use this for type annotations when a provider type is expected.\n *\n * @example\n * ```typescript\n * function getProviderName(type: ProviderTypeString): string {\n * // type is 'medusa'\n * }\n * ```\n */\nexport type ProviderTypeString = 'mock' | 'medusa' | 'stelorder' | 'shopify' | 'bigcommerce' | 'woocommerce' | 'spree' | 'magento';\n\n/**\n * Metadata about each provider.\n * Useful for UI, error messages, validation, and documentation.\n *\n * @internal\n */\nexport const PROVIDER_METADATA: Record<\n ProviderTypeString,\n {\n name: string;\n description: string;\n requiresStorefront: boolean;\n requiredEnvVars: string[];\n maxRetries: number;\n }\n> = {\n mock: {\n name: 'Mock',\n description: 'Fixture-backed runtime provider for layout/design mode without a real backend',\n requiresStorefront: false,\n requiredEnvVars: [],\n maxRetries: 0,\n },\n medusa: {\n name: 'Medusa JS',\n description: 'Medusa v2 commerce engine',\n requiresStorefront: true,\n requiredEnvVars: [\n 'NEXT_PUBLIC_COMMERCE_API_URL',\n 'NEXT_PUBLIC_COMMERCE_API_KEY',\n 'NEXT_PUBLIC_SALES_CHANNEL_ID',\n ],\n maxRetries: 3,\n },\n stelorder: {\n name: 'Stel Order',\n description: 'Stel Order ERP and sales document API',\n requiresStorefront: false,\n requiredEnvVars: [\n 'NEXT_PUBLIC_COMMERCE_API_URL',\n 'NEXT_PUBLIC_COMMERCE_API_KEY',\n ],\n maxRetries: 2,\n },\n shopify: {\n name: 'Shopify',\n description: 'Shopify Storefront API (GraphQL)',\n requiresStorefront: false,\n requiredEnvVars: [\n 'NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN',\n 'NEXT_PUBLIC_SHOPIFY_STOREFRONT_TOKEN',\n ],\n maxRetries: 3,\n },\n bigcommerce: {\n name: 'BigCommerce',\n description: 'BigCommerce REST Storefront API',\n requiresStorefront: false,\n requiredEnvVars: [\n 'BIGCOMMERCE_STORE_HASH',\n 'BIGCOMMERCE_STOREFRONT_API_TOKEN',\n 'BIGCOMMERCE_CHANNEL_ID',\n ],\n maxRetries: 3,\n },\n woocommerce: {\n name: 'WooCommerce',\n description: 'WooCommerce Store API + REST API v3',\n requiresStorefront: false,\n requiredEnvVars: [\n 'WOOCOMMERCE_URL',\n 'WOOCOMMERCE_CONSUMER_KEY',\n 'WOOCOMMERCE_CONSUMER_SECRET',\n ],\n maxRetries: 3,\n },\n spree: {\n name: 'Spree Commerce',\n description: 'Spree API v2 Storefront (JSON:API)',\n requiresStorefront: false,\n requiredEnvVars: [\n 'SPREE_API_URL',\n ],\n maxRetries: 3,\n },\n magento: {\n name: 'Adobe Commerce (Magento)',\n description: 'Adobe Commerce GraphQL + REST API',\n requiresStorefront: true,\n requiredEnvVars: [\n 'MAGENTO_URL',\n 'MAGENTO_STORE_CODE',\n ],\n maxRetries: 3,\n },\n};\n\n/**\n * Check if a string is a valid provider type.\n *\n * @example\n * ```typescript\n * if (isSupportedProviderType(process.env.COMMERCE_PROVIDER)) {\n * // type is narrowed to ProviderTypeString\n * }\n * ```\n */\nexport function isSupportedProviderType(\n value: unknown\n): value is ProviderTypeString {\n return (\n typeof value === 'string' &&\n Object.values(SupportedProviderType).includes(value as SupportedProviderType)\n );\n}\n\n/**\n * Get metadata for a provider type.\n * Useful for validation, error messages, and logging.\n *\n * @example\n * ```typescript\n * const meta = getProviderMetadata('medusa');\n * console.log(`Using ${meta.name} with max ${meta.maxRetries} retries`);\n * ```\n */\nexport function getProviderMetadata(\n type: ProviderTypeString\n): (typeof PROVIDER_METADATA)[ProviderTypeString] {\n if (!isSupportedProviderType(type)) {\n throw new Error(\n `Unsupported provider: ${type}. Supported: ${Object.values(\n SupportedProviderType\n ).join(', ')}`\n );\n }\n return PROVIDER_METADATA[type];\n}\n","/**\n * @thorprovider/types — Storefront Context\n *\n * Platform-agnostic representation of a \"sales channel\" or equivalent.\n * Abstracts differences between Medusa sales_channel, Shopify publications,\n * BigCommerce channels, WooCommerce sites, Spree stores, and Magento store views.\n *\n * @remarks\n * - Required for all multi-tenant deployments\n * - Returned by `CommerceProvider.getStorefrontContext()`\n * - MUST be validated on startup; errors should NOT be silently ignored\n */\n\n/**\n * Supported commerce platform types for storefront identification.\n *\n * @remarks\n * Keep this type in sync with SupportedProviderType from provider.ts.\n * When adding a new provider, update both packages/types/src/provider.ts\n * and this type.\n *\n * Currently supported:\n * - ✅ 'mock': Backend-optional layout/design mode using fixture data\n * - ✅ 'medusa': Fully implemented\n * - 🟡 'stelorder': ERP adapter v1\n *\n * Planned (not yet implemented):\n * - 🟡 'shopify': Phase 2\n * - 🟡 'bigcommerce': Phase 2\n * - 🟡 'woocommerce': Phase 3\n * - 🟡 'spree': Phase 3\n * - 🟡 'magento': Phase 3\n */\nexport type StorefrontPlatformType = 'mock' | 'medusa' | 'stelorder' | 'shopify' | 'bigcommerce' | 'woocommerce' | 'spree' | 'magento';\n\n/**\n * StorefrontContext\n *\n * Platform-agnostic representation of a \"sales channel\" or equivalent.\n *\n * @example\n * ```typescript\n * const ctx: StorefrontContext = {\n * id: 'sc_01J...',\n * name: 'B2C Storefront',\n * platformType: 'medusa',\n * requiresProductScoping: true,\n * currencyCode: 'USD',\n * };\n * ```\n */\nexport interface StorefrontContext {\n /**\n * Unique identifier for this storefront across the system.\n * Examples: \"sc_123\" (Medusa), \"gid://shopify/Channel/789\" (Shopify), \"1\" (WooCommerce)\n */\n id: string;\n\n /**\n * Human-readable name for logging and debugging.\n */\n name: string;\n\n /**\n * Platform this storefront belongs to.\n */\n platformType: StorefrontPlatformType;\n\n /**\n * Whether products must be explicitly linked/published to this storefront.\n *\n * @remarks\n * - Medusa: true (products must be linked to sales channel)\n * - Shopify: false (products visible by default unless unlisted)\n * - Stel Order: false (single-company ERP model, no native channel scoping)\n * - WooCommerce: false (no scoping concept)\n * - BigCommerce: false (products visible by default unless delisted)\n * - Spree: true (products must be assigned per store)\n * - Magento: true (products must be assigned per website)\n */\n requiresProductScoping: boolean;\n\n /**\n * Primary currency code for this storefront.\n * Examples: \"USD\", \"EUR\", \"GBP\"\n */\n currencyCode: string;\n\n /**\n * Optional region or locale code.\n * Examples: \"US\", \"EU\", \"en-US\", \"es-ES\"\n */\n locale?: string;\n\n /**\n * Optional: Store/Channel metadata from platform.\n * @internal\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Storefront validation error.\n * Thrown when storefront configuration is invalid or missing.\n *\n * @example\n * ```typescript\n * throw new StorefrontConfigError(\n * 'Medusa requires NEXT_PUBLIC_SALES_CHANNEL_ID',\n * 'medusa',\n * 'NEXT_PUBLIC_SALES_CHANNEL_ID',\n * );\n * ```\n */\nexport class StorefrontConfigError extends Error {\n public readonly platformType: string;\n public readonly requiredEnvVar?: string;\n\n constructor(\n message: string,\n platformType: string,\n requiredEnvVar?: string,\n ) {\n super(message);\n this.name = 'StorefrontConfigError';\n this.platformType = platformType;\n this.requiredEnvVar = requiredEnvVar;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkCO,IAAK,wBAAL,kBAAKA,2BAAL;AACL,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,YAAS;AACT,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,aAAU;AACV,EAAAA,uBAAA,iBAAc;AACd,EAAAA,uBAAA,iBAAc;AACd,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,aAAU;AARA,SAAAA;AAAA,GAAA;AA8BL,IAAM,oBAST;AAAA,EACF,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB,CAAC;AAAA,IAClB,YAAY;AAAA,EACd;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AACF;AAYO,SAAS,wBACd,OAC6B;AAC7B,SACE,OAAO,UAAU,YACjB,OAAO,OAAO,qBAAqB,EAAE,SAAS,KAA8B;AAEhF;AAYO,SAAS,oBACd,MACgD;AAChD,MAAI,CAAC,wBAAwB,IAAI,GAAG;AAClC,UAAM,IAAI;AAAA,MACR,yBAAyB,IAAI,gBAAgB,OAAO;AAAA,QAClD;AAAA,MACF,EAAE,KAAK,IAAI,CAAC;AAAA,IACd;AAAA,EACF;AACA,SAAO,kBAAkB,IAAI;AAC/B;;;ACjFO,IAAM,wBAAN,cAAoC,MAAM;AAAA,EAC/B;AAAA,EACA;AAAA,EAEhB,YACE,SACA,cACA,gBACA;AACA,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,eAAe;AACpB,SAAK,iBAAiB;AAAA,EACxB;AACF;","names":["SupportedProviderType"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/provider.ts","../src/storefront.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} from './common';\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// 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} 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 OrderItem,\n OrderStatus,\n PaymentStatus,\n FulfillmentStatus,\n GetOrdersOptions,\n GetOrdersCallback,\n} from './order';\n\n// ============================================\n// Provider Types (L1 - Source of Truth)\n// ============================================\nexport { SupportedProviderType, type ProviderTypeString } from './provider';\n\nexport {\n isSupportedProviderType,\n getProviderMetadata,\n PROVIDER_METADATA,\n} from './provider';\n\n// ============================================\n// Storefront Types\n// ============================================\nexport type {\n StorefrontContext,\n StorefrontPlatformType,\n} from './storefront';\n\nexport {\n StorefrontConfigError,\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} from './auth';\n\n// ============================================\n// Payment Types\n// ============================================\nexport type {\n PaymentMethod,\n PaymentMethodType,\n PaymentMethodFeatures,\n PaymentMethodsOptions,\n CachedPaymentMethods,\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 VariantCost,\n GetVariantCostsOptions,\n GetVariantCostsResponse,\n CreateVariantCostBody,\n CreateVariantCostResponse,\n BatchVariantCostItem,\n BatchVariantCostsBody,\n BatchVariantCostsResponse,\n DeleteVariantCostResponse,\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 DropshipperVariantMarginOverride,\n DropshipperProductMarginItem,\n DropshipperPriceItem,\n UpdateDropshipperPricesBody,\n UpdateDropshipperPricesResponse,\n DropshipperOrderCustomer,\n DropshipperOrder,\n GetDropshipperOrdersOptions,\n GetDropshipperOrdersResponse,\n DropshipperShippingOption,\n GetDropshipperShippingOptionsParams,\n GetDropshipperShippingOptionsResponse,\n DropshipperOrderShippingAddress,\n DropshipperOrderItem,\n DropshipperOrderTotals,\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 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 DropshipperCustomerOrderRef,\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 // 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 // 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 } from './admin';\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","/**\n * @thorprovider/types — Supported Providers\n *\n * Centralized list of all supported commerce providers.\n * This is the single source of truth for provider types across the monorepo.\n *\n * @remarks\n * - L1 (Foundation): Defines the contract\n * - L2 (@thorprovider/adapters) imports from here to build the factory\n * - L5 (Starters) uses the factory which is bound to this enum\n *\n * When adding a new provider (e.g., Stel Order):\n * 1. Add to SupportedProviderType enum below\n * 2. Update @thorprovider/adapters factory/index.ts with discriminated union\n * 3. Create packages/adapters/src/providers/shopify/\n * 4. Implement CommerceProvider interface\n * 5. Update StorefrontPlatformType in storefront.ts\n */\n\n/**\n * All supported commerce platform providers.\n * `mock` is the backend-optional runtime provider used for layout/design mode.\n * `medusa` is fully implemented for real backend usage; others are placeholders for future expansion.\n *\n * @remarks Implementation status:\n * - ✅ mock: Fixture-backed provider for backend-optional storefronts\n * - ✅ medusa: Fully implemented\n * - 🟡 stelorder: In progress (ERP adapter v1)\n * - 🟡 shopify: Planned (Phase 2)\n * - 🟡 bigcommerce: Planned (Phase 2)\n * - 🟡 woocommerce: Planned (Phase 3)\n * - 🟡 spree: Planned (Phase 3)\n * - 🟡 magento: Planned (Phase 3)\n */\nexport enum SupportedProviderType {\n Mock = 'mock',\n Medusa = 'medusa',\n StelOrder = 'stelorder',\n Shopify = 'shopify',\n BigCommerce = 'bigcommerce',\n WooCommerce = 'woocommerce',\n Spree = 'spree',\n Magento = 'magento',\n}\n\n/**\n * Union type of all supported provider string values.\n * Use this for type annotations when a provider type is expected.\n *\n * @example\n * ```typescript\n * function getProviderName(type: ProviderTypeString): string {\n * // type is 'medusa'\n * }\n * ```\n */\nexport type ProviderTypeString = 'mock' | 'medusa' | 'stelorder' | 'shopify' | 'bigcommerce' | 'woocommerce' | 'spree' | 'magento';\n\n/**\n * Metadata about each provider.\n * Useful for UI, error messages, validation, and documentation.\n *\n * @internal\n */\nexport const PROVIDER_METADATA: Record<\n ProviderTypeString,\n {\n name: string;\n description: string;\n requiresStorefront: boolean;\n requiredEnvVars: string[];\n maxRetries: number;\n }\n> = {\n mock: {\n name: 'Mock',\n description: 'Fixture-backed runtime provider for layout/design mode without a real backend',\n requiresStorefront: false,\n requiredEnvVars: [],\n maxRetries: 0,\n },\n medusa: {\n name: 'Medusa JS',\n description: 'Medusa v2 commerce engine',\n requiresStorefront: true,\n requiredEnvVars: [\n 'NEXT_PUBLIC_COMMERCE_API_URL',\n 'NEXT_PUBLIC_COMMERCE_API_KEY',\n 'NEXT_PUBLIC_SALES_CHANNEL_ID',\n ],\n maxRetries: 3,\n },\n stelorder: {\n name: 'Stel Order',\n description: 'Stel Order ERP and sales document API',\n requiresStorefront: false,\n requiredEnvVars: [\n 'NEXT_PUBLIC_COMMERCE_API_URL',\n 'NEXT_PUBLIC_COMMERCE_API_KEY',\n ],\n maxRetries: 2,\n },\n shopify: {\n name: 'Shopify',\n description: 'Shopify Storefront API (GraphQL)',\n requiresStorefront: false,\n requiredEnvVars: [\n 'NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN',\n 'NEXT_PUBLIC_SHOPIFY_STOREFRONT_TOKEN',\n ],\n maxRetries: 3,\n },\n bigcommerce: {\n name: 'BigCommerce',\n description: 'BigCommerce REST Storefront API',\n requiresStorefront: false,\n requiredEnvVars: [\n 'BIGCOMMERCE_STORE_HASH',\n 'BIGCOMMERCE_STOREFRONT_API_TOKEN',\n 'BIGCOMMERCE_CHANNEL_ID',\n ],\n maxRetries: 3,\n },\n woocommerce: {\n name: 'WooCommerce',\n description: 'WooCommerce Store API + REST API v3',\n requiresStorefront: false,\n requiredEnvVars: [\n 'WOOCOMMERCE_URL',\n 'WOOCOMMERCE_CONSUMER_KEY',\n 'WOOCOMMERCE_CONSUMER_SECRET',\n ],\n maxRetries: 3,\n },\n spree: {\n name: 'Spree Commerce',\n description: 'Spree API v2 Storefront (JSON:API)',\n requiresStorefront: false,\n requiredEnvVars: [\n 'SPREE_API_URL',\n ],\n maxRetries: 3,\n },\n magento: {\n name: 'Adobe Commerce (Magento)',\n description: 'Adobe Commerce GraphQL + REST API',\n requiresStorefront: true,\n requiredEnvVars: [\n 'MAGENTO_URL',\n 'MAGENTO_STORE_CODE',\n ],\n maxRetries: 3,\n },\n};\n\n/**\n * Check if a string is a valid provider type.\n *\n * @example\n * ```typescript\n * if (isSupportedProviderType(process.env.COMMERCE_PROVIDER)) {\n * // type is narrowed to ProviderTypeString\n * }\n * ```\n */\nexport function isSupportedProviderType(\n value: unknown\n): value is ProviderTypeString {\n return (\n typeof value === 'string' &&\n Object.values(SupportedProviderType).includes(value as SupportedProviderType)\n );\n}\n\n/**\n * Get metadata for a provider type.\n * Useful for validation, error messages, and logging.\n *\n * @example\n * ```typescript\n * const meta = getProviderMetadata('medusa');\n * console.log(`Using ${meta.name} with max ${meta.maxRetries} retries`);\n * ```\n */\nexport function getProviderMetadata(\n type: ProviderTypeString\n): (typeof PROVIDER_METADATA)[ProviderTypeString] {\n if (!isSupportedProviderType(type)) {\n throw new Error(\n `Unsupported provider: ${type}. Supported: ${Object.values(\n SupportedProviderType\n ).join(', ')}`\n );\n }\n return PROVIDER_METADATA[type];\n}\n","/**\n * @thorprovider/types — Storefront Context\n *\n * Platform-agnostic representation of a \"sales channel\" or equivalent.\n * Abstracts differences between Medusa sales_channel, Shopify publications,\n * BigCommerce channels, WooCommerce sites, Spree stores, and Magento store views.\n *\n * @remarks\n * - Required for all multi-tenant deployments\n * - Returned by `CommerceProvider.getStorefrontContext()`\n * - MUST be validated on startup; errors should NOT be silently ignored\n */\n\n/**\n * Supported commerce platform types for storefront identification.\n *\n * @remarks\n * Keep this type in sync with SupportedProviderType from provider.ts.\n * When adding a new provider, update both packages/types/src/provider.ts\n * and this type.\n *\n * Currently supported:\n * - ✅ 'mock': Backend-optional layout/design mode using fixture data\n * - ✅ 'medusa': Fully implemented\n * - 🟡 'stelorder': ERP adapter v1\n *\n * Planned (not yet implemented):\n * - 🟡 'shopify': Phase 2\n * - 🟡 'bigcommerce': Phase 2\n * - 🟡 'woocommerce': Phase 3\n * - 🟡 'spree': Phase 3\n * - 🟡 'magento': Phase 3\n */\nexport type StorefrontPlatformType = 'mock' | 'medusa' | 'stelorder' | 'shopify' | 'bigcommerce' | 'woocommerce' | 'spree' | 'magento';\n\n/**\n * StorefrontContext\n *\n * Platform-agnostic representation of a \"sales channel\" or equivalent.\n *\n * @example\n * ```typescript\n * const ctx: StorefrontContext = {\n * id: 'sc_01J...',\n * name: 'B2C Storefront',\n * platformType: 'medusa',\n * requiresProductScoping: true,\n * currencyCode: 'USD',\n * };\n * ```\n */\nexport interface StorefrontContext {\n /**\n * Unique identifier for this storefront across the system.\n * Examples: \"sc_123\" (Medusa), \"gid://shopify/Channel/789\" (Shopify), \"1\" (WooCommerce)\n */\n id: string;\n\n /**\n * Human-readable name for logging and debugging.\n */\n name: string;\n\n /**\n * Platform this storefront belongs to.\n */\n platformType: StorefrontPlatformType;\n\n /**\n * Whether products must be explicitly linked/published to this storefront.\n *\n * @remarks\n * - Medusa: true (products must be linked to sales channel)\n * - Shopify: false (products visible by default unless unlisted)\n * - Stel Order: false (single-company ERP model, no native channel scoping)\n * - WooCommerce: false (no scoping concept)\n * - BigCommerce: false (products visible by default unless delisted)\n * - Spree: true (products must be assigned per store)\n * - Magento: true (products must be assigned per website)\n */\n requiresProductScoping: boolean;\n\n /**\n * Primary currency code for this storefront.\n * Examples: \"USD\", \"EUR\", \"GBP\"\n */\n currencyCode: string;\n\n /**\n * Optional region or locale code.\n * Examples: \"US\", \"EU\", \"en-US\", \"es-ES\"\n */\n locale?: string;\n\n /**\n * Optional: Store/Channel metadata from platform.\n * @internal\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Storefront validation error.\n * Thrown when storefront configuration is invalid or missing.\n *\n * @example\n * ```typescript\n * throw new StorefrontConfigError(\n * 'Medusa requires NEXT_PUBLIC_SALES_CHANNEL_ID',\n * 'medusa',\n * 'NEXT_PUBLIC_SALES_CHANNEL_ID',\n * );\n * ```\n */\nexport class StorefrontConfigError extends Error {\n public readonly platformType: string;\n public readonly requiredEnvVar?: string;\n\n constructor(\n message: string,\n platformType: string,\n requiredEnvVar?: string,\n ) {\n super(message);\n this.name = 'StorefrontConfigError';\n this.platformType = platformType;\n this.requiredEnvVar = requiredEnvVar;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkCO,IAAK,wBAAL,kBAAKA,2BAAL;AACL,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,YAAS;AACT,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,aAAU;AACV,EAAAA,uBAAA,iBAAc;AACd,EAAAA,uBAAA,iBAAc;AACd,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,aAAU;AARA,SAAAA;AAAA,GAAA;AA8BL,IAAM,oBAST;AAAA,EACF,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB,CAAC;AAAA,IAClB,YAAY;AAAA,EACd;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AACF;AAYO,SAAS,wBACd,OAC6B;AAC7B,SACE,OAAO,UAAU,YACjB,OAAO,OAAO,qBAAqB,EAAE,SAAS,KAA8B;AAEhF;AAYO,SAAS,oBACd,MACgD;AAChD,MAAI,CAAC,wBAAwB,IAAI,GAAG;AAClC,UAAM,IAAI;AAAA,MACR,yBAAyB,IAAI,gBAAgB,OAAO;AAAA,QAClD;AAAA,MACF,EAAE,KAAK,IAAI,CAAC;AAAA,IACd;AAAA,EACF;AACA,SAAO,kBAAkB,IAAI;AAC/B;;;ACjFO,IAAM,wBAAN,cAAoC,MAAM;AAAA,EAC/B;AAAA,EACA;AAAA,EAEhB,YACE,SACA,cACA,gBACA;AACA,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,eAAe;AACpB,SAAK,iBAAiB;AAAA,EACxB;AACF;","names":["SupportedProviderType"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thorprovider/types",
3
- "version": "5.1.6",
3
+ "version": "5.2.1",
4
4
  "description": "Shared TypeScript types for Thor Commerce ecosystem - Framework-agnostic type definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -563,6 +563,19 @@ export interface DropshipperOrderDetail {
563
563
  name: string;
564
564
  amount: number;
565
565
  shipping_option_id: string | null;
566
+ /** Fulfillment intent of the underlying shipping option: 'delivery' | 'pickup' | 'shipping' | null */
567
+ fulfillment_set_type?: string | null;
568
+ pickup_location?: {
569
+ id: string;
570
+ name: string;
571
+ address: {
572
+ address_1: string;
573
+ city: string | null;
574
+ province: string | null;
575
+ postal_code: string | null;
576
+ country_code: string;
577
+ } | null;
578
+ } | null;
566
579
  } | null;
567
580
  payment_collected_by: 'dropshipper' | 'provider' | null;
568
581
  payment_method?: { id: string; name: string } | null;
@@ -814,6 +827,12 @@ export interface ConvertDropshipperDraftOrderResponse {
814
827
  draft_id: string; // ID of the draft that was converted
815
828
  }
816
829
 
830
+ /** Response for `DELETE /admin/thor/dropshipper/draft-orders/:id` */
831
+ export interface DeleteDropshipperDraftOrderResponse {
832
+ id: string;
833
+ deleted: boolean;
834
+ }
835
+
817
836
  // ============================================================
818
837
  // Custom Categories (Solo Y)
819
838
  // ============================================================
@@ -2108,6 +2127,8 @@ export interface RegisterPaymentResponse {
2108
2127
  export interface DropshipperDashboardCapabilities {
2109
2128
  /** Core navigation — always expected to be true */
2110
2129
  dashboard: boolean;
2130
+ /** AI assistant chat (catalog intelligence) */
2131
+ aiAssistant: boolean;
2111
2132
  orders: boolean;
2112
2133
  products: boolean;
2113
2134
  prices: boolean;
@@ -2128,6 +2149,56 @@ export interface DropshipperDashboardCapabilities {
2128
2149
  team: boolean;
2129
2150
  }
2130
2151
 
2152
+ // ============================================================
2153
+ // AI Assistant Chat (catalog intelligence)
2154
+ // ============================================================
2155
+
2156
+ /** A single turn in the stateless chat history sent with each request */
2157
+ export interface ChatMessage {
2158
+ role: 'user' | 'assistant';
2159
+ content: string;
2160
+ }
2161
+
2162
+ /** Request body for `POST /admin/thor/dropshipper/ai/chat` */
2163
+ export interface ChatRequest {
2164
+ messages: ChatMessage[];
2165
+ model?: string;
2166
+ }
2167
+
2168
+ /** Semantic intent extracted by the backend classifier */
2169
+ export type ChatIntent = 'catalog_search' | 'greeting' | 'other';
2170
+
2171
+ /** Summarized variant attached to a chat source product */
2172
+ export interface ChatSourceVariant {
2173
+ id: string;
2174
+ title: string;
2175
+ sku: string;
2176
+ sale_price: number;
2177
+ margin_percent: number;
2178
+ available_quantity: number;
2179
+ }
2180
+
2181
+ /** A catalog product referenced by the assistant answer */
2182
+ export interface ChatSource {
2183
+ product_id: string;
2184
+ title: string;
2185
+ handle: string;
2186
+ thumbnail: string | null;
2187
+ sale_price: number;
2188
+ cost_price: number | null;
2189
+ margin_percent: number | null;
2190
+ available_quantity: number;
2191
+ variants_summary: ChatSourceVariant[];
2192
+ }
2193
+
2194
+ /** Response from `POST /admin/thor/dropshipper/ai/chat` */
2195
+ export interface ChatResponse {
2196
+ answer: string;
2197
+ intent: ChatIntent;
2198
+ model_used: string;
2199
+ sources: ChatSource[];
2200
+ }
2201
+
2131
2202
  // ============================================================
2132
2203
  // Geo-reference (countries, provinces, cities)
2133
2204
  // ============================================================
@@ -2285,6 +2356,57 @@ export interface AcknowledgeCostPriceChangesResponse {
2285
2356
  // Notifications
2286
2357
  // ============================================================
2287
2358
 
2359
+ /** Payload de `precio_actualizado`: solo lleva el costo vigente, nunca el anterior. */
2360
+ export interface PriceUpdatedNotificationData {
2361
+ type: 'price_updated'
2362
+ product_id?: string
2363
+ product_title?: string
2364
+ variant_id?: string
2365
+ variant_title?: string
2366
+ current_price?: string | number
2367
+ currency_code?: string
2368
+ /** Margen del dropshipper, % FIJO sobre el costo. */
2369
+ margin_percent?: string | number
2370
+ }
2371
+
2372
+ /** Payload de `producto_asignado`. */
2373
+ export interface ProductAssignedNotificationData {
2374
+ type: 'product_assigned'
2375
+ product_id?: string
2376
+ product_title?: string
2377
+ channel_name?: string
2378
+ cost?: string | number
2379
+ /** Margen del dropshipper, % FIJO sobre el costo. */
2380
+ margin_percent?: string | number
2381
+ }
2382
+
2383
+ /** Payload de `producto_agotado` / `producto_reabastecido`. */
2384
+ export interface StockChangeNotificationData {
2385
+ type: 'restock' | 'out_of_stock'
2386
+ product_id?: string
2387
+ product_title?: string
2388
+ variant_id?: string
2389
+ variant_title?: string
2390
+ inventory_item_id?: string
2391
+ stocked_quantity?: string | number
2392
+ }
2393
+
2394
+ /** Payload de `manual-admin-notification` (aviso directo). */
2395
+ export interface ManualAdminNotificationData {
2396
+ type: 'manual'
2397
+ subject?: string
2398
+ message?: string
2399
+ admin_name?: string
2400
+ admin_id?: string
2401
+ }
2402
+
2403
+ /** Datos tipados del payload de una notificación, discriminados por `type`. */
2404
+ export type NotificationData =
2405
+ | PriceUpdatedNotificationData
2406
+ | ProductAssignedNotificationData
2407
+ | StockChangeNotificationData
2408
+ | ManualAdminNotificationData
2409
+
2288
2410
  /**
2289
2411
  * Raw notification record from Medusa's Notification module.
2290
2412
  * A minimal shape of the fields consumed by the dashboard.
@@ -2295,7 +2417,7 @@ export interface RawNotification {
2295
2417
  to: string
2296
2418
  channel: string
2297
2419
  template: string
2298
- data: Record<string, unknown> | null
2420
+ data: NotificationData | null
2299
2421
  trigger_type: string | null
2300
2422
  receiver_id: string | null
2301
2423
  created_at: string
package/src/index.ts CHANGED
@@ -402,6 +402,7 @@ export type {
402
402
  UpdateDropshipperDraftOrderResponse,
403
403
  ConvertDropshipperDraftOrderBody,
404
404
  ConvertDropshipperDraftOrderResponse,
405
+ DeleteDropshipperDraftOrderResponse,
405
406
  // Dropshipper addresses (channel-scoped)
406
407
  DropshipperAddressBody,
407
408
  DropshipperAddressResponse,
@@ -434,8 +435,15 @@ export type {
434
435
  GetFinancialAnalysisResponse,
435
436
  RegisterPaymentBody,
436
437
  RegisterPaymentResponse,
437
- // Dashboard Capabilities
438
- DropshipperDashboardCapabilities,
438
+ // Dashboard Capabilities
439
+ DropshipperDashboardCapabilities,
440
+ // AI Assistant Chat
441
+ ChatMessage,
442
+ ChatRequest,
443
+ ChatIntent,
444
+ ChatSource,
445
+ ChatSourceVariant,
446
+ ChatResponse,
439
447
  // Geo-reference
440
448
  GeoCountry,
441
449
  GeoProvince,
@@ -461,6 +469,11 @@ export type {
461
469
  CostPriceChangesResponse,
462
470
  AcknowledgeCostPriceChangesResponse,
463
471
  // Notifications
472
+ NotificationData,
473
+ PriceUpdatedNotificationData,
474
+ ProductAssignedNotificationData,
475
+ StockChangeNotificationData,
476
+ ManualAdminNotificationData,
464
477
  RawNotification,
465
478
  GetNotificationsOptions,
466
479
  GetNotificationsResponse,