@shoppexio/storefront 1.0.90 → 1.0.91
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 +9 -0
- package/dist/{chunk-ROQI7BO6.js → chunk-UW6DFRB5.js} +90 -424
- package/dist/chunk-UW6DFRB5.js.map +1 -0
- package/dist/customer.cjs +268 -244
- package/dist/customer.cjs.map +1 -1
- package/dist/customer.d.cts +8 -11
- package/dist/customer.d.ts +8 -11
- package/dist/customer.js +346 -56
- package/dist/customer.js.map +1 -1
- package/dist/index.cjs +22162 -24428
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -3
- package/dist/index.d.ts +65 -3
- package/dist/index.js +299 -2290
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-ROQI7BO6.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { createApiClient
|
|
1
|
+
import { createApiClient } from '@shoppex/contracts/api-client';
|
|
2
2
|
import { NavigationMenuSlot } from '@shoppex/contracts/navigation';
|
|
3
3
|
export { NavigationMenuSlot } from '@shoppex/contracts/navigation';
|
|
4
4
|
import * as src from 'src';
|
|
5
|
+
import { CustomerWarrantyClaimWire, CustomerPortalAffiliateCreateLinkWire, CustomerPortalDashboardWire, CustomerPortalPaginatedInvoicesWire, CustomerPortalInvoiceDetailWire, CustomerLoyaltyWire, CustomerLoyaltyRedeemWire, CustomerWarrantyListWire, CustomerPortalNotificationPreferencesWire } from '@shoppex/contracts/customer-account-wire';
|
|
5
6
|
export { CATALOG_UNIT_PRICE_DECIMAL_PLACES, CATALOG_UNIT_PRICE_FORMAT_OPTIONS, PAYABLE_AMOUNT_DECIMAL_PLACES, roundPayableAmount } from '@shoppex/contracts/catalog-unit-price';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -14,6 +15,7 @@ interface ShoppexConfig {
|
|
|
14
15
|
currency?: string;
|
|
15
16
|
apiBaseUrl?: string;
|
|
16
17
|
checkoutBaseUrl?: string;
|
|
18
|
+
preview: boolean;
|
|
17
19
|
}
|
|
18
20
|
interface ShoppexInitOptions {
|
|
19
21
|
locale?: string;
|
|
@@ -29,6 +31,14 @@ interface ShoppexInitOptions {
|
|
|
29
31
|
apiBaseUrl?: string;
|
|
30
32
|
checkoutBaseUrl?: string;
|
|
31
33
|
shopId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Set on pages that render an unpublished draft (preview links): the page
|
|
36
|
+
* has no live side effects. The cart (lines, metadata, coupon) lives in this
|
|
37
|
+
* tab's sessionStorage under `shoppex_cart_<storeSlug>_preview`-style keys,
|
|
38
|
+
* never in the buyer's localStorage cart, and the SDK sends no presence or
|
|
39
|
+
* affiliate funnel events.
|
|
40
|
+
*/
|
|
41
|
+
preview?: boolean;
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
/**
|
|
@@ -593,7 +603,7 @@ interface BuyerRewards {
|
|
|
593
603
|
lifetime_earned: string;
|
|
594
604
|
redeemed: string | null;
|
|
595
605
|
currency: string;
|
|
596
|
-
};
|
|
606
|
+
} | null;
|
|
597
607
|
activity: BuyerRewardActivityItem[];
|
|
598
608
|
earned_after_invoice: BuyerRewardActivityItem[];
|
|
599
609
|
pending_after_invoice: BuyerRewardActivityItem[];
|
|
@@ -1065,6 +1075,12 @@ interface CartQuote {
|
|
|
1065
1075
|
* signing secret configured; absent on older backends.
|
|
1066
1076
|
*/
|
|
1067
1077
|
quote_token?: string | null;
|
|
1078
|
+
/**
|
|
1079
|
+
* True when the cart holds a physical product. Shipping is priced at
|
|
1080
|
+
* checkout from the buyer's address, so `total` excludes it; show
|
|
1081
|
+
* "shipping calculated at checkout" next to the total.
|
|
1082
|
+
*/
|
|
1083
|
+
requires_shipping: boolean;
|
|
1068
1084
|
coupon_applied: boolean;
|
|
1069
1085
|
coupon_source: CartCodeSource | null;
|
|
1070
1086
|
coupon_discount_order_type: 'TOTAL' | 'PAYMENT_FEES' | null;
|
|
@@ -1781,6 +1797,24 @@ interface CustomerEmailPreferencesPatch {
|
|
|
1781
1797
|
subscribed: boolean;
|
|
1782
1798
|
}>;
|
|
1783
1799
|
}
|
|
1800
|
+
/** Which order mails the buyer receives. A key left out is left as it is. */
|
|
1801
|
+
interface CustomerNotificationPreferencesPatch {
|
|
1802
|
+
order_created_emails?: boolean;
|
|
1803
|
+
order_completed_emails?: boolean;
|
|
1804
|
+
payment_issue_emails?: boolean;
|
|
1805
|
+
}
|
|
1806
|
+
interface CustomerAffiliateLinkInput {
|
|
1807
|
+
code: string;
|
|
1808
|
+
label: string;
|
|
1809
|
+
/** Asking for a rate of one's own sends the link to the shop for approval. */
|
|
1810
|
+
requested_affiliate_revenue_percent?: number;
|
|
1811
|
+
requested_affiliate_customer_discount_percent?: number;
|
|
1812
|
+
}
|
|
1813
|
+
interface CustomerInvoicePdf {
|
|
1814
|
+
blob: Blob;
|
|
1815
|
+
/** From the producer's `Content-Disposition`; null when it named none. */
|
|
1816
|
+
filename: string | null;
|
|
1817
|
+
}
|
|
1784
1818
|
/** One basket line for a QUOTE. `variant_id` is omitted, never null, when a product has no variants. */
|
|
1785
1819
|
interface ResellerOrderItem {
|
|
1786
1820
|
product_id: string;
|
|
@@ -1820,6 +1854,14 @@ declare function dashboard(): Promise<SDKResponse<CustomerPortalDashboardWire>>;
|
|
|
1820
1854
|
*/
|
|
1821
1855
|
declare function orders(options?: CustomerOrdersQuery): Promise<SDKResponse<CustomerPortalPaginatedInvoicesWire>>;
|
|
1822
1856
|
declare function order(id: string): Promise<SDKResponse<CustomerPortalInvoiceDetailWire>>;
|
|
1857
|
+
/**
|
|
1858
|
+
* The invoice as a PDF, for the buyer to save.
|
|
1859
|
+
*
|
|
1860
|
+
* A file, not the JSON envelope, so it does not go through `requestCustomer`.
|
|
1861
|
+
* Anything but a PDF on a 2xx is a contract failure rather than a download: a
|
|
1862
|
+
* proxy's HTML error page saved as `invoice.pdf` is a file that will not open.
|
|
1863
|
+
*/
|
|
1864
|
+
declare function invoicePdf(id: string): Promise<SDKResponse<CustomerInvoicePdf>>;
|
|
1823
1865
|
declare function loyalty(): Promise<SDKResponse<CustomerLoyaltyWire>>;
|
|
1824
1866
|
declare function redeemLoyaltyPoints(input: {
|
|
1825
1867
|
points: number;
|
|
@@ -1846,6 +1888,15 @@ declare function addFavorite(productUniqid: string): Promise<SDKResponse<unknown
|
|
|
1846
1888
|
declare function removeFavorite(productUniqid: string): Promise<SDKResponse<unknown>>;
|
|
1847
1889
|
declare function affiliate(): Promise<SDKResponse<unknown>>;
|
|
1848
1890
|
declare function affiliateStats(days?: number): Promise<SDKResponse<unknown>>;
|
|
1891
|
+
/**
|
|
1892
|
+
* A referral link with a code of the buyer's choosing.
|
|
1893
|
+
*
|
|
1894
|
+
* `status` in the answer is `pending` when the shop approves links first, or
|
|
1895
|
+
* when the link asks for rates of its own. Nothing here pays out, converts or
|
|
1896
|
+
* shares a commission: those decide where earned money goes and are not
|
|
1897
|
+
* reachable from a storefront.
|
|
1898
|
+
*/
|
|
1899
|
+
declare function createAffiliateLink(input: CustomerAffiliateLinkInput): Promise<SDKResponse<CustomerPortalAffiliateCreateLinkWire>>;
|
|
1849
1900
|
declare function createTicket(payload: CustomerTicketPayload): Promise<SDKResponse<unknown>>;
|
|
1850
1901
|
declare function ticket(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1851
1902
|
declare function replyToTicket(uniqid: string, message: string): Promise<SDKResponse<unknown>>;
|
|
@@ -1860,6 +1911,13 @@ declare function updateAvatar(file: File): Promise<SDKResponse<unknown>>;
|
|
|
1860
1911
|
declare function removeAvatar(): Promise<SDKResponse<unknown>>;
|
|
1861
1912
|
declare function emailPreferences(): Promise<SDKResponse<unknown>>;
|
|
1862
1913
|
declare function updateEmailPreferences(patch: CustomerEmailPreferencesPatch): Promise<SDKResponse<unknown>>;
|
|
1914
|
+
/**
|
|
1915
|
+
* Order mail, as opposed to the marketing lists above: order placed, order
|
|
1916
|
+
* completed, payment needs attention. Its own producer
|
|
1917
|
+
* (`routes/v1/customer-notifications.ts`), and it answers the saved set.
|
|
1918
|
+
*/
|
|
1919
|
+
declare function notificationPreferences(): Promise<SDKResponse<CustomerPortalNotificationPreferencesWire>>;
|
|
1920
|
+
declare function updateNotificationPreferences(patch: CustomerNotificationPreferencesPatch): Promise<SDKResponse<CustomerPortalNotificationPreferencesWire>>;
|
|
1863
1921
|
declare function sessions(): Promise<SDKResponse<unknown>>;
|
|
1864
1922
|
declare function revokeSession(id: string): Promise<SDKResponse<unknown>>;
|
|
1865
1923
|
/**
|
|
@@ -2080,6 +2138,7 @@ declare const shoppex: {
|
|
|
2080
2138
|
dashboard: typeof dashboard;
|
|
2081
2139
|
orders: typeof orders;
|
|
2082
2140
|
order: typeof order;
|
|
2141
|
+
invoicePdf: typeof invoicePdf;
|
|
2083
2142
|
loyalty: typeof loyalty;
|
|
2084
2143
|
redeemLoyaltyPoints: typeof redeemLoyaltyPoints;
|
|
2085
2144
|
warranties: typeof warranties;
|
|
@@ -2094,6 +2153,7 @@ declare const shoppex: {
|
|
|
2094
2153
|
removeFavorite: typeof removeFavorite;
|
|
2095
2154
|
affiliate: typeof affiliate;
|
|
2096
2155
|
affiliateStats: typeof affiliateStats;
|
|
2156
|
+
createAffiliateLink: typeof createAffiliateLink;
|
|
2097
2157
|
createTicket: typeof createTicket;
|
|
2098
2158
|
ticket: typeof ticket;
|
|
2099
2159
|
replyToTicket: typeof replyToTicket;
|
|
@@ -2102,6 +2162,8 @@ declare const shoppex: {
|
|
|
2102
2162
|
removeAvatar: typeof removeAvatar;
|
|
2103
2163
|
emailPreferences: typeof emailPreferences;
|
|
2104
2164
|
updateEmailPreferences: typeof updateEmailPreferences;
|
|
2165
|
+
notificationPreferences: typeof notificationPreferences;
|
|
2166
|
+
updateNotificationPreferences: typeof updateNotificationPreferences;
|
|
2105
2167
|
sessions: typeof sessions;
|
|
2106
2168
|
revokeSession: typeof revokeSession;
|
|
2107
2169
|
revokeAllSessions: typeof revokeAllSessions;
|
|
@@ -2142,4 +2204,4 @@ declare const shoppex: {
|
|
|
2142
2204
|
mergeSettings: typeof mergeSettings;
|
|
2143
2205
|
};
|
|
2144
2206
|
|
|
2145
|
-
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 CustomerEmailPreferencesPatch, 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, createTicket, dashboard, shoppex as default, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, order, 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, updateAvatar, updateEmailPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };
|
|
2207
|
+
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, 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, 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, updateAvatar, updateEmailPreferences, updateNotificationPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { createApiClient
|
|
1
|
+
import { createApiClient } from '@shoppex/contracts/api-client';
|
|
2
2
|
import { NavigationMenuSlot } from '@shoppex/contracts/navigation';
|
|
3
3
|
export { NavigationMenuSlot } from '@shoppex/contracts/navigation';
|
|
4
4
|
import * as src from 'src';
|
|
5
|
+
import { CustomerWarrantyClaimWire, CustomerPortalAffiliateCreateLinkWire, CustomerPortalDashboardWire, CustomerPortalPaginatedInvoicesWire, CustomerPortalInvoiceDetailWire, CustomerLoyaltyWire, CustomerLoyaltyRedeemWire, CustomerWarrantyListWire, CustomerPortalNotificationPreferencesWire } from '@shoppex/contracts/customer-account-wire';
|
|
5
6
|
export { CATALOG_UNIT_PRICE_DECIMAL_PLACES, CATALOG_UNIT_PRICE_FORMAT_OPTIONS, PAYABLE_AMOUNT_DECIMAL_PLACES, roundPayableAmount } from '@shoppex/contracts/catalog-unit-price';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -14,6 +15,7 @@ interface ShoppexConfig {
|
|
|
14
15
|
currency?: string;
|
|
15
16
|
apiBaseUrl?: string;
|
|
16
17
|
checkoutBaseUrl?: string;
|
|
18
|
+
preview: boolean;
|
|
17
19
|
}
|
|
18
20
|
interface ShoppexInitOptions {
|
|
19
21
|
locale?: string;
|
|
@@ -29,6 +31,14 @@ interface ShoppexInitOptions {
|
|
|
29
31
|
apiBaseUrl?: string;
|
|
30
32
|
checkoutBaseUrl?: string;
|
|
31
33
|
shopId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Set on pages that render an unpublished draft (preview links): the page
|
|
36
|
+
* has no live side effects. The cart (lines, metadata, coupon) lives in this
|
|
37
|
+
* tab's sessionStorage under `shoppex_cart_<storeSlug>_preview`-style keys,
|
|
38
|
+
* never in the buyer's localStorage cart, and the SDK sends no presence or
|
|
39
|
+
* affiliate funnel events.
|
|
40
|
+
*/
|
|
41
|
+
preview?: boolean;
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
/**
|
|
@@ -593,7 +603,7 @@ interface BuyerRewards {
|
|
|
593
603
|
lifetime_earned: string;
|
|
594
604
|
redeemed: string | null;
|
|
595
605
|
currency: string;
|
|
596
|
-
};
|
|
606
|
+
} | null;
|
|
597
607
|
activity: BuyerRewardActivityItem[];
|
|
598
608
|
earned_after_invoice: BuyerRewardActivityItem[];
|
|
599
609
|
pending_after_invoice: BuyerRewardActivityItem[];
|
|
@@ -1065,6 +1075,12 @@ interface CartQuote {
|
|
|
1065
1075
|
* signing secret configured; absent on older backends.
|
|
1066
1076
|
*/
|
|
1067
1077
|
quote_token?: string | null;
|
|
1078
|
+
/**
|
|
1079
|
+
* True when the cart holds a physical product. Shipping is priced at
|
|
1080
|
+
* checkout from the buyer's address, so `total` excludes it; show
|
|
1081
|
+
* "shipping calculated at checkout" next to the total.
|
|
1082
|
+
*/
|
|
1083
|
+
requires_shipping: boolean;
|
|
1068
1084
|
coupon_applied: boolean;
|
|
1069
1085
|
coupon_source: CartCodeSource | null;
|
|
1070
1086
|
coupon_discount_order_type: 'TOTAL' | 'PAYMENT_FEES' | null;
|
|
@@ -1781,6 +1797,24 @@ interface CustomerEmailPreferencesPatch {
|
|
|
1781
1797
|
subscribed: boolean;
|
|
1782
1798
|
}>;
|
|
1783
1799
|
}
|
|
1800
|
+
/** Which order mails the buyer receives. A key left out is left as it is. */
|
|
1801
|
+
interface CustomerNotificationPreferencesPatch {
|
|
1802
|
+
order_created_emails?: boolean;
|
|
1803
|
+
order_completed_emails?: boolean;
|
|
1804
|
+
payment_issue_emails?: boolean;
|
|
1805
|
+
}
|
|
1806
|
+
interface CustomerAffiliateLinkInput {
|
|
1807
|
+
code: string;
|
|
1808
|
+
label: string;
|
|
1809
|
+
/** Asking for a rate of one's own sends the link to the shop for approval. */
|
|
1810
|
+
requested_affiliate_revenue_percent?: number;
|
|
1811
|
+
requested_affiliate_customer_discount_percent?: number;
|
|
1812
|
+
}
|
|
1813
|
+
interface CustomerInvoicePdf {
|
|
1814
|
+
blob: Blob;
|
|
1815
|
+
/** From the producer's `Content-Disposition`; null when it named none. */
|
|
1816
|
+
filename: string | null;
|
|
1817
|
+
}
|
|
1784
1818
|
/** One basket line for a QUOTE. `variant_id` is omitted, never null, when a product has no variants. */
|
|
1785
1819
|
interface ResellerOrderItem {
|
|
1786
1820
|
product_id: string;
|
|
@@ -1820,6 +1854,14 @@ declare function dashboard(): Promise<SDKResponse<CustomerPortalDashboardWire>>;
|
|
|
1820
1854
|
*/
|
|
1821
1855
|
declare function orders(options?: CustomerOrdersQuery): Promise<SDKResponse<CustomerPortalPaginatedInvoicesWire>>;
|
|
1822
1856
|
declare function order(id: string): Promise<SDKResponse<CustomerPortalInvoiceDetailWire>>;
|
|
1857
|
+
/**
|
|
1858
|
+
* The invoice as a PDF, for the buyer to save.
|
|
1859
|
+
*
|
|
1860
|
+
* A file, not the JSON envelope, so it does not go through `requestCustomer`.
|
|
1861
|
+
* Anything but a PDF on a 2xx is a contract failure rather than a download: a
|
|
1862
|
+
* proxy's HTML error page saved as `invoice.pdf` is a file that will not open.
|
|
1863
|
+
*/
|
|
1864
|
+
declare function invoicePdf(id: string): Promise<SDKResponse<CustomerInvoicePdf>>;
|
|
1823
1865
|
declare function loyalty(): Promise<SDKResponse<CustomerLoyaltyWire>>;
|
|
1824
1866
|
declare function redeemLoyaltyPoints(input: {
|
|
1825
1867
|
points: number;
|
|
@@ -1846,6 +1888,15 @@ declare function addFavorite(productUniqid: string): Promise<SDKResponse<unknown
|
|
|
1846
1888
|
declare function removeFavorite(productUniqid: string): Promise<SDKResponse<unknown>>;
|
|
1847
1889
|
declare function affiliate(): Promise<SDKResponse<unknown>>;
|
|
1848
1890
|
declare function affiliateStats(days?: number): Promise<SDKResponse<unknown>>;
|
|
1891
|
+
/**
|
|
1892
|
+
* A referral link with a code of the buyer's choosing.
|
|
1893
|
+
*
|
|
1894
|
+
* `status` in the answer is `pending` when the shop approves links first, or
|
|
1895
|
+
* when the link asks for rates of its own. Nothing here pays out, converts or
|
|
1896
|
+
* shares a commission: those decide where earned money goes and are not
|
|
1897
|
+
* reachable from a storefront.
|
|
1898
|
+
*/
|
|
1899
|
+
declare function createAffiliateLink(input: CustomerAffiliateLinkInput): Promise<SDKResponse<CustomerPortalAffiliateCreateLinkWire>>;
|
|
1849
1900
|
declare function createTicket(payload: CustomerTicketPayload): Promise<SDKResponse<unknown>>;
|
|
1850
1901
|
declare function ticket(uniqid: string): Promise<SDKResponse<unknown>>;
|
|
1851
1902
|
declare function replyToTicket(uniqid: string, message: string): Promise<SDKResponse<unknown>>;
|
|
@@ -1860,6 +1911,13 @@ declare function updateAvatar(file: File): Promise<SDKResponse<unknown>>;
|
|
|
1860
1911
|
declare function removeAvatar(): Promise<SDKResponse<unknown>>;
|
|
1861
1912
|
declare function emailPreferences(): Promise<SDKResponse<unknown>>;
|
|
1862
1913
|
declare function updateEmailPreferences(patch: CustomerEmailPreferencesPatch): Promise<SDKResponse<unknown>>;
|
|
1914
|
+
/**
|
|
1915
|
+
* Order mail, as opposed to the marketing lists above: order placed, order
|
|
1916
|
+
* completed, payment needs attention. Its own producer
|
|
1917
|
+
* (`routes/v1/customer-notifications.ts`), and it answers the saved set.
|
|
1918
|
+
*/
|
|
1919
|
+
declare function notificationPreferences(): Promise<SDKResponse<CustomerPortalNotificationPreferencesWire>>;
|
|
1920
|
+
declare function updateNotificationPreferences(patch: CustomerNotificationPreferencesPatch): Promise<SDKResponse<CustomerPortalNotificationPreferencesWire>>;
|
|
1863
1921
|
declare function sessions(): Promise<SDKResponse<unknown>>;
|
|
1864
1922
|
declare function revokeSession(id: string): Promise<SDKResponse<unknown>>;
|
|
1865
1923
|
/**
|
|
@@ -2080,6 +2138,7 @@ declare const shoppex: {
|
|
|
2080
2138
|
dashboard: typeof dashboard;
|
|
2081
2139
|
orders: typeof orders;
|
|
2082
2140
|
order: typeof order;
|
|
2141
|
+
invoicePdf: typeof invoicePdf;
|
|
2083
2142
|
loyalty: typeof loyalty;
|
|
2084
2143
|
redeemLoyaltyPoints: typeof redeemLoyaltyPoints;
|
|
2085
2144
|
warranties: typeof warranties;
|
|
@@ -2094,6 +2153,7 @@ declare const shoppex: {
|
|
|
2094
2153
|
removeFavorite: typeof removeFavorite;
|
|
2095
2154
|
affiliate: typeof affiliate;
|
|
2096
2155
|
affiliateStats: typeof affiliateStats;
|
|
2156
|
+
createAffiliateLink: typeof createAffiliateLink;
|
|
2097
2157
|
createTicket: typeof createTicket;
|
|
2098
2158
|
ticket: typeof ticket;
|
|
2099
2159
|
replyToTicket: typeof replyToTicket;
|
|
@@ -2102,6 +2162,8 @@ declare const shoppex: {
|
|
|
2102
2162
|
removeAvatar: typeof removeAvatar;
|
|
2103
2163
|
emailPreferences: typeof emailPreferences;
|
|
2104
2164
|
updateEmailPreferences: typeof updateEmailPreferences;
|
|
2165
|
+
notificationPreferences: typeof notificationPreferences;
|
|
2166
|
+
updateNotificationPreferences: typeof updateNotificationPreferences;
|
|
2105
2167
|
sessions: typeof sessions;
|
|
2106
2168
|
revokeSession: typeof revokeSession;
|
|
2107
2169
|
revokeAllSessions: typeof revokeAllSessions;
|
|
@@ -2142,4 +2204,4 @@ declare const shoppex: {
|
|
|
2142
2204
|
mergeSettings: typeof mergeSettings;
|
|
2143
2205
|
};
|
|
2144
2206
|
|
|
2145
|
-
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 CustomerEmailPreferencesPatch, 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, createTicket, dashboard, shoppex as default, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, order, 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, updateAvatar, updateEmailPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };
|
|
2207
|
+
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, 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, 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, updateAvatar, updateEmailPreferences, updateNotificationPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };
|