@asteby/storefront 0.21.1 → 0.22.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,5 +1,5 @@
1
- import { b6 as ProductSort, bS as TokenIntrospection, bz as Shop, bg as Region, bk as RegionPostalCode, b4 as ProductConnection, b1 as Product, z as Connection, y as Collection, ao as LocationListParams, al as Location, au as NearestLocation, bD as StockLevel, bl as RestockSubscriptionInput, bm as RestockSubscriptionResult, n as CartLineInput, C as Cart, q as CartLineUpdateInput, g as CartBuyerInput, b as AddressInput, U as DeliveryOptions, aT as PaymentMethods, S as DeliveryInput, ag as InvoiceRequest, be as RecommendationPlacement, t as CartRecommendations, v as CheckoutInput, x as CheckoutResult, bb as PromotionsList, aP as PaymentConfig, aY as PaymentSubmitInput, aL as PaymentAttemptResult, E as CustomerIdentifier, M as CustomerSessionInput, K as CustomerSession, D as CustomerCapabilities, H as CustomerRegisterInput, I as CustomerRegisterResult, P as CustomerVerifyRegistrationInput, F as CustomerPasswordLoginInput, N as CustomerSetPasswordInput, J as CustomerResetPasswordInput, B as Customer, O as CustomerUpdateInput, L as CustomerSessionInfo, bc as ReauthInput, bd as ReauthResult, Q as DataExportFile, A as AccountDeleteInput, ax as Order, bo as ReturnRequestInput, bn as ReturnRequest, ah as InvoiceResult, a_ as PendingPayment, ae as InvoiceFileKind, ad as InvoiceFile, $ as FiscalProfile, a0 as FiscalProfileInput, bI as Subject, bN as SubjectInput, bP as SubjectPatch, a as Address, bO as SubjectKind, bR as Theme, aI as Page, aq as Menu, c as Article, as as Money, e as AvailabilityStatus, p as CartLineProblem, d as Availability, aa as InsufficientStockLine, b7 as ProductVariant, R as DeclineCode, aZ as PaymentVoucher, aU as PaymentNextStep, r as CartPromotions, b9 as PromotionReward, ac as InvoiceDoc, bs as Shipment, av as NextAction, aB as OrderProgress, bw as ShipmentStatus, bt as ShipmentEvent, bK as SubjectCatalogNode, bL as SubjectField, T as DeliveryMethod, bT as UnavailableRateProvider } from './account-settings-BkShqX2k.cjs';
2
- export { f as CartBuyer, h as CartCost, i as CartDelivery, j as CartDiscountCode, k as CartDiscountLine, l as CartInvoice, m as CartLine, o as CartLineMerchandise, s as CartRecommendation, u as CheckoutInfo, w as CheckoutPayment, G as CustomerPreferences, V as Facet, W as FacetValue, X as FiscalDocumentEvidence, Y as FiscalDocumentSource, Z as FiscalIdentity, _ as FiscalIdentityInput, a1 as FiscalVerification, a2 as GeoHint, a3 as IdentityCapture, a4 as IdentityDocumentSpec, a5 as IdentityFieldRule, a6 as IdentityRulesV1, a7 as IdentityStrategy, a8 as Image, a9 as InsufficientStockDetails, ab as InvoiceAction, af as InvoiceReceiver, ai as InvoiceStage, aj as InvoiceSummary, ak as InvoicingCapabilities, am as LocationContacts, an as LocationKind, ap as LocationPickup, ar as MenuItem, at as MoneyRange, aw as NextActionKind, ay as OrderLine, az as OrderPickup, aA as OrderProblem, aC as OrderProgressStep, aD as OrderSection, aE as OrderShippingService, aF as OrderStage, aG as OrderStepKey, aH as OrderStepState, aJ as PageInfo, aK as PaymentAction, aM as PaymentAttemptStatus, aN as PaymentClient, aO as PaymentClientCsp, aQ as PaymentFlow, aR as PaymentInfo, aS as PaymentMethod, aV as PaymentOption, aW as PaymentOptionKey, aX as PaymentPoint, a$ as PendingPaymentVoucher, b0 as PickupOption, b2 as ProductAttributeValue, b3 as ProductCategory, b5 as ProductOption, b8 as PromotionAnnouncement, ba as PromotionTier, bf as Refund, bh as RegionFiscalEntry, bi as RegionFiscalId, bj as RegionPaymentMethod, bp as SEO, bq as Section, br as SelectedOption, bu as ShipmentKind, bv as ShipmentMap, bx as ShipmentsSummary, by as ShippingRate, bA as ShopBranch, bB as ShopContact, bC as ShopPolicies, bE as StorefrontError, bF as StorefrontErrorBody, bG as StorefrontErrorCode, bH as StorefrontErrorInit, bJ as SubjectCatalog, bM as SubjectFieldType, bQ as SubjectRef, bU as dataExportBytes, bV as isAccountDeleteBlocked, bW as isReauthRequired, bX as isStorefrontError, bY as safeExportFilename } from './account-settings-BkShqX2k.cjs';
1
+ import { ba as ProductSort, bW as TokenIntrospection, bD as Shop, bk as Region, bo as RegionPostalCode, b8 as ProductConnection, b5 as Product, z as Connection, y as Collection, as as LocationListParams, ap as Location, ay as NearestLocation, bH as StockLevel, bp as RestockSubscriptionInput, bq as RestockSubscriptionResult, n as CartLineInput, C as Cart, q as CartLineUpdateInput, g as CartBuyerInput, b as AddressInput, Y as DeliveryOptions, aX as PaymentMethods, W as DeliveryInput, ak as InvoiceRequest, bi as RecommendationPlacement, t as CartRecommendations, v as CheckoutInput, x as CheckoutResult, bf as PromotionsList, aT as PaymentConfig, b0 as PaymentSubmitInput, aP as PaymentAttemptResult, I as CustomerIdentifier, Q as CustomerSessionInput, O as CustomerSession, D as CustomerCapabilities, L as CustomerRegisterInput, M as CustomerRegisterResult, T as CustomerVerifyRegistrationInput, J as CustomerPasswordLoginInput, R as CustomerSetPasswordInput, N as CustomerResetPasswordInput, B as Customer, S as CustomerUpdateInput, P as CustomerSessionInfo, bg as ReauthInput, bh as ReauthResult, H as CustomerEmailCodeInput, F as CustomerEmailChangeInput, G as CustomerEmailChangeRequested, E as CustomerEmailChangeConfirmInput, U as DataExportFile, A as AccountDeleteInput, aB as Order, bs as ReturnRequestInput, br as ReturnRequest, al as InvoiceResult, b2 as PendingPayment, ai as InvoiceFileKind, ah as InvoiceFile, a3 as FiscalProfile, a4 as FiscalProfileInput, bM as Subject, bR as SubjectInput, bT as SubjectPatch, a as Address, bS as SubjectKind, bV as Theme, aM as Page, au as Menu, c as Article, aw as Money, e as AvailabilityStatus, p as CartLineProblem, d as Availability, ae as InsufficientStockLine, bb as ProductVariant, V as DeclineCode, b1 as PaymentVoucher, aY as PaymentNextStep, r as CartPromotions, bd as PromotionReward, ag as InvoiceDoc, bw as Shipment, az as NextAction, aF as OrderProgress, bA as ShipmentStatus, bx as ShipmentEvent, bO as SubjectCatalogNode, bP as SubjectField, X as DeliveryMethod, bX as UnavailableRateProvider } from './account-settings-Cj-yownd.cjs';
2
+ export { f as CartBuyer, h as CartCost, i as CartDelivery, j as CartDiscountCode, k as CartDiscountLine, l as CartInvoice, m as CartLine, o as CartLineMerchandise, s as CartRecommendation, u as CheckoutInfo, w as CheckoutPayment, K as CustomerPreferences, Z as Facet, _ as FacetValue, $ as FiscalDocumentEvidence, a0 as FiscalDocumentSource, a1 as FiscalIdentity, a2 as FiscalIdentityInput, a5 as FiscalVerification, a6 as GeoHint, a7 as IdentityCapture, a8 as IdentityDocumentSpec, a9 as IdentityFieldRule, aa as IdentityRulesV1, ab as IdentityStrategy, ac as Image, ad as InsufficientStockDetails, af as InvoiceAction, aj as InvoiceReceiver, am as InvoiceStage, an as InvoiceSummary, ao as InvoicingCapabilities, aq as LocationContacts, ar as LocationKind, at as LocationPickup, av as MenuItem, ax as MoneyRange, aA as NextActionKind, aC as OrderLine, aD as OrderPickup, aE as OrderProblem, aG as OrderProgressStep, aH as OrderSection, aI as OrderShippingService, aJ as OrderStage, aK as OrderStepKey, aL as OrderStepState, aN as PageInfo, aO as PaymentAction, aQ as PaymentAttemptStatus, aR as PaymentClient, aS as PaymentClientCsp, aU as PaymentFlow, aV as PaymentInfo, aW as PaymentMethod, aZ as PaymentOption, a_ as PaymentOptionKey, a$ as PaymentPoint, b3 as PendingPaymentVoucher, b4 as PickupOption, b6 as ProductAttributeValue, b7 as ProductCategory, b9 as ProductOption, bc as PromotionAnnouncement, be as PromotionTier, bj as Refund, bl as RegionFiscalEntry, bm as RegionFiscalId, bn as RegionPaymentMethod, bt as SEO, bu as Section, bv as SelectedOption, by as ShipmentKind, bz as ShipmentMap, bB as ShipmentsSummary, bC as ShippingRate, bE as ShopBranch, bF as ShopContact, bG as ShopPolicies, bI as StorefrontError, bJ as StorefrontErrorBody, bK as StorefrontErrorCode, bL as StorefrontErrorInit, bN as SubjectCatalog, bQ as SubjectFieldType, bU as SubjectRef, bY as dataExportBytes, bZ as isAccountDeleteBlocked, b_ as isReauthRequired, b$ as isStorefrontError, c0 as safeExportFilename } from './account-settings-Cj-yownd.cjs';
3
3
  import { GeoPoint } from './geo.cjs';
