@asteby/storefront 0.9.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/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { GeoPoint } from './geo.cjs';
2
2
  export { OpenStatus, OpeningHours } from './geo.cjs';
3
- import { am as ProductSort, aB as Shop, ak as ProductConnection, ah as Product, x as Connection, w as Collection, S as LocationListParams, P as Location, Y as NearestLocation, aF as StockLevel, at as RestockSubscriptionInput, au as RestockSubscriptionResult, l as CartLineInput, C as Cart, o as CartLineUpdateInput, f as CartBuyerInput, a as AddressInput, H as DeliveryOptions, a9 as PaymentMethods, F as DeliveryInput, as as RecommendationPlacement, r as CartRecommendations, t as CheckoutInput, v as CheckoutResult, ar as PromotionsList, a6 as PaymentConfig, ae as PaymentSubmitInput, a2 as PaymentAttemptResult, z as CustomerIdentifier, D as CustomerSessionInput, B as CustomerSession, y as Customer, Z as Order, aw as ReturnRequestInput, av as ReturnRequest, N as InvoiceRequest, O as InvoiceResult, A as Address, aI as Theme, $ as Page, U as Menu, b as Article, aH as StorefrontErrorCode, M as InsufficientStockLine, W as Money, d as AvailabilityStatus, n as CartLineProblem, c as Availability, an as ProductVariant, E as DeclineCode, af as PaymentVoucher, aa as PaymentNextStep, p as CartPromotions, ap as PromotionReward, G as DeliveryMethod, aJ as UnavailableRateProvider } from './types-CSMuPSQA.cjs';
4
- export { e as CartBuyer, g as CartCost, h as CartDelivery, i as CartDiscountCode, j as CartDiscountLine, k as CartLine, m as CartLineMerchandise, q as CartRecommendation, s as CheckoutInfo, u as CheckoutPayment, I as Facet, J as FacetValue, K as Image, L as InsufficientStockDetails, Q as LocationContacts, R as LocationKind, T as LocationPickup, V as MenuItem, X as MoneyRange, _ as OrderLine, a0 as PageInfo, a1 as PaymentAction, a3 as PaymentAttemptStatus, a4 as PaymentClient, a5 as PaymentClientCsp, a7 as PaymentFlow, a8 as PaymentMethod, ab as PaymentOption, ac as PaymentOptionKey, ad as PaymentPoint, ag as PickupOption, ai as ProductAttributeValue, aj as ProductCategory, al as ProductOption, ao as PromotionAnnouncement, aq as PromotionTier, ax as SEO, ay as Section, az as SelectedOption, aA as ShippingRate, aC as ShopBranch, aD as ShopContact, aE as ShopPolicies, aG as StorefrontErrorBody } from './types-CSMuPSQA.cjs';
3
+ import { at as ProductSort, aI as Shop, ar as ProductConnection, ao as Product, x as Connection, w as Collection, Z as LocationListParams, W as Location, a3 as NearestLocation, aM as StockLevel, aA as RestockSubscriptionInput, aB as RestockSubscriptionResult, l as CartLineInput, C as Cart, o as CartLineUpdateInput, f as CartBuyerInput, a as AddressInput, O as DeliveryOptions, ag as PaymentMethods, M as DeliveryInput, az as RecommendationPlacement, r as CartRecommendations, t as CheckoutInput, v as CheckoutResult, ay as PromotionsList, ad as PaymentConfig, al as PaymentSubmitInput, a9 as PaymentAttemptResult, B as CustomerIdentifier, I as CustomerSessionInput, H as CustomerSession, z as CustomerCapabilities, E as CustomerRegisterInput, F as CustomerRegisterResult, K as CustomerVerifyRegistrationInput, D as CustomerPasswordLoginInput, J as CustomerSetPasswordInput, G as CustomerResetPasswordInput, y as Customer, a4 as Order, aD as ReturnRequestInput, aC as ReturnRequest, U as InvoiceRequest, V as InvoiceResult, A as Address, aP as Theme, a6 as Page, $ as Menu, b as Article, aO as StorefrontErrorCode, T as InsufficientStockLine, a1 as Money, d as AvailabilityStatus, n as CartLineProblem, c as Availability, au as ProductVariant, L as DeclineCode, am as PaymentVoucher, ah as PaymentNextStep, p as CartPromotions, aw as PromotionReward, N as DeliveryMethod, aQ as UnavailableRateProvider } from './types-DdLzlxw4.cjs';
4
+ export { e as CartBuyer, g as CartCost, h as CartDelivery, i as CartDiscountCode, j as CartDiscountLine, k as CartLine, m as CartLineMerchandise, q as CartRecommendation, s as CheckoutInfo, u as CheckoutPayment, P as Facet, Q as FacetValue, R as Image, S as InsufficientStockDetails, X as LocationContacts, Y as LocationKind, _ as LocationPickup, a0 as MenuItem, a2 as MoneyRange, a5 as OrderLine, a7 as PageInfo, a8 as PaymentAction, aa as PaymentAttemptStatus, ab as PaymentClient, ac as PaymentClientCsp, ae as PaymentFlow, af as PaymentMethod, ai as PaymentOption, aj as PaymentOptionKey, ak as PaymentPoint, an as PickupOption, ap as ProductAttributeValue, aq as ProductCategory, as as ProductOption, av as PromotionAnnouncement, ax as PromotionTier, aE as SEO, aF as Section, aG as SelectedOption, aH as ShippingRate, aJ as ShopBranch, aK as ShopContact, aL as ShopPolicies, aN as StorefrontErrorBody } from './types-DdLzlxw4.cjs';
5
5
 
