@behio/storefront-sdk 0.1.11 → 0.2.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-WMBSTKJR.mjs → chunk-EFFPOXWL.mjs} +77 -0
- package/dist/{chunk-33DUMF3N.js → chunk-R7H7E5BX.js} +77 -0
- package/dist/index.d.mts +152 -1
- package/dist/index.d.ts +152 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/react.d.mts +453 -3
- package/dist/react.d.ts +453 -3
- package/dist/react.js +180 -58
- package/dist/react.mjs +124 -2
- package/package.json +1 -1
|
@@ -102,6 +102,11 @@ var BehioStorefront = class {
|
|
|
102
102
|
this.orders = new OrdersModule(this);
|
|
103
103
|
this.customer = new CustomerModule(this);
|
|
104
104
|
this.pages = new PagesModule(this);
|
|
105
|
+
this.wishlist = new WishlistModule(this);
|
|
106
|
+
this.reviews = new ReviewsModule(this);
|
|
107
|
+
this.returns = new ReturnsModule(this);
|
|
108
|
+
this.consent = new ConsentModule(this);
|
|
109
|
+
this.quotes = new QuotesModule(this);
|
|
105
110
|
}
|
|
106
111
|
// --- Public methods ---
|
|
107
112
|
/** Get basic shop info */
|
|
@@ -676,6 +681,78 @@ var PagesModule = class {
|
|
|
676
681
|
return this.client.request("GET", `/pages/${slug}`, { query: { locale } });
|
|
677
682
|
}
|
|
678
683
|
};
|
|
684
|
+
var WishlistModule = class {
|
|
685
|
+
constructor(client) {
|
|
686
|
+
this.client = client;
|
|
687
|
+
}
|
|
688
|
+
async get() {
|
|
689
|
+
return this.client.request("GET", "/customer/wishlist");
|
|
690
|
+
}
|
|
691
|
+
async add(productId) {
|
|
692
|
+
return this.client.request("POST", "/customer/wishlist", { body: { productId } });
|
|
693
|
+
}
|
|
694
|
+
async remove(productId) {
|
|
695
|
+
return this.client.request("DELETE", `/customer/wishlist/${productId}`);
|
|
696
|
+
}
|
|
697
|
+
async isInWishlist(productId) {
|
|
698
|
+
return this.client.request("GET", `/customer/wishlist/${productId}/check`);
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
var ReviewsModule = class {
|
|
702
|
+
constructor(client) {
|
|
703
|
+
this.client = client;
|
|
704
|
+
}
|
|
705
|
+
async getProductReviews(productId, page = 1, limit = 20) {
|
|
706
|
+
return this.client.request("GET", `/catalog/products/${productId}/reviews`, {
|
|
707
|
+
query: { page: String(page), limit: String(limit) }
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
async submit(input) {
|
|
711
|
+
return this.client.request("POST", "/catalog/reviews", { body: input });
|
|
712
|
+
}
|
|
713
|
+
async voteHelpful(reviewId, helpful) {
|
|
714
|
+
return this.client.request("POST", `/catalog/reviews/${reviewId}/vote`, { body: { helpful } });
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
var ReturnsModule = class {
|
|
718
|
+
constructor(client) {
|
|
719
|
+
this.client = client;
|
|
720
|
+
}
|
|
721
|
+
async submit(input) {
|
|
722
|
+
return this.client.request("POST", "/returns", { body: input });
|
|
723
|
+
}
|
|
724
|
+
async getStatus(returnId, email) {
|
|
725
|
+
return this.client.request("GET", `/returns/${returnId}/status`, { query: { email } });
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
var ConsentModule = class {
|
|
729
|
+
constructor(client) {
|
|
730
|
+
this.client = client;
|
|
731
|
+
}
|
|
732
|
+
async record(input) {
|
|
733
|
+
return this.client.request("POST", "/consent", { body: input, auth: false });
|
|
734
|
+
}
|
|
735
|
+
async get(visitorId) {
|
|
736
|
+
return this.client.request("GET", `/consent/${visitorId}`, { auth: false });
|
|
737
|
+
}
|
|
738
|
+
async revoke(visitorId) {
|
|
739
|
+
return this.client.request("DELETE", `/consent/${visitorId}`, { auth: false });
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
var QuotesModule = class {
|
|
743
|
+
constructor(client) {
|
|
744
|
+
this.client = client;
|
|
745
|
+
}
|
|
746
|
+
async submit(input) {
|
|
747
|
+
return this.client.request("POST", "/catalog/quote-request", { body: input });
|
|
748
|
+
}
|
|
749
|
+
async accept(quoteId, email) {
|
|
750
|
+
return this.client.request("POST", `/quotes/${quoteId}/accept`, { body: { email } });
|
|
751
|
+
}
|
|
752
|
+
async getStatus(quoteId) {
|
|
753
|
+
return this.client.request("GET", `/quotes/${quoteId}`);
|
|
754
|
+
}
|
|
755
|
+
};
|
|
679
756
|
|
|
680
757
|
export {
|
|
681
758
|
ProductSort,
|
|
@@ -102,6 +102,11 @@ var BehioStorefront = class {
|
|
|
102
102
|
this.orders = new OrdersModule(this);
|
|
103
103
|
this.customer = new CustomerModule(this);
|
|
104
104
|
this.pages = new PagesModule(this);
|
|
105
|
+
this.wishlist = new WishlistModule(this);
|
|
106
|
+
this.reviews = new ReviewsModule(this);
|
|
107
|
+
this.returns = new ReturnsModule(this);
|
|
108
|
+
this.consent = new ConsentModule(this);
|
|
109
|
+
this.quotes = new QuotesModule(this);
|
|
105
110
|
}
|
|
106
111
|
// --- Public methods ---
|
|
107
112
|
/** Get basic shop info */
|
|
@@ -676,6 +681,78 @@ var PagesModule = class {
|
|
|
676
681
|
return this.client.request("GET", `/pages/${slug}`, { query: { locale } });
|
|
677
682
|
}
|
|
678
683
|
};
|
|
684
|
+
var WishlistModule = class {
|
|
685
|
+
constructor(client) {
|
|
686
|
+
this.client = client;
|
|
687
|
+
}
|
|
688
|
+
async get() {
|
|
689
|
+
return this.client.request("GET", "/customer/wishlist");
|
|
690
|
+
}
|
|
691
|
+
async add(productId) {
|
|
692
|
+
return this.client.request("POST", "/customer/wishlist", { body: { productId } });
|
|
693
|
+
}
|
|
694
|
+
async remove(productId) {
|
|
695
|
+
return this.client.request("DELETE", `/customer/wishlist/${productId}`);
|
|
696
|
+
}
|
|
697
|
+
async isInWishlist(productId) {
|
|
698
|
+
return this.client.request("GET", `/customer/wishlist/${productId}/check`);
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
var ReviewsModule = class {
|
|
702
|
+
constructor(client) {
|
|
703
|
+
this.client = client;
|
|
704
|
+
}
|
|
705
|
+
async getProductReviews(productId, page = 1, limit = 20) {
|
|
706
|
+
return this.client.request("GET", `/catalog/products/${productId}/reviews`, {
|
|
707
|
+
query: { page: String(page), limit: String(limit) }
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
async submit(input) {
|
|
711
|
+
return this.client.request("POST", "/catalog/reviews", { body: input });
|
|
712
|
+
}
|
|
713
|
+
async voteHelpful(reviewId, helpful) {
|
|
714
|
+
return this.client.request("POST", `/catalog/reviews/${reviewId}/vote`, { body: { helpful } });
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
var ReturnsModule = class {
|
|
718
|
+
constructor(client) {
|
|
719
|
+
this.client = client;
|
|
720
|
+
}
|
|
721
|
+
async submit(input) {
|
|
722
|
+
return this.client.request("POST", "/returns", { body: input });
|
|
723
|
+
}
|
|
724
|
+
async getStatus(returnId, email) {
|
|
725
|
+
return this.client.request("GET", `/returns/${returnId}/status`, { query: { email } });
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
var ConsentModule = class {
|
|
729
|
+
constructor(client) {
|
|
730
|
+
this.client = client;
|
|
731
|
+
}
|
|
732
|
+
async record(input) {
|
|
733
|
+
return this.client.request("POST", "/consent", { body: input, auth: false });
|
|
734
|
+
}
|
|
735
|
+
async get(visitorId) {
|
|
736
|
+
return this.client.request("GET", `/consent/${visitorId}`, { auth: false });
|
|
737
|
+
}
|
|
738
|
+
async revoke(visitorId) {
|
|
739
|
+
return this.client.request("DELETE", `/consent/${visitorId}`, { auth: false });
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
var QuotesModule = class {
|
|
743
|
+
constructor(client) {
|
|
744
|
+
this.client = client;
|
|
745
|
+
}
|
|
746
|
+
async submit(input) {
|
|
747
|
+
return this.client.request("POST", "/catalog/quote-request", { body: input });
|
|
748
|
+
}
|
|
749
|
+
async accept(quoteId, email) {
|
|
750
|
+
return this.client.request("POST", `/quotes/${quoteId}/accept`, { body: { email } });
|
|
751
|
+
}
|
|
752
|
+
async getStatus(quoteId) {
|
|
753
|
+
return this.client.request("GET", `/quotes/${quoteId}`);
|
|
754
|
+
}
|
|
755
|
+
};
|
|
679
756
|
|
|
680
757
|
|
|
681
758
|
|
package/dist/index.d.mts
CHANGED
|
@@ -441,6 +441,103 @@ interface GiftCardBalance {
|
|
|
441
441
|
balance: number;
|
|
442
442
|
currency: string;
|
|
443
443
|
}
|
|
444
|
+
interface WishlistItem {
|
|
445
|
+
id: string;
|
|
446
|
+
productId: string;
|
|
447
|
+
productName: string;
|
|
448
|
+
productSku: string;
|
|
449
|
+
productSlug: string | null;
|
|
450
|
+
imageUrl: string | null;
|
|
451
|
+
price: number | null;
|
|
452
|
+
stockCached: number;
|
|
453
|
+
createdAt: number;
|
|
454
|
+
}
|
|
455
|
+
interface ProductReview {
|
|
456
|
+
id: string;
|
|
457
|
+
authorName: string;
|
|
458
|
+
rating: number;
|
|
459
|
+
title: string | null;
|
|
460
|
+
content: string | null;
|
|
461
|
+
imageUrls: string[];
|
|
462
|
+
isVerifiedPurchase: boolean;
|
|
463
|
+
helpfulCount: number;
|
|
464
|
+
unhelpfulCount: number;
|
|
465
|
+
replyContent: string | null;
|
|
466
|
+
createdAt: number;
|
|
467
|
+
}
|
|
468
|
+
interface ProductReviewsResponse {
|
|
469
|
+
items: ProductReview[];
|
|
470
|
+
averageRating: number;
|
|
471
|
+
reviewCount: number;
|
|
472
|
+
page: number;
|
|
473
|
+
totalPages: number;
|
|
474
|
+
}
|
|
475
|
+
interface SubmitReviewInput {
|
|
476
|
+
productId: string;
|
|
477
|
+
rating: number;
|
|
478
|
+
title?: string;
|
|
479
|
+
content?: string;
|
|
480
|
+
authorName: string;
|
|
481
|
+
authorEmail?: string;
|
|
482
|
+
imageUrls?: string[];
|
|
483
|
+
}
|
|
484
|
+
interface ReturnRequest {
|
|
485
|
+
id: string;
|
|
486
|
+
orderId: string;
|
|
487
|
+
status: string;
|
|
488
|
+
reason: string;
|
|
489
|
+
customerNote: string | null;
|
|
490
|
+
refundAmount: number | null;
|
|
491
|
+
refundMethod: string | null;
|
|
492
|
+
createdAt: number;
|
|
493
|
+
}
|
|
494
|
+
interface SubmitReturnInput {
|
|
495
|
+
orderId: string;
|
|
496
|
+
reason: string;
|
|
497
|
+
customerNote?: string;
|
|
498
|
+
items: {
|
|
499
|
+
orderItemId: string;
|
|
500
|
+
productName: string;
|
|
501
|
+
quantity: number;
|
|
502
|
+
reason?: string;
|
|
503
|
+
imageUrls?: string[];
|
|
504
|
+
}[];
|
|
505
|
+
}
|
|
506
|
+
interface CookieConsent {
|
|
507
|
+
necessary: boolean;
|
|
508
|
+
analytics: boolean;
|
|
509
|
+
marketing: boolean;
|
|
510
|
+
preferences: boolean;
|
|
511
|
+
consentedAt: number;
|
|
512
|
+
}
|
|
513
|
+
interface CookieConsentInput {
|
|
514
|
+
visitorId: string;
|
|
515
|
+
analytics: boolean;
|
|
516
|
+
marketing: boolean;
|
|
517
|
+
preferences: boolean;
|
|
518
|
+
}
|
|
519
|
+
interface QuoteRequest {
|
|
520
|
+
id: string;
|
|
521
|
+
status: string;
|
|
522
|
+
contactName: string;
|
|
523
|
+
contactEmail: string;
|
|
524
|
+
companyName: string | null;
|
|
525
|
+
quotedTotal: number | null;
|
|
526
|
+
createdAt: number;
|
|
527
|
+
}
|
|
528
|
+
interface SubmitQuoteInput {
|
|
529
|
+
contactName: string;
|
|
530
|
+
contactEmail: string;
|
|
531
|
+
contactPhone?: string;
|
|
532
|
+
companyName?: string;
|
|
533
|
+
companyIco?: string;
|
|
534
|
+
message?: string;
|
|
535
|
+
items: {
|
|
536
|
+
productId: string;
|
|
537
|
+
quantity: number;
|
|
538
|
+
requestedPrice?: number;
|
|
539
|
+
}[];
|
|
540
|
+
}
|
|
444
541
|
|
|
445
542
|
declare class BehioStorefront {
|
|
446
543
|
private baseUrl;
|
|
@@ -469,6 +566,11 @@ declare class BehioStorefront {
|
|
|
469
566
|
readonly orders: OrdersModule;
|
|
470
567
|
readonly customer: CustomerModule;
|
|
471
568
|
readonly pages: PagesModule;
|
|
569
|
+
readonly wishlist: WishlistModule;
|
|
570
|
+
readonly reviews: ReviewsModule;
|
|
571
|
+
readonly returns: ReturnsModule;
|
|
572
|
+
readonly consent: ConsentModule;
|
|
573
|
+
readonly quotes: QuotesModule;
|
|
472
574
|
/** Get basic shop info */
|
|
473
575
|
getShopInfo(): Promise<ShopInfo>;
|
|
474
576
|
/** Get SEO metadata for the shop homepage in the given locale (defaults to shop default). */
|
|
@@ -672,5 +774,54 @@ declare class PagesModule {
|
|
|
672
774
|
/** Get page by slug */
|
|
673
775
|
get(slug: string, locale?: string): Promise<PageDetail>;
|
|
674
776
|
}
|
|
777
|
+
declare class WishlistModule {
|
|
778
|
+
private client;
|
|
779
|
+
constructor(client: BehioStorefront);
|
|
780
|
+
get(): Promise<{
|
|
781
|
+
items: WishlistItem[];
|
|
782
|
+
}>;
|
|
783
|
+
add(productId: string): Promise<{
|
|
784
|
+
success: boolean;
|
|
785
|
+
}>;
|
|
786
|
+
remove(productId: string): Promise<{
|
|
787
|
+
success: boolean;
|
|
788
|
+
}>;
|
|
789
|
+
isInWishlist(productId: string): Promise<{
|
|
790
|
+
inWishlist: boolean;
|
|
791
|
+
}>;
|
|
792
|
+
}
|
|
793
|
+
declare class ReviewsModule {
|
|
794
|
+
private client;
|
|
795
|
+
constructor(client: BehioStorefront);
|
|
796
|
+
getProductReviews(productId: string, page?: number, limit?: number): Promise<ProductReviewsResponse>;
|
|
797
|
+
submit(input: SubmitReviewInput): Promise<{
|
|
798
|
+
id: string;
|
|
799
|
+
}>;
|
|
800
|
+
voteHelpful(reviewId: string, helpful: boolean): Promise<{
|
|
801
|
+
success: boolean;
|
|
802
|
+
}>;
|
|
803
|
+
}
|
|
804
|
+
declare class ReturnsModule {
|
|
805
|
+
private client;
|
|
806
|
+
constructor(client: BehioStorefront);
|
|
807
|
+
submit(input: SubmitReturnInput): Promise<ReturnRequest>;
|
|
808
|
+
getStatus(returnId: string, email: string): Promise<ReturnRequest>;
|
|
809
|
+
}
|
|
810
|
+
declare class ConsentModule {
|
|
811
|
+
private client;
|
|
812
|
+
constructor(client: BehioStorefront);
|
|
813
|
+
record(input: CookieConsentInput): Promise<CookieConsent>;
|
|
814
|
+
get(visitorId: string): Promise<CookieConsent | null>;
|
|
815
|
+
revoke(visitorId: string): Promise<{
|
|
816
|
+
success: boolean;
|
|
817
|
+
}>;
|
|
818
|
+
}
|
|
819
|
+
declare class QuotesModule {
|
|
820
|
+
private client;
|
|
821
|
+
constructor(client: BehioStorefront);
|
|
822
|
+
submit(input: SubmitQuoteInput): Promise<QuoteRequest>;
|
|
823
|
+
accept(quoteId: string, email: string): Promise<QuoteRequest>;
|
|
824
|
+
getStatus(quoteId: string): Promise<QuoteRequest>;
|
|
825
|
+
}
|
|
675
826
|
|
|
676
|
-
export { type ActivePromotion, type AddToCartInput, type AddressType, AddressTypes, type AuthTokens, BehioApiError, type BehioErrorCode, type BehioEventHandler, type BehioEventType, BehioNetworkError, BehioStorefront, type BehioStorefrontConfig, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type CartItemProduct, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CrossSellItem, type CustomerAddress, type CustomerProfile, type DataGroupFieldType, type FilterField, type FulfillmentStatus, FulfillmentStatuses, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type OrderStatusHistory, OrderStatuses, type Page, type PageDetail, type PaginatedResponse, type PaymentStatus, PaymentStatuses, type ProductDetail, type ProductLabel, type ProductListItem, type ProductPrice, ProductSort, type ProductSortValue, type ProductVariant, type ProductVolumePrice, type ProductsQuery, type RegisterInput, type RequestInterceptor, type RequestInterceptorConfig, type ResponseInterceptor, type ResponseInterceptorData, type ShopInfo, type ShopSeo };
|
|
827
|
+
export { type ActivePromotion, type AddToCartInput, type AddressType, AddressTypes, type AuthTokens, BehioApiError, type BehioErrorCode, type BehioEventHandler, type BehioEventType, BehioNetworkError, BehioStorefront, type BehioStorefrontConfig, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type CartItemProduct, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CookieConsent, type CookieConsentInput, type CrossSellItem, type CustomerAddress, type CustomerProfile, type DataGroupFieldType, type FilterField, type FulfillmentStatus, FulfillmentStatuses, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type OrderStatusHistory, OrderStatuses, type Page, type PageDetail, type PaginatedResponse, type PaymentStatus, PaymentStatuses, type ProductDetail, type ProductLabel, type ProductListItem, type ProductPrice, type ProductReview, type ProductReviewsResponse, ProductSort, type ProductSortValue, type ProductVariant, type ProductVolumePrice, type ProductsQuery, type QuoteRequest, type RegisterInput, type RequestInterceptor, type RequestInterceptorConfig, type ResponseInterceptor, type ResponseInterceptorData, type ReturnRequest, type ShopInfo, type ShopSeo, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type WishlistItem };
|
package/dist/index.d.ts
CHANGED
|
@@ -441,6 +441,103 @@ interface GiftCardBalance {
|
|
|
441
441
|
balance: number;
|
|
442
442
|
currency: string;
|
|
443
443
|
}
|
|
444
|
+
interface WishlistItem {
|
|
445
|
+
id: string;
|
|
446
|
+
productId: string;
|
|
447
|
+
productName: string;
|
|
448
|
+
productSku: string;
|
|
449
|
+
productSlug: string | null;
|
|
450
|
+
imageUrl: string | null;
|
|
451
|
+
price: number | null;
|
|
452
|
+
stockCached: number;
|
|
453
|
+
createdAt: number;
|
|
454
|
+
}
|
|
455
|
+
interface ProductReview {
|
|
456
|
+
id: string;
|
|
457
|
+
authorName: string;
|
|
458
|
+
rating: number;
|
|
459
|
+
title: string | null;
|
|
460
|
+
content: string | null;
|
|
461
|
+
imageUrls: string[];
|
|
462
|
+
isVerifiedPurchase: boolean;
|
|
463
|
+
helpfulCount: number;
|
|
464
|
+
unhelpfulCount: number;
|
|
465
|
+
replyContent: string | null;
|
|
466
|
+
createdAt: number;
|
|
467
|
+
}
|
|
468
|
+
interface ProductReviewsResponse {
|
|
469
|
+
items: ProductReview[];
|
|
470
|
+
averageRating: number;
|
|
471
|
+
reviewCount: number;
|
|
472
|
+
page: number;
|
|
473
|
+
totalPages: number;
|
|
474
|
+
}
|
|
475
|
+
interface SubmitReviewInput {
|
|
476
|
+
productId: string;
|
|
477
|
+
rating: number;
|
|
478
|
+
title?: string;
|
|
479
|
+
content?: string;
|
|
480
|
+
authorName: string;
|
|
481
|
+
authorEmail?: string;
|
|
482
|
+
imageUrls?: string[];
|
|
483
|
+
}
|
|
484
|
+
interface ReturnRequest {
|
|
485
|
+
id: string;
|
|
486
|
+
orderId: string;
|
|
487
|
+
status: string;
|
|
488
|
+
reason: string;
|
|
489
|
+
customerNote: string | null;
|
|
490
|
+
refundAmount: number | null;
|
|
491
|
+
refundMethod: string | null;
|
|
492
|
+
createdAt: number;
|
|
493
|
+
}
|
|
494
|
+
interface SubmitReturnInput {
|
|
495
|
+
orderId: string;
|
|
496
|
+
reason: string;
|
|
497
|
+
customerNote?: string;
|
|
498
|
+
items: {
|
|
499
|
+
orderItemId: string;
|
|
500
|
+
productName: string;
|
|
501
|
+
quantity: number;
|
|
502
|
+
reason?: string;
|
|
503
|
+
imageUrls?: string[];
|
|
504
|
+
}[];
|
|
505
|
+
}
|
|
506
|
+
interface CookieConsent {
|
|
507
|
+
necessary: boolean;
|
|
508
|
+
analytics: boolean;
|
|
509
|
+
marketing: boolean;
|
|
510
|
+
preferences: boolean;
|
|
511
|
+
consentedAt: number;
|
|
512
|
+
}
|
|
513
|
+
interface CookieConsentInput {
|
|
514
|
+
visitorId: string;
|
|
515
|
+
analytics: boolean;
|
|
516
|
+
marketing: boolean;
|
|
517
|
+
preferences: boolean;
|
|
518
|
+
}
|
|
519
|
+
interface QuoteRequest {
|
|
520
|
+
id: string;
|
|
521
|
+
status: string;
|
|
522
|
+
contactName: string;
|
|
523
|
+
contactEmail: string;
|
|
524
|
+
companyName: string | null;
|
|
525
|
+
quotedTotal: number | null;
|
|
526
|
+
createdAt: number;
|
|
527
|
+
}
|
|
528
|
+
interface SubmitQuoteInput {
|
|
529
|
+
contactName: string;
|
|
530
|
+
contactEmail: string;
|
|
531
|
+
contactPhone?: string;
|
|
532
|
+
companyName?: string;
|
|
533
|
+
companyIco?: string;
|
|
534
|
+
message?: string;
|
|
535
|
+
items: {
|
|
536
|
+
productId: string;
|
|
537
|
+
quantity: number;
|
|
538
|
+
requestedPrice?: number;
|
|
539
|
+
}[];
|
|
540
|
+
}
|
|
444
541
|
|
|
445
542
|
declare class BehioStorefront {
|
|
446
543
|
private baseUrl;
|
|
@@ -469,6 +566,11 @@ declare class BehioStorefront {
|
|
|
469
566
|
readonly orders: OrdersModule;
|
|
470
567
|
readonly customer: CustomerModule;
|
|
471
568
|
readonly pages: PagesModule;
|
|
569
|
+
readonly wishlist: WishlistModule;
|
|
570
|
+
readonly reviews: ReviewsModule;
|
|
571
|
+
readonly returns: ReturnsModule;
|
|
572
|
+
readonly consent: ConsentModule;
|
|
573
|
+
readonly quotes: QuotesModule;
|
|
472
574
|
/** Get basic shop info */
|
|
473
575
|
getShopInfo(): Promise<ShopInfo>;
|
|
474
576
|
/** Get SEO metadata for the shop homepage in the given locale (defaults to shop default). */
|
|
@@ -672,5 +774,54 @@ declare class PagesModule {
|
|
|
672
774
|
/** Get page by slug */
|
|
673
775
|
get(slug: string, locale?: string): Promise<PageDetail>;
|
|
674
776
|
}
|
|
777
|
+
declare class WishlistModule {
|
|
778
|
+
private client;
|
|
779
|
+
constructor(client: BehioStorefront);
|
|
780
|
+
get(): Promise<{
|
|
781
|
+
items: WishlistItem[];
|
|
782
|
+
}>;
|
|
783
|
+
add(productId: string): Promise<{
|
|
784
|
+
success: boolean;
|
|
785
|
+
}>;
|
|
786
|
+
remove(productId: string): Promise<{
|
|
787
|
+
success: boolean;
|
|
788
|
+
}>;
|
|
789
|
+
isInWishlist(productId: string): Promise<{
|
|
790
|
+
inWishlist: boolean;
|
|
791
|
+
}>;
|
|
792
|
+
}
|
|
793
|
+
declare class ReviewsModule {
|
|
794
|
+
private client;
|
|
795
|
+
constructor(client: BehioStorefront);
|
|
796
|
+
getProductReviews(productId: string, page?: number, limit?: number): Promise<ProductReviewsResponse>;
|
|
797
|
+
submit(input: SubmitReviewInput): Promise<{
|
|
798
|
+
id: string;
|
|
799
|
+
}>;
|
|
800
|
+
voteHelpful(reviewId: string, helpful: boolean): Promise<{
|
|
801
|
+
success: boolean;
|
|
802
|
+
}>;
|
|
803
|
+
}
|
|
804
|
+
declare class ReturnsModule {
|
|
805
|
+
private client;
|
|
806
|
+
constructor(client: BehioStorefront);
|
|
807
|
+
submit(input: SubmitReturnInput): Promise<ReturnRequest>;
|
|
808
|
+
getStatus(returnId: string, email: string): Promise<ReturnRequest>;
|
|
809
|
+
}
|
|
810
|
+
declare class ConsentModule {
|
|
811
|
+
private client;
|
|
812
|
+
constructor(client: BehioStorefront);
|
|
813
|
+
record(input: CookieConsentInput): Promise<CookieConsent>;
|
|
814
|
+
get(visitorId: string): Promise<CookieConsent | null>;
|
|
815
|
+
revoke(visitorId: string): Promise<{
|
|
816
|
+
success: boolean;
|
|
817
|
+
}>;
|
|
818
|
+
}
|
|
819
|
+
declare class QuotesModule {
|
|
820
|
+
private client;
|
|
821
|
+
constructor(client: BehioStorefront);
|
|
822
|
+
submit(input: SubmitQuoteInput): Promise<QuoteRequest>;
|
|
823
|
+
accept(quoteId: string, email: string): Promise<QuoteRequest>;
|
|
824
|
+
getStatus(quoteId: string): Promise<QuoteRequest>;
|
|
825
|
+
}
|
|
675
826
|
|
|
676
|
-
export { type ActivePromotion, type AddToCartInput, type AddressType, AddressTypes, type AuthTokens, BehioApiError, type BehioErrorCode, type BehioEventHandler, type BehioEventType, BehioNetworkError, BehioStorefront, type BehioStorefrontConfig, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type CartItemProduct, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CrossSellItem, type CustomerAddress, type CustomerProfile, type DataGroupFieldType, type FilterField, type FulfillmentStatus, FulfillmentStatuses, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type OrderStatusHistory, OrderStatuses, type Page, type PageDetail, type PaginatedResponse, type PaymentStatus, PaymentStatuses, type ProductDetail, type ProductLabel, type ProductListItem, type ProductPrice, ProductSort, type ProductSortValue, type ProductVariant, type ProductVolumePrice, type ProductsQuery, type RegisterInput, type RequestInterceptor, type RequestInterceptorConfig, type ResponseInterceptor, type ResponseInterceptorData, type ShopInfo, type ShopSeo };
|
|
827
|
+
export { type ActivePromotion, type AddToCartInput, type AddressType, AddressTypes, type AuthTokens, BehioApiError, type BehioErrorCode, type BehioEventHandler, type BehioEventType, BehioNetworkError, BehioStorefront, type BehioStorefrontConfig, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type CartItemProduct, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CookieConsent, type CookieConsentInput, type CrossSellItem, type CustomerAddress, type CustomerProfile, type DataGroupFieldType, type FilterField, type FulfillmentStatus, FulfillmentStatuses, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type OrderStatusHistory, OrderStatuses, type Page, type PageDetail, type PaginatedResponse, type PaymentStatus, PaymentStatuses, type ProductDetail, type ProductLabel, type ProductListItem, type ProductPrice, type ProductReview, type ProductReviewsResponse, ProductSort, type ProductSortValue, type ProductVariant, type ProductVolumePrice, type ProductsQuery, type QuoteRequest, type RegisterInput, type RequestInterceptor, type RequestInterceptorConfig, type ResponseInterceptor, type ResponseInterceptorData, type ReturnRequest, type ShopInfo, type ShopSeo, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type WishlistItem };
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkR7H7E5BXjs = require('./chunk-R7H7E5BX.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -17,4 +17,4 @@ var _chunk33DUMF3Njs = require('./chunk-33DUMF3N.js');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.AddressTypes =
|
|
20
|
+
exports.AddressTypes = _chunkR7H7E5BXjs.AddressTypes; exports.BehioApiError = _chunkR7H7E5BXjs.BehioApiError; exports.BehioNetworkError = _chunkR7H7E5BXjs.BehioNetworkError; exports.BehioStorefront = _chunkR7H7E5BXjs.BehioStorefront; exports.FulfillmentStatuses = _chunkR7H7E5BXjs.FulfillmentStatuses; exports.OrderStatuses = _chunkR7H7E5BXjs.OrderStatuses; exports.PaymentStatuses = _chunkR7H7E5BXjs.PaymentStatuses; exports.ProductSort = _chunkR7H7E5BXjs.ProductSort;
|