4
4
  export { OpenStatus, OpeningHours } from './geo.cjs';
5
5
 
@@ -346,6 +346,31 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
346
346
  * A wrong credential is always the same `400`; too many tries is `429` (`StorefrontError.retryAfter`).
347
347
  */
348
348
  reauth: (input: ReauthInput, options?: WriteOptions) => Promise<ReauthResult>;
349
+ /**
350
+ * The buyer's e-mail from their account (contract 1.15, `capabilities().email_change`). All four calls need the
351
+ * buyer's session; a wrong or expired code is always the same `400` on `code`, too many tries is `429`.
352
+ */
353
+ email: {
354
+ /**
355
+ * Mails a code to the account's CURRENT e-mail so it can be verified. `422` when it is already verified, the
356
+ * account has no e-mail or the store cannot send mail; `429` while a code was just sent.
357
+ */
358
+ requestVerification: (options?: WriteOptions) => Promise<void>;
359
+ /** Verifies the current e-mail with the code; answers the buyer with `email_verified: true`. */
360
+ confirmVerification: (input: CustomerEmailCodeInput, options?: WriteOptions) => Promise<Customer>;
361
+ /**
362
+ * Asks to change the e-mail. Needs a recent `reauth` (`403 reauth_required`, see `isReauthRequired`). A code is
363
+ * sent to the NEW address and nothing changes until `confirmChange`. The answer is the same whether or not the
364
+ * new address already has an account (then nothing is sent and the code can never work): word your screen as
365
+ * «if the address can be used, we sent a code». `400` on `email` for an invalid or unchanged address.
366
+ */
367
+ requestChange: (input: CustomerEmailChangeInput, options?: WriteOptions) => Promise<CustomerEmailChangeRequested>;
368
+ /**
369
+ * Confirms the change with the code that arrived at the new address. The other sessions of the account are
370
+ * closed (the one making the call stays) and the answer is the buyer with the new, verified e-mail.
371
+ */
372
+ confirmChange: (input: CustomerEmailChangeConfirmInput, options?: WriteOptions) => Promise<Customer>;
373
+ };
349
374
  /**
350
375
  * The buyer's data as a JSON file (contract 1.9, `capabilities().data_export`). Needs a recent `reauth`. It is
351
376
  * built on request and is neither stored nor emailed: call it from YOUR server, stream the bytes
@@ -964,4 +989,4 @@ type DeliveryNotices = {
964
989
  /** Splits `delivery.unavailable` into the `missing_weight` notice and the generic one. */
