@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/dist/mockup.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { ah as Product, an as ProductVariant } from './types-CSMuPSQA.cjs';
1
+ import { ao as Product, au as ProductVariant } from './types-DdLzlxw4.cjs';
2
2
  import './geo.cjs';
3
3
 
4
4
  /**
package/dist/mockup.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ah as Product, an as ProductVariant } from './types-iGGZ9EiC.js';
1
+ import { ao as Product, au as ProductVariant } from './types-COSwo4ND.js';
2
2
  import './geo.js';
3
3
 
4
4
  /**
@@ -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 { Page as $, Address as A, CustomerSession as B, Cart as C, CustomerSessionInput as D, DeclineCode as E, DeliveryInput as F, DeliveryMethod as G, DeliveryOptions as H, Facet as I, FacetValue as J, Image as K, InsufficientStockDetails as L, InsufficientStockLine as M, InvoiceRequest as N, InvoiceResult as O, Location as P, LocationContacts as Q, LocationKind as R, LocationListParams as S, LocationPickup as T, Menu as U, MenuItem as V, Money as W, MoneyRange as X, NearestLocation as Y, Order as Z, OrderLine as _, AddressInput as a, PageInfo as a0, PaymentAction as a1, PaymentAttemptResult as a2, PaymentAttemptStatus as a3, PaymentClient as a4, PaymentClientCsp as a5, PaymentConfig as a6, PaymentFlow as a7, PaymentMethod as a8, PaymentMethods as a9, ShippingRate as aA, Shop as aB, ShopBranch as aC, ShopContact as aD, ShopPolicies as aE, StockLevel as aF, StorefrontErrorBody as aG, StorefrontErrorCode as aH, Theme as aI, UnavailableRateProvider as aJ, PaymentNextStep as aa, PaymentOption as ab, PaymentOptionKey as ac, PaymentPoint as ad, PaymentSubmitInput as ae, PaymentVoucher as af, PickupOption as ag, Product as ah, ProductAttributeValue as ai, ProductCategory as aj, ProductConnection as ak, ProductOption as al, ProductSort as am, ProductVariant as an, PromotionAnnouncement as ao, PromotionReward as ap, PromotionTier as aq, PromotionsList as ar, RecommendationPlacement as as, RestockSubscriptionInput as at, RestockSubscriptionResult as au, ReturnRequest as av, ReturnRequestInput as aw, SEO as ax, Section as ay, SelectedOption 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, CustomerIdentifier as z };
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 { Page as $, Address as A, CustomerSession as B, Cart as C, CustomerSessionInput as D, DeclineCode as E, DeliveryInput as F, DeliveryMethod as G, DeliveryOptions as H, Facet as I, FacetValue as J, Image as K, InsufficientStockDetails as L, InsufficientStockLine as M, InvoiceRequest as N, InvoiceResult as O, Location as P, LocationContacts as Q, LocationKind as R, LocationListParams as S, LocationPickup as T, Menu as U, MenuItem as V, Money as W, MoneyRange as X, NearestLocation as Y, Order as Z, OrderLine as _, AddressInput as a, PageInfo as a0, PaymentAction as a1, PaymentAttemptResult as a2, PaymentAttemptStatus as a3, PaymentClient as a4, PaymentClientCsp as a5, PaymentConfig as a6, PaymentFlow as a7, PaymentMethod as a8, PaymentMethods as a9, ShippingRate as aA, Shop as aB, ShopBranch as aC, ShopContact as aD, ShopPolicies as aE, StockLevel as aF, StorefrontErrorBody as aG, StorefrontErrorCode as aH, Theme as aI, UnavailableRateProvider as aJ, PaymentNextStep as aa, PaymentOption as ab, PaymentOptionKey as ac, PaymentPoint as ad, PaymentSubmitInput as ae, PaymentVoucher as af, PickupOption as ag, Product as ah, ProductAttributeValue as ai, ProductCategory as aj, ProductConnection as ak, ProductOption as al, ProductSort as am, ProductVariant as an, PromotionAnnouncement as ao, PromotionReward as ap, PromotionTier as aq, PromotionsList as ar, RecommendationPlacement as as, RestockSubscriptionInput as at, RestockSubscriptionResult as au, ReturnRequest as av, ReturnRequestInput as aw, SEO as ax, Section as ay, SelectedOption 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, CustomerIdentifier as z };
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.8.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": {