6
6
  type QueryValue = string | number | boolean | null | undefined;
7
7
  type QueryParams = Record<string, QueryValue | QueryValue[]>;
@@ -270,6 +270,21 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
270
270
  requestOtp: (identifier: CustomerIdentifier, options?: WriteOptions) => Promise<void>;
271
271
  /** Exchanges the code for a buyer session (`token` goes in `customerToken`). */
272
272
  createSession: (input: CustomerSessionInput, options?: WriteOptions) => Promise<CustomerSession>;
273
+ /** What the store supports (password login, email verification, OTP channels). Drives which forms to show. */
274
+ capabilities: (options?: RequestOptions) => Promise<CustomerCapabilities>;
275
+ /**
276
+ * Creates an account with email + password. `verification_required` (202): a code was emailed, finish with
277
+ * `verifyRegistration`. `created` (201): the account exists and `session` is ready. `409` when the email is taken.
278
+ */
279
+ register: (input: CustomerRegisterInput, options?: WriteOptions) => Promise<CustomerRegisterResult>;
280
+ /** Confirms the emailed registration code and returns the new buyer session. */
281
+ verifyRegistration: (input: CustomerVerifyRegistrationInput, options?: WriteOptions) => Promise<CustomerSession>;
282
+ /** Email + password login. `401` for wrong credentials. */
283
+ loginWithPassword: (input: CustomerPasswordLoginInput, options?: WriteOptions) => Promise<CustomerSession>;
284
+ /** Sets or changes the password of the signed-in buyer (`options.customerToken`, or a `withCustomerToken` client). */
285
+ setPassword: (input: CustomerSetPasswordInput, options?: WriteOptions) => Promise<void>;
286
+ /** Resets a forgotten password with the code from `requestOtp({ email })`. */
287
+ resetPassword: (input: CustomerResetPasswordInput, options?: WriteOptions) => Promise<void>;
273
288
  get: (options?: RequestOptions) => Promise<Customer>;
274
289
  orders: (params?: PaginationParams, options?: RequestOptions) => Promise<Connection<Order>>;
275
290
  /** `null` when the order does not exist or belongs to someone else. */