965
990
  declare function deliveryNotices(delivery: Pick<DeliveryOptions, 'unavailable' | 'partial'> | null | undefined): DeliveryNotices;
966
991
 
967
- export { AccountDeleteInput, 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, CustomerSessionInfo, CustomerSessionInput, CustomerSetPasswordInput, CustomerUpdateInput, CustomerVerifyRegistrationInput, DEFAULT_FIT_TAG_PREFIX, DataExportFile, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiagnoseOptions, type DiscountBarState, type DiscountBarView, type FetchLike, FiscalProfile, FiscalProfileInput, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, InvoiceRequest, InvoiceResult, Location, LocationListParams, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, PRIVATE_MASK, Page, type PaginationParams, PaymentAttemptResult, PaymentConfig, type PaymentErrorClass, type PaymentErrorClassKind, type PaymentErrorKind, type PaymentErrorLike, type PaymentErrorView, type PaymentLocale, type PaymentMessageKey, type PaymentMessages, PaymentMethods, PaymentNextStep, type PaymentOutcome, type PaymentOutcomeKind, PaymentSubmitInput, PaymentVoucher, PendingPayment, type PreviewOptions, Product, ProductConnection, type ProductListParams, ProductSort, ProductVariant, type PromoProgressView, type PromotionLocale, type PromotionMessageKey, type PromotionMessages, PromotionReward, PromotionsList, type QueryParams, type QueryValue, ReauthInput, ReauthResult, RecommendationPlacement, Region, RegionPostalCode, type RequestOptions, type ResolveAvailabilityOptions, type ResolvedSubject, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, SHIPPING_STEPS, SUBJECT_CATALOG_PAGE_BYTES, Shipment, ShipmentEvent, ShipmentStatus, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, type StorefrontRequestContext, type StorefrontResponseContext, Subject, SubjectCatalogNode, SubjectField, SubjectInput, SubjectKind, type SubjectOption, SubjectPatch, type SubjectProblemCode, type SubjectProblems, type SubjectValues, Theme, TokenIntrospection, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, coversYear, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, fitTag, fitTagsAny, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isMasked, isTestInvoice, isTestShipment, isTokenPublishable, maskToken, negotiateLocale, nextAction, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, reconcileSubjectValues, repairPath, resolveAvailability, resolveSubject, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, splitSubjectTree, storefrontDomainHeader, subjectFields, subjectLevels, subjectOptions, suggestMarket, toMoney, visitorCountry };
992
+ export { AccountDeleteInput, 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, CustomerEmailChangeConfirmInput, CustomerEmailChangeInput, CustomerEmailChangeRequested, CustomerEmailCodeInput, CustomerIdentifier, CustomerPasswordLoginInput, CustomerRegisterInput, CustomerRegisterResult, CustomerResetPasswordInput, CustomerSession, CustomerSessionInfo, CustomerSessionInput, CustomerSetPasswordInput, CustomerUpdateInput, CustomerVerifyRegistrationInput, DEFAULT_FIT_TAG_PREFIX, DataExportFile, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiagnoseOptions, type DiscountBarState, type DiscountBarView, type FetchLike, FiscalProfile, FiscalProfileInput, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, InvoiceRequest, InvoiceResult, Location, LocationListParams, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, PRIVATE_MASK, Page, type PaginationParams, PaymentAttemptResult, PaymentConfig, type PaymentErrorClass, type PaymentErrorClassKind, type PaymentErrorKind, type PaymentErrorLike, type PaymentErrorView, type PaymentLocale, type PaymentMessageKey, type PaymentMessages, PaymentMethods, PaymentNextStep, type PaymentOutcome, type PaymentOutcomeKind, PaymentSubmitInput, PaymentVoucher, PendingPayment, type PreviewOptions, Product, ProductConnection, type ProductListParams, ProductSort, ProductVariant, type PromoProgressView, type PromotionLocale, type PromotionMessageKey, type PromotionMessages, PromotionReward, PromotionsList, type QueryParams, type QueryValue, ReauthInput, ReauthResult, RecommendationPlacement, Region, RegionPostalCode, type RequestOptions, type ResolveAvailabilityOptions, type ResolvedSubject, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, SHIPPING_STEPS, SUBJECT_CATALOG_PAGE_BYTES, Shipment, ShipmentEvent, ShipmentStatus, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, type StorefrontRequestContext, type StorefrontResponseContext, Subject, SubjectCatalogNode, SubjectField, SubjectInput, SubjectKind, type SubjectOption, SubjectPatch, type SubjectProblemCode, type SubjectProblems, type SubjectValues, Theme, TokenIntrospection, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, coversYear, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, fitTag, fitTagsAny, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isMasked, isTestInvoice, isTestShipment, isTokenPublishable, maskToken, negotiateLocale, nextAction, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, reconcileSubjectValues, repairPath, resolveAvailability, resolveSubject, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, splitSubjectTree, storefrontDomainHeader, subjectFields, subjectLevels, subjectOptions, suggestMarket, toMoney, visitorCountry };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { b6 as ProductSort, bS as TokenIntrospection, bz as Shop, bg as Region, bk as RegionPostalCode, b4 as ProductConnection, b1 as Product, z as Connection, y as Collection, ao as LocationListParams, al as Location, au as NearestLocation, bD as StockLevel, bl as RestockSubscriptionInput, bm as RestockSubscriptionResult, n as CartLineInput, C as Cart, q as CartLineUpdateInput, g as CartBuyerInput, b as AddressInput, U as DeliveryOptions, aT as PaymentMethods, S as DeliveryInput, ag as InvoiceRequest, be as RecommendationPlacement, t as CartRecommendations, v as CheckoutInput, x as CheckoutResult, bb as PromotionsList, aP as PaymentConfig, aY as PaymentSubmitInput, aL as PaymentAttemptResult, E as CustomerIdentifier, M as CustomerSessionInput, K as CustomerSession, D as CustomerCapabilities, H as CustomerRegisterInput, I as CustomerRegisterResult, P as CustomerVerifyRegistrationInput, F as CustomerPasswordLoginInput, N as CustomerSetPasswordInput, J as CustomerResetPasswordInput, B as Customer, O as CustomerUpdateInput, L as CustomerSessionInfo, bc as ReauthInput, bd as ReauthResult, Q as DataExportFile, A as AccountDeleteInput, ax as Order, bo as ReturnRequestInput, bn as ReturnRequest, ah as InvoiceResult, a_ as PendingPayment, ae as InvoiceFileKind, ad as InvoiceFile, $ as FiscalProfile, a0 as FiscalProfileInput, bI as Subject, bN as SubjectInput, bP as SubjectPatch, a as Address, bO as SubjectKind, bR as Theme, aI as Page, aq as Menu, c as Article, as as Money, e as AvailabilityStatus, p as CartLineProblem, d as Availability, aa as InsufficientStockLine, b7 as ProductVariant, R as DeclineCode, aZ as PaymentVoucher, aU as PaymentNextStep, r as CartPromotions, b9 as PromotionReward, ac as InvoiceDoc, bs as Shipment, av as NextAction, aB as OrderProgress, bw as ShipmentStatus, bt as ShipmentEvent, bK as SubjectCatalogNode, bL as SubjectField, T as DeliveryMethod, bT as UnavailableRateProvider } from './account-settings-quulZwuF.js';
2
- export { f as CartBuyer, h as CartCost, i as CartDelivery, j as CartDiscountCode, k as CartDiscountLine, l as CartInvoice, m as CartLine, o as CartLineMerchandise, s as CartRecommendation, u as CheckoutInfo, w as CheckoutPayment, G as CustomerPreferences, V as Facet, W as FacetValue, X as FiscalDocumentEvidence, Y as FiscalDocumentSource, Z as FiscalIdentity, _ as FiscalIdentityInput, a1 as FiscalVerification, a2 as GeoHint, a3 as IdentityCapture, a4 as IdentityDocumentSpec, a5 as IdentityFieldRule, a6 as IdentityRulesV1, a7 as IdentityStrategy, a8 as Image, a9 as InsufficientStockDetails, ab as InvoiceAction, af as InvoiceReceiver, ai as InvoiceStage, aj as InvoiceSummary, ak as InvoicingCapabilities, am as LocationContacts, an as LocationKind, ap as LocationPickup, ar as MenuItem, at as MoneyRange, aw as NextActionKind, ay as OrderLine, az as OrderPickup, aA as OrderProblem, aC as OrderProgressStep, aD as OrderSection, aE as OrderShippingService, aF as OrderStage, aG as OrderStepKey, aH as OrderStepState, aJ as PageInfo, aK as PaymentAction, aM as PaymentAttemptStatus, aN as PaymentClient, aO as PaymentClientCsp, aQ as PaymentFlow, aR as PaymentInfo, aS as PaymentMethod, aV as PaymentOption, aW as PaymentOptionKey, aX as PaymentPoint, a$ as PendingPaymentVoucher, b0 as PickupOption, b2 as ProductAttributeValue, b3 as ProductCategory, b5 as ProductOption, b8 as PromotionAnnouncement, ba as PromotionTier, bf as Refund, bh as RegionFiscalEntry, bi as RegionFiscalId, bj as RegionPaymentMethod, bp as SEO, bq as Section, br as SelectedOption, bu as ShipmentKind, bv as ShipmentMap, bx as ShipmentsSummary, by as ShippingRate, bA as ShopBranch, bB as ShopContact, bC as ShopPolicies, bE as StorefrontError, bF as StorefrontErrorBody, bG as StorefrontErrorCode, bH as StorefrontErrorInit, bJ as SubjectCatalog, bM as SubjectFieldType, bQ as SubjectRef, bU as dataExportBytes, bV as isAccountDeleteBlocked, bW as isReauthRequired, bX as isStorefrontError, bY as safeExportFilename } from './account-settings-quulZwuF.js';
1
+ import { ba as ProductSort, bW as TokenIntrospection, bD as Shop, bk as Region, bo as RegionPostalCode, b8 as ProductConnection, b5 as Product, z as Connection, y as Collection, as as LocationListParams, ap as Location, ay as NearestLocation, bH as StockLevel, bp as RestockSubscriptionInput, bq as RestockSubscriptionResult, n as CartLineInput, C as Cart, q as CartLineUpdateInput, g as CartBuyerInput, b as AddressInput, Y as DeliveryOptions, aX as PaymentMethods, W as DeliveryInput, ak as InvoiceRequest, bi as RecommendationPlacement, t as CartRecommendations, v as CheckoutInput, x as CheckoutResult, bf as PromotionsList, aT as PaymentConfig, b0 as PaymentSubmitInput, aP as PaymentAttemptResult, I as CustomerIdentifier, Q as CustomerSessionInput, O as CustomerSession, D as CustomerCapabilities, L as CustomerRegisterInput, M as CustomerRegisterResult, T as CustomerVerifyRegistrationInput, J as CustomerPasswordLoginInput, R as CustomerSetPasswordInput, N as CustomerResetPasswordInput, B as Customer, S as CustomerUpdateInput, P as CustomerSessionInfo, bg as ReauthInput, bh as ReauthResult, H as CustomerEmailCodeInput, F as CustomerEmailChangeInput, G as CustomerEmailChangeRequested, E as CustomerEmailChangeConfirmInput, U as DataExportFile, A as AccountDeleteInput, aB as Order, bs as ReturnRequestInput, br as ReturnRequest, al as InvoiceResult, b2 as PendingPayment, ai as InvoiceFileKind, ah as InvoiceFile, a3 as FiscalProfile, a4 as FiscalProfileInput, bM as Subject, bR as SubjectInput, bT as SubjectPatch, a as Address, bS as SubjectKind, bV as Theme, aM as Page, au as Menu, c as Article, aw as Money, e as AvailabilityStatus, p as CartLineProblem, d as Availability, ae as InsufficientStockLine, bb as ProductVariant, V as DeclineCode, b1 as PaymentVoucher, aY as PaymentNextStep, r as CartPromotions, bd as PromotionReward, ag as InvoiceDoc, bw as Shipment, az as NextAction, aF as OrderProgress, bA as ShipmentStatus, bx as ShipmentEvent, bO as SubjectCatalogNode, bP as SubjectField, X as DeliveryMethod, bX as UnavailableRateProvider } from './account-settings-DYMmes8_.js';
2
+ export { f as CartBuyer, h as CartCost, i as CartDelivery, j as CartDiscountCode, k as CartDiscountLine, l as CartInvoice, m as CartLine, o as CartLineMerchandise, s as CartRecommendation, u as CheckoutInfo, w as CheckoutPayment, K as CustomerPreferences, Z as Facet, _ as FacetValue, $ as FiscalDocumentEvidence, a0 as FiscalDocumentSource, a1 as FiscalIdentity, a2 as FiscalIdentityInput, a5 as FiscalVerification, a6 as GeoHint, a7 as IdentityCapture, a8 as IdentityDocumentSpec, a9 as IdentityFieldRule, aa as IdentityRulesV1, ab as IdentityStrategy, ac as Image, ad as InsufficientStockDetails, af as InvoiceAction, aj as InvoiceReceiver, am as InvoiceStage, an as InvoiceSummary, ao as InvoicingCapabilities, aq as LocationContacts, ar as LocationKind, at as LocationPickup, av as MenuItem, ax as MoneyRange, aA as NextActionKind, aC as OrderLine, aD as OrderPickup, aE as OrderProblem, aG as OrderProgressStep, aH as OrderSection, aI as OrderShippingService, aJ as OrderStage, aK as OrderStepKey, aL as OrderStepState, aN as PageInfo, aO as PaymentAction, aQ as PaymentAttemptStatus, aR as PaymentClient, aS as PaymentClientCsp, aU as PaymentFlow, aV as PaymentInfo, aW as PaymentMethod, aZ as PaymentOption, a_ as PaymentOptionKey, a$ as PaymentPoint, b3 as PendingPaymentVoucher, b4 as PickupOption, b6 as ProductAttributeValue, b7 as ProductCategory, b9 as ProductOption, bc as PromotionAnnouncement, be as PromotionTier, bj as Refund, bl as RegionFiscalEntry, bm as RegionFiscalId, bn as RegionPaymentMethod, bt as SEO, bu as Section, bv as SelectedOption, by as ShipmentKind, bz as ShipmentMap, bB as ShipmentsSummary, bC as ShippingRate, bE as ShopBranch, bF as ShopContact, bG as ShopPolicies, bI as StorefrontError, bJ as StorefrontErrorBody, bK as StorefrontErrorCode, bL as StorefrontErrorInit, bN as SubjectCatalog, bQ as SubjectFieldType, bU as SubjectRef, bY as dataExportBytes, bZ as isAccountDeleteBlocked, b_ as isReauthRequired, b$ as isStorefrontError, c0 as safeExportFilename } from './account-settings-DYMmes8_.js';
3
3
  import { GeoPoint } from './geo.js';
