@shoppexio/storefront 1.0.106 → 1.0.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/{chunk-INBEHRZN.js → chunk-HMEEWD3P.js} +54 -2
- package/dist/{chunk-INBEHRZN.js.map → chunk-HMEEWD3P.js.map} +1 -1
- package/dist/customer.cjs +70 -4
- package/dist/customer.cjs.map +1 -1
- package/dist/customer.d.cts +12 -2
- package/dist/customer.d.ts +12 -2
- package/dist/customer.js +18 -4
- package/dist/customer.js.map +1 -1
- package/dist/index.cjs +62 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -11
- package/dist/index.d.ts +44 -11
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,7 @@ import { NavigationMenuSlot } from '@shoppex/contracts/navigation';
|
|
|
3
3
|
export { NavigationMenuSlot } from '@shoppex/contracts/navigation';
|
|
4
4
|
import { StorefrontDeliveryType } from '@shoppex/contracts/storefront-delivery-type';
|
|
5
5
|
import { createApiClient } from '@shoppex/contracts/api-client';
|
|
6
|
+
import { BuyerStatusFilter } from '@shoppex/contracts/buyer-invoice-status';
|
|
6
7
|
import { CustomerWarrantyClaimWire, CustomerPortalAffiliateCreateLinkWire, CustomerPortalDashboardWire, CustomerPortalPaginatedInvoicesWire, CustomerPortalInvoiceDetailWire, CustomerLoyaltyWire, CustomerLoyaltyRedeemWire, CustomerWarrantyListWire, CustomerPortalOrderReviewWire, CustomerPortalNotificationPreferencesWire } from '@shoppex/contracts/customer-account-wire';
|
|
7
8
|
export { CATALOG_UNIT_PRICE_DECIMAL_PLACES, CATALOG_UNIT_PRICE_FORMAT_OPTIONS, PAYABLE_AMOUNT_DECIMAL_PLACES, roundPayableAmount } from '@shoppex/contracts/catalog-unit-price';
|
|
8
9
|
|
|
@@ -541,21 +542,30 @@ interface Subscription {
|
|
|
541
542
|
interval?: SubscriptionInterval;
|
|
542
543
|
flags?: SubscriptionFlags;
|
|
543
544
|
}
|
|
545
|
+
/**
|
|
546
|
+
* The public invoice read (`GET /v1/invoices/unique/:id`, InvoiceEnricher).
|
|
547
|
+
* Its lines arrive as `product`; it carries no `products` or `created_at`.
|
|
548
|
+
*/
|
|
544
549
|
interface Invoice {
|
|
545
550
|
uniqid: string;
|
|
546
|
-
status: string;
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
551
|
+
status: string | null;
|
|
552
|
+
/**
|
|
553
|
+
* The invoice total in USD (InvoiceEnricher maps `totalUsd` here), a decimal
|
|
554
|
+
* string such as "15.38". It is not in `currency`.
|
|
555
|
+
*/
|
|
556
|
+
total: string | number;
|
|
557
|
+
currency: string | null;
|
|
558
|
+
gateway: string | null;
|
|
559
|
+
product: InvoiceProduct[];
|
|
552
560
|
rewards?: BuyerRewards | null;
|
|
553
561
|
}
|
|
554
562
|
interface InvoiceProduct {
|
|
555
|
-
|
|
563
|
+
/** The product's id; null on a line that has no catalog product. */
|
|
564
|
+
uniqid: string | null;
|
|
556
565
|
title: string;
|
|
557
566
|
quantity: number;
|
|
558
|
-
|
|
567
|
+
/** The line total in the invoice currency. */
|
|
568
|
+
total: number;
|
|
559
569
|
}
|
|
560
570
|
type RewardActionType = 'WALLET_CREDIT' | 'COUPON';
|
|
561
571
|
type RewardGrantStatus = 'PENDING' | 'FULFILLED' | 'FAILED' | 'REVOKED';
|
|
@@ -594,9 +604,17 @@ interface CouponValidation {
|
|
|
594
604
|
source?: 'COUPON' | 'AFFILIATE';
|
|
595
605
|
product_restricted?: boolean;
|
|
596
606
|
variant_restricted?: boolean;
|
|
597
|
-
restriction_scope?: 'all' | 'products' | 'variants' | 'products_and_variants';
|
|
607
|
+
restriction_scope?: 'all' | 'all_except' | 'products' | 'variants' | 'products_and_variants';
|
|
598
608
|
allowed_product_ids?: string[];
|
|
599
609
|
allowed_variant_ids?: string[];
|
|
610
|
+
/** 'all_except': every product but these. */
|
|
611
|
+
excluded_product_ids?: string[];
|
|
612
|
+
/** Products with a discount of their own on this coupon; a fixed amount is in the shop currency. */
|
|
613
|
+
product_discounts?: Array<{
|
|
614
|
+
product_id: string;
|
|
615
|
+
discount_type: 'percentage' | 'fixed';
|
|
616
|
+
discount: number;
|
|
617
|
+
}>;
|
|
600
618
|
message?: string;
|
|
601
619
|
}
|
|
602
620
|
interface CouponValidationOptions {
|
|
@@ -1832,6 +1850,11 @@ interface CustomerOrdersQuery {
|
|
|
1832
1850
|
* actually chose.
|
|
1833
1851
|
*/
|
|
1834
1852
|
status?: string;
|
|
1853
|
+
/**
|
|
1854
|
+
* One order-list group of the buyer status table (`@shoppex/contracts/buyer-invoice-status`):
|
|
1855
|
+
* "paid" holds COMPLETED and AWAITING_STOCK, which a single `status` cannot.
|
|
1856
|
+
*/
|
|
1857
|
+
statusGroup?: BuyerStatusFilter;
|
|
1835
1858
|
/** Partial invoice-id search. The producer trims it to 64 characters. */
|
|
1836
1859
|
search?: string;
|
|
1837
1860
|
}
|
|
@@ -1849,6 +1872,16 @@ interface CustomerSubscriptionCancelOptions {
|
|
|
1849
1872
|
cancel_at_period_end?: boolean;
|
|
1850
1873
|
reason?: string | null;
|
|
1851
1874
|
}
|
|
1875
|
+
/** Why a buyer pauses (`SUBSCRIPTION_PAUSE_REASONS`); the dashboard's `pause_options.reason_enabled` says whether to ask. */
|
|
1876
|
+
type CustomerSubscriptionPauseReason = 'taking_a_break' | 'too_expensive' | 'not_using' | 'not_working' | 'other';
|
|
1877
|
+
/**
|
|
1878
|
+
* A buyer pause: one of the dashboard's `pause_options.lengths[].days`, and a reason when the
|
|
1879
|
+
* shop asks for one. Without `length_days` the backend pauses for the shop's longest pause.
|
|
1880
|
+
*/
|
|
1881
|
+
interface CustomerSubscriptionPauseOptions {
|
|
1882
|
+
length_days?: 7 | 14 | 30 | 60 | 90;
|
|
1883
|
+
reason?: CustomerSubscriptionPauseReason | null;
|
|
1884
|
+
}
|
|
1852
1885
|
interface CustomerEmailPreferencesPatch {
|
|
1853
1886
|
global_unsubscribed?: boolean;
|
|
1854
1887
|
list_subscriptions?: Array<{
|
|
@@ -1947,7 +1980,7 @@ declare function claimWarranty(uniqid: string, message?: string): Promise<SDKRes
|
|
|
1947
1980
|
declare function resetLicenseHwid(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1948
1981
|
declare function subscriptionBillingHistory(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1949
1982
|
declare function cancelSubscription(uniqid: string, options?: CustomerSubscriptionCancelOptions): Promise<SDKResponse<unknown>>;
|
|
1950
|
-
declare function pauseSubscription(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1983
|
+
declare function pauseSubscription(uniqid: string, options?: CustomerSubscriptionPauseOptions): Promise<SDKResponse<unknown>>;
|
|
1951
1984
|
declare function resumeSubscription(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1952
1985
|
declare function undoSubscriptionCancel(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1953
1986
|
declare function favorites(): Promise<SDKResponse<unknown>>;
|
|
@@ -2234,4 +2267,4 @@ declare const shoppex: {
|
|
|
2234
2267
|
trackProductView: typeof src.trackProductView;
|
|
2235
2268
|
};
|
|
2236
2269
|
|
|
2237
|
-
export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, CURRENCY_UNAVAILABLE_ERROR_CODE, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerAffiliateLinkInput, type CustomerEmailPreferencesPatch, type CustomerInvoicePdf, type CustomerNotificationPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, PRODUCT_FILTER_UNSUPPORTED, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createAffiliateLink, createTicket, dashboard, shoppex as default, discardTicketImage, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, invoicePdf, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, notificationPreferences, order, orderReview, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackCartActivity, trackPageView, trackProductView, undoSubscriptionCancel, updateAvatar, updateEmailPreferences, updateNotificationPreferences, updateProfile, uploadTicketImage, validateStorefrontCustomFieldValue, verifyOtp, warranties };
|
|
2270
|
+
export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, CURRENCY_UNAVAILABLE_ERROR_CODE, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerAffiliateLinkInput, type CustomerEmailPreferencesPatch, type CustomerInvoicePdf, type CustomerNotificationPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerSubscriptionPauseOptions, type CustomerSubscriptionPauseReason, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, PRODUCT_FILTER_UNSUPPORTED, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createAffiliateLink, createTicket, dashboard, shoppex as default, discardTicketImage, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, invoicePdf, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, notificationPreferences, order, orderReview, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackCartActivity, trackPageView, trackProductView, undoSubscriptionCancel, updateAvatar, updateEmailPreferences, updateNotificationPreferences, updateProfile, uploadTicketImage, validateStorefrontCustomFieldValue, verifyOtp, warranties };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { NavigationMenuSlot } from '@shoppex/contracts/navigation';
|
|
|
3
3
|
export { NavigationMenuSlot } from '@shoppex/contracts/navigation';
|
|
4
4
|
import { StorefrontDeliveryType } from '@shoppex/contracts/storefront-delivery-type';
|
|
5
5
|
import { createApiClient } from '@shoppex/contracts/api-client';
|
|
6
|
+
import { BuyerStatusFilter } from '@shoppex/contracts/buyer-invoice-status';
|
|
6
7
|
import { CustomerWarrantyClaimWire, CustomerPortalAffiliateCreateLinkWire, CustomerPortalDashboardWire, CustomerPortalPaginatedInvoicesWire, CustomerPortalInvoiceDetailWire, CustomerLoyaltyWire, CustomerLoyaltyRedeemWire, CustomerWarrantyListWire, CustomerPortalOrderReviewWire, CustomerPortalNotificationPreferencesWire } from '@shoppex/contracts/customer-account-wire';
|
|
7
8
|
export { CATALOG_UNIT_PRICE_DECIMAL_PLACES, CATALOG_UNIT_PRICE_FORMAT_OPTIONS, PAYABLE_AMOUNT_DECIMAL_PLACES, roundPayableAmount } from '@shoppex/contracts/catalog-unit-price';
|
|
8
9
|
|
|
@@ -541,21 +542,30 @@ interface Subscription {
|
|
|
541
542
|
interval?: SubscriptionInterval;
|
|
542
543
|
flags?: SubscriptionFlags;
|
|
543
544
|
}
|
|
545
|
+
/**
|
|
546
|
+
* The public invoice read (`GET /v1/invoices/unique/:id`, InvoiceEnricher).
|
|
547
|
+
* Its lines arrive as `product`; it carries no `products` or `created_at`.
|
|
548
|
+
*/
|
|
544
549
|
interface Invoice {
|
|
545
550
|
uniqid: string;
|
|
546
|
-
status: string;
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
551
|
+
status: string | null;
|
|
552
|
+
/**
|
|
553
|
+
* The invoice total in USD (InvoiceEnricher maps `totalUsd` here), a decimal
|
|
554
|
+
* string such as "15.38". It is not in `currency`.
|
|
555
|
+
*/
|
|
556
|
+
total: string | number;
|
|
557
|
+
currency: string | null;
|
|
558
|
+
gateway: string | null;
|
|
559
|
+
product: InvoiceProduct[];
|
|
552
560
|
rewards?: BuyerRewards | null;
|
|
553
561
|
}
|
|
554
562
|
interface InvoiceProduct {
|
|
555
|
-
|
|
563
|
+
/** The product's id; null on a line that has no catalog product. */
|
|
564
|
+
uniqid: string | null;
|
|
556
565
|
title: string;
|
|
557
566
|
quantity: number;
|
|
558
|
-
|
|
567
|
+
/** The line total in the invoice currency. */
|
|
568
|
+
total: number;
|
|
559
569
|
}
|
|
560
570
|
type RewardActionType = 'WALLET_CREDIT' | 'COUPON';
|
|
561
571
|
type RewardGrantStatus = 'PENDING' | 'FULFILLED' | 'FAILED' | 'REVOKED';
|
|
@@ -594,9 +604,17 @@ interface CouponValidation {
|
|
|
594
604
|
source?: 'COUPON' | 'AFFILIATE';
|
|
595
605
|
product_restricted?: boolean;
|
|
596
606
|
variant_restricted?: boolean;
|
|
597
|
-
restriction_scope?: 'all' | 'products' | 'variants' | 'products_and_variants';
|
|
607
|
+
restriction_scope?: 'all' | 'all_except' | 'products' | 'variants' | 'products_and_variants';
|
|
598
608
|
allowed_product_ids?: string[];
|
|
599
609
|
allowed_variant_ids?: string[];
|
|
610
|
+
/** 'all_except': every product but these. */
|
|
611
|
+
excluded_product_ids?: string[];
|
|
612
|
+
/** Products with a discount of their own on this coupon; a fixed amount is in the shop currency. */
|
|
613
|
+
product_discounts?: Array<{
|
|
614
|
+
product_id: string;
|
|
615
|
+
discount_type: 'percentage' | 'fixed';
|
|
616
|
+
discount: number;
|
|
617
|
+
}>;
|
|
600
618
|
message?: string;
|
|
601
619
|
}
|
|
602
620
|
interface CouponValidationOptions {
|
|
@@ -1832,6 +1850,11 @@ interface CustomerOrdersQuery {
|
|
|
1832
1850
|
* actually chose.
|
|
1833
1851
|
*/
|
|
1834
1852
|
status?: string;
|
|
1853
|
+
/**
|
|
1854
|
+
* One order-list group of the buyer status table (`@shoppex/contracts/buyer-invoice-status`):
|
|
1855
|
+
* "paid" holds COMPLETED and AWAITING_STOCK, which a single `status` cannot.
|
|
1856
|
+
*/
|
|
1857
|
+
statusGroup?: BuyerStatusFilter;
|
|
1835
1858
|
/** Partial invoice-id search. The producer trims it to 64 characters. */
|
|
1836
1859
|
search?: string;
|
|
1837
1860
|
}
|
|
@@ -1849,6 +1872,16 @@ interface CustomerSubscriptionCancelOptions {
|
|
|
1849
1872
|
cancel_at_period_end?: boolean;
|
|
1850
1873
|
reason?: string | null;
|
|
1851
1874
|
}
|
|
1875
|
+
/** Why a buyer pauses (`SUBSCRIPTION_PAUSE_REASONS`); the dashboard's `pause_options.reason_enabled` says whether to ask. */
|
|
1876
|
+
type CustomerSubscriptionPauseReason = 'taking_a_break' | 'too_expensive' | 'not_using' | 'not_working' | 'other';
|
|
1877
|
+
/**
|
|
1878
|
+
* A buyer pause: one of the dashboard's `pause_options.lengths[].days`, and a reason when the
|
|
1879
|
+
* shop asks for one. Without `length_days` the backend pauses for the shop's longest pause.
|
|
1880
|
+
*/
|
|
1881
|
+
interface CustomerSubscriptionPauseOptions {
|
|
1882
|
+
length_days?: 7 | 14 | 30 | 60 | 90;
|
|
1883
|
+
reason?: CustomerSubscriptionPauseReason | null;
|
|
1884
|
+
}
|
|
1852
1885
|
interface CustomerEmailPreferencesPatch {
|
|
1853
1886
|
global_unsubscribed?: boolean;
|
|
1854
1887
|
list_subscriptions?: Array<{
|
|
@@ -1947,7 +1980,7 @@ declare function claimWarranty(uniqid: string, message?: string): Promise<SDKRes
|
|
|
1947
1980
|
declare function resetLicenseHwid(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1948
1981
|
declare function subscriptionBillingHistory(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1949
1982
|
declare function cancelSubscription(uniqid: string, options?: CustomerSubscriptionCancelOptions): Promise<SDKResponse<unknown>>;
|
|
1950
|
-
declare function pauseSubscription(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1983
|
+
declare function pauseSubscription(uniqid: string, options?: CustomerSubscriptionPauseOptions): Promise<SDKResponse<unknown>>;
|
|
1951
1984
|
declare function resumeSubscription(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1952
1985
|
declare function undoSubscriptionCancel(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1953
1986
|
declare function favorites(): Promise<SDKResponse<unknown>>;
|
|
@@ -2234,4 +2267,4 @@ declare const shoppex: {
|
|
|
2234
2267
|
trackProductView: typeof src.trackProductView;
|
|
2235
2268
|
};
|
|
2236
2269
|
|
|
2237
|
-
export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, CURRENCY_UNAVAILABLE_ERROR_CODE, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerAffiliateLinkInput, type CustomerEmailPreferencesPatch, type CustomerInvoicePdf, type CustomerNotificationPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, PRODUCT_FILTER_UNSUPPORTED, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createAffiliateLink, createTicket, dashboard, shoppex as default, discardTicketImage, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, invoicePdf, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, notificationPreferences, order, orderReview, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackCartActivity, trackPageView, trackProductView, undoSubscriptionCancel, updateAvatar, updateEmailPreferences, updateNotificationPreferences, updateProfile, uploadTicketImage, validateStorefrontCustomFieldValue, verifyOtp, warranties };
|
|
2270
|
+
export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, CURRENCY_UNAVAILABLE_ERROR_CODE, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerAffiliateLinkInput, type CustomerEmailPreferencesPatch, type CustomerInvoicePdf, type CustomerNotificationPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerSubscriptionPauseOptions, type CustomerSubscriptionPauseReason, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, PRODUCT_FILTER_UNSUPPORTED, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createAffiliateLink, createTicket, dashboard, shoppex as default, discardTicketImage, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, invoicePdf, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, notificationPreferences, order, orderReview, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackCartActivity, trackPageView, trackProductView, undoSubscriptionCancel, updateAvatar, updateEmailPreferences, updateNotificationPreferences, updateProfile, uploadTicketImage, validateStorefrontCustomFieldValue, verifyOtp, warranties };
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
customerWarrantyClaimSchema,
|
|
11
11
|
customerWarrantyListSchema,
|
|
12
12
|
storefrontStorageKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-HMEEWD3P.js";
|
|
14
14
|
|
|
15
15
|
// ../sdk/src/core/errors.ts
|
|
16
16
|
var CURRENCY_UNAVAILABLE_ERROR_CODE = "errors.storefront.currency_unavailable";
|
|
@@ -2686,8 +2686,10 @@ function priceVariantToProductVariant(variant) {
|
|
|
2686
2686
|
cloudflareImageId: variant.cloudflareImageId,
|
|
2687
2687
|
image_url: variant.image_url,
|
|
2688
2688
|
imageUrl: variant.imageUrl,
|
|
2689
|
+
is_featured: variant.is_featured,
|
|
2689
2690
|
visibility: variant.visibility,
|
|
2690
|
-
is_private: variant.is_private
|
|
2691
|
+
is_private: variant.is_private,
|
|
2692
|
+
license_period: variant.license_period
|
|
2691
2693
|
};
|
|
2692
2694
|
}
|
|
2693
2695
|
function normalizeProduct(product) {
|
|
@@ -4479,6 +4481,7 @@ function orders(options = {}) {
|
|
|
4479
4481
|
if (options.page !== void 0) query.set("page", String(options.page));
|
|
4480
4482
|
if (options.limit !== void 0) query.set("limit", String(options.limit));
|
|
4481
4483
|
if (options.status) query.set("status", options.status);
|
|
4484
|
+
if (options.statusGroup) query.set("status_group", options.statusGroup);
|
|
4482
4485
|
if (options.search) query.set("q", options.search);
|
|
4483
4486
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
4484
4487
|
return requestCustomer(`/invoices${suffix}`, { schema: customerPortalPaginatedInvoicesSchema });
|
|
@@ -4571,10 +4574,13 @@ function cancelSubscription(uniqid, options = {}) {
|
|
|
4571
4574
|
}
|
|
4572
4575
|
});
|
|
4573
4576
|
}
|
|
4574
|
-
function pauseSubscription(uniqid) {
|
|
4577
|
+
function pauseSubscription(uniqid, options = {}) {
|
|
4575
4578
|
return requestCustomer(`/subscriptions/${encodeURIComponent(uniqid)}/pause`, {
|
|
4576
4579
|
method: "POST",
|
|
4577
|
-
body: {
|
|
4580
|
+
body: {
|
|
4581
|
+
...options.length_days !== void 0 ? { length_days: options.length_days } : {},
|
|
4582
|
+
...options.reason !== void 0 ? { reason: options.reason } : {}
|
|
4583
|
+
}
|
|
4578
4584
|
});
|
|
4579
4585
|
}
|
|
4580
4586
|
function resumeSubscription(uniqid) {
|