@asteby/storefront 0.14.0 → 0.16.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 { a_ as ProductSort, bw as TokenIntrospection, bo as Shop, b6 as Region, aY as ProductConnection, aV as Product, y as Connection, x as Collection, ah as LocationListParams, ae as Location, an as NearestLocation, bs as StockLevel, ba as RestockSubscriptionInput, bb as RestockSubscriptionResult, m as CartLineInput, C as Cart, p as CartLineUpdateInput, f as CartBuyerInput, a as AddressInput, Q as DeliveryOptions, aL as PaymentMethods, O as DeliveryInput, a9 as InvoiceRequest, b4 as RecommendationPlacement, s as CartRecommendations, u as CheckoutInput, w as CheckoutResult, b3 as PromotionsList, aH as PaymentConfig, aQ as PaymentSubmitInput, aD as PaymentAttemptResult, D as CustomerIdentifier, J as CustomerSessionInput, I as CustomerSession, B as CustomerCapabilities, F as CustomerRegisterInput, G as CustomerRegisterResult, M as CustomerVerifyRegistrationInput, E as CustomerPasswordLoginInput, K as CustomerSetPasswordInput, H as CustomerResetPasswordInput, z as Customer, L as CustomerUpdateInput, aq as Order, bd as ReturnRequestInput, bc as ReturnRequest, aa as InvoiceResult, aS as PendingPayment, a8 as InvoiceFileKind, a7 as InvoiceFile, A as Address, bv as Theme, aA as Page, aj as Menu, b as Article, bu as StorefrontErrorCode, a4 as InsufficientStockLine, al as Money, d as AvailabilityStatus, o as CartLineProblem, c as Availability, a$ as ProductVariant, N as DeclineCode, aR as PaymentVoucher, aM as PaymentNextStep, q as CartPromotions, b1 as PromotionReward, a6 as InvoiceDoc, bh as Shipment, ao as NextAction, au as OrderProgress, bl as ShipmentStatus, bi as ShipmentEvent, P as DeliveryMethod, bx as UnavailableRateProvider } from './types-BuKb-zbi.cjs';
4
- export { e as CartBuyer, g as CartCost, h as CartDelivery, i as CartDiscountCode, j as CartDiscountLine, k as CartInvoice, l as CartLine, n as CartLineMerchandise, r as CartRecommendation, t as CheckoutInfo, v as CheckoutPayment, R as Facet, S as FacetValue, T as FiscalDocumentEvidence, U as FiscalDocumentSource, V as FiscalIdentity, W as FiscalIdentityInput, X as FiscalVerification, Y as GeoHint, Z as IdentityCapture, _ as IdentityDocumentSpec, $ as IdentityFieldRule, a0 as IdentityRulesV1, a1 as IdentityStrategy, a2 as Image, a3 as InsufficientStockDetails, a5 as InvoiceAction, ab as InvoiceStage, ac as InvoiceSummary, ad as InvoicingCapabilities, af as LocationContacts, ag as LocationKind, ai as LocationPickup, ak as MenuItem, am as MoneyRange, ap as NextActionKind, ar as OrderLine, as as OrderPickup, at as OrderProblem, av as OrderProgressStep, aw as OrderSection, ax as OrderStage, ay as OrderStepKey, az as OrderStepState, aB as PageInfo, aC as PaymentAction, aE as PaymentAttemptStatus, aF as PaymentClient, aG as PaymentClientCsp, aI as PaymentFlow, aJ as PaymentInfo, aK as PaymentMethod, aN as PaymentOption, aO as PaymentOptionKey, aP as PaymentPoint, aT as PendingPaymentVoucher, aU as PickupOption, aW as ProductAttributeValue, aX as ProductCategory, aZ as ProductOption, b0 as PromotionAnnouncement, b2 as PromotionTier, b5 as Refund, b7 as RegionFiscalEntry, b8 as RegionFiscalId, b9 as RegionPaymentMethod, be as SEO, bf as Section, bg as SelectedOption, bj as ShipmentKind, bk as ShipmentMap, bm as ShipmentsSummary, bn as ShippingRate, bp as ShopBranch, bq as ShopContact, br as ShopPolicies, bt as StorefrontErrorBody } from './types-BuKb-zbi.cjs';
3
+ import { b0 as ProductSort, bz as TokenIntrospection, br as Shop, b8 as Region, bc as RegionPostalCode, a_ as ProductConnection, aX as Product, y as Connection, x as Collection, aj as LocationListParams, ag as Location, ap as NearestLocation, bv as StockLevel, bd as RestockSubscriptionInput, be as RestockSubscriptionResult, m as CartLineInput, C as Cart, p as CartLineUpdateInput, f as CartBuyerInput, a as AddressInput, Q as DeliveryOptions, aN as PaymentMethods, O as DeliveryInput, ab as InvoiceRequest, b6 as RecommendationPlacement, s as CartRecommendations, u as CheckoutInput, w as CheckoutResult, b5 as PromotionsList, aJ as PaymentConfig, aS as PaymentSubmitInput, aF as PaymentAttemptResult, D as CustomerIdentifier, J as CustomerSessionInput, I as CustomerSession, B as CustomerCapabilities, F as CustomerRegisterInput, G as CustomerRegisterResult, M as CustomerVerifyRegistrationInput, E as CustomerPasswordLoginInput, K as CustomerSetPasswordInput, H as CustomerResetPasswordInput, z as Customer, L as CustomerUpdateInput, as as Order, bg as ReturnRequestInput, bf as ReturnRequest, ac as InvoiceResult, aU as PendingPayment, aa as InvoiceFileKind, a9 as InvoiceFile, X as FiscalProfile, Y as FiscalProfileInput, A as Address, by as Theme, aC as Page, al as Menu, b as Article, bx as StorefrontErrorCode, a6 as InsufficientStockLine, an as Money, d as AvailabilityStatus, o as CartLineProblem, c as Availability, b1 as ProductVariant, N as DeclineCode, aT as PaymentVoucher, aO as PaymentNextStep, q as CartPromotions, b3 as PromotionReward, a8 as InvoiceDoc, bk as Shipment, aq as NextAction, aw as OrderProgress, bo as ShipmentStatus, bl as ShipmentEvent, P as DeliveryMethod, bA as UnavailableRateProvider } from './types-TQPpYbac.cjs';
4
+ export { e as CartBuyer, g as CartCost, h as CartDelivery, i as CartDiscountCode, j as CartDiscountLine, k as CartInvoice, l as CartLine, n as CartLineMerchandise, r as CartRecommendation, t as CheckoutInfo, v as CheckoutPayment, R as Facet, S as FacetValue, T as FiscalDocumentEvidence, U as FiscalDocumentSource, V as FiscalIdentity, W as FiscalIdentityInput, Z as FiscalVerification, _ as GeoHint, $ as IdentityCapture, a0 as IdentityDocumentSpec, a1 as IdentityFieldRule, a2 as IdentityRulesV1, a3 as IdentityStrategy, a4 as Image, a5 as InsufficientStockDetails, a7 as InvoiceAction, ad as InvoiceStage, ae as InvoiceSummary, af as InvoicingCapabilities, ah as LocationContacts, ai as LocationKind, ak as LocationPickup, am as MenuItem, ao as MoneyRange, ar as NextActionKind, at as OrderLine, au as OrderPickup, av as OrderProblem, ax as OrderProgressStep, ay as OrderSection, az as OrderStage, aA as OrderStepKey, aB as OrderStepState, aD as PageInfo, aE as PaymentAction, aG as PaymentAttemptStatus, aH as PaymentClient, aI as PaymentClientCsp, aK as PaymentFlow, aL as PaymentInfo, aM as PaymentMethod, aP as PaymentOption, aQ as PaymentOptionKey, aR as PaymentPoint, aV as PendingPaymentVoucher, aW as PickupOption, aY as ProductAttributeValue, aZ as ProductCategory, a$ as ProductOption, b2 as PromotionAnnouncement, b4 as PromotionTier, b7 as Refund, b9 as RegionFiscalEntry, ba as RegionFiscalId, bb as RegionPaymentMethod, bh as SEO, bi as Section, bj as SelectedOption, bm as ShipmentKind, bn as ShipmentMap, bp as ShipmentsSummary, bq as ShippingRate, bs as ShopBranch, bt as ShopContact, bu as ShopPolicies, bw as StorefrontErrorBody } from './types-TQPpYbac.cjs';
5
5
 
