@asteby/storefront 0.24.0 → 0.26.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/README.md +18 -0
- package/dist/{account-settings-CrQV1rPU.d.ts → account-settings-BnhDUPWx.d.ts} +29 -1
- package/dist/{account-settings-BZKux56f.d.cts → account-settings-C0r3jJ72.d.cts} +29 -1
- package/dist/{chunk-5BJRZIS3.js → chunk-ZLVXWHHQ.js} +17 -3
- package/dist/chunk-ZLVXWHHQ.js.map +1 -0
- package/dist/cli.js +68 -2
- package/dist/fiscal-document.d.cts +2 -2
- package/dist/fiscal-document.d.ts +2 -2
- package/dist/index.cjs +221 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +162 -5
- package/dist/index.d.ts +162 -5
- package/dist/index.js +195 -4
- package/dist/index.js.map +1 -1
- package/dist/mock.cjs +186 -4
- package/dist/mock.cjs.map +1 -1
- package/dist/mock.d.cts +6 -1
- package/dist/mock.d.ts +6 -1
- package/dist/mock.js +187 -5
- package/dist/mock.js.map +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 {
|
|
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, 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, c2 as UnavailableRateProvider, aS as PageInfo } from './account-settings-C0r3jJ72.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, c3 as dataExportBytes, c4 as isAccountDeleteBlocked, c5 as isReauthRequired, c6 as isStorefrontError, c7 as safeExportFilename } from './account-settings-C0r3jJ72.cjs';
|
|
3
3
|
import { GeoPoint } from './geo.cjs';
|
|
4
4
|
export { OpenStatus, OpeningHours } from './geo.cjs';
|
|
5
5
|
|
|
@@ -11,6 +11,38 @@ type PaginationParams = {
|
|
|
11
11
|
/** Cursor from `page_info.end_cursor`. */
|
|
12
12
|
after?: string | null;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Cursor paging of the account lists (contract 1.19). `first` is 10 by default; a page has at most 50 (51–100 is cut to 50,
|
|
16
|
+
* more is a 400). `after` goes to the next
|
|
17
|
+
* (older) page with `page_info.end_cursor`; `before` goes back with `page_info.start_cursor`; never both.
|
|
18
|
+
*/
|
|
19
|
+
type AccountListParams = {
|
|
20
|
+
first?: number;
|
|
21
|
+
after?: string | null;
|
|
22
|
+
before?: string | null;
|
|
23
|
+
/** From this day (UTC, inclusive; `YYYY-MM-DD`) or an RFC 3339 instant. */
|
|
24
|
+
from?: string;
|
|
25
|
+
/** Until this day (UTC, inclusive; `YYYY-MM-DD`) or an RFC 3339 instant (exclusive). */
|
|
26
|
+
to?: string;
|
|
27
|
+
/** An exact order number (case-insensitive; a leading «#» is fine). */
|
|
28
|
+
q?: string;
|
|
29
|
+
};
|
|
30
|
+
/** Filters of `customer.orders.list` (derived ones are applied to bounded batches: a short page with `has_next_page` is valid). */
|
|
31
|
+
type OrderListParams = AccountListParams & {
|
|
32
|
+
/** An order status (`placed`, `accepted`, `fulfilling`, `ready`, `shipped`, `delivered`, `cancelled`) or progress stage (`pending_payment`, `paid`, `preparing`, `ready_for_pickup`, `in_transit`, `out_for_delivery`, `refunded`). */
|
|
33
|
+
status?: string;
|
|
34
|
+
delivery_method?: 'shipping' | 'pickup';
|
|
35
|
+
/** With an invoice (issued or on its way) or without one. */
|
|
36
|
+
has_invoice?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type InvoiceListParams = AccountListParams & {
|
|
39
|
+
/** `issued`, `pending`, `cancelled` or `error`. */
|
|
40
|
+
status?: string;
|
|
41
|
+
};
|
|
42
|
+
type ShipmentListParams = AccountListParams & {
|
|
43
|
+
/** A parcel status: `pending`, `label_created`, `in_transit`, `out_for_delivery`, `delivered`, `exception`, `returned`, `lost`, `cancelled`. */
|
|
44
|
+
status?: string;
|
|
45
|
+
};
|
|
14
46
|
type ProductListParams = PaginationParams & {
|
|
15
47
|
/** Free-text search. */
|
|
16
48
|
q?: string;
|
|
@@ -42,6 +74,8 @@ type ArticleListParams = Omit<PaginationParams, 'first'> & {
|
|
|
42
74
|
tag?: string;
|
|
43
75
|
q?: string;
|
|
44
76
|
};
|
|
77
|
+
/** The query of an account list: only what is set (no empty strings, no `undefined`), booleans as `true` / `false`. */
|
|
78
|
+
declare function accountListQuery(params: (AccountListParams & Record<string, QueryValue | undefined>) | undefined): QueryParams | undefined;
|
|
45
79
|
/** Appends params to a URLSearchParams, repeating keys for arrays and skipping nullish values. */
|
|
46
80
|
declare function appendParams(search: URLSearchParams, params: QueryParams | undefined): URLSearchParams;
|
|
47
81
|
/** Serializes product list params per the contract (`filter.<attr>` repeated, `handles` comma-separated). */
|
|
@@ -408,7 +442,31 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
|
|
|
408
442
|
* repeat after success is also fine. Afterwards the token is dead: drop it.
|
|
409
443
|
*/
|
|
410
444
|
deleteAccount: (input: AccountDeleteInput, options?: WriteOptions) => Promise<void>;
|
|
411
|
-
|
|
445
|
+
/**
|
|
446
|
+
* The buyer's orders, newest first. Callable as before (`orders({ first })`) and, since contract 1.19, with
|
|
447
|
+
* `orders.list({ first, after, before, status, delivery_method, has_invoice, from, to, q })`: cursor paging
|
|
448
|
+
* (keyset, stable while new orders arrive), `page_info.start_cursor` / `has_previous_page` to go back, and
|
|
449
|
+
* `total_count` when it is cheap to know. An OPS older than 1.19 ignores the new parameters.
|
|
450
|
+
*/
|
|
451
|
+
orders: ((params?: PaginationParams, options?: RequestOptions) => Promise<Connection<Order>>) & {
|
|
452
|
+
list: (params?: OrderListParams, options?: RequestOptions) => Promise<Connection<Order>>;
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* The buyer's invoices, one node per order that has them (`{ order, invoices }`), cursor-paged like `orders.list`.
|
|
456
|
+
* It replaces opening the detail of every order. An OPS older than 1.19 (no such route) is served from one page of
|
|
457
|
+
* orders and their details, so the account keeps working until the addon is updated.
|
|
458
|
+
*/
|
|
459
|
+
invoices: {
|
|
460
|
+
list: (params?: InvoiceListParams, options?: RequestOptions) => Promise<InvoiceConnection>;
|
|
461
|
+
};
|
|
462
|
+
/**
|
|
463
|
+
* The buyer's shipments, one node per delivered order with its service and parcels (`{ order, stage, service,
|
|
464
|
+
* shipments }`), cursor-paged like `orders.list`, without tracking events or map (those come with `order(id)`).
|
|
465
|
+
* An OPS older than 1.19 is served from one page of orders and their details.
|
|
466
|
+
*/
|
|
467
|
+
shipments: {
|
|
468
|
+
list: (params?: ShipmentListParams, options?: RequestOptions) => Promise<ShipmentConnection>;
|
|
469
|
+
};
|
|
412
470
|
/** `null` when the order does not exist or belongs to someone else. */
|
|
413
471
|
order: (id: string, options?: RequestOptions) => Promise<Order | null>;
|
|
414
472
|
requestReturn: (orderId: string, input: ReturnRequestInput, options?: WriteOptions) => Promise<ReturnRequest>;
|
|
@@ -591,7 +649,7 @@ declare function isTokenPublishable(token: string | null | undefined): boolean;
|
|
|
591
649
|
type AvailabilityTone = 'success' | 'warning' | 'danger' | 'info';
|
|
592
650
|
type AvailabilityLocale = 'es' | 'en';
|
|
593
651
|
/** Text keys, overridable per shop. `{n}` and `{date}` are replaced. */
|
|
594
|
-
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';
|
|
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' | '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';
|
|
595
653
|
type AvailabilityMessages = Record<AvailabilityMessageKey, string>;
|
|
596
654
|
/** `es-MX` -> `es`, `en-US` -> `en`; anything else falls back to Spanish. */
|
|
597
655
|
declare function availabilityLocale(locale: string | null | undefined): AvailabilityLocale;
|
|
@@ -599,6 +657,13 @@ declare function availabilityLocale(locale: string | null | undefined): Availabi
|
|
|
599
657
|
declare function availabilityMessages(locale: string | null | undefined, overrides?: Partial<AvailabilityMessages> | null): AvailabilityMessages;
|
|
600
658
|
/** Replaces `{name}` placeholders. */
|
|
601
659
|
declare function formatAvailabilityMessage(template: string, values?: Record<string, string | number>): string;
|
|
660
|
+
/**
|
|
661
|
+
* Ship date of a cart line, `YYYY-MM-DD`, or `null`. Pure: it only picks what the server
|
|
662
|
+
* sent (`ships_on`, else `availability.restock_eta`, else the date part of `preorder_release_at`).
|
|
663
|
+
*/
|
|
664
|
+
declare function lineShipDate(line: Pick<CartLine, 'ships_on' | 'availability'>): string | null;
|
|
665
|
+
/** Localized "Ships on: {date}" for a cart line, or `null` without a date. */
|
|
666
|
+
declare function lineShipLabel(line: Pick<CartLine, 'ships_on' | 'availability'>, locale: string | null | undefined, overrides?: Partial<AvailabilityMessages> | null): string | null;
|
|
602
667
|
type ResolveAvailabilityOptions = {
|
|
603
668
|
/**
|
|
604
669
|
* Polyfill only: shop-level "low stock" threshold to derive `low_stock` from
|
|
@@ -1013,4 +1078,96 @@ type DeliveryNotices = {
|
|
|
1013
1078
|
/** Splits `delivery.unavailable` into the `missing_weight` notice and the generic one. */
|
|
1014
1079
|
declare function deliveryNotices(delivery: Pick<DeliveryOptions, 'unavailable' | 'partial'> | null | undefined): DeliveryNotices;
|
|
1015
1080
|
|
|
1016
|
-
|
|
1081
|
+
/**
|
|
1082
|
+
* The URL side of the account lists (orders, invoices, shipments): what a list page reads from `?despues=…&estado=…`
|
|
1083
|
+
* and the links to the previous / next page. Framework-free (React Router, Next or plain links all use it), pure and
|
|
1084
|
+
* safe on untrusted input: everything read from a URL is validated, so a hand-edited or hostile query can never reach
|
|
1085
|
+
* the API as anything but a well-formed filter.
|
|
1086
|
+
*
|
|
1087
|
+
* A list URL is the whole state of the page (cursor, filters, position), so it can be shared, bookmarked and used with
|
|
1088
|
+
* the browser's back / forward buttons, and every link is a real `<a href>` that works without JavaScript.
|
|
1089
|
+
*/
|
|
1090
|
+
|
|
1091
|
+
/** What a list page reads from its URL. Every field is optional; the cursors are opaque. */
|
|
1092
|
+
type ListQuery = {
|
|
1093
|
+
/** `page_info.end_cursor` of the page before: this page continues after it. */
|
|
1094
|
+
after?: string;
|
|
1095
|
+
/** `page_info.start_cursor` of the page after: this page is the one before it. */
|
|
1096
|
+
before?: string;
|
|
1097
|
+
/** 1-based position of the first item of the page, only for the «showing 11–20» text (a cursor has no page number). */
|
|
1098
|
+
pos?: number;
|
|
1099
|
+
status?: string;
|
|
1100
|
+
delivery?: 'shipping' | 'pickup';
|
|
1101
|
+
invoice?: boolean;
|
|
1102
|
+
/** `YYYY-MM-DD` */
|
|
1103
|
+
from?: string;
|
|
1104
|
+
/** `YYYY-MM-DD` */
|
|
1105
|
+
to?: string;
|
|
1106
|
+
q?: string;
|
|
1107
|
+
};
|
|
1108
|
+
/** The names a URL uses for each field, and the words for the values that are not free text. */
|
|
1109
|
+
type ListUrlNames = {
|
|
1110
|
+
after: string;
|
|
1111
|
+
before: string;
|
|
1112
|
+
pos: string;
|
|
1113
|
+
status: string;
|
|
1114
|
+
delivery: string;
|
|
1115
|
+
invoice: string;
|
|
1116
|
+
from: string;
|
|
1117
|
+
to: string;
|
|
1118
|
+
q: string;
|
|
1119
|
+
/** The URL word of each delivery method. */
|
|
1120
|
+
deliveryValues: {
|
|
1121
|
+
shipping: string;
|
|
1122
|
+
pickup: string;
|
|
1123
|
+
};
|
|
1124
|
+
/** The URL words of `invoice` (with / without an invoice). */
|
|
1125
|
+
invoiceValues: {
|
|
1126
|
+
yes: string;
|
|
1127
|
+
no: string;
|
|
1128
|
+
};
|
|
1129
|
+
};
|
|
1130
|
+
/** Spanish URLs (`?despues=…&estado=en_camino&desde=2026-01-01`), the default of a Spanish store. */
|
|
1131
|
+
declare const LIST_URL_ES: ListUrlNames;
|
|
1132
|
+
/** English URLs, the same as the API's own parameter names. */
|
|
1133
|
+
declare const LIST_URL_EN: ListUrlNames;
|
|
1134
|
+
/**
|
|
1135
|
+
* Reads and validates a list URL. Unknown or malformed values are dropped (never an error): a stale or hand-edited link
|
|
1136
|
+
* simply shows the unfiltered list. `after` wins over `before` when both are present.
|
|
1137
|
+
*/
|
|
1138
|
+
declare function readListQuery(search: URLSearchParams | string | undefined | null, names?: ListUrlNames): ListQuery;
|
|
1139
|
+
/** Are there filters on (cursor and position are not filters)? */
|
|
1140
|
+
declare function isFiltered(query: ListQuery): boolean;
|
|
1141
|
+
/** The same query without cursor and position: the first page of the same filters. */
|
|
1142
|
+
declare function firstPageQuery(query: ListQuery): ListQuery;
|
|
1143
|
+
/** The API parameters of a list page. */
|
|
1144
|
+
declare function listApiParams(query: ListQuery, first: number): OrderListParams;
|
|
1145
|
+
/** `?despues=…&estado=…` (with the leading `?`), or `''` for the first page without filters. Keys in a stable order. */
|
|
1146
|
+
declare function listQueryString(query: ListQuery, names?: ListUrlNames): string;
|
|
1147
|
+
/** `path` + the query string. */
|
|
1148
|
+
declare const listHref: (path: string, query: ListQuery, names?: ListUrlNames) => string;
|
|
1149
|
+
/** What the page the buyer is on knows about itself, to build the links around it. */
|
|
1150
|
+
type ListPageState = {
|
|
1151
|
+
query: ListQuery;
|
|
1152
|
+
pageInfo: PageInfo | null | undefined;
|
|
1153
|
+
/** Nodes on this page. */
|
|
1154
|
+
count: number;
|
|
1155
|
+
/** Page size asked for. */
|
|
1156
|
+
first: number;
|
|
1157
|
+
};
|
|
1158
|
+
/** 1-based position of the first node of this page: known when it is the first page, else what the URL carried. */
|
|
1159
|
+
declare function pagePosition({ query, pageInfo, count }: Pick<ListPageState, 'query' | 'pageInfo' | 'count'>): number | undefined;
|
|
1160
|
+
/** The query of the next (older) page, or `null` at the end. */
|
|
1161
|
+
declare function nextPageQuery(state: ListPageState): ListQuery | null;
|
|
1162
|
+
/** The query of the previous (newer) page, or `null` on the first. */
|
|
1163
|
+
declare function previousPageQuery(state: ListPageState): ListQuery | null;
|
|
1164
|
+
/** «from»–«to» of «total» for the «showing 11–20 of 300» text; `null` when the page is empty or the position is unknown. */
|
|
1165
|
+
declare function pageRange(state: Pick<ListPageState, 'query' | 'pageInfo' | 'count'> & {
|
|
1166
|
+
total?: number | null;
|
|
1167
|
+
}): {
|
|
1168
|
+
from: number;
|
|
1169
|
+
to: number;
|
|
1170
|
+
total: number | null;
|
|
1171
|
+
} | null;
|
|
1172
|
+
|
|
1173
|
+
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, 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 {
|
|
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, 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, c2 as UnavailableRateProvider, aS as PageInfo } from './account-settings-BnhDUPWx.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, c3 as dataExportBytes, c4 as isAccountDeleteBlocked, c5 as isReauthRequired, c6 as isStorefrontError, c7 as safeExportFilename } from './account-settings-BnhDUPWx.js';
|
|
3
3
|
import { GeoPoint } from './geo.js';
|
|
4
4
|
export { OpenStatus, OpeningHours } from './geo.js';
|
|
5
5
|
|
|
@@ -11,6 +11,38 @@ type PaginationParams = {
|
|
|
11
11
|
/** Cursor from `page_info.end_cursor`. */
|
|
12
12
|
after?: string | null;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Cursor paging of the account lists (contract 1.19). `first` is 10 by default; a page has at most 50 (51–100 is cut to 50,
|
|
16
|
+
* more is a 400). `after` goes to the next
|
|
17
|
+
* (older) page with `page_info.end_cursor`; `before` goes back with `page_info.start_cursor`; never both.
|
|
18
|
+
*/
|
|
19
|
+
type AccountListParams = {
|
|
20
|
+
first?: number;
|
|
21
|
+
after?: string | null;
|
|
22
|
+
before?: string | null;
|
|
23
|
+
/** From this day (UTC, inclusive; `YYYY-MM-DD`) or an RFC 3339 instant. */
|
|
24
|
+
from?: string;
|
|
25
|
+
/** Until this day (UTC, inclusive; `YYYY-MM-DD`) or an RFC 3339 instant (exclusive). */
|
|
26
|
+
to?: string;
|
|
27
|
+
/** An exact order number (case-insensitive; a leading «#» is fine). */
|
|
28
|
+
q?: string;
|
|
29
|
+
};
|
|
30
|
+
/** Filters of `customer.orders.list` (derived ones are applied to bounded batches: a short page with `has_next_page` is valid). */
|
|
31
|
+
type OrderListParams = AccountListParams & {
|
|
32
|
+
/** An order status (`placed`, `accepted`, `fulfilling`, `ready`, `shipped`, `delivered`, `cancelled`) or progress stage (`pending_payment`, `paid`, `preparing`, `ready_for_pickup`, `in_transit`, `out_for_delivery`, `refunded`). */
|
|
33
|
+
status?: string;
|
|
34
|
+
delivery_method?: 'shipping' | 'pickup';
|
|
35
|
+
/** With an invoice (issued or on its way) or without one. */
|
|
36
|
+
has_invoice?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type InvoiceListParams = AccountListParams & {
|
|
39
|
+
/** `issued`, `pending`, `cancelled` or `error`. */
|
|
40
|
+
status?: string;
|
|
41
|
+
};
|
|
42
|
+
type ShipmentListParams = AccountListParams & {
|
|
43
|
+
/** A parcel status: `pending`, `label_created`, `in_transit`, `out_for_delivery`, `delivered`, `exception`, `returned`, `lost`, `cancelled`. */
|
|
44
|
+
status?: string;
|
|
45
|
+
};
|
|
14
46
|
type ProductListParams = PaginationParams & {
|
|
15
47
|
/** Free-text search. */
|
|
16
48
|
q?: string;
|
|
@@ -42,6 +74,8 @@ type ArticleListParams = Omit<PaginationParams, 'first'> & {
|
|
|
42
74
|
tag?: string;
|
|
43
75
|
q?: string;
|
|
44
76
|
};
|
|
77
|
+
/** The query of an account list: only what is set (no empty strings, no `undefined`), booleans as `true` / `false`. */
|
|
78
|
+
declare function accountListQuery(params: (AccountListParams & Record<string, QueryValue | undefined>) | undefined): QueryParams | undefined;
|
|
45
79
|
/** Appends params to a URLSearchParams, repeating keys for arrays and skipping nullish values. */
|
|
46
80
|
declare function appendParams(search: URLSearchParams, params: QueryParams | undefined): URLSearchParams;
|
|
47
81
|
/** Serializes product list params per the contract (`filter.<attr>` repeated, `handles` comma-separated). */
|
|
@@ -408,7 +442,31 @@ declare function createStorefrontClient(config: StorefrontClientOptions): {
|
|
|
408
442
|
* repeat after success is also fine. Afterwards the token is dead: drop it.
|
|
409
443
|
*/
|
|
410
444
|
deleteAccount: (input: AccountDeleteInput, options?: WriteOptions) => Promise<void>;
|
|
411
|
-
|
|
445
|
+
/**
|
|
446
|
+
* The buyer's orders, newest first. Callable as before (`orders({ first })`) and, since contract 1.19, with
|
|
447
|
+
* `orders.list({ first, after, before, status, delivery_method, has_invoice, from, to, q })`: cursor paging
|
|
448
|
+
* (keyset, stable while new orders arrive), `page_info.start_cursor` / `has_previous_page` to go back, and
|
|
449
|
+
* `total_count` when it is cheap to know. An OPS older than 1.19 ignores the new parameters.
|
|
450
|
+
*/
|
|
451
|
+
orders: ((params?: PaginationParams, options?: RequestOptions) => Promise<Connection<Order>>) & {
|
|
452
|
+
list: (params?: OrderListParams, options?: RequestOptions) => Promise<Connection<Order>>;
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* The buyer's invoices, one node per order that has them (`{ order, invoices }`), cursor-paged like `orders.list`.
|
|
456
|
+
* It replaces opening the detail of every order. An OPS older than 1.19 (no such route) is served from one page of
|
|
457
|
+
* orders and their details, so the account keeps working until the addon is updated.
|
|
458
|
+
*/
|
|
459
|
+
invoices: {
|
|
460
|
+
list: (params?: InvoiceListParams, options?: RequestOptions) => Promise<InvoiceConnection>;
|
|
461
|
+
};
|
|
462
|
+
/**
|
|
463
|
+
* The buyer's shipments, one node per delivered order with its service and parcels (`{ order, stage, service,
|
|
464
|
+
* shipments }`), cursor-paged like `orders.list`, without tracking events or map (those come with `order(id)`).
|
|
465
|
+
* An OPS older than 1.19 is served from one page of orders and their details.
|
|
466
|
+
*/
|
|
467
|
+
shipments: {
|
|
468
|
+
list: (params?: ShipmentListParams, options?: RequestOptions) => Promise<ShipmentConnection>;
|
|
469
|
+
};
|
|
412
470
|
/** `null` when the order does not exist or belongs to someone else. */
|
|
413
471
|
order: (id: string, options?: RequestOptions) => Promise<Order | null>;
|
|
414
472
|
requestReturn: (orderId: string, input: ReturnRequestInput, options?: WriteOptions) => Promise<ReturnRequest>;
|
|
@@ -591,7 +649,7 @@ declare function isTokenPublishable(token: string | null | undefined): boolean;
|
|
|
591
649
|
type AvailabilityTone = 'success' | 'warning' | 'danger' | 'info';
|
|
592
650
|
type AvailabilityLocale = 'es' | 'en';
|
|
593
651
|
/** Text keys, overridable per shop. `{n}` and `{date}` are replaced. */
|
|
594
|
-
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';
|
|
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' | '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';
|
|
595
653
|
type AvailabilityMessages = Record<AvailabilityMessageKey, string>;
|
|
596
654
|
/** `es-MX` -> `es`, `en-US` -> `en`; anything else falls back to Spanish. */
|
|
597
655
|
declare function availabilityLocale(locale: string | null | undefined): AvailabilityLocale;
|
|
@@ -599,6 +657,13 @@ declare function availabilityLocale(locale: string | null | undefined): Availabi
|
|
|
599
657
|
declare function availabilityMessages(locale: string | null | undefined, overrides?: Partial<AvailabilityMessages> | null): AvailabilityMessages;
|
|
600
658
|
/** Replaces `{name}` placeholders. */
|
|
601
659
|
declare function formatAvailabilityMessage(template: string, values?: Record<string, string | number>): string;
|
|
660
|
+
/**
|
|
661
|
+
* Ship date of a cart line, `YYYY-MM-DD`, or `null`. Pure: it only picks what the server
|
|
662
|
+
* sent (`ships_on`, else `availability.restock_eta`, else the date part of `preorder_release_at`).
|
|
663
|
+
*/
|
|
664
|
+
declare function lineShipDate(line: Pick<CartLine, 'ships_on' | 'availability'>): string | null;
|
|
665
|
+
/** Localized "Ships on: {date}" for a cart line, or `null` without a date. */
|
|
666
|
+
declare function lineShipLabel(line: Pick<CartLine, 'ships_on' | 'availability'>, locale: string | null | undefined, overrides?: Partial<AvailabilityMessages> | null): string | null;
|
|
602
667
|
type ResolveAvailabilityOptions = {
|
|
603
668
|
/**
|
|
604
669
|
* Polyfill only: shop-level "low stock" threshold to derive `low_stock` from
|
|
@@ -1013,4 +1078,96 @@ type DeliveryNotices = {
|
|
|
1013
1078
|
/** Splits `delivery.unavailable` into the `missing_weight` notice and the generic one. */
|
|
1014
1079
|
declare function deliveryNotices(delivery: Pick<DeliveryOptions, 'unavailable' | 'partial'> | null | undefined): DeliveryNotices;
|
|
1015
1080
|
|
|
1016
|
-
|
|
1081
|
+
/**
|
|
1082
|
+
* The URL side of the account lists (orders, invoices, shipments): what a list page reads from `?despues=…&estado=…`
|
|
1083
|
+
* and the links to the previous / next page. Framework-free (React Router, Next or plain links all use it), pure and
|
|
1084
|
+
* safe on untrusted input: everything read from a URL is validated, so a hand-edited or hostile query can never reach
|
|
1085
|
+
* the API as anything but a well-formed filter.
|
|
1086
|
+
*
|
|
1087
|
+
* A list URL is the whole state of the page (cursor, filters, position), so it can be shared, bookmarked and used with
|
|
1088
|
+
* the browser's back / forward buttons, and every link is a real `<a href>` that works without JavaScript.
|
|
1089
|
+
*/
|
|
1090
|
+
|
|
1091
|
+
/** What a list page reads from its URL. Every field is optional; the cursors are opaque. */
|
|
1092
|
+
type ListQuery = {
|
|
1093
|
+
/** `page_info.end_cursor` of the page before: this page continues after it. */
|
|
1094
|
+
after?: string;
|
|
1095
|
+
/** `page_info.start_cursor` of the page after: this page is the one before it. */
|
|
1096
|
+
before?: string;
|
|
1097
|
+
/** 1-based position of the first item of the page, only for the «showing 11–20» text (a cursor has no page number). */
|
|
1098
|
+
pos?: number;
|
|
1099
|
+
status?: string;
|
|
1100
|
+
delivery?: 'shipping' | 'pickup';
|
|
1101
|
+
invoice?: boolean;
|
|
1102
|
+
/** `YYYY-MM-DD` */
|
|
1103
|
+
from?: string;
|
|
1104
|
+
/** `YYYY-MM-DD` */
|
|
1105
|
+
to?: string;
|
|
1106
|
+
q?: string;
|
|
1107
|
+
};
|
|
1108
|
+
/** The names a URL uses for each field, and the words for the values that are not free text. */
|
|
1109
|
+
type ListUrlNames = {
|
|
1110
|
+
after: string;
|
|
1111
|
+
before: string;
|
|
1112
|
+
pos: string;
|
|
1113
|
+
status: string;
|
|
1114
|
+
delivery: string;
|
|
1115
|
+
invoice: string;
|
|
1116
|
+
from: string;
|
|
1117
|
+
to: string;
|
|
1118
|
+
q: string;
|
|
1119
|
+
/** The URL word of each delivery method. */
|
|
1120
|
+
deliveryValues: {
|
|
1121
|
+
shipping: string;
|
|
1122
|
+
pickup: string;
|
|
1123
|
+
};
|
|
1124
|
+
/** The URL words of `invoice` (with / without an invoice). */
|
|
1125
|
+
invoiceValues: {
|
|
1126
|
+
yes: string;
|
|
1127
|
+
no: string;
|
|
1128
|
+
};
|
|
1129
|
+
};
|
|
1130
|
+
/** Spanish URLs (`?despues=…&estado=en_camino&desde=2026-01-01`), the default of a Spanish store. */
|
|
1131
|
+
declare const LIST_URL_ES: ListUrlNames;
|
|
1132
|
+
/** English URLs, the same as the API's own parameter names. */
|
|
1133
|
+
declare const LIST_URL_EN: ListUrlNames;
|
|
1134
|
+
/**
|
|
1135
|
+
* Reads and validates a list URL. Unknown or malformed values are dropped (never an error): a stale or hand-edited link
|
|
1136
|
+
* simply shows the unfiltered list. `after` wins over `before` when both are present.
|
|
1137
|
+
*/
|
|
1138
|
+
declare function readListQuery(search: URLSearchParams | string | undefined | null, names?: ListUrlNames): ListQuery;
|
|
1139
|
+
/** Are there filters on (cursor and position are not filters)? */
|
|
1140
|
+
declare function isFiltered(query: ListQuery): boolean;
|
|
1141
|
+
/** The same query without cursor and position: the first page of the same filters. */
|
|
1142
|
+
declare function firstPageQuery(query: ListQuery): ListQuery;
|
|
1143
|
+
/** The API parameters of a list page. */
|
|
1144
|
+
declare function listApiParams(query: ListQuery, first: number): OrderListParams;
|
|
1145
|
+
/** `?despues=…&estado=…` (with the leading `?`), or `''` for the first page without filters. Keys in a stable order. */
|
|
1146
|
+
declare function listQueryString(query: ListQuery, names?: ListUrlNames): string;
|
|
1147
|
+
/** `path` + the query string. */
|
|
1148
|
+
declare const listHref: (path: string, query: ListQuery, names?: ListUrlNames) => string;
|
|
1149
|
+
/** What the page the buyer is on knows about itself, to build the links around it. */
|
|
1150
|
+
type ListPageState = {
|
|
1151
|
+
query: ListQuery;
|
|
1152
|
+
pageInfo: PageInfo | null | undefined;
|
|
1153
|
+
/** Nodes on this page. */
|
|
1154
|
+
count: number;
|
|
1155
|
+
/** Page size asked for. */
|
|
1156
|
+
first: number;
|
|
1157
|
+
};
|
|
1158
|
+
/** 1-based position of the first node of this page: known when it is the first page, else what the URL carried. */
|
|
1159
|
+
declare function pagePosition({ query, pageInfo, count }: Pick<ListPageState, 'query' | 'pageInfo' | 'count'>): number | undefined;
|
|
1160
|
+
/** The query of the next (older) page, or `null` at the end. */
|
|
1161
|
+
declare function nextPageQuery(state: ListPageState): ListQuery | null;
|
|
1162
|
+
/** The query of the previous (newer) page, or `null` on the first. */
|
|
1163
|
+
declare function previousPageQuery(state: ListPageState): ListQuery | null;
|
|
1164
|
+
/** «from»–«to» of «total» for the «showing 11–20 of 300» text; `null` when the page is empty or the position is unknown. */
|
|
1165
|
+
declare function pageRange(state: Pick<ListPageState, 'query' | 'pageInfo' | 'count'> & {
|
|
1166
|
+
total?: number | null;
|
|
1167
|
+
}): {
|
|
1168
|
+
from: number;
|
|
1169
|
+
to: number;
|
|
1170
|
+
total: number | null;
|
|
1171
|
+
} | null;
|
|
1172
|
+
|
|
1173
|
+
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, 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 };
|