4
4
  export { OpenStatus, OpeningHours } from './geo.js';
5
5
 
@@ -346,6 +346,31 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
346
346
  * A wrong credential is always the same `400`; too many tries is `429` (`StorefrontError.retryAfter`).
347
347
  */
348
348
  reauth: (input: ReauthInput, options?: WriteOptions) => Promise<ReauthResult>;
349
+ /**
350
+ * The buyer's e-mail from their account (contract 1.15, `capabilities().email_change`). All four calls need the
351
+ * buyer's session; a wrong or expired code is always the same `400` on `code`, too many tries is `429`.
352
+ */
353
+ email: {
354
+ /**
355
+ * Mails a code to the account's CURRENT e-mail so it can be verified. `422` when it is already verified, the
356
+ * account has no e-mail or the store cannot send mail; `429` while a code was just sent.
357
+ */
358
+ requestVerification: (options?: WriteOptions) => Promise<void>;
359
+ /** Verifies the current e-mail with the code; answers the buyer with `email_verified: true`. */
360
+ confirmVerification: (input: CustomerEmailCodeInput, options?: WriteOptions) => Promise<Customer>;
361
+ /**
362
+ * Asks to change the e-mail. Needs a recent `reauth` (`403 reauth_required`, see `isReauthRequired`). A code is
363
+ * sent to the NEW address and nothing changes until `confirmChange`. The answer is the same whether or not the
364
+ * new address already has an account (then nothing is sent and the code can never work): word your screen as
365
+ * «if the address can be used, we sent a code». `400` on `email` for an invalid or unchanged address.
366
+ */
367
+ requestChange: (input: CustomerEmailChangeInput, options?: WriteOptions) => Promise<CustomerEmailChangeRequested>;
368
+ /**
369
+ * Confirms the change with the code that arrived at the new address. The other sessions of the account are
370
+ * closed (the one making the call stays) and the answer is the buyer with the new, verified e-mail.
371
+ */
372
+ confirmChange: (input: CustomerEmailChangeConfirmInput, options?: WriteOptions) => Promise<Customer>;
373
+ };
349
374
  /**
350
375
  * The buyer's data as a JSON file (contract 1.9, `capabilities().data_export`). Needs a recent `reauth`. It is
351
376
  * built on request and is neither stored nor emailed: call it from YOUR server, stream the bytes
@@ -964,4 +989,4 @@ type DeliveryNotices = {
964
989
  /** Splits `delivery.unavailable` into the `missing_weight` notice and the generic one. */