@@ -677,4 +692,4 @@ type DeliveryNotices = {
677
692
  /** Splits `delivery.unavailable` into the `missing_weight` notice and the generic one. */
678
693
  declare function deliveryNotices(delivery: Pick<DeliveryOptions, 'unavailable' | 'partial'> | null | undefined): DeliveryNotices;
679
694
 
680
- export { Address, AddressInput, Article, type ArticleListParams, Availability, type AvailabilityLocale, type AvailabilityMessageKey, type AvailabilityMessages, AvailabilityStatus, type AvailabilityTone, type AvailabilityView, type AvailabilityViewOptions, CLIENT_IP_HEADER, COUNTRY_HEADERS, Cart, CartBuyerInput, CartLineInput, CartLineProblem, type CartLineProblemView, CartLineUpdateInput, CartPromotions, CartRecommendations, CheckoutInput, CheckoutResult, Collection, type CollectionListParams, Connection, Customer, CustomerIdentifier, CustomerSession, CustomerSessionInput, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiscountBarState, type DiscountBarView, type FetchLike, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceRequest, InvoiceResult, Location, LocationListParams, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, Order, Page, type PaginationParams, PaymentAttemptResult, PaymentConfig, type PaymentErrorKind, type PaymentErrorView, type PaymentLocale, type PaymentMessageKey, type PaymentMessages, PaymentMethods, PaymentNextStep, type PaymentOutcome, type PaymentOutcomeKind, PaymentSubmitInput, PaymentVoucher, type PreviewOptions, Product, ProductConnection, type ProductListParams, ProductSort, ProductVariant, type PromoProgressView, type PromotionLocale, type PromotionMessageKey, type PromotionMessages, PromotionReward, PromotionsList, type QueryParams, type QueryValue, RecommendationPlacement, type RequestOptions, type ResolveAvailabilityOptions, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, StorefrontError, StorefrontErrorCode, type StorefrontErrorInit, type StorefrontRequestContext, type StorefrontResponseContext, Theme, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, hreflangLinks, isStorefrontError, isTokenPublishable, negotiateLocale, normalizeClientIp, normalizeNote, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, resolveAvailability, rewardLabel, safeHttpsUrl, schemaAvailability, storefrontDomainHeader, suggestMarket, toMoney, visitorCountry };
695
+ export { Address, AddressInput, Article, type ArticleListParams, Availability, type AvailabilityLocale, type AvailabilityMessageKey, type AvailabilityMessages, AvailabilityStatus, type AvailabilityTone, type AvailabilityView, type AvailabilityViewOptions, CLIENT_IP_HEADER, COUNTRY_HEADERS, Cart, CartBuyerInput, CartLineInput, CartLineProblem, type CartLineProblemView, CartLineUpdateInput, CartPromotions, CartRecommendations, CheckoutInput, CheckoutResult, Collection, type CollectionListParams, Connection, Customer, CustomerCapabilities, CustomerIdentifier, CustomerPasswordLoginInput, CustomerRegisterInput, CustomerRegisterResult, CustomerResetPasswordInput, CustomerSession, CustomerSessionInput, CustomerSetPasswordInput, CustomerVerifyRegistrationInput, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiscountBarState, type DiscountBarView, type FetchLike, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceRequest, InvoiceResult, Location, LocationListParams, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, Order, Page, type PaginationParams, PaymentAttemptResult, PaymentConfig, type PaymentErrorKind, type PaymentErrorView, type PaymentLocale, type PaymentMessageKey, type PaymentMessages, PaymentMethods, PaymentNextStep, type PaymentOutcome, type PaymentOutcomeKind, PaymentSubmitInput, PaymentVoucher, type PreviewOptions, Product, ProductConnection, type ProductListParams, ProductSort, ProductVariant, type PromoProgressView, type PromotionLocale, type PromotionMessageKey, type PromotionMessages, PromotionReward, PromotionsList, type QueryParams, type QueryValue, RecommendationPlacement, type RequestOptions, type ResolveAvailabilityOptions, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, StorefrontError, StorefrontErrorCode, type StorefrontErrorInit, type StorefrontRequestContext, type StorefrontResponseContext, Theme, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, hreflangLinks, isStorefrontError, isTokenPublishable, negotiateLocale, normalizeClientIp, normalizeNote, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, resolveAvailability, rewardLabel, safeHttpsUrl, schemaAvailability, storefrontDomainHeader, suggestMarket, toMoney, visitorCountry };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { GeoPoint } from './geo.js';
2
2
  export { OpenStatus, OpeningHours } from './geo.js';
3
- import { am as ProductSort, aB as Shop, ak as ProductConnection, ah as Product, x as Connection, w as Collection, S as LocationListParams, P as Location, Y as NearestLocation, aF as StockLevel, at as RestockSubscriptionInput, au as RestockSubscriptionResult, l as CartLineInput, C as Cart, o as CartLineUpdateInput, f as CartBuyerInput, a as AddressInput, H as DeliveryOptions, a9 as PaymentMethods, F as DeliveryInput, as as RecommendationPlacement, r as CartRecommendations, t as CheckoutInput, v as CheckoutResult, ar as PromotionsList, a6 as PaymentConfig, ae as PaymentSubmitInput, a2 as PaymentAttemptResult, z as CustomerIdentifier, D as CustomerSessionInput, B as CustomerSession, y as Customer, Z as Order, aw as ReturnRequestInput, av as ReturnRequest, N as InvoiceRequest, O as InvoiceResult, A as Address, aI as Theme, $ as Page, U as Menu, b as Article, aH as StorefrontErrorCode, M as InsufficientStockLine, W as Money, d as AvailabilityStatus, n as CartLineProblem, c as Availability, an as ProductVariant, E as DeclineCode, af as PaymentVoucher, aa as PaymentNextStep, p as CartPromotions, ap as PromotionReward, G as DeliveryMethod, aJ as UnavailableRateProvider } from './types-iGGZ9EiC.js';
4
- export { e as CartBuyer, g as CartCost, h as CartDelivery, i as CartDiscountCode, j as CartDiscountLine, k as CartLine, m as CartLineMerchandise, q as CartRecommendation, s as CheckoutInfo, u as CheckoutPayment, I as Facet, J as FacetValue, K as Image, L as InsufficientStockDetails, Q as LocationContacts, R as LocationKind, T as LocationPickup, V as MenuItem, X as MoneyRange, _ as OrderLine, a0 as PageInfo, a1 as PaymentAction, a3 as PaymentAttemptStatus, a4 as PaymentClient, a5 as PaymentClientCsp, a7 as PaymentFlow, a8 as PaymentMethod, ab as PaymentOption, ac as PaymentOptionKey, ad as PaymentPoint, ag as PickupOption, ai as ProductAttributeValue, aj as ProductCategory, al as ProductOption, ao as PromotionAnnouncement, aq as PromotionTier, ax as SEO, ay as Section, az as SelectedOption, aA as ShippingRate, aC as ShopBranch, aD as ShopContact, aE as ShopPolicies, aG as StorefrontErrorBody } from './types-iGGZ9EiC.js';
3
+ import { at as ProductSort, aI as Shop, ar as ProductConnection, ao as Product, x as Connection, w as Collection, Z as LocationListParams, W as Location, a3 as NearestLocation, aM as StockLevel, aA as RestockSubscriptionInput, aB as RestockSubscriptionResult, l as CartLineInput, C as Cart, o as CartLineUpdateInput, f as CartBuyerInput, a as AddressInput, O as DeliveryOptions, ag as PaymentMethods, M as DeliveryInput, az as RecommendationPlacement, r as CartRecommendations, t as CheckoutInput, v as CheckoutResult, ay as PromotionsList, ad as PaymentConfig, al as PaymentSubmitInput, a9 as PaymentAttemptResult, B as CustomerIdentifier, I as CustomerSessionInput, H as CustomerSession, z as CustomerCapabilities, E as CustomerRegisterInput, F as CustomerRegisterResult, K as CustomerVerifyRegistrationInput, D as CustomerPasswordLoginInput, J as CustomerSetPasswordInput, G as CustomerResetPasswordInput, y as Customer, a4 as Order, aD as ReturnRequestInput, aC as ReturnRequest, U as InvoiceRequest, V as InvoiceResult, A as Address, aP as Theme, a6 as Page, $ as Menu, b as Article, aO as StorefrontErrorCode, T as InsufficientStockLine, a1 as Money, d as AvailabilityStatus, n as CartLineProblem, c as Availability, au as ProductVariant, L as DeclineCode, am as PaymentVoucher, ah as PaymentNextStep, p as CartPromotions, aw as PromotionReward, N as DeliveryMethod, aQ as UnavailableRateProvider } from './types-COSwo4ND.js';
4
+ export { e as CartBuyer, g as CartCost, h as CartDelivery, i as CartDiscountCode, j as CartDiscountLine, k as CartLine, m as CartLineMerchandise, q as CartRecommendation, s as CheckoutInfo, u as CheckoutPayment, P as Facet, Q as FacetValue, R as Image, S as InsufficientStockDetails, X as LocationContacts, Y as LocationKind, _ as LocationPickup, a0 as MenuItem, a2 as MoneyRange, a5 as OrderLine, a7 as PageInfo, a8 as PaymentAction, aa as PaymentAttemptStatus, ab as PaymentClient, ac as PaymentClientCsp, ae as PaymentFlow, af as PaymentMethod, ai as PaymentOption, aj as PaymentOptionKey, ak as PaymentPoint, an as PickupOption, ap as ProductAttributeValue, aq as ProductCategory, as as ProductOption, av as PromotionAnnouncement, ax as PromotionTier, aE as SEO, aF as Section, aG as SelectedOption, aH as ShippingRate, aJ as ShopBranch, aK as ShopContact, aL as ShopPolicies, aN as StorefrontErrorBody } from './types-COSwo4ND.js';
5
5
 
6
6
  type QueryValue = string | number | boolean | null | undefined;
7
7
  type QueryParams = Record<string, QueryValue | QueryValue[]>;
@@ -270,6 +270,21 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
270
270
  requestOtp: (identifier: CustomerIdentifier, options?: WriteOptions) => Promise<void>;
271
271
  /** Exchanges the code for a buyer session (`token` goes in `customerToken`). */
272
272
  createSession: (input: CustomerSessionInput, options?: WriteOptions) => Promise<CustomerSession>;
273
+ /** What the store supports (password login, email verification, OTP channels). Drives which forms to show. */
274
+ capabilities: (options?: RequestOptions) => Promise<CustomerCapabilities>;
275
+ /**
276
+ * Creates an account with email + password. `verification_required` (202): a code was emailed, finish with
277
+ * `verifyRegistration`. `created` (201): the account exists and `session` is ready. `409` when the email is taken.
278
+ */
279
+ register: (input: CustomerRegisterInput, options?: WriteOptions) => Promise<CustomerRegisterResult>;
280
+ /** Confirms the emailed registration code and returns the new buyer session. */
281
+ verifyRegistration: (input: CustomerVerifyRegistrationInput, options?: WriteOptions) => Promise<CustomerSession>;
282
+ /** Email + password login. `401` for wrong credentials. */
283
+ loginWithPassword: (input: CustomerPasswordLoginInput, options?: WriteOptions) => Promise<CustomerSession>;
284
+ /** Sets or changes the password of the signed-in buyer (`options.customerToken`, or a `withCustomerToken` client). */
285
+ setPassword: (input: CustomerSetPasswordInput, options?: WriteOptions) => Promise<void>;
286
+ /** Resets a forgotten password with the code from `requestOtp({ email })`. */
287
+ resetPassword: (input: CustomerResetPasswordInput, options?: WriteOptions) => Promise<void>;
273
288
  get: (options?: RequestOptions) => Promise<Customer>;
274
289
  orders: (params?: PaginationParams, options?: RequestOptions) => Promise<Connection<Order>>;
275
290
  /** `null` when the order does not exist or belongs to someone else. */
@@ -677,4 +692,4 @@ type DeliveryNotices = {
677
692
  /** Splits `delivery.unavailable` into the `missing_weight` notice and the generic one. */
678
693
  declare function deliveryNotices(delivery: Pick<DeliveryOptions, 'unavailable' | 'partial'> | null | undefined): DeliveryNotices;
679
694
 
680
- export { Address, AddressInput, Article, type ArticleListParams, Availability, type AvailabilityLocale, type AvailabilityMessageKey, type AvailabilityMessages, AvailabilityStatus, type AvailabilityTone, type AvailabilityView, type AvailabilityViewOptions, CLIENT_IP_HEADER, COUNTRY_HEADERS, Cart, CartBuyerInput, CartLineInput, CartLineProblem, type CartLineProblemView, CartLineUpdateInput, CartPromotions, CartRecommendations, CheckoutInput, CheckoutResult, Collection, type CollectionListParams, Connection, Customer, CustomerIdentifier, CustomerSession, CustomerSessionInput, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiscountBarState, type DiscountBarView, type FetchLike, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceRequest, InvoiceResult, Location, LocationListParams, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, Order, Page, type PaginationParams, PaymentAttemptResult, PaymentConfig, type PaymentErrorKind, type PaymentErrorView, type PaymentLocale, type PaymentMessageKey, type PaymentMessages, PaymentMethods, PaymentNextStep, type PaymentOutcome, type PaymentOutcomeKind, PaymentSubmitInput, PaymentVoucher, type PreviewOptions, Product, ProductConnection, type ProductListParams, ProductSort, ProductVariant, type PromoProgressView, type PromotionLocale, type PromotionMessageKey, type PromotionMessages, PromotionReward, PromotionsList, type QueryParams, type QueryValue, RecommendationPlacement, type RequestOptions, type ResolveAvailabilityOptions, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, StorefrontError, StorefrontErrorCode, type StorefrontErrorInit, type StorefrontRequestContext, type StorefrontResponseContext, Theme, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, hreflangLinks, isStorefrontError, isTokenPublishable, negotiateLocale, normalizeClientIp, normalizeNote, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, resolveAvailability, rewardLabel, safeHttpsUrl, schemaAvailability, storefrontDomainHeader, suggestMarket, toMoney, visitorCountry };
695
+ export { Address, AddressInput, Article, type ArticleListParams, Availability, type AvailabilityLocale, type AvailabilityMessageKey, type AvailabilityMessages, AvailabilityStatus, type AvailabilityTone, type AvailabilityView, type AvailabilityViewOptions, CLIENT_IP_HEADER, COUNTRY_HEADERS, Cart, CartBuyerInput, CartLineInput, CartLineProblem, type CartLineProblemView, CartLineUpdateInput, CartPromotions, CartRecommendations, CheckoutInput, CheckoutResult, Collection, type CollectionListParams, Connection, Customer, CustomerCapabilities, CustomerIdentifier, CustomerPasswordLoginInput, CustomerRegisterInput, CustomerRegisterResult, CustomerResetPasswordInput, CustomerSession, CustomerSessionInput, CustomerSetPasswordInput, CustomerVerifyRegistrationInput, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiscountBarState, type DiscountBarView, type FetchLike, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceRequest, InvoiceResult, Location, LocationListParams, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, Order, Page, type PaginationParams, PaymentAttemptResult, PaymentConfig, type PaymentErrorKind, type PaymentErrorView, type PaymentLocale, type PaymentMessageKey, type PaymentMessages, PaymentMethods, PaymentNextStep, type PaymentOutcome, type PaymentOutcomeKind, PaymentSubmitInput, PaymentVoucher, type PreviewOptions, Product, ProductConnection, type ProductListParams, ProductSort, ProductVariant, type PromoProgressView, type PromotionLocale, type PromotionMessageKey, type PromotionMessages, PromotionReward, PromotionsList, type QueryParams, type QueryValue, RecommendationPlacement, type RequestOptions, type ResolveAvailabilityOptions, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, StorefrontError, StorefrontErrorCode, type StorefrontErrorInit, type StorefrontRequestContext, type StorefrontResponseContext, Theme, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, hreflangLinks, isStorefrontError, isTokenPublishable, negotiateLocale, normalizeClientIp, normalizeNote, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, resolveAvailability, rewardLabel, safeHttpsUrl, schemaAvailability, storefrontDomainHeader, suggestMarket, toMoney, visitorCountry };
package/dist/index.js CHANGED
@@ -380,6 +380,24 @@ function createStorefrontClient(config) {
380
380
  requestOtp: (identifier, options) => write("POST", "/storefront/customer/otp", identifier, options),
381
381
  /** Exchanges the code for a buyer session (`token` goes in `customerToken`). */
382
382
  createSession: (input, options) => write("POST", "/storefront/customer/session", input, options),
383
+ /** What the store supports (password login, email verification, OTP channels). Drives which forms to show. */
384
+ capabilities: (options) => get("/storefront/customer/capabilities", void 0, options),
385
+ /**
386
+ * Creates an account with email + password. `verification_required` (202): a code was emailed, finish with
387
+ * `verifyRegistration`. `created` (201): the account exists and `session` is ready. `409` when the email is taken.
388
+ */
389
+ register: async (input, options) => {
390
+ const res = await write("POST", "/storefront/customer/register", input, options);
391
+ return res && "token" in res ? { status: "created", session: res } : { status: "verification_required" };
392
+ },
393
+ /** Confirms the emailed registration code and returns the new buyer session. */
394
+ verifyRegistration: (input, options) => write("POST", "/storefront/customer/register/verify", input, options),
395
+ /** Email + password login. `401` for wrong credentials. */
396
+ loginWithPassword: (input, options) => write("POST", "/storefront/customer/login", input, options),
397
+ /** Sets or changes the password of the signed-in buyer (`options.customerToken`, or a `withCustomerToken` client). */
398
+ setPassword: (input, options) => write("PUT", "/storefront/customer/password", input, options),
399
+ /** Resets a forgotten password with the code from `requestOtp({ email })`. */
400
+ resetPassword: (input, options) => write("POST", "/storefront/customer/password/reset", input, options),
383
401
  get: (options) => get("/storefront/customer", void 0, options),
384
402
  orders: (params, options) => get("/storefront/customer/orders", params, options),
385
403
  /** `null` when the order does not exist or belongs to someone else. */