@behio/storefront-sdk 0.36.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-QKEW2EU5.js → chunk-FOUBL2EQ.js} +24 -1
- package/dist/{chunk-5C6MNGGB.mjs → chunk-MF5LMHZ4.mjs} +24 -1
- package/dist/{client-Bf2bJGyN.d.mts → client-Cb_eHKm9.d.mts} +91 -2
- package/dist/{client-Bf2bJGyN.d.ts → client-Cb_eHKm9.d.ts} +91 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/next.js +2 -2
- package/dist/next.mjs +1 -1
- package/dist/react.d.mts +37 -3
- package/dist/react.d.ts +37 -3
- package/dist/react.js +98 -60
- package/dist/react.mjs +114 -76
- package/package.json +2 -2
|
@@ -125,7 +125,7 @@ var BehioStorefront = class {
|
|
|
125
125
|
// Rate limit tracking
|
|
126
126
|
this.rateLimitRemaining = null;
|
|
127
127
|
this.rateLimitReset = null;
|
|
128
|
-
this.baseUrl = (config.baseUrl || "https://
|
|
128
|
+
this.baseUrl = (config.baseUrl || "https://be.behio.com").replace(/\/$/, "");
|
|
129
129
|
this.apiKey = config.apiKey;
|
|
130
130
|
this.shopDomain = config.shopDomain;
|
|
131
131
|
this.defaultLocale = config.locale;
|
|
@@ -1036,6 +1036,29 @@ var CustomerModule = class {
|
|
|
1036
1036
|
async getDownloadUrl(downloadId) {
|
|
1037
1037
|
return this.client.request("POST", `/customer/downloads/${downloadId}/url`);
|
|
1038
1038
|
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Online courses (LMS): list the logged-in customer's enrolled courses
|
|
1041
|
+
* with progress. Enrollment is created automatically when an order with a
|
|
1042
|
+
* course product is paid. Requires an authenticated customer session.
|
|
1043
|
+
*/
|
|
1044
|
+
async getCourses() {
|
|
1045
|
+
return this.client.request("GET", "/customer/courses");
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Course player payload: modules and lessons in order, with per-lesson
|
|
1049
|
+
* drip-unlock state. Locked lessons never contain content — the server
|
|
1050
|
+
* withholds `videoUrl`/`content`/`attachments` until `unlockAt`.
|
|
1051
|
+
*/
|
|
1052
|
+
async getCourse(courseId) {
|
|
1053
|
+
return this.client.request("GET", `/customer/courses/${courseId}`);
|
|
1054
|
+
}
|
|
1055
|
+
/** Mark an unlocked lesson as completed (idempotent). */
|
|
1056
|
+
async completeLesson(courseId, lessonId) {
|
|
1057
|
+
return this.client.request(
|
|
1058
|
+
"POST",
|
|
1059
|
+
`/customer/courses/${courseId}/lessons/${lessonId}/complete`
|
|
1060
|
+
);
|
|
1061
|
+
}
|
|
1039
1062
|
};
|
|
1040
1063
|
var PagesModule = class {
|
|
1041
1064
|
constructor(client) {
|
|
@@ -125,7 +125,7 @@ var BehioStorefront = class {
|
|
|
125
125
|
// Rate limit tracking
|
|
126
126
|
this.rateLimitRemaining = null;
|
|
127
127
|
this.rateLimitReset = null;
|
|
128
|
-
this.baseUrl = (config.baseUrl || "https://
|
|
128
|
+
this.baseUrl = (config.baseUrl || "https://be.behio.com").replace(/\/$/, "");
|
|
129
129
|
this.apiKey = config.apiKey;
|
|
130
130
|
this.shopDomain = config.shopDomain;
|
|
131
131
|
this.defaultLocale = config.locale;
|
|
@@ -1036,6 +1036,29 @@ var CustomerModule = class {
|
|
|
1036
1036
|
async getDownloadUrl(downloadId) {
|
|
1037
1037
|
return this.client.request("POST", `/customer/downloads/${downloadId}/url`);
|
|
1038
1038
|
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Online courses (LMS): list the logged-in customer's enrolled courses
|
|
1041
|
+
* with progress. Enrollment is created automatically when an order with a
|
|
1042
|
+
* course product is paid. Requires an authenticated customer session.
|
|
1043
|
+
*/
|
|
1044
|
+
async getCourses() {
|
|
1045
|
+
return this.client.request("GET", "/customer/courses");
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Course player payload: modules and lessons in order, with per-lesson
|
|
1049
|
+
* drip-unlock state. Locked lessons never contain content — the server
|
|
1050
|
+
* withholds `videoUrl`/`content`/`attachments` until `unlockAt`.
|
|
1051
|
+
*/
|
|
1052
|
+
async getCourse(courseId) {
|
|
1053
|
+
return this.client.request("GET", `/customer/courses/${courseId}`);
|
|
1054
|
+
}
|
|
1055
|
+
/** Mark an unlocked lesson as completed (idempotent). */
|
|
1056
|
+
async completeLesson(courseId, lessonId) {
|
|
1057
|
+
return this.client.request(
|
|
1058
|
+
"POST",
|
|
1059
|
+
`/customer/courses/${courseId}/lessons/${lessonId}/complete`
|
|
1060
|
+
);
|
|
1061
|
+
}
|
|
1039
1062
|
};
|
|
1040
1063
|
var PagesModule = class {
|
|
1041
1064
|
constructor(client) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface BehioStorefrontConfig {
|
|
2
2
|
/** API key (public: pk_live_xxx or private: sk_live_xxx) */
|
|
3
3
|
apiKey: string;
|
|
4
|
-
/** Backend base URL. Default: https://
|
|
4
|
+
/** Backend base URL. Default: https://be.behio.com */
|
|
5
5
|
baseUrl?: string;
|
|
6
6
|
/**
|
|
7
7
|
* The domain this storefront is served on (e.g. "mujshop.cz"), sent as
|
|
@@ -38,6 +38,13 @@ interface MessageResponse {
|
|
|
38
38
|
type NewsletterOptInDefault = "CHECKED" | "UNCHECKED" | "HIDDEN";
|
|
39
39
|
/** How sold-out products behave in the catalog. */
|
|
40
40
|
type StockBehavior = "HIDE" | "BACKORDER" | "SHOW_SOLD_OUT";
|
|
41
|
+
/**
|
|
42
|
+
* Shop-level stock mode preset. ALWAYS_AVAILABLE (reseller) and MADE_TO_ORDER
|
|
43
|
+
* (production) shops sell regardless of stock: `inStock` is always true,
|
|
44
|
+
* availability derives to "in-stock" / "on-order" and stock counts are hidden.
|
|
45
|
+
* Templates can hide stock UI entirely when the mode is not TRACKED.
|
|
46
|
+
*/
|
|
47
|
+
type StockMode = "TRACKED" | "ALWAYS_AVAILABLE" | "MADE_TO_ORDER";
|
|
41
48
|
/**
|
|
42
49
|
* Merchant-configured checkout & cart rules the storefront MUST honour so the
|
|
43
50
|
* shop behaves exactly as it was configured in the admin. Mirrors the backend
|
|
@@ -92,6 +99,8 @@ interface CheckoutSettings {
|
|
|
92
99
|
* cart API 400s on anything above it.
|
|
93
100
|
*/
|
|
94
101
|
stockBehavior: StockBehavior;
|
|
102
|
+
/** Stock mode preset; non-TRACKED shops are always purchasable. */
|
|
103
|
+
stockMode: StockMode;
|
|
95
104
|
/**
|
|
96
105
|
* Merchant enabled the "only X left" nudge. When true, products whose stock
|
|
97
106
|
* is within `lowStockThreshold` carry `lowStockRemaining` — render the badge
|
|
@@ -1099,6 +1108,70 @@ interface DigitalDownload {
|
|
|
1099
1108
|
isMaxedOut: boolean;
|
|
1100
1109
|
createdAt: number;
|
|
1101
1110
|
}
|
|
1111
|
+
/** One enrolled course on the customer's "My courses" list. */
|
|
1112
|
+
interface CourseListItem {
|
|
1113
|
+
courseId: string;
|
|
1114
|
+
/** Localized course (product) name, best-effort. */
|
|
1115
|
+
name: string | null;
|
|
1116
|
+
/** Product slug for linking to the PDP. */
|
|
1117
|
+
slug: string;
|
|
1118
|
+
imageUrl: string | null;
|
|
1119
|
+
totalLessons: number;
|
|
1120
|
+
completedLessons: number;
|
|
1121
|
+
enrolledAt: number;
|
|
1122
|
+
/** Access expiry (epoch ms, null = never expires). */
|
|
1123
|
+
expiresAt: number | null;
|
|
1124
|
+
isExpired: boolean;
|
|
1125
|
+
}
|
|
1126
|
+
/** Downloadable attachment on a course lesson. */
|
|
1127
|
+
interface CourseAttachment {
|
|
1128
|
+
name: string;
|
|
1129
|
+
url: string;
|
|
1130
|
+
fileSize?: number;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* One lesson in the course player. Locked lessons (drip unlocking) expose
|
|
1134
|
+
* only the title and `unlockAt` — `videoUrl`/`content`/`attachments` are
|
|
1135
|
+
* null/empty until the lesson unlocks server-side.
|
|
1136
|
+
*/
|
|
1137
|
+
interface CourseLesson {
|
|
1138
|
+
id: string;
|
|
1139
|
+
title: string;
|
|
1140
|
+
isPreview: boolean;
|
|
1141
|
+
isUnlocked: boolean;
|
|
1142
|
+
/** When a locked lesson unlocks (epoch ms). Null once unlocked. */
|
|
1143
|
+
unlockAt: number | null;
|
|
1144
|
+
isCompleted: boolean;
|
|
1145
|
+
videoUrl: string | null;
|
|
1146
|
+
content: string | null;
|
|
1147
|
+
attachments: CourseAttachment[];
|
|
1148
|
+
}
|
|
1149
|
+
interface CourseModule {
|
|
1150
|
+
id: string;
|
|
1151
|
+
title: string;
|
|
1152
|
+
lessons: CourseLesson[];
|
|
1153
|
+
}
|
|
1154
|
+
/** Full course player payload for an enrolled customer. */
|
|
1155
|
+
interface CourseDetail {
|
|
1156
|
+
courseId: string;
|
|
1157
|
+
name: string | null;
|
|
1158
|
+
slug: string;
|
|
1159
|
+
imageUrl: string | null;
|
|
1160
|
+
/** Welcome text shown at the top of the member area (markdown). */
|
|
1161
|
+
welcomeText: string | null;
|
|
1162
|
+
enrolledAt: number;
|
|
1163
|
+
expiresAt: number | null;
|
|
1164
|
+
totalLessons: number;
|
|
1165
|
+
completedLessons: number;
|
|
1166
|
+
modules: CourseModule[];
|
|
1167
|
+
}
|
|
1168
|
+
/** Progress snapshot returned after completing a lesson. */
|
|
1169
|
+
interface CourseProgress {
|
|
1170
|
+
courseId: string;
|
|
1171
|
+
lessonId: string;
|
|
1172
|
+
totalLessons: number;
|
|
1173
|
+
completedLessons: number;
|
|
1174
|
+
}
|
|
1102
1175
|
/** Short-lived signed URL to fetch a purchased digital file. */
|
|
1103
1176
|
interface DownloadUrl {
|
|
1104
1177
|
/** Short-lived (15 min) signed URL. */
|
|
@@ -2209,6 +2282,22 @@ declare class CustomerModule {
|
|
|
2209
2282
|
* server-side. Requires an authenticated customer session.
|
|
2210
2283
|
*/
|
|
2211
2284
|
getDownloadUrl(downloadId: string): Promise<SdkResult<DownloadUrl>>;
|
|
2285
|
+
/**
|
|
2286
|
+
* Online courses (LMS): list the logged-in customer's enrolled courses
|
|
2287
|
+
* with progress. Enrollment is created automatically when an order with a
|
|
2288
|
+
* course product is paid. Requires an authenticated customer session.
|
|
2289
|
+
*/
|
|
2290
|
+
getCourses(): Promise<SdkResult<{
|
|
2291
|
+
items: CourseListItem[];
|
|
2292
|
+
}>>;
|
|
2293
|
+
/**
|
|
2294
|
+
* Course player payload: modules and lessons in order, with per-lesson
|
|
2295
|
+
* drip-unlock state. Locked lessons never contain content — the server
|
|
2296
|
+
* withholds `videoUrl`/`content`/`attachments` until `unlockAt`.
|
|
2297
|
+
*/
|
|
2298
|
+
getCourse(courseId: string): Promise<SdkResult<CourseDetail>>;
|
|
2299
|
+
/** Mark an unlocked lesson as completed (idempotent). */
|
|
2300
|
+
completeLesson(courseId: string, lessonId: string): Promise<SdkResult<CourseProgress>>;
|
|
2212
2301
|
}
|
|
2213
2302
|
declare class PagesModule {
|
|
2214
2303
|
private client;
|
|
@@ -2399,4 +2488,4 @@ declare class NewsletterModule {
|
|
|
2399
2488
|
unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
2400
2489
|
}
|
|
2401
2490
|
|
|
2402
|
-
export { type
|
|
2491
|
+
export { type ReturnRequest as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type CheckoutInput as D, type PageDetail as E, type FilterField as F, type Page as G, type ShopInfo as H, type ShopScripts as I, type ShopSeo as J, type Bundle as K, type LoyaltySummary as L, type Menu as M, type NewsletterSubscribeResult as N, type OrderListItem as O, type ProductsQuery as P, type ProductGroup as Q, type RegisterInput as R, type Subscription as S, type CrossSellItem as T, type ActivePromotion as U, type GiftCardBalance as V, type WishlistItem as W, type ProductReviewsResponse as X, type SubmitReviewInput as Y, type ReturnableOrder as Z, type ReturnStatus as _, BehioStorefront as a, type OrderStatusHistory as a$, type SubmitReturnInput as a0, type CookieConsent as a1, type CookieConsentInput as a2, type QuoteRequest as a3, type SubmitQuoteInput as a4, type BackInStockSubscription as a5, type AddToCartInput as a6, type AuthTokens as a7, BehioApiError as a8, type BundleItem as a9, type CourseLesson as aA, type CourseModule as aB, type DataGroupFieldType as aC, type DigitalDownload as aD, type DownloadUrl as aE, type Facet as aF, type FacetAvailability as aG, type FacetCategory as aH, type FacetLabel as aI, type FacetPriceRange as aJ, type FacetRange as aK, type FacetRatingBucket as aL, type FacetValue as aM, FulfillmentStatuses as aN, type GiftCardPurchaseInput as aO, type GiftCardPurchaseResult as aP, type GiftCardSummary as aQ, type LoyaltyBalance as aR, type LoyaltyNextTier as aS, type LoyaltyProgram as aT, type LoyaltyTier as aU, type LoyaltyTierPerks as aV, type LoyaltyTransaction as aW, type MenuItem as aX, type MenuItemRef as aY, type MenuItemType as aZ, type NewsletterOptInDefault as a_, type CartDiscount as aa, type CartItem as ab, type CheckoutAddress as ac, type FulfillmentStatus as ad, type LoginInput as ae, type MessageResponse as af, type OrderItem as ag, type OrderStatus as ah, type PaymentStatus as ai, type ProductPrice as aj, type ProductReview as ak, type ProductVariant as al, type SdkResult as am, type AddressType as an, AddressTypes as ao, type BadgeTone as ap, type BehioErrorCode as aq, type BehioEventHandler as ar, type BehioEventType as as, BehioNetworkError as at, type CartBundleLine as au, type CartBundleLineItem as av, type CartItemProduct as aw, type CartPromotion as ax, type CheckoutSettings as ay, type CourseAttachment as az, type PaginatedResponse as b, OrderStatuses as b0, type OrderTracking as b1, type PageAttachment as b2, PaymentStatuses as b3, type PickupPointHours as b4, type PriceDisplay as b5, type ProductAvailability as b6, type ProductCustomField as b7, type ProductCustomFieldGroup as b8, type ProductMedia as b9, type VariantAxisValue as bA, err as bB, ok as bC, toSdkError as bD, type ProductMediaVariant as ba, type ProductPromotionSummary as bb, ProductSort as bc, type ProductSortValue as bd, type ProductVolumePrice as be, type QuoteItem as bf, type RegisterResult as bg, type RequestInterceptor as bh, type RequestInterceptorConfig as bi, type ResponseInterceptor as bj, type ResponseInterceptorData as bk, type ReturnRequestItem as bl, type ReturnStatusItem as bm, type ReturnableOrderItem as bn, type SdkError as bo, type ShopScript as bp, type ShopScriptPlacement as bq, type ShopScriptType as br, type ShopSeoIdentity as bs, type StockBehavior as bt, type StockMode as bu, type SubscriptionFrequency as bv, type SubscriptionItem as bw, type SubscriptionStatus as bx, type TaxBreakdownLine as by, type VariantAxis as bz, type ProductListItem as c, type ProductDetail as d, type CategoryDetail as e, type ProductLabel as f, type FacetsResponse as g, type Cart as h, type CustomerProfile as i, type CustomerAddress as j, type AddressDetail as k, type CourseDetail as l, type CourseProgress as m, type CourseListItem as n, type SubscriptionAction as o, type PickupPointsInput as p, type PickupPoint as q, type ShippingMethodSummary as r, type ShippingQuoteInput as s, type ShippingQuote as t, type CheckoutPaymentMethod as u, type NewsletterSubscribeInput as v, type NewsletterUnsubscribeResult as w, type OrderDetail as x, type OrderAccessRequestResponse as y, type OrderAccessVerifyResponse as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface BehioStorefrontConfig {
|
|
2
2
|
/** API key (public: pk_live_xxx or private: sk_live_xxx) */
|
|
3
3
|
apiKey: string;
|
|
4
|
-
/** Backend base URL. Default: https://
|
|
4
|
+
/** Backend base URL. Default: https://be.behio.com */
|
|
5
5
|
baseUrl?: string;
|
|
6
6
|
/**
|
|
7
7
|
* The domain this storefront is served on (e.g. "mujshop.cz"), sent as
|
|
@@ -38,6 +38,13 @@ interface MessageResponse {
|
|
|
38
38
|
type NewsletterOptInDefault = "CHECKED" | "UNCHECKED" | "HIDDEN";
|
|
39
39
|
/** How sold-out products behave in the catalog. */
|
|
40
40
|
type StockBehavior = "HIDE" | "BACKORDER" | "SHOW_SOLD_OUT";
|
|
41
|
+
/**
|
|
42
|
+
* Shop-level stock mode preset. ALWAYS_AVAILABLE (reseller) and MADE_TO_ORDER
|
|
43
|
+
* (production) shops sell regardless of stock: `inStock` is always true,
|
|
44
|
+
* availability derives to "in-stock" / "on-order" and stock counts are hidden.
|
|
45
|
+
* Templates can hide stock UI entirely when the mode is not TRACKED.
|
|
46
|
+
*/
|
|
47
|
+
type StockMode = "TRACKED" | "ALWAYS_AVAILABLE" | "MADE_TO_ORDER";
|
|
41
48
|
/**
|
|
42
49
|
* Merchant-configured checkout & cart rules the storefront MUST honour so the
|
|
43
50
|
* shop behaves exactly as it was configured in the admin. Mirrors the backend
|
|
@@ -92,6 +99,8 @@ interface CheckoutSettings {
|
|
|
92
99
|
* cart API 400s on anything above it.
|
|
93
100
|
*/
|
|
94
101
|
stockBehavior: StockBehavior;
|
|
102
|
+
/** Stock mode preset; non-TRACKED shops are always purchasable. */
|
|
103
|
+
stockMode: StockMode;
|
|
95
104
|
/**
|
|
96
105
|
* Merchant enabled the "only X left" nudge. When true, products whose stock
|
|
97
106
|
* is within `lowStockThreshold` carry `lowStockRemaining` — render the badge
|
|
@@ -1099,6 +1108,70 @@ interface DigitalDownload {
|
|
|
1099
1108
|
isMaxedOut: boolean;
|
|
1100
1109
|
createdAt: number;
|
|
1101
1110
|
}
|
|
1111
|
+
/** One enrolled course on the customer's "My courses" list. */
|
|
1112
|
+
interface CourseListItem {
|
|
1113
|
+
courseId: string;
|
|
1114
|
+
/** Localized course (product) name, best-effort. */
|
|
1115
|
+
name: string | null;
|
|
1116
|
+
/** Product slug for linking to the PDP. */
|
|
1117
|
+
slug: string;
|
|
1118
|
+
imageUrl: string | null;
|
|
1119
|
+
totalLessons: number;
|
|
1120
|
+
completedLessons: number;
|
|
1121
|
+
enrolledAt: number;
|
|
1122
|
+
/** Access expiry (epoch ms, null = never expires). */
|
|
1123
|
+
expiresAt: number | null;
|
|
1124
|
+
isExpired: boolean;
|
|
1125
|
+
}
|
|
1126
|
+
/** Downloadable attachment on a course lesson. */
|
|
1127
|
+
interface CourseAttachment {
|
|
1128
|
+
name: string;
|
|
1129
|
+
url: string;
|
|
1130
|
+
fileSize?: number;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* One lesson in the course player. Locked lessons (drip unlocking) expose
|
|
1134
|
+
* only the title and `unlockAt` — `videoUrl`/`content`/`attachments` are
|
|
1135
|
+
* null/empty until the lesson unlocks server-side.
|
|
1136
|
+
*/
|
|
1137
|
+
interface CourseLesson {
|
|
1138
|
+
id: string;
|
|
1139
|
+
title: string;
|
|
1140
|
+
isPreview: boolean;
|
|
1141
|
+
isUnlocked: boolean;
|
|
1142
|
+
/** When a locked lesson unlocks (epoch ms). Null once unlocked. */
|
|
1143
|
+
unlockAt: number | null;
|
|
1144
|
+
isCompleted: boolean;
|
|
1145
|
+
videoUrl: string | null;
|
|
1146
|
+
content: string | null;
|
|
1147
|
+
attachments: CourseAttachment[];
|
|
1148
|
+
}
|
|
1149
|
+
interface CourseModule {
|
|
1150
|
+
id: string;
|
|
1151
|
+
title: string;
|
|
1152
|
+
lessons: CourseLesson[];
|
|
1153
|
+
}
|
|
1154
|
+
/** Full course player payload for an enrolled customer. */
|
|
1155
|
+
interface CourseDetail {
|
|
1156
|
+
courseId: string;
|
|
1157
|
+
name: string | null;
|
|
1158
|
+
slug: string;
|
|
1159
|
+
imageUrl: string | null;
|
|
1160
|
+
/** Welcome text shown at the top of the member area (markdown). */
|
|
1161
|
+
welcomeText: string | null;
|
|
1162
|
+
enrolledAt: number;
|
|
1163
|
+
expiresAt: number | null;
|
|
1164
|
+
totalLessons: number;
|
|
1165
|
+
completedLessons: number;
|
|
1166
|
+
modules: CourseModule[];
|
|
1167
|
+
}
|
|
1168
|
+
/** Progress snapshot returned after completing a lesson. */
|
|
1169
|
+
interface CourseProgress {
|
|
1170
|
+
courseId: string;
|
|
1171
|
+
lessonId: string;
|
|
1172
|
+
totalLessons: number;
|
|
1173
|
+
completedLessons: number;
|
|
1174
|
+
}
|
|
1102
1175
|
/** Short-lived signed URL to fetch a purchased digital file. */
|
|
1103
1176
|
interface DownloadUrl {
|
|
1104
1177
|
/** Short-lived (15 min) signed URL. */
|
|
@@ -2209,6 +2282,22 @@ declare class CustomerModule {
|
|
|
2209
2282
|
* server-side. Requires an authenticated customer session.
|
|
2210
2283
|
*/
|
|
2211
2284
|
getDownloadUrl(downloadId: string): Promise<SdkResult<DownloadUrl>>;
|
|
2285
|
+
/**
|
|
2286
|
+
* Online courses (LMS): list the logged-in customer's enrolled courses
|
|
2287
|
+
* with progress. Enrollment is created automatically when an order with a
|
|
2288
|
+
* course product is paid. Requires an authenticated customer session.
|
|
2289
|
+
*/
|
|
2290
|
+
getCourses(): Promise<SdkResult<{
|
|
2291
|
+
items: CourseListItem[];
|
|
2292
|
+
}>>;
|
|
2293
|
+
/**
|
|
2294
|
+
* Course player payload: modules and lessons in order, with per-lesson
|
|
2295
|
+
* drip-unlock state. Locked lessons never contain content — the server
|
|
2296
|
+
* withholds `videoUrl`/`content`/`attachments` until `unlockAt`.
|
|
2297
|
+
*/
|
|
2298
|
+
getCourse(courseId: string): Promise<SdkResult<CourseDetail>>;
|
|
2299
|
+
/** Mark an unlocked lesson as completed (idempotent). */
|
|
2300
|
+
completeLesson(courseId: string, lessonId: string): Promise<SdkResult<CourseProgress>>;
|
|
2212
2301
|
}
|
|
2213
2302
|
declare class PagesModule {
|
|
2214
2303
|
private client;
|
|
@@ -2399,4 +2488,4 @@ declare class NewsletterModule {
|
|
|
2399
2488
|
unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
2400
2489
|
}
|
|
2401
2490
|
|
|
2402
|
-
export { type
|
|
2491
|
+
export { type ReturnRequest as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type CheckoutInput as D, type PageDetail as E, type FilterField as F, type Page as G, type ShopInfo as H, type ShopScripts as I, type ShopSeo as J, type Bundle as K, type LoyaltySummary as L, type Menu as M, type NewsletterSubscribeResult as N, type OrderListItem as O, type ProductsQuery as P, type ProductGroup as Q, type RegisterInput as R, type Subscription as S, type CrossSellItem as T, type ActivePromotion as U, type GiftCardBalance as V, type WishlistItem as W, type ProductReviewsResponse as X, type SubmitReviewInput as Y, type ReturnableOrder as Z, type ReturnStatus as _, BehioStorefront as a, type OrderStatusHistory as a$, type SubmitReturnInput as a0, type CookieConsent as a1, type CookieConsentInput as a2, type QuoteRequest as a3, type SubmitQuoteInput as a4, type BackInStockSubscription as a5, type AddToCartInput as a6, type AuthTokens as a7, BehioApiError as a8, type BundleItem as a9, type CourseLesson as aA, type CourseModule as aB, type DataGroupFieldType as aC, type DigitalDownload as aD, type DownloadUrl as aE, type Facet as aF, type FacetAvailability as aG, type FacetCategory as aH, type FacetLabel as aI, type FacetPriceRange as aJ, type FacetRange as aK, type FacetRatingBucket as aL, type FacetValue as aM, FulfillmentStatuses as aN, type GiftCardPurchaseInput as aO, type GiftCardPurchaseResult as aP, type GiftCardSummary as aQ, type LoyaltyBalance as aR, type LoyaltyNextTier as aS, type LoyaltyProgram as aT, type LoyaltyTier as aU, type LoyaltyTierPerks as aV, type LoyaltyTransaction as aW, type MenuItem as aX, type MenuItemRef as aY, type MenuItemType as aZ, type NewsletterOptInDefault as a_, type CartDiscount as aa, type CartItem as ab, type CheckoutAddress as ac, type FulfillmentStatus as ad, type LoginInput as ae, type MessageResponse as af, type OrderItem as ag, type OrderStatus as ah, type PaymentStatus as ai, type ProductPrice as aj, type ProductReview as ak, type ProductVariant as al, type SdkResult as am, type AddressType as an, AddressTypes as ao, type BadgeTone as ap, type BehioErrorCode as aq, type BehioEventHandler as ar, type BehioEventType as as, BehioNetworkError as at, type CartBundleLine as au, type CartBundleLineItem as av, type CartItemProduct as aw, type CartPromotion as ax, type CheckoutSettings as ay, type CourseAttachment as az, type PaginatedResponse as b, OrderStatuses as b0, type OrderTracking as b1, type PageAttachment as b2, PaymentStatuses as b3, type PickupPointHours as b4, type PriceDisplay as b5, type ProductAvailability as b6, type ProductCustomField as b7, type ProductCustomFieldGroup as b8, type ProductMedia as b9, type VariantAxisValue as bA, err as bB, ok as bC, toSdkError as bD, type ProductMediaVariant as ba, type ProductPromotionSummary as bb, ProductSort as bc, type ProductSortValue as bd, type ProductVolumePrice as be, type QuoteItem as bf, type RegisterResult as bg, type RequestInterceptor as bh, type RequestInterceptorConfig as bi, type ResponseInterceptor as bj, type ResponseInterceptorData as bk, type ReturnRequestItem as bl, type ReturnStatusItem as bm, type ReturnableOrderItem as bn, type SdkError as bo, type ShopScript as bp, type ShopScriptPlacement as bq, type ShopScriptType as br, type ShopSeoIdentity as bs, type StockBehavior as bt, type StockMode as bu, type SubscriptionFrequency as bv, type SubscriptionItem as bw, type SubscriptionStatus as bx, type TaxBreakdownLine as by, type VariantAxis as bz, type ProductListItem as c, type ProductDetail as d, type CategoryDetail as e, type ProductLabel as f, type FacetsResponse as g, type Cart as h, type CustomerProfile as i, type CustomerAddress as j, type AddressDetail as k, type CourseDetail as l, type CourseProgress as m, type CourseListItem as n, type SubscriptionAction as o, type PickupPointsInput as p, type PickupPoint as q, type ShippingMethodSummary as r, type ShippingQuoteInput as s, type ShippingQuote as t, type CheckoutPaymentMethod as u, type NewsletterSubscribeInput as v, type NewsletterUnsubscribeResult as w, type OrderDetail as x, type OrderAccessRequestResponse as y, type OrderAccessVerifyResponse as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as BehioStorefront,
|
|
2
|
-
export {
|
|
1
|
+
import { a as BehioStorefront, am as SdkResult, a1 as CookieConsent } from './client-Cb_eHKm9.mjs';
|
|
2
|
+
export { U as ActivePromotion, a6 as AddToCartInput, k as AddressDetail, A as AddressSuggestion, an as AddressType, ao as AddressTypes, a7 as AuthTokens, a5 as BackInStockSubscription, ap as BadgeTone, a8 as BehioApiError, aq as BehioErrorCode, ar as BehioEventHandler, as as BehioEventType, at as BehioNetworkError, B as BehioStorefrontConfig, K as Bundle, a9 as BundleItem, h as Cart, au as CartBundleLine, av as CartBundleLineItem, aa as CartDiscount, ab as CartItem, aw as CartItemProduct, ax as CartPromotion, C as Category, e as CategoryDetail, ac as CheckoutAddress, D as CheckoutInput, u as CheckoutPaymentMethod, ay as CheckoutSettings, a2 as CookieConsentInput, az as CourseAttachment, l as CourseDetail, aA as CourseLesson, n as CourseListItem, aB as CourseModule, m as CourseProgress, T as CrossSellItem, j as CustomerAddress, i as CustomerProfile, aC as DataGroupFieldType, aD as DigitalDownload, aE as DownloadUrl, aF as Facet, aG as FacetAvailability, aH as FacetCategory, aI as FacetLabel, aJ as FacetPriceRange, aK as FacetRange, aL as FacetRatingBucket, aM as FacetValue, g as FacetsResponse, F as FilterField, ad as FulfillmentStatus, aN as FulfillmentStatuses, V as GiftCardBalance, aO as GiftCardPurchaseInput, aP as GiftCardPurchaseResult, aQ as GiftCardSummary, ae as LoginInput, aR as LoyaltyBalance, aS as LoyaltyNextTier, aT as LoyaltyProgram, L as LoyaltySummary, aU as LoyaltyTier, aV as LoyaltyTierPerks, aW as LoyaltyTransaction, M as Menu, aX as MenuItem, aY as MenuItemRef, aZ as MenuItemType, af as MessageResponse, a_ as NewsletterOptInDefault, v as NewsletterSubscribeInput, N as NewsletterSubscribeResult, w as NewsletterUnsubscribeResult, y as OrderAccessRequestResponse, z as OrderAccessVerifyResponse, x as OrderDetail, ag as OrderItem, O as OrderListItem, ah as OrderStatus, a$ as OrderStatusHistory, b0 as OrderStatuses, b1 as OrderTracking, G as Page, b2 as PageAttachment, E as PageDetail, b as PaginatedResponse, ai as PaymentStatus, b3 as PaymentStatuses, q as PickupPoint, b4 as PickupPointHours, p as PickupPointsInput, b5 as PriceDisplay, b6 as ProductAvailability, b7 as ProductCustomField, b8 as ProductCustomFieldGroup, d as ProductDetail, Q as ProductGroup, f as ProductLabel, c as ProductListItem, b9 as ProductMedia, ba as ProductMediaVariant, aj as ProductPrice, bb as ProductPromotionSummary, ak as ProductReview, X as ProductReviewsResponse, bc as ProductSort, bd as ProductSortValue, al as ProductVariant, be as ProductVolumePrice, P as ProductsQuery, bf as QuoteItem, a3 as QuoteRequest, R as RegisterInput, bg as RegisterResult, bh as RequestInterceptor, bi as RequestInterceptorConfig, bj as ResponseInterceptor, bk as ResponseInterceptorData, $ as ReturnRequest, bl as ReturnRequestItem, _ as ReturnStatus, bm as ReturnStatusItem, Z as ReturnableOrder, bn as ReturnableOrderItem, bo as SdkError, r as ShippingMethodSummary, t as ShippingQuote, s as ShippingQuoteInput, H as ShopInfo, bp as ShopScript, bq as ShopScriptPlacement, br as ShopScriptType, I as ShopScripts, J as ShopSeo, bs as ShopSeoIdentity, bt as StockBehavior, bu as StockMode, a4 as SubmitQuoteInput, a0 as SubmitReturnInput, Y as SubmitReviewInput, S as Subscription, o as SubscriptionAction, bv as SubscriptionFrequency, bw as SubscriptionItem, bx as SubscriptionStatus, by as TaxBreakdownLine, bz as VariantAxis, bA as VariantAxisValue, W as WishlistItem, bB as err, bC as ok, bD as toSdkError } from './client-Cb_eHKm9.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as BehioStorefront,
|
|
2
|
-
export {
|
|
1
|
+
import { a as BehioStorefront, am as SdkResult, a1 as CookieConsent } from './client-Cb_eHKm9.js';
|
|
2
|
+
export { U as ActivePromotion, a6 as AddToCartInput, k as AddressDetail, A as AddressSuggestion, an as AddressType, ao as AddressTypes, a7 as AuthTokens, a5 as BackInStockSubscription, ap as BadgeTone, a8 as BehioApiError, aq as BehioErrorCode, ar as BehioEventHandler, as as BehioEventType, at as BehioNetworkError, B as BehioStorefrontConfig, K as Bundle, a9 as BundleItem, h as Cart, au as CartBundleLine, av as CartBundleLineItem, aa as CartDiscount, ab as CartItem, aw as CartItemProduct, ax as CartPromotion, C as Category, e as CategoryDetail, ac as CheckoutAddress, D as CheckoutInput, u as CheckoutPaymentMethod, ay as CheckoutSettings, a2 as CookieConsentInput, az as CourseAttachment, l as CourseDetail, aA as CourseLesson, n as CourseListItem, aB as CourseModule, m as CourseProgress, T as CrossSellItem, j as CustomerAddress, i as CustomerProfile, aC as DataGroupFieldType, aD as DigitalDownload, aE as DownloadUrl, aF as Facet, aG as FacetAvailability, aH as FacetCategory, aI as FacetLabel, aJ as FacetPriceRange, aK as FacetRange, aL as FacetRatingBucket, aM as FacetValue, g as FacetsResponse, F as FilterField, ad as FulfillmentStatus, aN as FulfillmentStatuses, V as GiftCardBalance, aO as GiftCardPurchaseInput, aP as GiftCardPurchaseResult, aQ as GiftCardSummary, ae as LoginInput, aR as LoyaltyBalance, aS as LoyaltyNextTier, aT as LoyaltyProgram, L as LoyaltySummary, aU as LoyaltyTier, aV as LoyaltyTierPerks, aW as LoyaltyTransaction, M as Menu, aX as MenuItem, aY as MenuItemRef, aZ as MenuItemType, af as MessageResponse, a_ as NewsletterOptInDefault, v as NewsletterSubscribeInput, N as NewsletterSubscribeResult, w as NewsletterUnsubscribeResult, y as OrderAccessRequestResponse, z as OrderAccessVerifyResponse, x as OrderDetail, ag as OrderItem, O as OrderListItem, ah as OrderStatus, a$ as OrderStatusHistory, b0 as OrderStatuses, b1 as OrderTracking, G as Page, b2 as PageAttachment, E as PageDetail, b as PaginatedResponse, ai as PaymentStatus, b3 as PaymentStatuses, q as PickupPoint, b4 as PickupPointHours, p as PickupPointsInput, b5 as PriceDisplay, b6 as ProductAvailability, b7 as ProductCustomField, b8 as ProductCustomFieldGroup, d as ProductDetail, Q as ProductGroup, f as ProductLabel, c as ProductListItem, b9 as ProductMedia, ba as ProductMediaVariant, aj as ProductPrice, bb as ProductPromotionSummary, ak as ProductReview, X as ProductReviewsResponse, bc as ProductSort, bd as ProductSortValue, al as ProductVariant, be as ProductVolumePrice, P as ProductsQuery, bf as QuoteItem, a3 as QuoteRequest, R as RegisterInput, bg as RegisterResult, bh as RequestInterceptor, bi as RequestInterceptorConfig, bj as ResponseInterceptor, bk as ResponseInterceptorData, $ as ReturnRequest, bl as ReturnRequestItem, _ as ReturnStatus, bm as ReturnStatusItem, Z as ReturnableOrder, bn as ReturnableOrderItem, bo as SdkError, r as ShippingMethodSummary, t as ShippingQuote, s as ShippingQuoteInput, H as ShopInfo, bp as ShopScript, bq as ShopScriptPlacement, br as ShopScriptType, I as ShopScripts, J as ShopSeo, bs as ShopSeoIdentity, bt as StockBehavior, bu as StockMode, a4 as SubmitQuoteInput, a0 as SubmitReturnInput, Y as SubmitReviewInput, S as Subscription, o as SubscriptionAction, bv as SubscriptionFrequency, bw as SubscriptionItem, bx as SubscriptionStatus, by as TaxBreakdownLine, bz as VariantAxis, bA as VariantAxisValue, W as WishlistItem, bB as err, bC as ok, bD as toSdkError } from './client-Cb_eHKm9.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var _chunkCZRSJULDjs = require('./chunk-CZRSJULD.js');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkFOUBL2EQjs = require('./chunk-FOUBL2EQ.js');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -37,4 +37,4 @@ var _chunkQKEW2EU5js = require('./chunk-QKEW2EU5.js');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
exports.AddressTypes =
|
|
40
|
+
exports.AddressTypes = _chunkFOUBL2EQjs.AddressTypes; exports.BehioApiError = _chunkFOUBL2EQjs.BehioApiError; exports.BehioNetworkError = _chunkFOUBL2EQjs.BehioNetworkError; exports.BehioStorefront = _chunkFOUBL2EQjs.BehioStorefront; exports.FulfillmentStatuses = _chunkFOUBL2EQjs.FulfillmentStatuses; exports.OrderStatuses = _chunkFOUBL2EQjs.OrderStatuses; exports.PaymentStatuses = _chunkFOUBL2EQjs.PaymentStatuses; exports.ProductSort = _chunkFOUBL2EQjs.ProductSort; exports.err = _chunkFOUBL2EQjs.err; exports.formatPrice = _chunkCZRSJULDjs.formatPrice; exports.generateVisitorId = _chunkCZRSJULDjs.generateVisitorId; exports.getStoredVisitorId = _chunkCZRSJULDjs.getStoredVisitorId; exports.grantAnalyticsConsent = _chunkCZRSJULDjs.grantAnalyticsConsent; exports.ok = _chunkFOUBL2EQjs.ok; exports.revokeAnalyticsConsent = _chunkCZRSJULDjs.revokeAnalyticsConsent; exports.toSdkError = _chunkFOUBL2EQjs.toSdkError; exports.trackEcommerceEvent = _chunkCZRSJULDjs.trackEcommerceEvent;
|
package/dist/index.mjs
CHANGED
package/dist/next.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-
|
|
1
|
+
import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-Cb_eHKm9.mjs';
|
|
2
2
|
|
|
3
3
|
interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
|
|
4
4
|
/** Override the cart session cookie name (default: "behio_cart_session"). */
|
package/dist/next.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-
|
|
1
|
+
import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-Cb_eHKm9.js';
|
|
2
2
|
|
|
3
3
|
interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
|
|
4
4
|
/** Override the cart session cookie name (default: "behio_cart_session"). */
|
package/dist/next.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFOUBL2EQjs = require('./chunk-FOUBL2EQ.js');
|
|
4
4
|
|
|
5
5
|
// src/next.ts
|
|
6
6
|
var _headers = require('next/headers');
|
|
@@ -18,7 +18,7 @@ async function getBehio(options = {}) {
|
|
|
18
18
|
const locale = _nullishCoalesce(options.locale, () => ( process.env.BEHIO_LOCALE));
|
|
19
19
|
const currency = _nullishCoalesce(options.currency, () => ( process.env.BEHIO_CURRENCY));
|
|
20
20
|
const cookieName = _nullishCoalesce(options.cartCookieName, () => ( CART_COOKIE_NAME));
|
|
21
|
-
const client = new (0,
|
|
21
|
+
const client = new (0, _chunkFOUBL2EQjs.BehioStorefront)({
|
|
22
22
|
apiKey,
|
|
23
23
|
...baseUrl ? { baseUrl } : {},
|
|
24
24
|
...locale ? { locale } : {},
|
package/dist/next.mjs
CHANGED
package/dist/react.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { QueryClient } from '@tanstack/react-query';
|
|
4
|
-
import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, M as Menu, f as ProductLabel, F as FilterField, g as FacetsResponse, h as Cart, i as CustomerProfile, R as RegisterInput, j as CustomerAddress, A as AddressSuggestion, k as AddressDetail, L as LoyaltySummary, S as Subscription,
|
|
5
|
-
export {
|
|
4
|
+
import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, M as Menu, f as ProductLabel, F as FilterField, g as FacetsResponse, h as Cart, i as CustomerProfile, R as RegisterInput, j as CustomerAddress, A as AddressSuggestion, k as AddressDetail, L as LoyaltySummary, l as CourseDetail, m as CourseProgress, n as CourseListItem, S as Subscription, o as SubscriptionAction, p as PickupPointsInput, q as PickupPoint, r as ShippingMethodSummary, s as ShippingQuoteInput, t as ShippingQuote, u as CheckoutPaymentMethod, N as NewsletterSubscribeResult, v as NewsletterSubscribeInput, w as NewsletterUnsubscribeResult, O as OrderListItem, x as OrderDetail, y as OrderAccessRequestResponse, z as OrderAccessVerifyResponse, D as CheckoutInput, E as PageDetail, G as Page, H as ShopInfo, I as ShopScripts, J as ShopSeo, K as Bundle, Q as ProductGroup, T as CrossSellItem, U as ActivePromotion, V as GiftCardBalance, W as WishlistItem, X as ProductReviewsResponse, Y as SubmitReviewInput, Z as ReturnableOrder, _ as ReturnStatus, $ as ReturnRequest, a0 as SubmitReturnInput, a1 as CookieConsent, a2 as CookieConsentInput, a3 as QuoteRequest, a4 as SubmitQuoteInput, a5 as BackInStockSubscription } from './client-Cb_eHKm9.mjs';
|
|
5
|
+
export { a6 as AddToCartInput, a7 as AuthTokens, a8 as BehioApiError, a9 as BundleItem, aa as CartDiscount, ab as CartItem, ac as CheckoutAddress, ad as FulfillmentStatus, ae as LoginInput, af as MessageResponse, ag as OrderItem, ah as OrderStatus, ai as PaymentStatus, aj as ProductPrice, ak as ProductReview, al as ProductVariant } from './client-Cb_eHKm9.mjs';
|
|
6
6
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
7
|
export { EcommerceEventName, EcommerceItem, EcommercePayload, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, revokeAnalyticsConsent, trackEcommerceEvent } from './index.mjs';
|
|
8
8
|
|
|
@@ -332,6 +332,40 @@ declare function useLoyalty(options?: UseLoyaltyOptions): {
|
|
|
332
332
|
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<NoInfer<LoyaltySummary>, Error>>;
|
|
333
333
|
};
|
|
334
334
|
|
|
335
|
+
interface UseCoursesOptions {
|
|
336
|
+
enabled?: boolean;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* "My courses" list for the logged-in customer: enrolled courses with
|
|
340
|
+
* progress. Enrollment happens automatically when an order containing a
|
|
341
|
+
* course product is paid. Only runs when a customer is authenticated.
|
|
342
|
+
*/
|
|
343
|
+
declare function useCourses(options?: UseCoursesOptions): {
|
|
344
|
+
courses: CourseListItem[];
|
|
345
|
+
isLoading: boolean;
|
|
346
|
+
error: Error | null;
|
|
347
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<NoInfer<{
|
|
348
|
+
items: CourseListItem[];
|
|
349
|
+
}>, Error>>;
|
|
350
|
+
};
|
|
351
|
+
interface UseCourseOptions {
|
|
352
|
+
enabled?: boolean;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Course player payload: modules and lessons in order with drip-unlock
|
|
356
|
+
* state, plus a `completeLesson` mutation that records progress and
|
|
357
|
+
* refreshes the course. Locked lessons carry no content — render the
|
|
358
|
+
* title + `unlockAt` and let the server decide when content appears.
|
|
359
|
+
*/
|
|
360
|
+
declare function useCourse(courseId: string | null, options?: UseCourseOptions): {
|
|
361
|
+
course: NoInfer<CourseDetail> | undefined;
|
|
362
|
+
isLoading: boolean;
|
|
363
|
+
error: Error | null;
|
|
364
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<NoInfer<CourseDetail>, Error>>;
|
|
365
|
+
completeLesson: (lessonId: string) => Promise<CourseProgress>;
|
|
366
|
+
isCompleting: boolean;
|
|
367
|
+
};
|
|
368
|
+
|
|
335
369
|
interface UseSubscriptionsOptions {
|
|
336
370
|
enabled?: boolean;
|
|
337
371
|
}
|
|
@@ -1293,4 +1327,4 @@ declare function useNotifyWhenAvailable(): _tanstack_react_query.UseMutationResu
|
|
|
1293
1327
|
*/
|
|
1294
1328
|
declare function useBehioClient(): BehioStorefront;
|
|
1295
1329
|
|
|
1296
|
-
export { ActivePromotion, type AnalyticsEventInput, BehioAnalyticsTracker, BehioProvider, type BehioProviderProps, Bundle, Cart, Category, CategoryDetail, CheckoutInput, CookieConsent, CookieConsentInput, CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, CustomerAddress, CustomerProfile, FilterField, GiftCardBalance, OrderDetail, OrderListItem, Page, PageDetail, PaginatedResponse, type PersonalOffer, ProductDetail, ProductLabel, ProductListItem, ProductReviewsResponse, ProductsQuery, QuoteRequest, RegisterInput, ReturnRequest, ShopInfo, ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, SubmitQuoteInput, SubmitReturnInput, SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSubscriptionsOptions, WishlistItem, cookieStorage, createMemoryStorage, detectStorage, localStorageAdapter, memoryStorage, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCheckout, useCookieConsent, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useWishlist };
|
|
1330
|
+
export { ActivePromotion, type AnalyticsEventInput, BehioAnalyticsTracker, BehioProvider, type BehioProviderProps, Bundle, Cart, Category, CategoryDetail, CheckoutInput, CookieConsent, CookieConsentInput, CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, CustomerAddress, CustomerProfile, FilterField, GiftCardBalance, OrderDetail, OrderListItem, Page, PageDetail, PaginatedResponse, type PersonalOffer, ProductDetail, ProductLabel, ProductListItem, ProductReviewsResponse, ProductsQuery, QuoteRequest, RegisterInput, ReturnRequest, ShopInfo, ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, SubmitQuoteInput, SubmitReturnInput, SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSubscriptionsOptions, WishlistItem, cookieStorage, createMemoryStorage, detectStorage, localStorageAdapter, memoryStorage, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCheckout, useCookieConsent, useCourse, useCourses, useCrossSell, useCurrency, useCustomer, useFacets, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLookupReturnableOrder, useLoyalty, useMenu, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubscriptions, useWishlist };
|