965
990
  declare function deliveryNotices(delivery: Pick<DeliveryOptions, 'unavailable' | 'partial'> | null | undefined): DeliveryNotices;
966
991
 
967
- export { AccountDeleteInput, 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, CustomerSessionInfo, CustomerSessionInput, CustomerSetPasswordInput, CustomerUpdateInput, CustomerVerifyRegistrationInput, DEFAULT_FIT_TAG_PREFIX, DataExportFile, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiagnoseOptions, type DiscountBarState, type DiscountBarView, type FetchLike, FiscalProfile, FiscalProfileInput, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, InvoiceRequest, InvoiceResult, Location, LocationListParams, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, PRIVATE_MASK, Page, type PaginationParams, PaymentAttemptResult, PaymentConfig, type PaymentErrorClass, type PaymentErrorClassKind, type PaymentErrorKind, type PaymentErrorLike, type PaymentErrorView, type PaymentLocale, type PaymentMessageKey, type PaymentMessages, PaymentMethods, PaymentNextStep, type PaymentOutcome, type PaymentOutcomeKind, PaymentSubmitInput, PaymentVoucher, PendingPayment, type PreviewOptions, Product, ProductConnection, type ProductListParams, ProductSort, ProductVariant, type PromoProgressView, type PromotionLocale, type PromotionMessageKey, type PromotionMessages, PromotionReward, PromotionsList, type QueryParams, type QueryValue, ReauthInput, ReauthResult, RecommendationPlacement, Region, RegionPostalCode, type RequestOptions, type ResolveAvailabilityOptions, type ResolvedSubject, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, SHIPPING_STEPS, SUBJECT_CATALOG_PAGE_BYTES, Shipment, ShipmentEvent, ShipmentStatus, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, type StorefrontRequestContext, type StorefrontResponseContext, Subject, SubjectCatalogNode, SubjectField, SubjectInput, SubjectKind, type SubjectOption, SubjectPatch, type SubjectProblemCode, type SubjectProblems, type SubjectValues, Theme, TokenIntrospection, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, coversYear, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, fitTag, fitTagsAny, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isMasked, isTestInvoice, isTestShipment, isTokenPublishable, maskToken, negotiateLocale, nextAction, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, reconcileSubjectValues, repairPath, resolveAvailability, resolveSubject, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, splitSubjectTree, storefrontDomainHeader, subjectFields, subjectLevels, subjectOptions, suggestMarket, toMoney, visitorCountry };
992
+ export { AccountDeleteInput, 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, CustomerEmailChangeConfirmInput, CustomerEmailChangeInput, CustomerEmailChangeRequested, CustomerEmailCodeInput, CustomerIdentifier, CustomerPasswordLoginInput, CustomerRegisterInput, CustomerRegisterResult, CustomerResetPasswordInput, CustomerSession, CustomerSessionInfo, CustomerSessionInput, CustomerSetPasswordInput, CustomerUpdateInput, CustomerVerifyRegistrationInput, DEFAULT_FIT_TAG_PREFIX, DataExportFile, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiagnoseOptions, type DiscountBarState, type DiscountBarView, type FetchLike, FiscalProfile, FiscalProfileInput, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, InvoiceRequest, InvoiceResult, Location, LocationListParams, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, PRIVATE_MASK, Page, type PaginationParams, PaymentAttemptResult, PaymentConfig, type PaymentErrorClass, type PaymentErrorClassKind, type PaymentErrorKind, type PaymentErrorLike, type PaymentErrorView, type PaymentLocale, type PaymentMessageKey, type PaymentMessages, PaymentMethods, PaymentNextStep, type PaymentOutcome, type PaymentOutcomeKind, PaymentSubmitInput, PaymentVoucher, PendingPayment, type PreviewOptions, Product, ProductConnection, type ProductListParams, ProductSort, ProductVariant, type PromoProgressView, type PromotionLocale, type PromotionMessageKey, type PromotionMessages, PromotionReward, PromotionsList, type QueryParams, type QueryValue, ReauthInput, ReauthResult, RecommendationPlacement, Region, RegionPostalCode, type RequestOptions, type ResolveAvailabilityOptions, type ResolvedSubject, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, SHIPPING_STEPS, SUBJECT_CATALOG_PAGE_BYTES, Shipment, ShipmentEvent, ShipmentStatus, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, type StorefrontRequestContext, type StorefrontResponseContext, Subject, SubjectCatalogNode, SubjectField, SubjectInput, SubjectKind, type SubjectOption, SubjectPatch, type SubjectProblemCode, type SubjectProblems, type SubjectValues, Theme, TokenIntrospection, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, coversYear, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, fitTag, fitTagsAny, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isMasked, isTestInvoice, isTestShipment, isTokenPublishable, maskToken, negotiateLocale, nextAction, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, reconcileSubjectValues, repairPath, resolveAvailability, resolveSubject, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, splitSubjectTree, storefrontDomainHeader, subjectFields, subjectLevels, subjectOptions, suggestMarket, toMoney, visitorCountry };
package/dist/index.js CHANGED
@@ -433,6 +433,31 @@ function createStorefrontClient(config) {
433
433
  * A wrong credential is always the same `400`; too many tries is `429` (`StorefrontError.retryAfter`).
434
434
  */
435
435
  reauth: (input, options) => write("POST", "/storefront/customer/reauth", input, options),
436
+ /**
437
+ * The buyer's e-mail from their account (contract 1.15, `capabilities().email_change`). All four calls need the
438
+ * buyer's session; a wrong or expired code is always the same `400` on `code`, too many tries is `429`.
439
+ */
440
+ email: {
441
+ /**
442
+ * Mails a code to the account's CURRENT e-mail so it can be verified. `422` when it is already verified, the
443
+ * account has no e-mail or the store cannot send mail; `429` while a code was just sent.
444
+ */
445
+ requestVerification: (options) => write("POST", "/storefront/customer/email/verification", void 0, options),
446
+ /** Verifies the current e-mail with the code; answers the buyer with `email_verified: true`. */
447
+ confirmVerification: (input, options) => write("POST", "/storefront/customer/email/verification/confirm", input, options),
448
+ /**
449
+ * Asks to change the e-mail. Needs a recent `reauth` (`403 reauth_required`, see `isReauthRequired`). A code is
450
+ * sent to the NEW address and nothing changes until `confirmChange`. The answer is the same whether or not the
451
+ * new address already has an account (then nothing is sent and the code can never work): word your screen as
452
+ * «if the address can be used, we sent a code». `400` on `email` for an invalid or unchanged address.
453
+ */
454
+ requestChange: (input, options) => write("POST", "/storefront/customer/email/change", input, options),
455
+ /**
456
+ * Confirms the change with the code that arrived at the new address. The other sessions of the account are
457
+ * closed (the one making the call stays) and the answer is the buyer with the new, verified e-mail.
458
+ */
459
+ confirmChange: (input, options) => write("POST", "/storefront/customer/email/change/confirm", input, options)
460
+ },
436
461
  /**
437
462
  * The buyer's data as a JSON file (contract 1.9, `capabilities().data_export`). Needs a recent `reauth`. It is
438
463
  * built on request and is neither stored nor emailed: call it from YOUR server, stream the bytes