@thorprovider/types 5.0.2 → 5.1.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 +76 -1
- package/dist/index.d.ts +76 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/admin/DropshippingAdmin.ts +84 -0
- package/src/cart.ts +3 -0
- package/src/index.ts +8 -0
package/dist/index.d.mts
CHANGED
|
@@ -909,6 +909,8 @@ interface ShippingMethod {
|
|
|
909
909
|
estimatedDays?: string;
|
|
910
910
|
/** The parent fulfillment set type from Medusa (e.g., 'shipping', 'pickup', 'pick-up') */
|
|
911
911
|
fulfillmentSetType?: string | null;
|
|
912
|
+
/** Warehouse/store address for pickup shipping methods */
|
|
913
|
+
address?: string;
|
|
912
914
|
}
|
|
913
915
|
/**
|
|
914
916
|
* Main cart type - normalized across all providers
|
|
@@ -3784,6 +3786,36 @@ interface DeleteVariantCostResponse {
|
|
|
3784
3786
|
deleted: true;
|
|
3785
3787
|
id: string;
|
|
3786
3788
|
}
|
|
3789
|
+
/** A product image from Medusa's public gallery */
|
|
3790
|
+
interface DropshipperProductImage {
|
|
3791
|
+
id: string;
|
|
3792
|
+
url: string;
|
|
3793
|
+
}
|
|
3794
|
+
/** A product attachment (file/doc) linked via the product_attachment module */
|
|
3795
|
+
interface DropshipperProductAttachment {
|
|
3796
|
+
id: string;
|
|
3797
|
+
product_id: string;
|
|
3798
|
+
url: string;
|
|
3799
|
+
name: string;
|
|
3800
|
+
description: string | null;
|
|
3801
|
+
mime_type: string;
|
|
3802
|
+
size: number;
|
|
3803
|
+
rank: number;
|
|
3804
|
+
updated_at: string;
|
|
3805
|
+
metadata: Record<string, unknown> | null;
|
|
3806
|
+
}
|
|
3807
|
+
/** Private media (images/videos visible only to the dropshipper) */
|
|
3808
|
+
interface DropshipperProductPrivateMedia {
|
|
3809
|
+
id: string;
|
|
3810
|
+
product_id: string;
|
|
3811
|
+
file_id: string;
|
|
3812
|
+
url: string;
|
|
3813
|
+
rank: number;
|
|
3814
|
+
file_name: string;
|
|
3815
|
+
mime_type: string;
|
|
3816
|
+
size: number;
|
|
3817
|
+
metadata: Record<string, unknown> | null;
|
|
3818
|
+
}
|
|
3787
3819
|
/** A product variant as seen by the dropshipper */
|
|
3788
3820
|
interface DropshipperVariant {
|
|
3789
3821
|
id: string;
|
|
@@ -3865,6 +3897,12 @@ interface DropshipperProduct {
|
|
|
3865
3897
|
}>;
|
|
3866
3898
|
/** Native Medusa product options (Size, Color, etc.) */
|
|
3867
3899
|
medusa_options?: DropshipperProductOption[];
|
|
3900
|
+
/** Public gallery images from Medusa — only set when the endpoint fetches them */
|
|
3901
|
+
images?: DropshipperProductImage[];
|
|
3902
|
+
/** Product attachments (PDFs, CSVs, etc.) from the product_attachment module */
|
|
3903
|
+
attachments?: DropshipperProductAttachment[];
|
|
3904
|
+
/** Private media (images/videos for dropshipper internal use) */
|
|
3905
|
+
private_media?: DropshipperProductPrivateMedia[];
|
|
3868
3906
|
}
|
|
3869
3907
|
/** Options for `GET /admin/thor/dropshipper/products` */
|
|
3870
3908
|
interface GetDropshipperProductsOptions {
|
|
@@ -4003,6 +4041,19 @@ interface DropshipperShippingOption {
|
|
|
4003
4041
|
label: string;
|
|
4004
4042
|
code: string | null;
|
|
4005
4043
|
} | null;
|
|
4044
|
+
estimated_days?: string | null;
|
|
4045
|
+
location?: {
|
|
4046
|
+
id: string;
|
|
4047
|
+
name: string;
|
|
4048
|
+
address?: {
|
|
4049
|
+
address_1: string;
|
|
4050
|
+
address_2: string | null;
|
|
4051
|
+
city: string | null;
|
|
4052
|
+
province: string | null;
|
|
4053
|
+
postal_code: string | null;
|
|
4054
|
+
country_code: string;
|
|
4055
|
+
} | null;
|
|
4056
|
+
} | null;
|
|
4006
4057
|
}
|
|
4007
4058
|
/** Options for `GET /admin/thor/dropshipper/orders/shipping-options` */
|
|
4008
4059
|
interface GetDropshipperShippingOptionsParams {
|
|
@@ -5484,5 +5535,29 @@ interface DropshipperProfile {
|
|
|
5484
5535
|
interface GetMyProfileResponse {
|
|
5485
5536
|
user: DropshipperProfile;
|
|
5486
5537
|
}
|
|
5538
|
+
/** Response for `GET /admin/thor/dropshipper/cost-prices/has-changes` */
|
|
5539
|
+
interface CostPriceChangesCheckResponse {
|
|
5540
|
+
has_changes: boolean;
|
|
5541
|
+
}
|
|
5542
|
+
/** A single changed cost price in the diff response */
|
|
5543
|
+
interface CostPriceChangeItem {
|
|
5544
|
+
variant_id: string;
|
|
5545
|
+
variant_title: string;
|
|
5546
|
+
sku: string | null;
|
|
5547
|
+
product_id: string;
|
|
5548
|
+
product_title: string;
|
|
5549
|
+
thumbnail: string | null;
|
|
5550
|
+
old_cost_price: number;
|
|
5551
|
+
new_cost_price: number;
|
|
5552
|
+
currency_code: string;
|
|
5553
|
+
}
|
|
5554
|
+
/** Response for `GET /admin/thor/dropshipper/cost-prices/changes` */
|
|
5555
|
+
interface CostPriceChangesResponse {
|
|
5556
|
+
changes: CostPriceChangeItem[];
|
|
5557
|
+
}
|
|
5558
|
+
/** Response for `POST /admin/thor/dropshipper/cost-prices/acknowledge` */
|
|
5559
|
+
interface AcknowledgeCostPriceChangesResponse {
|
|
5560
|
+
acknowledged: boolean;
|
|
5561
|
+
}
|
|
5487
5562
|
|
|
5488
|
-
export { type AccountDropdownConfig, type AccountMenuItem, 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 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 DropshipperProductAttribute, type DropshipperProductAttributeValue, type DropshipperProductMarginItem, type DropshipperProductOption, type DropshipperProductOptionValue, 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 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 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 };
|
|
5563
|
+
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 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 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -909,6 +909,8 @@ interface ShippingMethod {
|
|
|
909
909
|
estimatedDays?: string;
|
|
910
910
|
/** The parent fulfillment set type from Medusa (e.g., 'shipping', 'pickup', 'pick-up') */
|
|
911
911
|
fulfillmentSetType?: string | null;
|
|
912
|
+
/** Warehouse/store address for pickup shipping methods */
|
|
913
|
+
address?: string;
|
|
912
914
|
}
|
|
913
915
|
/**
|
|
914
916
|
* Main cart type - normalized across all providers
|
|
@@ -3784,6 +3786,36 @@ interface DeleteVariantCostResponse {
|
|
|
3784
3786
|
deleted: true;
|
|
3785
3787
|
id: string;
|
|
3786
3788
|
}
|
|
3789
|
+
/** A product image from Medusa's public gallery */
|
|
3790
|
+
interface DropshipperProductImage {
|
|
3791
|
+
id: string;
|
|
3792
|
+
url: string;
|
|
3793
|
+
}
|
|
3794
|
+
/** A product attachment (file/doc) linked via the product_attachment module */
|
|
3795
|
+
interface DropshipperProductAttachment {
|
|
3796
|
+
id: string;
|
|
3797
|
+
product_id: string;
|
|
3798
|
+
url: string;
|
|
3799
|
+
name: string;
|
|
3800
|
+
description: string | null;
|
|
3801
|
+
mime_type: string;
|
|
3802
|
+
size: number;
|
|
3803
|
+
rank: number;
|
|
3804
|
+
updated_at: string;
|
|
3805
|
+
metadata: Record<string, unknown> | null;
|
|
3806
|
+
}
|
|
3807
|
+
/** Private media (images/videos visible only to the dropshipper) */
|
|
3808
|
+
interface DropshipperProductPrivateMedia {
|
|
3809
|
+
id: string;
|
|
3810
|
+
product_id: string;
|
|
3811
|
+
file_id: string;
|
|
3812
|
+
url: string;
|
|
3813
|
+
rank: number;
|
|
3814
|
+
file_name: string;
|
|
3815
|
+
mime_type: string;
|
|
3816
|
+
size: number;
|
|
3817
|
+
metadata: Record<string, unknown> | null;
|
|
3818
|
+
}
|
|
3787
3819
|
/** A product variant as seen by the dropshipper */
|
|
3788
3820
|
interface DropshipperVariant {
|
|
3789
3821
|
id: string;
|
|
@@ -3865,6 +3897,12 @@ interface DropshipperProduct {
|
|
|
3865
3897
|
}>;
|
|
3866
3898
|
/** Native Medusa product options (Size, Color, etc.) */
|
|
3867
3899
|
medusa_options?: DropshipperProductOption[];
|
|
3900
|
+
/** Public gallery images from Medusa — only set when the endpoint fetches them */
|
|
3901
|
+
images?: DropshipperProductImage[];
|
|
3902
|
+
/** Product attachments (PDFs, CSVs, etc.) from the product_attachment module */
|
|
3903
|
+
attachments?: DropshipperProductAttachment[];
|
|
3904
|
+
/** Private media (images/videos for dropshipper internal use) */
|
|
3905
|
+
private_media?: DropshipperProductPrivateMedia[];
|
|
3868
3906
|
}
|
|
3869
3907
|
/** Options for `GET /admin/thor/dropshipper/products` */
|
|
3870
3908
|
interface GetDropshipperProductsOptions {
|
|
@@ -4003,6 +4041,19 @@ interface DropshipperShippingOption {
|
|
|
4003
4041
|
label: string;
|
|
4004
4042
|
code: string | null;
|
|
4005
4043
|
} | null;
|
|
4044
|
+
estimated_days?: string | null;
|
|
4045
|
+
location?: {
|
|
4046
|
+
id: string;
|
|
4047
|
+
name: string;
|
|
4048
|
+
address?: {
|
|
4049
|
+
address_1: string;
|
|
4050
|
+
address_2: string | null;
|
|
4051
|
+
city: string | null;
|
|
4052
|
+
province: string | null;
|
|
4053
|
+
postal_code: string | null;
|
|
4054
|
+
country_code: string;
|
|
4055
|
+
} | null;
|
|
4056
|
+
} | null;
|
|
4006
4057
|
}
|
|
4007
4058
|
/** Options for `GET /admin/thor/dropshipper/orders/shipping-options` */
|
|
4008
4059
|
interface GetDropshipperShippingOptionsParams {
|
|
@@ -5484,5 +5535,29 @@ interface DropshipperProfile {
|
|
|
5484
5535
|
interface GetMyProfileResponse {
|
|
5485
5536
|
user: DropshipperProfile;
|
|
5486
5537
|
}
|
|
5538
|
+
/** Response for `GET /admin/thor/dropshipper/cost-prices/has-changes` */
|
|
5539
|
+
interface CostPriceChangesCheckResponse {
|
|
5540
|
+
has_changes: boolean;
|
|
5541
|
+
}
|
|
5542
|
+
/** A single changed cost price in the diff response */
|
|
5543
|
+
interface CostPriceChangeItem {
|
|
5544
|
+
variant_id: string;
|
|
5545
|
+
variant_title: string;
|
|
5546
|
+
sku: string | null;
|
|
5547
|
+
product_id: string;
|
|
5548
|
+
product_title: string;
|
|
5549
|
+
thumbnail: string | null;
|
|
5550
|
+
old_cost_price: number;
|
|
5551
|
+
new_cost_price: number;
|
|
5552
|
+
currency_code: string;
|
|
5553
|
+
}
|
|
5554
|
+
/** Response for `GET /admin/thor/dropshipper/cost-prices/changes` */
|
|
5555
|
+
interface CostPriceChangesResponse {
|
|
5556
|
+
changes: CostPriceChangeItem[];
|
|
5557
|
+
}
|
|
5558
|
+
/** Response for `POST /admin/thor/dropshipper/cost-prices/acknowledge` */
|
|
5559
|
+
interface AcknowledgeCostPriceChangesResponse {
|
|
5560
|
+
acknowledged: boolean;
|
|
5561
|
+
}
|
|
5487
5562
|
|
|
5488
|
-
export { type AccountDropdownConfig, type AccountMenuItem, 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 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 DropshipperProductAttribute, type DropshipperProductAttributeValue, type DropshipperProductMarginItem, type DropshipperProductOption, type DropshipperProductOptionValue, 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 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 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 };
|
|
5563
|
+
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 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 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 };
|
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 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 } 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 // 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 } 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
|
@@ -155,6 +155,39 @@ export interface DeleteVariantCostResponse {
|
|
|
155
155
|
// Products & Sale Prices (Solo Y)
|
|
156
156
|
// ============================================================
|
|
157
157
|
|
|
158
|
+
/** A product image from Medusa's public gallery */
|
|
159
|
+
export interface DropshipperProductImage {
|
|
160
|
+
id: string;
|
|
161
|
+
url: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** A product attachment (file/doc) linked via the product_attachment module */
|
|
165
|
+
export interface DropshipperProductAttachment {
|
|
166
|
+
id: string;
|
|
167
|
+
product_id: string;
|
|
168
|
+
url: string;
|
|
169
|
+
name: string;
|
|
170
|
+
description: string | null;
|
|
171
|
+
mime_type: string;
|
|
172
|
+
size: number;
|
|
173
|
+
rank: number;
|
|
174
|
+
updated_at: string;
|
|
175
|
+
metadata: Record<string, unknown> | null;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Private media (images/videos visible only to the dropshipper) */
|
|
179
|
+
export interface DropshipperProductPrivateMedia {
|
|
180
|
+
id: string;
|
|
181
|
+
product_id: string;
|
|
182
|
+
file_id: string;
|
|
183
|
+
url: string;
|
|
184
|
+
rank: number;
|
|
185
|
+
file_name: string;
|
|
186
|
+
mime_type: string;
|
|
187
|
+
size: number;
|
|
188
|
+
metadata: Record<string, unknown> | null;
|
|
189
|
+
}
|
|
190
|
+
|
|
158
191
|
/** A product variant as seen by the dropshipper */
|
|
159
192
|
export interface DropshipperVariant {
|
|
160
193
|
id: string;
|
|
@@ -239,6 +272,12 @@ export interface DropshipperProduct {
|
|
|
239
272
|
}>;
|
|
240
273
|
/** Native Medusa product options (Size, Color, etc.) */
|
|
241
274
|
medusa_options?: DropshipperProductOption[];
|
|
275
|
+
/** Public gallery images from Medusa — only set when the endpoint fetches them */
|
|
276
|
+
images?: DropshipperProductImage[];
|
|
277
|
+
/** Product attachments (PDFs, CSVs, etc.) from the product_attachment module */
|
|
278
|
+
attachments?: DropshipperProductAttachment[];
|
|
279
|
+
/** Private media (images/videos for dropshipper internal use) */
|
|
280
|
+
private_media?: DropshipperProductPrivateMedia[];
|
|
242
281
|
}
|
|
243
282
|
|
|
244
283
|
/** Options for `GET /admin/thor/dropshipper/products` */
|
|
@@ -398,6 +437,19 @@ export interface DropshipperShippingOption {
|
|
|
398
437
|
label: string;
|
|
399
438
|
code: string | null;
|
|
400
439
|
} | null;
|
|
440
|
+
estimated_days?: string | null;
|
|
441
|
+
location?: {
|
|
442
|
+
id: string;
|
|
443
|
+
name: string;
|
|
444
|
+
address?: {
|
|
445
|
+
address_1: string;
|
|
446
|
+
address_2: string | null;
|
|
447
|
+
city: string | null;
|
|
448
|
+
province: string | null;
|
|
449
|
+
postal_code: string | null;
|
|
450
|
+
country_code: string;
|
|
451
|
+
} | null;
|
|
452
|
+
} | null;
|
|
401
453
|
}
|
|
402
454
|
|
|
403
455
|
/** Options for `GET /admin/thor/dropshipper/orders/shipping-options` */
|
|
@@ -2188,3 +2240,35 @@ export interface DropshipperProfile {
|
|
|
2188
2240
|
export interface GetMyProfileResponse {
|
|
2189
2241
|
user: DropshipperProfile;
|
|
2190
2242
|
}
|
|
2243
|
+
|
|
2244
|
+
// ============================================================
|
|
2245
|
+
// Cost Price Changes Detection (Solo Y)
|
|
2246
|
+
// ============================================================
|
|
2247
|
+
|
|
2248
|
+
/** Response for `GET /admin/thor/dropshipper/cost-prices/has-changes` */
|
|
2249
|
+
export interface CostPriceChangesCheckResponse {
|
|
2250
|
+
has_changes: boolean
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
/** A single changed cost price in the diff response */
|
|
2254
|
+
export interface CostPriceChangeItem {
|
|
2255
|
+
variant_id: string
|
|
2256
|
+
variant_title: string
|
|
2257
|
+
sku: string | null
|
|
2258
|
+
product_id: string
|
|
2259
|
+
product_title: string
|
|
2260
|
+
thumbnail: string | null
|
|
2261
|
+
old_cost_price: number
|
|
2262
|
+
new_cost_price: number
|
|
2263
|
+
currency_code: string
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
/** Response for `GET /admin/thor/dropshipper/cost-prices/changes` */
|
|
2267
|
+
export interface CostPriceChangesResponse {
|
|
2268
|
+
changes: CostPriceChangeItem[]
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
/** Response for `POST /admin/thor/dropshipper/cost-prices/acknowledge` */
|
|
2272
|
+
export interface AcknowledgeCostPriceChangesResponse {
|
|
2273
|
+
acknowledged: boolean
|
|
2274
|
+
}
|
package/src/cart.ts
CHANGED
|
@@ -66,6 +66,9 @@ export interface ShippingMethod {
|
|
|
66
66
|
|
|
67
67
|
/** The parent fulfillment set type from Medusa (e.g., 'shipping', 'pickup', 'pick-up') */
|
|
68
68
|
fulfillmentSetType?: string | null;
|
|
69
|
+
|
|
70
|
+
/** Warehouse/store address for pickup shipping methods */
|
|
71
|
+
address?: string;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
/**
|
package/src/index.ts
CHANGED
|
@@ -278,6 +278,9 @@ export type {
|
|
|
278
278
|
DeleteVariantCostResponse,
|
|
279
279
|
DropshipperVariant,
|
|
280
280
|
DropshipperProduct,
|
|
281
|
+
DropshipperProductImage,
|
|
282
|
+
DropshipperProductAttachment,
|
|
283
|
+
DropshipperProductPrivateMedia,
|
|
281
284
|
GetDropshipperProductsOptions,
|
|
282
285
|
GetDropshipperProductsResponse,
|
|
283
286
|
ValidateCheckoutItemsRequest,
|
|
@@ -452,6 +455,11 @@ export type {
|
|
|
452
455
|
// Dropshipper Profile
|
|
453
456
|
DropshipperProfile,
|
|
454
457
|
GetMyProfileResponse,
|
|
458
|
+
// Cost Price Changes Detection
|
|
459
|
+
CostPriceChangesCheckResponse,
|
|
460
|
+
CostPriceChangeItem,
|
|
461
|
+
CostPriceChangesResponse,
|
|
462
|
+
AcknowledgeCostPriceChangesResponse,
|
|
455
463
|
} from './admin';
|
|
456
464
|
|
|
457
465
|
// ============================================
|