6
6
  type QueryValue = string | number | boolean | null | undefined;
7
7
  type QueryParams = Record<string, QueryValue | QueryValue[]>;
@@ -191,6 +191,12 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
191
191
  * has no region configured.
192
192
  */
193
193
  region: (options?: RequestOptions) => Promise<Region | null>;
194
+ /**
195
+ * State and municipality of a postal code from the region pack (`null` when the code is not in its catalog, or the
196
+ * organization has no region pack). The source of `AddressFields.lookupPostalCode`: the state it fills is the one
197
+ * the server checks the address against.
198
+ */
199
+ postalCode: (zip: string, options?: RequestOptions) => Promise<RegionPostalCode | null>;
194
200
  products: {
195
201
  list: (params?: ProductListParams, options?: RequestOptions) => Promise<ProductConnection>;
196
202
  /** `null` when the product does not exist or is unpublished. */
@@ -334,6 +340,18 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
334
340
  * (`invoiceFileBytes`). `null` when the order, the document or the file does not exist or is not the buyer's.
335
341
  */
336
342
  invoiceFile: (orderId: string, invoiceId: string, kind: InvoiceFileKind, options?: RequestOptions) => Promise<InvoiceFile | null>;
343
+ /**
344
+ * Saved fiscal profiles of the buyer (contract 1.9, `capabilities().fiscal_profiles`). Personal data: private,
345
+ * never cached, never logged. `422` with `field: 'fiscal.<field>'` when the region rejects a value; `409` for a
346
+ * repeated tax id or past the limit; `404` for a profile that is not the buyer's.
347
+ */
348
+ fiscalProfiles: {
349
+ list: (options?: RequestOptions) => Promise<FiscalProfile[]>;
350
+ create: (profile: FiscalProfileInput, options?: WriteOptions) => Promise<FiscalProfile>;
351
+ update: (id: string, profile: FiscalProfileInput, options?: WriteOptions) => Promise<FiscalProfile>;
352
+ /** Physical delete (a profile leaves nothing behind). A saved default passes to another profile. */
353
+ delete: (id: string, options?: WriteOptions) => Promise<void>;
354
+ };
337
355
  addresses: {
338
356
  list: (options?: RequestOptions) => Promise<{
339
357
  nodes: Address[];
@@ -881,4 +899,4 @@ type DeliveryNotices = {
881
899
  /** Splits `delivery.unavailable` into the `missing_weight` notice and the generic one. */
882
900
  declare function deliveryNotices(delivery: Pick<DeliveryOptions, 'unavailable' | 'partial'> | null | undefined): DeliveryNotices;
883
901
 
884
- 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, CustomerUpdateInput, CustomerVerifyRegistrationInput, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiagnoseOptions, type DiscountBarState, type DiscountBarView, type FetchLike, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, InvoiceRequest, InvoiceResult, Location, LocationListParams, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, 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, RecommendationPlacement, Region, type RequestOptions, type ResolveAvailabilityOptions, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, SHIPPING_STEPS, Shipment, ShipmentEvent, ShipmentStatus, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, StorefrontError, StorefrontErrorCode, type StorefrontErrorInit, type StorefrontRequestContext, type StorefrontResponseContext, Theme, TokenIntrospection, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isStorefrontError, isTestInvoice, isTestShipment, isTokenPublishable, maskToken, negotiateLocale, nextAction, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, repairPath, resolveAvailability, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, storefrontDomainHeader, suggestMarket, toMoney, visitorCountry };
902
+ 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, CustomerUpdateInput, CustomerVerifyRegistrationInput, 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, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, 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, RecommendationPlacement, Region, RegionPostalCode, type RequestOptions, type ResolveAvailabilityOptions, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, SHIPPING_STEPS, Shipment, ShipmentEvent, ShipmentStatus, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, StorefrontError, StorefrontErrorCode, type StorefrontErrorInit, type StorefrontRequestContext, type StorefrontResponseContext, Theme, TokenIntrospection, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isStorefrontError, isTestInvoice, isTestShipment, isTokenPublishable, maskToken, negotiateLocale, nextAction, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, repairPath, resolveAvailability, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, 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 { a_ as ProductSort, bw as TokenIntrospection, bo as Shop, b6 as Region, aY as ProductConnection, aV as Product, y as Connection, x as Collection, ah as LocationListParams, ae as Location, an as NearestLocation, bs as StockLevel, ba as RestockSubscriptionInput, bb as RestockSubscriptionResult, m as CartLineInput, C as Cart, p as CartLineUpdateInput, f as CartBuyerInput, a as AddressInput, Q as DeliveryOptions, aL as PaymentMethods, O as DeliveryInput, a9 as InvoiceRequest, b4 as RecommendationPlacement, s as CartRecommendations, u as CheckoutInput, w as CheckoutResult, b3 as PromotionsList, aH as PaymentConfig, aQ as PaymentSubmitInput, aD as PaymentAttemptResult, D as CustomerIdentifier, J as CustomerSessionInput, I as CustomerSession, B as CustomerCapabilities, F as CustomerRegisterInput, G as CustomerRegisterResult, M as CustomerVerifyRegistrationInput, E as CustomerPasswordLoginInput, K as CustomerSetPasswordInput, H as CustomerResetPasswordInput, z as Customer, L as CustomerUpdateInput, aq as Order, bd as ReturnRequestInput, bc as ReturnRequest, aa as InvoiceResult, aS as PendingPayment, a8 as InvoiceFileKind, a7 as InvoiceFile, A as Address, bv as Theme, aA as Page, aj as Menu, b as Article, bu as StorefrontErrorCode, a4 as InsufficientStockLine, al as Money, d as AvailabilityStatus, o as CartLineProblem, c as Availability, a$ as ProductVariant, N as DeclineCode, aR as PaymentVoucher, aM as PaymentNextStep, q as CartPromotions, b1 as PromotionReward, a6 as InvoiceDoc, bh as Shipment, ao as NextAction, au as OrderProgress, bl as ShipmentStatus, bi as ShipmentEvent, P as DeliveryMethod, bx as UnavailableRateProvider } from './types-BeTemDg6.js';
4
- export { e as CartBuyer, g as CartCost, h as CartDelivery, i as CartDiscountCode, j as CartDiscountLine, k as CartInvoice, l as CartLine, n as CartLineMerchandise, r as CartRecommendation, t as CheckoutInfo, v as CheckoutPayment, R as Facet, S as FacetValue, T as FiscalDocumentEvidence, U as FiscalDocumentSource, V as FiscalIdentity, W as FiscalIdentityInput, X as FiscalVerification, Y as GeoHint, Z as IdentityCapture, _ as IdentityDocumentSpec, $ as IdentityFieldRule, a0 as IdentityRulesV1, a1 as IdentityStrategy, a2 as Image, a3 as InsufficientStockDetails, a5 as InvoiceAction, ab as InvoiceStage, ac as InvoiceSummary, ad as InvoicingCapabilities, af as LocationContacts, ag as LocationKind, ai as LocationPickup, ak as MenuItem, am as MoneyRange, ap as NextActionKind, ar as OrderLine, as as OrderPickup, at as OrderProblem, av as OrderProgressStep, aw as OrderSection, ax as OrderStage, ay as OrderStepKey, az as OrderStepState, aB as PageInfo, aC as PaymentAction, aE as PaymentAttemptStatus, aF as PaymentClient, aG as PaymentClientCsp, aI as PaymentFlow, aJ as PaymentInfo, aK as PaymentMethod, aN as PaymentOption, aO as PaymentOptionKey, aP as PaymentPoint, aT as PendingPaymentVoucher, aU as PickupOption, aW as ProductAttributeValue, aX as ProductCategory, aZ as ProductOption, b0 as PromotionAnnouncement, b2 as PromotionTier, b5 as Refund, b7 as RegionFiscalEntry, b8 as RegionFiscalId, b9 as RegionPaymentMethod, be as SEO, bf as Section, bg as SelectedOption, bj as ShipmentKind, bk as ShipmentMap, bm as ShipmentsSummary, bn as ShippingRate, bp as ShopBranch, bq as ShopContact, br as ShopPolicies, bt as StorefrontErrorBody } from './types-BeTemDg6.js';
3
+ import { b0 as ProductSort, bz as TokenIntrospection, br as Shop, b8 as Region, bc as RegionPostalCode, a_ as ProductConnection, aX as Product, y as Connection, x as Collection, aj as LocationListParams, ag as Location, ap as NearestLocation, bv as StockLevel, bd as RestockSubscriptionInput, be as RestockSubscriptionResult, m as CartLineInput, C as Cart, p as CartLineUpdateInput, f as CartBuyerInput, a as AddressInput, Q as DeliveryOptions, aN as PaymentMethods, O as DeliveryInput, ab as InvoiceRequest, b6 as RecommendationPlacement, s as CartRecommendations, u as CheckoutInput, w as CheckoutResult, b5 as PromotionsList, aJ as PaymentConfig, aS as PaymentSubmitInput, aF as PaymentAttemptResult, D as CustomerIdentifier, J as CustomerSessionInput, I as CustomerSession, B as CustomerCapabilities, F as CustomerRegisterInput, G as CustomerRegisterResult, M as CustomerVerifyRegistrationInput, E as CustomerPasswordLoginInput, K as CustomerSetPasswordInput, H as CustomerResetPasswordInput, z as Customer, L as CustomerUpdateInput, as as Order, bg as ReturnRequestInput, bf as ReturnRequest, ac as InvoiceResult, aU as PendingPayment, aa as InvoiceFileKind, a9 as InvoiceFile, X as FiscalProfile, Y as FiscalProfileInput, A as Address, by as Theme, aC as Page, al as Menu, b as Article, bx as StorefrontErrorCode, a6 as InsufficientStockLine, an as Money, d as AvailabilityStatus, o as CartLineProblem, c as Availability, b1 as ProductVariant, N as DeclineCode, aT as PaymentVoucher, aO as PaymentNextStep, q as CartPromotions, b3 as PromotionReward, a8 as InvoiceDoc, bk as Shipment, aq as NextAction, aw as OrderProgress, bo as ShipmentStatus, bl as ShipmentEvent, P as DeliveryMethod, bA as UnavailableRateProvider } from './types-DFK20t_g.js';
4
+ export { e as CartBuyer, g as CartCost, h as CartDelivery, i as CartDiscountCode, j as CartDiscountLine, k as CartInvoice, l as CartLine, n as CartLineMerchandise, r as CartRecommendation, t as CheckoutInfo, v as CheckoutPayment, R as Facet, S as FacetValue, T as FiscalDocumentEvidence, U as FiscalDocumentSource, V as FiscalIdentity, W as FiscalIdentityInput, Z as FiscalVerification, _ as GeoHint, $ as IdentityCapture, a0 as IdentityDocumentSpec, a1 as IdentityFieldRule, a2 as IdentityRulesV1, a3 as IdentityStrategy, a4 as Image, a5 as InsufficientStockDetails, a7 as InvoiceAction, ad as InvoiceStage, ae as InvoiceSummary, af as InvoicingCapabilities, ah as LocationContacts, ai as LocationKind, ak as LocationPickup, am as MenuItem, ao as MoneyRange, ar as NextActionKind, at as OrderLine, au as OrderPickup, av as OrderProblem, ax as OrderProgressStep, ay as OrderSection, az as OrderStage, aA as OrderStepKey, aB as OrderStepState, aD as PageInfo, aE as PaymentAction, aG as PaymentAttemptStatus, aH as PaymentClient, aI as PaymentClientCsp, aK as PaymentFlow, aL as PaymentInfo, aM as PaymentMethod, aP as PaymentOption, aQ as PaymentOptionKey, aR as PaymentPoint, aV as PendingPaymentVoucher, aW as PickupOption, aY as ProductAttributeValue, aZ as ProductCategory, a$ as ProductOption, b2 as PromotionAnnouncement, b4 as PromotionTier, b7 as Refund, b9 as RegionFiscalEntry, ba as RegionFiscalId, bb as RegionPaymentMethod, bh as SEO, bi as Section, bj as SelectedOption, bm as ShipmentKind, bn as ShipmentMap, bp as ShipmentsSummary, bq as ShippingRate, bs as ShopBranch, bt as ShopContact, bu as ShopPolicies, bw as StorefrontErrorBody } from './types-DFK20t_g.js';
5
5
 
6
6
  type QueryValue = string | number | boolean | null | undefined;
7
7
  type QueryParams = Record<string, QueryValue | QueryValue[]>;
@@ -191,6 +191,12 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
191
191
  * has no region configured.
192
192
  */
193
193
  region: (options?: RequestOptions) => Promise<Region | null>;
194
+ /**
195
+ * State and municipality of a postal code from the region pack (`null` when the code is not in its catalog, or the
196
+ * organization has no region pack). The source of `AddressFields.lookupPostalCode`: the state it fills is the one
197
+ * the server checks the address against.
198
+ */
199
+ postalCode: (zip: string, options?: RequestOptions) => Promise<RegionPostalCode | null>;
194
200
  products: {
195
201
  list: (params?: ProductListParams, options?: RequestOptions) => Promise<ProductConnection>;
196
202
  /** `null` when the product does not exist or is unpublished. */
@@ -334,6 +340,18 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
334
340
  * (`invoiceFileBytes`). `null` when the order, the document or the file does not exist or is not the buyer's.
335
341
  */
336
342
  invoiceFile: (orderId: string, invoiceId: string, kind: InvoiceFileKind, options?: RequestOptions) => Promise<InvoiceFile | null>;
343
+ /**
344
+ * Saved fiscal profiles of the buyer (contract 1.9, `capabilities().fiscal_profiles`). Personal data: private,
345
+ * never cached, never logged. `422` with `field: 'fiscal.<field>'` when the region rejects a value; `409` for a
346
+ * repeated tax id or past the limit; `404` for a profile that is not the buyer's.
347
+ */
348
+ fiscalProfiles: {
349
+ list: (options?: RequestOptions) => Promise<FiscalProfile[]>;
350
+ create: (profile: FiscalProfileInput, options?: WriteOptions) => Promise<FiscalProfile>;
351
+ update: (id: string, profile: FiscalProfileInput, options?: WriteOptions) => Promise<FiscalProfile>;
352
+ /** Physical delete (a profile leaves nothing behind). A saved default passes to another profile. */
353
+ delete: (id: string, options?: WriteOptions) => Promise<void>;
354
+ };
337
355
  addresses: {
338
356
  list: (options?: RequestOptions) => Promise<{
339
357
  nodes: Address[];
@@ -881,4 +899,4 @@ type DeliveryNotices = {
881
899
  /** Splits `delivery.unavailable` into the `missing_weight` notice and the generic one. */
882
900
  declare function deliveryNotices(delivery: Pick<DeliveryOptions, 'unavailable' | 'partial'> | null | undefined): DeliveryNotices;
883
901
 
884
- 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, CustomerUpdateInput, CustomerVerifyRegistrationInput, DeclineCode, type DeliveryChoice, type DeliveryChoiceKind, DeliveryInput, DeliveryMethod, type DeliveryNotices, DeliveryOptions, type DiagnoseOptions, type DiscountBarState, type DiscountBarView, type FetchLike, type FormatMoneyOptions, GeoPoint, InsufficientStockLine, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, InvoiceRequest, InvoiceResult, Location, LocationListParams, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, 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, RecommendationPlacement, Region, type RequestOptions, type ResolveAvailabilityOptions, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, SHIPPING_STEPS, Shipment, ShipmentEvent, ShipmentStatus, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, StorefrontError, StorefrontErrorCode, type StorefrontErrorInit, type StorefrontRequestContext, type StorefrontResponseContext, Theme, TokenIntrospection, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isStorefrontError, isTestInvoice, isTestShipment, isTokenPublishable, maskToken, negotiateLocale, nextAction, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, repairPath, resolveAvailability, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, storefrontDomainHeader, suggestMarket, toMoney, visitorCountry };
902
+ 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, CustomerUpdateInput, CustomerVerifyRegistrationInput, 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, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, 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, RecommendationPlacement, Region, RegionPostalCode, type RequestOptions, type ResolveAvailabilityOptions, RestockSubscriptionInput, RestockSubscriptionResult, ReturnRequest, ReturnRequestInput, SHIPPING_STEPS, Shipment, ShipmentEvent, ShipmentStatus, type ShippingBarState, type ShippingBarView, Shop, StockLevel, type StorefrontClient, type StorefrontClientOptions, StorefrontError, StorefrontErrorCode, type StorefrontErrorInit, type StorefrontRequestContext, type StorefrontResponseContext, Theme, TokenIntrospection, UnavailableRateProvider, type WriteOptions, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isStorefrontError, isTestInvoice, isTestShipment, isTokenPublishable, maskToken, negotiateLocale, nextAction, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, productAvailability, productListQuery, promoProgressView, promotionMessages, repairPath, resolveAvailability, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, storefrontDomainHeader, suggestMarket, toMoney, visitorCountry };
package/dist/index.js CHANGED
@@ -279,6 +279,12 @@ function createStorefrontClient(config) {
279
279
  * has no region configured.
280
280
  */
281
281
  region: (options) => getOrNull("/storefront/region", void 0, options),
282
+ /**
283
+ * State and municipality of a postal code from the region pack (`null` when the code is not in its catalog, or the
284
+ * organization has no region pack). The source of `AddressFields.lookupPostalCode`: the state it fills is the one
285
+ * the server checks the address against.
286
+ */
287
+ postalCode: (zip, options) => getOrNull("/storefront/region/postal-code", { zip: zip.trim() }, options),
282
288
  products: {
283
289
  list: (params, options) => get("/storefront/products", productListQuery(params), options),
284
290
  /** `null` when the product does not exist or is unpublished. */
@@ -442,6 +448,18 @@ function createStorefrontClient(config) {
442
448
  }
443
449
  return { filename: file.filename, content_type: file.content_type, content_base64: file.content_base64 };
444
450
  },
451
+ /**
452
+ * Saved fiscal profiles of the buyer (contract 1.9, `capabilities().fiscal_profiles`). Personal data: private,
453
+ * never cached, never logged. `422` with `field: 'fiscal.<field>'` when the region rejects a value; `409` for a
454
+ * repeated tax id or past the limit; `404` for a profile that is not the buyer's.
455
+ */
456
+ fiscalProfiles: {
457
+ list: async (options) => (await get("/storefront/customer/fiscal-profiles", void 0, { ...options, cache: "no-store" })).nodes,
458
+ create: (profile, options) => write("POST", "/storefront/customer/fiscal-profiles", profile, options),
459
+ update: (id, profile, options) => write("PATCH", `/storefront/customer/fiscal-profiles/${enc(id)}`, profile, options),
460
+ /** Physical delete (a profile leaves nothing behind). A saved default passes to another profile. */
461
+ delete: (id, options) => write("DELETE", `/storefront/customer/fiscal-profiles/${enc(id)}`, void 0, options)
462
+ },
445
463
  addresses: {
446
464
  list: (options) => get("/storefront/customer/addresses", void 0, options),
447
465
  create: (address, options) => write("POST", "/storefront/customer/addresses", address, options),