@asteby/storefront 0.8.0 → 0.10.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/README.md +33 -1
- package/dist/index.cjs +48 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -3
- package/dist/index.d.ts +49 -3
- package/dist/index.js +45 -1
- package/dist/index.js.map +1 -1
- package/dist/mock.cjs +113 -0
- package/dist/mock.cjs.map +1 -1
- package/dist/mock.d.cts +19 -1
- package/dist/mock.d.ts +19 -1
- package/dist/mock.js +113 -0
- package/dist/mock.js.map +1 -1
- package/dist/mockup.d.cts +1 -1
- package/dist/mockup.d.ts +1 -1
- package/dist/{types-iGGZ9EiC.d.ts → types-COSwo4ND.d.ts} +41 -1
- package/dist/{types-CSMuPSQA.d.cts → types-DdLzlxw4.d.cts} +41 -1
- package/package.json +1 -1
package/dist/mockup.d.cts
CHANGED
package/dist/mockup.d.ts
CHANGED
|
@@ -489,6 +489,46 @@ type CustomerSession = {
|
|
|
489
489
|
expires_at: string;
|
|
490
490
|
customer: Customer;
|
|
491
491
|
};
|
|
492
|
+
/** What the store's buyer accounts support (`GET /storefront/customer/capabilities`). Cache briefly, not forever. */
|
|
493
|
+
type CustomerCapabilities = {
|
|
494
|
+
/** Email + password registration and login are enabled. */
|
|
495
|
+
password: boolean;
|
|
496
|
+
/** Registration needs an emailed code (`customer.verifyRegistration`) before the account exists. */
|
|
497
|
+
email_verification: boolean;
|
|
498
|
+
/** Channels `customer.requestOtp` can deliver the code through. */
|
|
499
|
+
otp_channels: ('email' | 'whatsapp')[];
|
|
500
|
+
};
|
|
501
|
+
type CustomerRegisterInput = {
|
|
502
|
+
email: string;
|
|
503
|
+
password: string;
|
|
504
|
+
first_name?: string;
|
|
505
|
+
last_name?: string;
|
|
506
|
+
};
|
|
507
|
+
/** `verification_required`: a code was emailed, finish with `customer.verifyRegistration`. `created`: the account is ready and signed in. */
|
|
508
|
+
type CustomerRegisterResult = {
|
|
509
|
+
status: 'verification_required';
|
|
510
|
+
} | {
|
|
511
|
+
status: 'created';
|
|
512
|
+
session: CustomerSession;
|
|
513
|
+
};
|
|
514
|
+
type CustomerVerifyRegistrationInput = {
|
|
515
|
+
email: string;
|
|
516
|
+
code: string;
|
|
517
|
+
};
|
|
518
|
+
type CustomerPasswordLoginInput = {
|
|
519
|
+
email: string;
|
|
520
|
+
password: string;
|
|
521
|
+
};
|
|
522
|
+
/** `current_password` is required by the server when the account already has a password. */
|
|
523
|
+
type CustomerSetPasswordInput = {
|
|
524
|
+
password: string;
|
|
525
|
+
current_password?: string;
|
|
526
|
+
};
|
|
527
|
+
type CustomerResetPasswordInput = {
|
|
528
|
+
email: string;
|
|
529
|
+
code: string;
|
|
530
|
+
password: string;
|
|
531
|
+
};
|
|
492
532
|
type OrderLine = {
|
|
493
533
|
title: string;
|
|
494
534
|
variant_title: string | null;
|
|
@@ -832,4 +872,4 @@ type PromotionsList = {
|
|
|
832
872
|
announcements: PromotionAnnouncement[];
|
|
833
873
|
};
|
|
834
874
|
|
|
835
|
-
export type {
|
|
875
|
+
export type { Menu as $, Address as A, CustomerIdentifier as B, Cart as C, CustomerPasswordLoginInput as D, CustomerRegisterInput as E, CustomerRegisterResult as F, CustomerResetPasswordInput as G, CustomerSession as H, CustomerSessionInput as I, CustomerSetPasswordInput as J, CustomerVerifyRegistrationInput as K, DeclineCode as L, DeliveryInput as M, DeliveryMethod as N, DeliveryOptions as O, Facet as P, FacetValue as Q, Image as R, InsufficientStockDetails as S, InsufficientStockLine as T, InvoiceRequest as U, InvoiceResult as V, Location as W, LocationContacts as X, LocationKind as Y, LocationListParams as Z, LocationPickup as _, AddressInput as a, MenuItem as a0, Money as a1, MoneyRange as a2, NearestLocation as a3, Order as a4, OrderLine as a5, Page as a6, PageInfo as a7, PaymentAction as a8, PaymentAttemptResult as a9, RestockSubscriptionInput as aA, RestockSubscriptionResult as aB, ReturnRequest as aC, ReturnRequestInput as aD, SEO as aE, Section as aF, SelectedOption as aG, ShippingRate as aH, Shop as aI, ShopBranch as aJ, ShopContact as aK, ShopPolicies as aL, StockLevel as aM, StorefrontErrorBody as aN, StorefrontErrorCode as aO, Theme as aP, UnavailableRateProvider as aQ, PaymentAttemptStatus as aa, PaymentClient as ab, PaymentClientCsp as ac, PaymentConfig as ad, PaymentFlow as ae, PaymentMethod as af, PaymentMethods as ag, PaymentNextStep as ah, PaymentOption as ai, PaymentOptionKey as aj, PaymentPoint as ak, PaymentSubmitInput as al, PaymentVoucher as am, PickupOption as an, Product as ao, ProductAttributeValue as ap, ProductCategory as aq, ProductConnection as ar, ProductOption as as, ProductSort as at, ProductVariant as au, PromotionAnnouncement as av, PromotionReward as aw, PromotionTier as ax, PromotionsList as ay, RecommendationPlacement as az, Article as b, Availability as c, AvailabilityStatus as d, CartBuyer as e, CartBuyerInput as f, CartCost as g, CartDelivery as h, CartDiscountCode as i, CartDiscountLine as j, CartLine as k, CartLineInput as l, CartLineMerchandise as m, CartLineProblem as n, CartLineUpdateInput as o, CartPromotions as p, CartRecommendation as q, CartRecommendations as r, CheckoutInfo as s, CheckoutInput as t, CheckoutPayment as u, CheckoutResult as v, Collection as w, Connection as x, Customer as y, CustomerCapabilities as z };
|
|
@@ -489,6 +489,46 @@ type CustomerSession = {
|
|
|
489
489
|
expires_at: string;
|
|
490
490
|
customer: Customer;
|
|
491
491
|
};
|
|
492
|
+
/** What the store's buyer accounts support (`GET /storefront/customer/capabilities`). Cache briefly, not forever. */
|
|
493
|
+
type CustomerCapabilities = {
|
|
494
|
+
/** Email + password registration and login are enabled. */
|
|
495
|
+
password: boolean;
|
|
496
|
+
/** Registration needs an emailed code (`customer.verifyRegistration`) before the account exists. */
|
|
497
|
+
email_verification: boolean;
|
|
498
|
+
/** Channels `customer.requestOtp` can deliver the code through. */
|
|
499
|
+
otp_channels: ('email' | 'whatsapp')[];
|
|
500
|
+
};
|
|
501
|
+
type CustomerRegisterInput = {
|
|
502
|
+
email: string;
|
|
503
|
+
password: string;
|
|
504
|
+
first_name?: string;
|
|
505
|
+
last_name?: string;
|
|
506
|
+
};
|
|
507
|
+
/** `verification_required`: a code was emailed, finish with `customer.verifyRegistration`. `created`: the account is ready and signed in. */
|
|
508
|
+
type CustomerRegisterResult = {
|
|
509
|
+
status: 'verification_required';
|
|
510
|
+
} | {
|
|
511
|
+
status: 'created';
|
|
512
|
+
session: CustomerSession;
|
|
513
|
+
};
|
|
514
|
+
type CustomerVerifyRegistrationInput = {
|
|
515
|
+
email: string;
|
|
516
|
+
code: string;
|
|
517
|
+
};
|
|
518
|
+
type CustomerPasswordLoginInput = {
|
|
519
|
+
email: string;
|
|
520
|
+
password: string;
|
|
521
|
+
};
|
|
522
|
+
/** `current_password` is required by the server when the account already has a password. */
|
|
523
|
+
type CustomerSetPasswordInput = {
|
|
524
|
+
password: string;
|
|
525
|
+
current_password?: string;
|
|
526
|
+
};
|
|
527
|
+
type CustomerResetPasswordInput = {
|
|
528
|
+
email: string;
|
|
529
|
+
code: string;
|
|
530
|
+
password: string;
|
|
531
|
+
};
|
|
492
532
|
type OrderLine = {
|
|
493
533
|
title: string;
|
|
494
534
|
variant_title: string | null;
|
|
@@ -832,4 +872,4 @@ type PromotionsList = {
|
|
|
832
872
|
announcements: PromotionAnnouncement[];
|
|
833
873
|
};
|
|
834
874
|
|
|
835
|
-
export type {
|
|
875
|
+
export type { Menu as $, Address as A, CustomerIdentifier as B, Cart as C, CustomerPasswordLoginInput as D, CustomerRegisterInput as E, CustomerRegisterResult as F, CustomerResetPasswordInput as G, CustomerSession as H, CustomerSessionInput as I, CustomerSetPasswordInput as J, CustomerVerifyRegistrationInput as K, DeclineCode as L, DeliveryInput as M, DeliveryMethod as N, DeliveryOptions as O, Facet as P, FacetValue as Q, Image as R, InsufficientStockDetails as S, InsufficientStockLine as T, InvoiceRequest as U, InvoiceResult as V, Location as W, LocationContacts as X, LocationKind as Y, LocationListParams as Z, LocationPickup as _, AddressInput as a, MenuItem as a0, Money as a1, MoneyRange as a2, NearestLocation as a3, Order as a4, OrderLine as a5, Page as a6, PageInfo as a7, PaymentAction as a8, PaymentAttemptResult as a9, RestockSubscriptionInput as aA, RestockSubscriptionResult as aB, ReturnRequest as aC, ReturnRequestInput as aD, SEO as aE, Section as aF, SelectedOption as aG, ShippingRate as aH, Shop as aI, ShopBranch as aJ, ShopContact as aK, ShopPolicies as aL, StockLevel as aM, StorefrontErrorBody as aN, StorefrontErrorCode as aO, Theme as aP, UnavailableRateProvider as aQ, PaymentAttemptStatus as aa, PaymentClient as ab, PaymentClientCsp as ac, PaymentConfig as ad, PaymentFlow as ae, PaymentMethod as af, PaymentMethods as ag, PaymentNextStep as ah, PaymentOption as ai, PaymentOptionKey as aj, PaymentPoint as ak, PaymentSubmitInput as al, PaymentVoucher as am, PickupOption as an, Product as ao, ProductAttributeValue as ap, ProductCategory as aq, ProductConnection as ar, ProductOption as as, ProductSort as at, ProductVariant as au, PromotionAnnouncement as av, PromotionReward as aw, PromotionTier as ax, PromotionsList as ay, RecommendationPlacement as az, Article as b, Availability as c, AvailabilityStatus as d, CartBuyer as e, CartBuyerInput as f, CartCost as g, CartDelivery as h, CartDiscountCode as i, CartDiscountLine as j, CartLine as k, CartLineInput as l, CartLineMerchandise as m, CartLineProblem as n, CartLineUpdateInput as o, CartPromotions as p, CartRecommendation as q, CartRecommendations as r, CheckoutInfo as s, CheckoutInput as t, CheckoutPayment as u, CheckoutResult as v, Collection as w, Connection as x, Customer as y, CustomerCapabilities as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asteby/storefront",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Typed client for the Storefront API v1 (catalog, cart, checkout, customer, content) using only global fetch — Node 20+, edge runtimes and browsers — plus an in-memory mock of the whole contract.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|