@asteby/storefront 0.25.0 → 0.27.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/{account-settings-mTEXvtfz.d.ts → account-settings-Cio2mAvd.d.ts} +44 -1
- package/dist/{account-settings-DOAM5mTk.d.cts → account-settings-DghDmuaI.d.cts} +44 -1
- package/dist/{chunk-5BJRZIS3.js → chunk-ZLVXWHHQ.js} +17 -3
- package/dist/chunk-ZLVXWHHQ.js.map +1 -0
- package/dist/cli.js +21 -1
- package/dist/fiscal-document.d.cts +2 -2
- package/dist/fiscal-document.d.ts +2 -2
- package/dist/index.cjs +36 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -4
- package/dist/index.d.ts +20 -4
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/dist/mock.cjs.map +1 -1
- package/dist/mock.d.cts +1 -1
- package/dist/mock.d.ts +1 -1
- package/dist/mock.js +1 -1
- package/dist/mockup.d.cts +1 -1
- package/dist/mockup.d.ts +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5BJRZIS3.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bf as ProductSort, c1 as TokenIntrospection, bK as Shop, bp as Region, bt as RegionPostalCode, d as AddressSuggestions, bd as ProductConnection, ba as Product, D as Connection, B as Collection, aw as LocationListParams, at as Location, aC as NearestLocation, bO as StockLevel, bu as RestockSubscriptionInput, bv as RestockSubscriptionResult, p as CartLineInput, C as Cart, s as CartLineUpdateInput, i as CartBuyerInput, b as AddressInput, _ as DeliveryOptions, b0 as PaymentMethods, Y as DeliveryInput, ao as InvoiceRequest, bn as RecommendationPlacement, v as CartRecommendations, x as CheckoutInput, z as CheckoutResult, bk as PromotionsList, aY as PaymentConfig, b5 as PaymentSubmitInput, aU as PaymentAttemptResult, K as CustomerIdentifier, S as CustomerSessionInput, Q as CustomerSession, F as CustomerCapabilities, N as CustomerRegisterInput, O as CustomerRegisterResult, V as CustomerVerifyRegistrationInput, L as CustomerPasswordLoginInput, T as CustomerSetPasswordInput, P as CustomerResetPasswordInput, E as Customer, U as CustomerUpdateInput, R as CustomerSessionInfo, bl as ReauthInput, bm as ReauthResult, J as CustomerEmailCodeInput, H as CustomerEmailChangeInput, I as CustomerEmailChangeRequested, G as CustomerEmailChangeConfirmInput, W as DataExportFile, A as AccountDeleteInput, aF as Order, ai as InvoiceConnection, bC as ShipmentConnection, bx as ReturnRequestInput, bw as ReturnRequest, ap as InvoiceResult, b7 as PendingPayment, al as InvoiceFileKind, ak as InvoiceFile, a5 as FiscalProfile, a6 as FiscalProfileInput, bT as Subject, bY as SubjectInput, b_ as SubjectPatch, a as Address, bZ as SubjectKind, c0 as Theme, aR as Page, ay as Menu, e as Article, aA as Money, g as AvailabilityStatus, r as CartLineProblem, f as Availability, ag as InsufficientStockLine, bg as ProductVariant, X as DeclineCode, b6 as PaymentVoucher, b1 as PaymentNextStep, t as CartPromotions, bi as PromotionReward, aj as InvoiceDoc, bB as Shipment, aD as NextAction, aJ as OrderProgress, bH as ShipmentStatus, bD as ShipmentEvent, bV as SubjectCatalogNode, bW as SubjectField, Z as DeliveryMethod,
|
|
2
|
-
export { c as AddressSuggestion, h as CartBuyer, j as CartCost, k as CartDelivery, l as CartDiscountCode, m as CartDiscountLine, n as CartInvoice,
|
|
1
|
+
import { bf as ProductSort, c1 as TokenIntrospection, bK as Shop, bp as Region, bt as RegionPostalCode, d as AddressSuggestions, bd as ProductConnection, ba as Product, D as Connection, B as Collection, aw as LocationListParams, at as Location, aC as NearestLocation, bO as StockLevel, bu as RestockSubscriptionInput, bv as RestockSubscriptionResult, p as CartLineInput, C as Cart, s as CartLineUpdateInput, i as CartBuyerInput, b as AddressInput, _ as DeliveryOptions, b0 as PaymentMethods, Y as DeliveryInput, ao as InvoiceRequest, bn as RecommendationPlacement, v as CartRecommendations, x as CheckoutInput, z as CheckoutResult, bk as PromotionsList, aY as PaymentConfig, b5 as PaymentSubmitInput, aU as PaymentAttemptResult, c3 as TrackingLookupInput, c4 as TrackingLookupResult, K as CustomerIdentifier, S as CustomerSessionInput, Q as CustomerSession, F as CustomerCapabilities, N as CustomerRegisterInput, O as CustomerRegisterResult, V as CustomerVerifyRegistrationInput, L as CustomerPasswordLoginInput, T as CustomerSetPasswordInput, P as CustomerResetPasswordInput, E as Customer, U as CustomerUpdateInput, R as CustomerSessionInfo, bl as ReauthInput, bm as ReauthResult, J as CustomerEmailCodeInput, H as CustomerEmailChangeInput, I as CustomerEmailChangeRequested, G as CustomerEmailChangeConfirmInput, W as DataExportFile, A as AccountDeleteInput, aF as Order, ai as InvoiceConnection, bC as ShipmentConnection, bx as ReturnRequestInput, bw as ReturnRequest, ap as InvoiceResult, b7 as PendingPayment, al as InvoiceFileKind, ak as InvoiceFile, a5 as FiscalProfile, a6 as FiscalProfileInput, bT as Subject, bY as SubjectInput, b_ as SubjectPatch, a as Address, bZ as SubjectKind, c0 as Theme, aR as Page, ay as Menu, e as Article, aA as Money, g as AvailabilityStatus, r as CartLineProblem, f as Availability, ag as InsufficientStockLine, o as CartLine, bg as ProductVariant, X as DeclineCode, b6 as PaymentVoucher, b1 as PaymentNextStep, t as CartPromotions, bi as PromotionReward, aj as InvoiceDoc, bB as Shipment, aD as NextAction, aJ as OrderProgress, bH as ShipmentStatus, bD as ShipmentEvent, bV as SubjectCatalogNode, bW as SubjectField, Z as DeliveryMethod, c6 as UnavailableRateProvider, aS as PageInfo } from './account-settings-DghDmuaI.cjs';
|
|
2
|
+
export { c as AddressSuggestion, h as CartBuyer, j as CartCost, k as CartDelivery, l as CartDiscountCode, m as CartDiscountLine, n as CartInvoice, q as CartLineMerchandise, u as CartRecommendation, w as CheckoutInfo, y as CheckoutPayment, M as CustomerPreferences, $ as Facet, a0 as FacetValue, a1 as FiscalDocumentEvidence, a2 as FiscalDocumentSource, a3 as FiscalIdentity, a4 as FiscalIdentityInput, a7 as FiscalVerification, a8 as GeoHint, a9 as IdentityCapture, aa as IdentityDocumentSpec, ab as IdentityFieldRule, ac as IdentityRulesV1, ad as IdentityStrategy, ae as Image, af as InsufficientStockDetails, ah as InvoiceAction, am as InvoiceListNode, an as InvoiceReceiver, aq as InvoiceStage, ar as InvoiceSummary, as as InvoicingCapabilities, au as LocationContacts, av as LocationKind, ax as LocationPickup, az as MenuItem, aB as MoneyRange, aE as NextActionKind, aG as OrderLine, aH as OrderPickup, aI as OrderProblem, aK as OrderProgressStep, aL as OrderRef, aM as OrderSection, aN as OrderShippingService, aO as OrderStage, aP as OrderStepKey, aQ as OrderStepState, aT as PaymentAction, aV as PaymentAttemptStatus, aW as PaymentClient, aX as PaymentClientCsp, aZ as PaymentFlow, a_ as PaymentInfo, a$ as PaymentMethod, b2 as PaymentOption, b3 as PaymentOptionKey, b4 as PaymentPoint, b8 as PendingPaymentVoucher, b9 as PickupOption, bb as ProductAttributeValue, bc as ProductCategory, be as ProductOption, bh as PromotionAnnouncement, bj as PromotionTier, bo as Refund, bq as RegionFiscalEntry, br as RegionFiscalId, bs as RegionPaymentMethod, by as SEO, bz as Section, bA as SelectedOption, bE as ShipmentKind, bF as ShipmentListNode, bG as ShipmentMap, bI as ShipmentsSummary, bJ as ShippingRate, bL as ShopBranch, bM as ShopContact, bN as ShopPolicies, bP as StorefrontError, bQ as StorefrontErrorBody, bR as StorefrontErrorCode, bS as StorefrontErrorInit, bU as SubjectCatalog, bX as SubjectFieldType, b$ as SubjectRef, c2 as TrackingEventView, c5 as TrackingView, c7 as dataExportBytes, c8 as isAccountDeleteBlocked, c9 as isReauthRequired, ca as isStorefrontError, cb as safeExportFilename } from './account-settings-DghDmuaI.cjs';
|
|
3
3
|
import { GeoPoint } from './geo.cjs';
|
|
4
4
|
export { OpenStatus, OpeningHours } from './geo.cjs';
|
|
5
5
|
|
|
@@ -363,6 +363,15 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
|
|
|
363
363
|
*/
|
|
364
364
|
get: (id: string, options?: RequestOptions) => Promise<CheckoutResult | null>;
|
|
365
365
|
};
|
|
366
|
+
/**
|
|
367
|
+
* Public "where is my order" lookup (`POST /storefront/customer/track`): by order number + email, or by the guide
|
|
368
|
+
* printed on the parcel. No buyer session. Every failure is one of three plain answers, so a miss never tells a
|
|
369
|
+
* real order from an unknown one: `not_found`, `rate_limited` (with `retryAfter` seconds when known) or
|
|
370
|
+
* `unavailable` (the server or the network failed). Needs the store to enable the route.
|
|
371
|
+
*/
|
|
372
|
+
tracking: {
|
|
373
|
+
lookup: (input: TrackingLookupInput, options?: WriteOptions) => Promise<TrackingLookupResult>;
|
|
374
|
+
};
|
|
366
375
|
customer: {
|
|
367
376
|
/** Sends a one-time code by email or SMS/WhatsApp. */
|
|
368
377
|
requestOtp: (identifier: CustomerIdentifier, options?: WriteOptions) => Promise<void>;
|
|
@@ -649,7 +658,7 @@ declare function isTokenPublishable(token: string | null | undefined): boolean;
|
|
|
649
658
|
type AvailabilityTone = 'success' | 'warning' | 'danger' | 'info';
|
|
650
659
|
type AvailabilityLocale = 'es' | 'en';
|
|
651
660
|
/** Text keys, overridable per shop. `{n}` and `{date}` are replaced. */
|
|
652
|
-
type AvailabilityMessageKey = 'status.in_stock' | 'status.low_stock' | 'status.low_stock_n' | 'status.out_of_stock' | 'status.backorder' | 'status.preorder' | 'sub.backorder_eta' | 'sub.preorder_date' | 'cta.add' | 'cta.out_of_stock' | 'cta.backorder' | 'cta.preorder' | 'sr.in_stock' | 'sr.low_stock' | 'sr.low_stock_n' | 'sr.out_of_stock' | 'sr.backorder' | 'sr.preorder' | 'option.sold_out' | 'option.backorder' | 'option.preorder' | 'max_per_order' | 'notify.title' | 'notify.email' | 'notify.phone' | 'notify.consent' | 'notify.submit' | 'notify.done' | 'notify.error' | 'problem.out_of_stock' | 'problem.insufficient_stock' | 'problem.insufficient_stock_n' | 'problem.adjust' | 'problem.remove' | 'conflict.title' | 'conflict.body' | 'conflict.dismiss';
|
|
661
|
+
type AvailabilityMessageKey = 'status.in_stock' | 'status.low_stock' | 'status.low_stock_n' | 'status.out_of_stock' | 'status.backorder' | 'status.preorder' | 'sub.backorder_eta' | 'sub.preorder_date' | 'line.ships_on' | 'cta.add' | 'cta.out_of_stock' | 'cta.backorder' | 'cta.preorder' | 'sr.in_stock' | 'sr.low_stock' | 'sr.low_stock_n' | 'sr.out_of_stock' | 'sr.backorder' | 'sr.preorder' | 'option.sold_out' | 'option.backorder' | 'option.preorder' | 'max_per_order' | 'notify.title' | 'notify.email' | 'notify.phone' | 'notify.consent' | 'notify.submit' | 'notify.done' | 'notify.error' | 'problem.out_of_stock' | 'problem.insufficient_stock' | 'problem.insufficient_stock_n' | 'problem.adjust' | 'problem.remove' | 'conflict.title' | 'conflict.body' | 'conflict.dismiss';
|
|
653
662
|
type AvailabilityMessages = Record<AvailabilityMessageKey, string>;
|
|
654
663
|
/** `es-MX` -> `es`, `en-US` -> `en`; anything else falls back to Spanish. */
|
|
655
664
|
declare function availabilityLocale(locale: string | null | undefined): AvailabilityLocale;
|
|
@@ -657,6 +666,13 @@ declare function availabilityLocale(locale: string | null | undefined): Availabi
|
|
|
657
666
|
declare function availabilityMessages(locale: string | null | undefined, overrides?: Partial<AvailabilityMessages> | null): AvailabilityMessages;
|
|
658
667
|
/** Replaces `{name}` placeholders. */
|
|
659
668
|
declare function formatAvailabilityMessage(template: string, values?: Record<string, string | number>): string;
|
|
669
|
+
/**
|
|
670
|
+
* Ship date of a cart line, `YYYY-MM-DD`, or `null`. Pure: it only picks what the server
|
|
671
|
+
* sent (`ships_on`, else `availability.restock_eta`, else the date part of `preorder_release_at`).
|
|
672
|
+
*/
|
|
673
|
+
declare function lineShipDate(line: Pick<CartLine, 'ships_on' | 'availability'>): string | null;
|
|
674
|
+
/** Localized "Ships on: {date}" for a cart line, or `null` without a date. */
|
|
675
|
+
declare function lineShipLabel(line: Pick<CartLine, 'ships_on' | 'availability'>, locale: string | null | undefined, overrides?: Partial<AvailabilityMessages> | null): string | null;
|
|
660
676
|
type ResolveAvailabilityOptions = {
|
|
661
677
|
/**
|
|
662
678
|
* Polyfill only: shop-level "low stock" threshold to derive `low_stock` from
|
|
@@ -1163,4 +1179,4 @@ declare function pageRange(state: Pick<ListPageState, 'query' | 'pageInfo' | 'co
|
|
|
1163
1179
|
total: number | null;
|
|
1164
1180
|
} | null;
|
|
1165
1181
|
|
|
1166
|
-
export { AccountDeleteInput, type AccountListParams, Address, AddressInput, type AddressSuggestParams, AddressSuggestions, 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, InvoiceConnection, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, type InvoiceListParams, InvoiceRequest, InvoiceResult, LIST_URL_EN, LIST_URL_ES, type ListPageState, type ListQuery, type ListUrlNames, Location, LocationListParams, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, type OrderListParams, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, PRIVATE_MASK, Page, PageInfo, 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, ShipmentConnection, ShipmentEvent, type ShipmentListParams, 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, accountListQuery, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, coversYear, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, firstPageQuery, fitTag, fitTagsAny, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isFiltered, isMasked, isTestInvoice, isTestShipment, isTokenPublishable, listApiParams, listHref, listQueryString, maskToken, negotiateLocale, nextAction, nextPageQuery, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, pagePosition, pageRange, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, previousPageQuery, productAvailability, productListQuery, promoProgressView, promotionMessages, readListQuery, reconcileSubjectValues, repairPath, resolveAvailability, resolveSubject, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, splitSubjectTree, storefrontDomainHeader, subjectFields, subjectLevels, subjectOptions, suggestMarket, toMoney, visitorCountry };
|
|
1182
|
+
export { AccountDeleteInput, type AccountListParams, Address, AddressInput, type AddressSuggestParams, AddressSuggestions, Article, type ArticleListParams, Availability, type AvailabilityLocale, type AvailabilityMessageKey, type AvailabilityMessages, AvailabilityStatus, type AvailabilityTone, type AvailabilityView, type AvailabilityViewOptions, CLIENT_IP_HEADER, COUNTRY_HEADERS, Cart, CartBuyerInput, CartLine, 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, InvoiceConnection, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, type InvoiceListParams, InvoiceRequest, InvoiceResult, LIST_URL_EN, LIST_URL_ES, type ListPageState, type ListQuery, type ListUrlNames, Location, LocationListParams, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, type OrderListParams, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, PRIVATE_MASK, Page, PageInfo, 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, ShipmentConnection, ShipmentEvent, type ShipmentListParams, 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, TrackingLookupInput, TrackingLookupResult, UnavailableRateProvider, type WriteOptions, accountListQuery, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, coversYear, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, firstPageQuery, fitTag, fitTagsAny, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isFiltered, isMasked, isTestInvoice, isTestShipment, isTokenPublishable, lineShipDate, lineShipLabel, listApiParams, listHref, listQueryString, maskToken, negotiateLocale, nextAction, nextPageQuery, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, pagePosition, pageRange, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, previousPageQuery, productAvailability, productListQuery, promoProgressView, promotionMessages, readListQuery, 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 { bf as ProductSort, c1 as TokenIntrospection, bK as Shop, bp as Region, bt as RegionPostalCode, d as AddressSuggestions, bd as ProductConnection, ba as Product, D as Connection, B as Collection, aw as LocationListParams, at as Location, aC as NearestLocation, bO as StockLevel, bu as RestockSubscriptionInput, bv as RestockSubscriptionResult, p as CartLineInput, C as Cart, s as CartLineUpdateInput, i as CartBuyerInput, b as AddressInput, _ as DeliveryOptions, b0 as PaymentMethods, Y as DeliveryInput, ao as InvoiceRequest, bn as RecommendationPlacement, v as CartRecommendations, x as CheckoutInput, z as CheckoutResult, bk as PromotionsList, aY as PaymentConfig, b5 as PaymentSubmitInput, aU as PaymentAttemptResult, K as CustomerIdentifier, S as CustomerSessionInput, Q as CustomerSession, F as CustomerCapabilities, N as CustomerRegisterInput, O as CustomerRegisterResult, V as CustomerVerifyRegistrationInput, L as CustomerPasswordLoginInput, T as CustomerSetPasswordInput, P as CustomerResetPasswordInput, E as Customer, U as CustomerUpdateInput, R as CustomerSessionInfo, bl as ReauthInput, bm as ReauthResult, J as CustomerEmailCodeInput, H as CustomerEmailChangeInput, I as CustomerEmailChangeRequested, G as CustomerEmailChangeConfirmInput, W as DataExportFile, A as AccountDeleteInput, aF as Order, ai as InvoiceConnection, bC as ShipmentConnection, bx as ReturnRequestInput, bw as ReturnRequest, ap as InvoiceResult, b7 as PendingPayment, al as InvoiceFileKind, ak as InvoiceFile, a5 as FiscalProfile, a6 as FiscalProfileInput, bT as Subject, bY as SubjectInput, b_ as SubjectPatch, a as Address, bZ as SubjectKind, c0 as Theme, aR as Page, ay as Menu, e as Article, aA as Money, g as AvailabilityStatus, r as CartLineProblem, f as Availability, ag as InsufficientStockLine, bg as ProductVariant, X as DeclineCode, b6 as PaymentVoucher, b1 as PaymentNextStep, t as CartPromotions, bi as PromotionReward, aj as InvoiceDoc, bB as Shipment, aD as NextAction, aJ as OrderProgress, bH as ShipmentStatus, bD as ShipmentEvent, bV as SubjectCatalogNode, bW as SubjectField, Z as DeliveryMethod,
|
|
2
|
-
export { c as AddressSuggestion, h as CartBuyer, j as CartCost, k as CartDelivery, l as CartDiscountCode, m as CartDiscountLine, n as CartInvoice,
|
|
1
|
+
import { bf as ProductSort, c1 as TokenIntrospection, bK as Shop, bp as Region, bt as RegionPostalCode, d as AddressSuggestions, bd as ProductConnection, ba as Product, D as Connection, B as Collection, aw as LocationListParams, at as Location, aC as NearestLocation, bO as StockLevel, bu as RestockSubscriptionInput, bv as RestockSubscriptionResult, p as CartLineInput, C as Cart, s as CartLineUpdateInput, i as CartBuyerInput, b as AddressInput, _ as DeliveryOptions, b0 as PaymentMethods, Y as DeliveryInput, ao as InvoiceRequest, bn as RecommendationPlacement, v as CartRecommendations, x as CheckoutInput, z as CheckoutResult, bk as PromotionsList, aY as PaymentConfig, b5 as PaymentSubmitInput, aU as PaymentAttemptResult, c3 as TrackingLookupInput, c4 as TrackingLookupResult, K as CustomerIdentifier, S as CustomerSessionInput, Q as CustomerSession, F as CustomerCapabilities, N as CustomerRegisterInput, O as CustomerRegisterResult, V as CustomerVerifyRegistrationInput, L as CustomerPasswordLoginInput, T as CustomerSetPasswordInput, P as CustomerResetPasswordInput, E as Customer, U as CustomerUpdateInput, R as CustomerSessionInfo, bl as ReauthInput, bm as ReauthResult, J as CustomerEmailCodeInput, H as CustomerEmailChangeInput, I as CustomerEmailChangeRequested, G as CustomerEmailChangeConfirmInput, W as DataExportFile, A as AccountDeleteInput, aF as Order, ai as InvoiceConnection, bC as ShipmentConnection, bx as ReturnRequestInput, bw as ReturnRequest, ap as InvoiceResult, b7 as PendingPayment, al as InvoiceFileKind, ak as InvoiceFile, a5 as FiscalProfile, a6 as FiscalProfileInput, bT as Subject, bY as SubjectInput, b_ as SubjectPatch, a as Address, bZ as SubjectKind, c0 as Theme, aR as Page, ay as Menu, e as Article, aA as Money, g as AvailabilityStatus, r as CartLineProblem, f as Availability, ag as InsufficientStockLine, o as CartLine, bg as ProductVariant, X as DeclineCode, b6 as PaymentVoucher, b1 as PaymentNextStep, t as CartPromotions, bi as PromotionReward, aj as InvoiceDoc, bB as Shipment, aD as NextAction, aJ as OrderProgress, bH as ShipmentStatus, bD as ShipmentEvent, bV as SubjectCatalogNode, bW as SubjectField, Z as DeliveryMethod, c6 as UnavailableRateProvider, aS as PageInfo } from './account-settings-Cio2mAvd.js';
|
|
2
|
+
export { c as AddressSuggestion, h as CartBuyer, j as CartCost, k as CartDelivery, l as CartDiscountCode, m as CartDiscountLine, n as CartInvoice, q as CartLineMerchandise, u as CartRecommendation, w as CheckoutInfo, y as CheckoutPayment, M as CustomerPreferences, $ as Facet, a0 as FacetValue, a1 as FiscalDocumentEvidence, a2 as FiscalDocumentSource, a3 as FiscalIdentity, a4 as FiscalIdentityInput, a7 as FiscalVerification, a8 as GeoHint, a9 as IdentityCapture, aa as IdentityDocumentSpec, ab as IdentityFieldRule, ac as IdentityRulesV1, ad as IdentityStrategy, ae as Image, af as InsufficientStockDetails, ah as InvoiceAction, am as InvoiceListNode, an as InvoiceReceiver, aq as InvoiceStage, ar as InvoiceSummary, as as InvoicingCapabilities, au as LocationContacts, av as LocationKind, ax as LocationPickup, az as MenuItem, aB as MoneyRange, aE as NextActionKind, aG as OrderLine, aH as OrderPickup, aI as OrderProblem, aK as OrderProgressStep, aL as OrderRef, aM as OrderSection, aN as OrderShippingService, aO as OrderStage, aP as OrderStepKey, aQ as OrderStepState, aT as PaymentAction, aV as PaymentAttemptStatus, aW as PaymentClient, aX as PaymentClientCsp, aZ as PaymentFlow, a_ as PaymentInfo, a$ as PaymentMethod, b2 as PaymentOption, b3 as PaymentOptionKey, b4 as PaymentPoint, b8 as PendingPaymentVoucher, b9 as PickupOption, bb as ProductAttributeValue, bc as ProductCategory, be as ProductOption, bh as PromotionAnnouncement, bj as PromotionTier, bo as Refund, bq as RegionFiscalEntry, br as RegionFiscalId, bs as RegionPaymentMethod, by as SEO, bz as Section, bA as SelectedOption, bE as ShipmentKind, bF as ShipmentListNode, bG as ShipmentMap, bI as ShipmentsSummary, bJ as ShippingRate, bL as ShopBranch, bM as ShopContact, bN as ShopPolicies, bP as StorefrontError, bQ as StorefrontErrorBody, bR as StorefrontErrorCode, bS as StorefrontErrorInit, bU as SubjectCatalog, bX as SubjectFieldType, b$ as SubjectRef, c2 as TrackingEventView, c5 as TrackingView, c7 as dataExportBytes, c8 as isAccountDeleteBlocked, c9 as isReauthRequired, ca as isStorefrontError, cb as safeExportFilename } from './account-settings-Cio2mAvd.js';
|
|
3
3
|
import { GeoPoint } from './geo.js';
|
|
4
4
|
export { OpenStatus, OpeningHours } from './geo.js';
|
|
5
5
|
|
|
@@ -363,6 +363,15 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
|
|
|
363
363
|
*/
|
|
364
364
|
get: (id: string, options?: RequestOptions) => Promise<CheckoutResult | null>;
|
|
365
365
|
};
|
|
366
|
+
/**
|
|
367
|
+
* Public "where is my order" lookup (`POST /storefront/customer/track`): by order number + email, or by the guide
|
|
368
|
+
* printed on the parcel. No buyer session. Every failure is one of three plain answers, so a miss never tells a
|
|
369
|
+
* real order from an unknown one: `not_found`, `rate_limited` (with `retryAfter` seconds when known) or
|
|
370
|
+
* `unavailable` (the server or the network failed). Needs the store to enable the route.
|
|
371
|
+
*/
|
|
372
|
+
tracking: {
|
|
373
|
+
lookup: (input: TrackingLookupInput, options?: WriteOptions) => Promise<TrackingLookupResult>;
|
|
374
|
+
};
|
|
366
375
|
customer: {
|
|
367
376
|
/** Sends a one-time code by email or SMS/WhatsApp. */
|
|
368
377
|
requestOtp: (identifier: CustomerIdentifier, options?: WriteOptions) => Promise<void>;
|
|
@@ -649,7 +658,7 @@ declare function isTokenPublishable(token: string | null | undefined): boolean;
|
|
|
649
658
|
type AvailabilityTone = 'success' | 'warning' | 'danger' | 'info';
|
|
650
659
|
type AvailabilityLocale = 'es' | 'en';
|
|
651
660
|
/** Text keys, overridable per shop. `{n}` and `{date}` are replaced. */
|
|
652
|
-
type AvailabilityMessageKey = 'status.in_stock' | 'status.low_stock' | 'status.low_stock_n' | 'status.out_of_stock' | 'status.backorder' | 'status.preorder' | 'sub.backorder_eta' | 'sub.preorder_date' | 'cta.add' | 'cta.out_of_stock' | 'cta.backorder' | 'cta.preorder' | 'sr.in_stock' | 'sr.low_stock' | 'sr.low_stock_n' | 'sr.out_of_stock' | 'sr.backorder' | 'sr.preorder' | 'option.sold_out' | 'option.backorder' | 'option.preorder' | 'max_per_order' | 'notify.title' | 'notify.email' | 'notify.phone' | 'notify.consent' | 'notify.submit' | 'notify.done' | 'notify.error' | 'problem.out_of_stock' | 'problem.insufficient_stock' | 'problem.insufficient_stock_n' | 'problem.adjust' | 'problem.remove' | 'conflict.title' | 'conflict.body' | 'conflict.dismiss';
|
|
661
|
+
type AvailabilityMessageKey = 'status.in_stock' | 'status.low_stock' | 'status.low_stock_n' | 'status.out_of_stock' | 'status.backorder' | 'status.preorder' | 'sub.backorder_eta' | 'sub.preorder_date' | 'line.ships_on' | 'cta.add' | 'cta.out_of_stock' | 'cta.backorder' | 'cta.preorder' | 'sr.in_stock' | 'sr.low_stock' | 'sr.low_stock_n' | 'sr.out_of_stock' | 'sr.backorder' | 'sr.preorder' | 'option.sold_out' | 'option.backorder' | 'option.preorder' | 'max_per_order' | 'notify.title' | 'notify.email' | 'notify.phone' | 'notify.consent' | 'notify.submit' | 'notify.done' | 'notify.error' | 'problem.out_of_stock' | 'problem.insufficient_stock' | 'problem.insufficient_stock_n' | 'problem.adjust' | 'problem.remove' | 'conflict.title' | 'conflict.body' | 'conflict.dismiss';
|
|
653
662
|
type AvailabilityMessages = Record<AvailabilityMessageKey, string>;
|
|
654
663
|
/** `es-MX` -> `es`, `en-US` -> `en`; anything else falls back to Spanish. */
|
|
655
664
|
declare function availabilityLocale(locale: string | null | undefined): AvailabilityLocale;
|
|
@@ -657,6 +666,13 @@ declare function availabilityLocale(locale: string | null | undefined): Availabi
|
|
|
657
666
|
declare function availabilityMessages(locale: string | null | undefined, overrides?: Partial<AvailabilityMessages> | null): AvailabilityMessages;
|
|
658
667
|
/** Replaces `{name}` placeholders. */
|
|
659
668
|
declare function formatAvailabilityMessage(template: string, values?: Record<string, string | number>): string;
|
|
669
|
+
/**
|
|
670
|
+
* Ship date of a cart line, `YYYY-MM-DD`, or `null`. Pure: it only picks what the server
|
|
671
|
+
* sent (`ships_on`, else `availability.restock_eta`, else the date part of `preorder_release_at`).
|
|
672
|
+
*/
|
|
673
|
+
declare function lineShipDate(line: Pick<CartLine, 'ships_on' | 'availability'>): string | null;
|
|
674
|
+
/** Localized "Ships on: {date}" for a cart line, or `null` without a date. */
|
|
675
|
+
declare function lineShipLabel(line: Pick<CartLine, 'ships_on' | 'availability'>, locale: string | null | undefined, overrides?: Partial<AvailabilityMessages> | null): string | null;
|
|
660
676
|
type ResolveAvailabilityOptions = {
|
|
661
677
|
/**
|
|
662
678
|
* Polyfill only: shop-level "low stock" threshold to derive `low_stock` from
|
|
@@ -1163,4 +1179,4 @@ declare function pageRange(state: Pick<ListPageState, 'query' | 'pageInfo' | 'co
|
|
|
1163
1179
|
total: number | null;
|
|
1164
1180
|
} | null;
|
|
1165
1181
|
|
|
1166
|
-
export { AccountDeleteInput, type AccountListParams, Address, AddressInput, type AddressSuggestParams, AddressSuggestions, 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, InvoiceConnection, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, type InvoiceListParams, InvoiceRequest, InvoiceResult, LIST_URL_EN, LIST_URL_ES, type ListPageState, type ListQuery, type ListUrlNames, Location, LocationListParams, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, type OrderListParams, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, PRIVATE_MASK, Page, PageInfo, 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, ShipmentConnection, ShipmentEvent, type ShipmentListParams, 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, accountListQuery, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, coversYear, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, firstPageQuery, fitTag, fitTagsAny, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isFiltered, isMasked, isTestInvoice, isTestShipment, isTokenPublishable, listApiParams, listHref, listQueryString, maskToken, negotiateLocale, nextAction, nextPageQuery, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, pagePosition, pageRange, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, previousPageQuery, productAvailability, productListQuery, promoProgressView, promotionMessages, readListQuery, reconcileSubjectValues, repairPath, resolveAvailability, resolveSubject, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, splitSubjectTree, storefrontDomainHeader, subjectFields, subjectLevels, subjectOptions, suggestMarket, toMoney, visitorCountry };
|
|
1182
|
+
export { AccountDeleteInput, type AccountListParams, Address, AddressInput, type AddressSuggestParams, AddressSuggestions, Article, type ArticleListParams, Availability, type AvailabilityLocale, type AvailabilityMessageKey, type AvailabilityMessages, AvailabilityStatus, type AvailabilityTone, type AvailabilityView, type AvailabilityViewOptions, CLIENT_IP_HEADER, COUNTRY_HEADERS, Cart, CartBuyerInput, CartLine, 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, InvoiceConnection, InvoiceDoc, InvoiceFile, InvoiceFileKind, type InvoiceGroup, type InvoiceListParams, InvoiceRequest, InvoiceResult, LIST_URL_EN, LIST_URL_ES, type ListPageState, type ListQuery, type ListUrlNames, Location, LocationListParams, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, MISSING_WEIGHT, type MarketInfo, type MarketSuggestion, Menu, Money, NOTE_MAX_LENGTH, NearestLocation, NextAction, Order, type OrderListParams, OrderProgress, PAYMENT_CHOICE_REFUSED_FIELD, PICKUP_STEPS, PRIVATE_MASK, Page, PageInfo, 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, ShipmentConnection, ShipmentEvent, type ShipmentListParams, 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, TrackingLookupInput, TrackingLookupResult, UnavailableRateProvider, type WriteOptions, accountListQuery, appendParams, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, clampPercent, classifyPaymentError, coversYear, createStorefrontClient, declineMessage, declineMessageKey, deliveryInput, deliveryNotices, diagnose, firstPageQuery, fitTag, fitTagsAny, formatAvailabilityMessage, formatMoney, formatVoucherExpiry, generateIdempotencyKey, groupInvoiceDocs, hreflangLinks, invoiceFileBytes, isFiltered, isMasked, isTestInvoice, isTestShipment, isTokenPublishable, lineShipDate, lineShipLabel, listApiParams, listHref, listQueryString, maskToken, negotiateLocale, nextAction, nextPageQuery, normalizeClientIp, normalizeNote, opsSaysNotRetryable, orderProgress, orderShipments, pagePosition, pageRange, parseDelivery, parseMoney, parseProductFilters, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, preferredLanguages, previousPageQuery, productAvailability, productListQuery, promoProgressView, promotionMessages, readListQuery, reconcileSubjectValues, repairPath, resolveAvailability, resolveSubject, rewardLabel, safeHttpsUrl, safeInvoiceFilename, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, splitSubjectTree, storefrontDomainHeader, subjectFields, subjectLevels, subjectOptions, suggestMarket, toMoney, visitorCountry };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isStorefrontError, availabilityLocale, StorefrontError, formatAvailabilityMessage, defaultCodeForStatus } from './chunk-
|
|
2
|
-
export { DEFAULT_FIT_TAG_PREFIX, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, PICKUP_STEPS, PRIVATE_MASK, SHIPPING_STEPS, SUBJECT_CATALOG_PAGE_BYTES, StorefrontError, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, coversYear, declineMessage, declineMessageKey, fitTag, fitTagsAny, formatAvailabilityMessage, formatVoucherExpiry, isMasked, isStorefrontError, isTestInvoice, isTestShipment, nextAction, orderProgress, orderShipments, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, productAvailability, reconcileSubjectValues, resolveAvailability, resolveSubject, safeHttpsUrl, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, splitSubjectTree, subjectFields, subjectLevels, subjectOptions } from './chunk-
|
|
1
|
+
import { isStorefrontError, availabilityLocale, StorefrontError, formatAvailabilityMessage, defaultCodeForStatus } from './chunk-ZLVXWHHQ.js';
|
|
2
|
+
export { DEFAULT_FIT_TAG_PREFIX, MAX_SUBJECT_YEAR, MIN_SUBJECT_YEAR, PICKUP_STEPS, PRIVATE_MASK, SHIPPING_STEPS, SUBJECT_CATALOG_PAGE_BYTES, StorefrontError, availabilityLocale, availabilityMessages, availabilityView, cartLineProblemView, coversYear, declineMessage, declineMessageKey, fitTag, fitTagsAny, formatAvailabilityMessage, formatVoucherExpiry, isMasked, isStorefrontError, isTestInvoice, isTestShipment, lineShipDate, lineShipLabel, nextAction, orderProgress, orderShipments, paymentErrorView, paymentIdempotencyKey, paymentMessages, paymentOutcome, productAvailability, reconcileSubjectValues, resolveAvailability, resolveSubject, safeHttpsUrl, safeTrackingUrl, schemaAvailability, shipmentsStatus, sortTrackingEvents, splitSubjectTree, subjectFields, subjectLevels, subjectOptions } from './chunk-ZLVXWHHQ.js';
|
|
3
3
|
import { isValidPoint } from './chunk-45R47HYO.js';
|
|
4
4
|
|
|
5
5
|
// src/money.ts
|
|
@@ -414,6 +414,26 @@ function createStorefrontClient(config) {
|
|
|
414
414
|
*/
|
|
415
415
|
get: (id, options) => getOrNull(`/storefront/checkouts/${enc(id)}`, void 0, options)
|
|
416
416
|
},
|
|
417
|
+
/**
|
|
418
|
+
* Public "where is my order" lookup (`POST /storefront/customer/track`): by order number + email, or by the guide
|
|
419
|
+
* printed on the parcel. No buyer session. Every failure is one of three plain answers, so a miss never tells a
|
|
420
|
+
* real order from an unknown one: `not_found`, `rate_limited` (with `retryAfter` seconds when known) or
|
|
421
|
+
* `unavailable` (the server or the network failed). Needs the store to enable the route.
|
|
422
|
+
*/
|
|
423
|
+
tracking: {
|
|
424
|
+
lookup: async (input, options) => {
|
|
425
|
+
try {
|
|
426
|
+
const tracking = await write("POST", "/storefront/customer/track", input, options);
|
|
427
|
+
return tracking && Array.isArray(tracking.events) ? { status: "found", tracking } : { status: "not_found" };
|
|
428
|
+
} catch (err) {
|
|
429
|
+
if (err instanceof StorefrontError) {
|
|
430
|
+
if (err.status === 429) return err.retryAfter ? { status: "rate_limited", retryAfter: err.retryAfter } : { status: "rate_limited" };
|
|
431
|
+
if (err.status === 400 || err.status === 404 || err.status === 422) return { status: "not_found" };
|
|
432
|
+
}
|
|
433
|
+
return { status: "unavailable" };
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
},
|
|
417
437
|
customer: {
|
|
418
438
|
/** Sends a one-time code by email or SMS/WhatsApp. */
|
|
419
439
|
requestOtp: (identifier, options) => write("POST", "/storefront/customer/otp", identifier, options),
|