@vtex/faststore 0.0.8 → 0.0.10
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/CHANGELOG.md +59 -0
- package/dist/actions.json +42 -0
- package/dist/catalog.json +731 -16
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/components.d.ts +9 -4
- package/dist/components.js +11 -6
- package/dist/content-types.json +300 -0
- package/dist/core/dist/define-component.d.ts +6 -1
- package/dist/docs/account-entry-point.md +4 -4
- package/dist/docs/account-menu.md +2 -2
- package/dist/docs/account-saved-cards.md +301 -0
- package/dist/docs/binding-switcher.md +154 -0
- package/dist/docs/card-entry.md +3 -3
- package/dist/docs/card-summary.md +175 -0
- package/dist/docs/cart-destination.md +238 -0
- package/dist/docs/cart-item.md +21 -3
- package/dist/docs/cart-totalizer.md +1 -1
- package/dist/docs/cart.md +118 -11
- package/dist/docs/footer-social.md +1 -1
- package/dist/docs/free-shipping-progress.md +13 -9
- package/dist/docs/incentives.md +2 -2
- package/dist/docs/logo.md +1 -1
- package/dist/docs/payment-method-badges.md +2 -2
- package/dist/docs/payment-methods.md +1 -1
- package/dist/docs/product-information.md +2 -2
- package/dist/docs/product-shelf.md +7 -0
- package/dist/docs/select.md +3 -4
- package/dist/docs/sign-in-redirect.md +1 -1
- package/dist/docs/toast.md +30 -12
- package/dist/index.d.ts +2 -1
- package/dist/internal/client.d.ts +4 -1
- package/dist/internal/client.js +4 -1
- package/dist/internal/server.d.ts +4 -2
- package/dist/internal/server.js +4 -2
- package/dist/matter/account-saved-cards/account-saved-cards.d.ts +383 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js +956 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/cart/cart-namespace.d.ts +5 -1
- package/dist/matter/cart/cart-namespace.js +5 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +34 -4
- package/dist/matter/cart/cart.js +238 -28
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +222 -0
- package/dist/matter/cart-destination/cart-destination.js +613 -0
- package/dist/matter/cart-destination/cart-destination.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +4 -2
- package/dist/matter/cart-item/cart-item.js +75 -16
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/cart-totalizer/cart-totalizer.js +3 -2
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +6 -3
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +76 -33
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +7 -0
- package/dist/matter/product-shelf/product-shelf.js +115 -1
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.js +6 -2
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/particles/binding-switcher/binding-switcher.d.ts +38 -0
- package/dist/particles/binding-switcher/binding-switcher.js +183 -0
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
- package/dist/particles/card-summary/card-network.d.ts +17 -0
- package/dist/particles/card-summary/card-network.js +25 -0
- package/dist/particles/card-summary/card-network.js.map +1 -0
- package/dist/particles/card-summary/card-summary.d.ts +83 -0
- package/dist/particles/card-summary/card-summary.js +188 -0
- package/dist/particles/card-summary/card-summary.js.map +1 -0
- package/dist/particles/footer-social/footer-social.d.ts +1 -1
- package/dist/particles/footer-social/footer-social.js +1 -1
- package/dist/particles/footer-social/footer-social.js.map +1 -1
- package/dist/particles/incentives/incentives.d.ts +1 -1
- package/dist/particles/incentives/incentives.js +1 -1
- package/dist/particles/incentives/incentives.js.map +1 -1
- package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
- package/dist/particles/payment-methods/payment-methods.js +1 -1
- package/dist/particles/payment-methods/payment-methods.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +20 -6
- package/dist/particles/toast/toast.js +49 -7
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +298 -34
- package/dist/sdk/actions/index.d.ts +3 -1
- package/dist/sdk/actions/index.js +3 -1
- package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
- package/dist/sdk/actions/locale-action-provider.js +20 -0
- package/dist/sdk/actions/locale-action-provider.js.map +1 -0
- package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
- package/dist/sdk/actions/saved-card-action-provider.js +16 -0
- package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +6 -2
- package/dist/sdk/cache/storefront-cache.js +2 -1
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/operations.d.ts +2 -1
- package/dist/sdk/cart/operations.js +55 -1
- package/dist/sdk/cart/operations.js.map +1 -1
- package/dist/sdk/cart/optimistic.d.ts +30 -7
- package/dist/sdk/cart/optimistic.js +78 -41
- package/dist/sdk/cart/optimistic.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
- package/dist/sdk/cart/use-cart-actions.js +61 -15
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
- package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
- package/dist/sdk/generated/gql.js +15 -11
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +177 -46
- package/dist/sdk/generated/graphql.js +2314 -93
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/messages/en-US.js +19 -0
- package/dist/sdk/i18n/messages/en-US.json +19 -0
- package/dist/sdk/i18n/messages/en-US.json.d.ts +19 -0
- package/dist/sdk/i18n/messages/es-ES.js +19 -0
- package/dist/sdk/i18n/messages/es-ES.json +19 -0
- package/dist/sdk/i18n/messages/pt-BR.js +19 -0
- package/dist/sdk/i18n/messages/pt-BR.json +19 -0
- package/dist/sdk/i18n/provider.js +1 -1
- package/dist/sdk/i18n/provider.js.map +1 -1
- package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
- package/dist/sdk/locale/binding-switch-provider.js +20 -0
- package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
- package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
- package/dist/sdk/locale/use-locale-actions.js +70 -0
- package/dist/sdk/locale/use-locale-actions.js.map +1 -0
- package/dist/sdk/navigation/binding-switch.d.ts +39 -0
- package/dist/sdk/navigation/binding-switch.js +129 -0
- package/dist/sdk/navigation/binding-switch.js.map +1 -0
- package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
- package/dist/sdk/navigation/decode-route-params.js +32 -0
- package/dist/sdk/navigation/decode-route-params.js.map +1 -0
- package/dist/sdk/saved-cards/operations.d.ts +16 -0
- package/dist/sdk/saved-cards/operations.js +41 -0
- package/dist/sdk/saved-cards/operations.js.map +1 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
- package/dist/sdk/seo/page-alternates.d.ts +5 -3
- package/dist/sdk/seo/page-alternates.js +7 -12
- package/dist/sdk/seo/page-alternates.js.map +1 -1
- package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
- package/dist/sdk/shipping/shipping-operations.js +13 -0
- package/dist/sdk/shipping/shipping-operations.js.map +1 -1
- package/dist/sdk/state/cart.d.ts +9 -2
- package/dist/sdk/state/cart.js +9 -2
- package/dist/sdk/state/cart.js.map +1 -1
- package/package.json +2 -2
- package/src/styles/tailwind.css +1 -2
package/dist/schema.graphql
CHANGED
|
@@ -503,6 +503,36 @@ extend type Query {
|
|
|
503
503
|
): CustomerOrdersConnection! @cacheControl(maxAge: 0, scope: PRIVATE)
|
|
504
504
|
}
|
|
505
505
|
|
|
506
|
+
extend type Query {
|
|
507
|
+
"""
|
|
508
|
+
The signed-in shopper's own saved cards. Takes no id — the identity comes from
|
|
509
|
+
the session. Resolves to the shopper's entity, with an empty list when no card
|
|
510
|
+
is saved. Null only when the read fails, alongside an UNAUTHORIZED,
|
|
511
|
+
UPSTREAM_ERROR, or UPSTREAM_TIMEOUT error at this path (ADR-00007), so the
|
|
512
|
+
failure does not null the rest of the operation.
|
|
513
|
+
"""
|
|
514
|
+
customerSavedCards: CustomerSavedCards
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
extend type Query {
|
|
518
|
+
"""
|
|
519
|
+
The credit-card networks the store accepts on the request's sales channel,
|
|
520
|
+
with their validation rules, for adding a saved card. Requires a signed-in
|
|
521
|
+
shopper. Null when the read fails, alongside an UNAUTHORIZED, UPSTREAM_ERROR,
|
|
522
|
+
UPSTREAM_TIMEOUT, or NO_CARD_NETWORKS error at this path (ADR-00007).
|
|
523
|
+
NO_CARD_NETWORKS means the store accepts no credit-card network on this
|
|
524
|
+
sales channel; the list is never empty.
|
|
525
|
+
"""
|
|
526
|
+
savedCardNetworks: [CardNetworkRule!]
|
|
527
|
+
"""
|
|
528
|
+
The signed-in shopper's saved addresses a new card can be billed to, in the
|
|
529
|
+
platform's order. Takes no id. Empty when none is saved. Null only when the
|
|
530
|
+
read fails, alongside an UNAUTHORIZED, UPSTREAM_ERROR, or UPSTREAM_TIMEOUT
|
|
531
|
+
error at this path.
|
|
532
|
+
"""
|
|
533
|
+
customerSavedCardBillingAddresses: [CardBillingAddress!]
|
|
534
|
+
}
|
|
535
|
+
|
|
506
536
|
"""
|
|
507
537
|
Root mutation type. Cart and checkout operations are declared via
|
|
508
538
|
`extend type Mutation` in the checkout module.
|
|
@@ -526,14 +556,14 @@ extend type Mutation {
|
|
|
526
556
|
"""Item details to add."""
|
|
527
557
|
input: CartItemAddInput!
|
|
528
558
|
): CartItemAddPayload!
|
|
529
|
-
"""Remove
|
|
559
|
+
"""Remove a line from the cart entirely (sets quantity to 0)."""
|
|
530
560
|
cartItemRemove(
|
|
531
561
|
"""Item to remove."""
|
|
532
562
|
input: CartItemRemoveInput!
|
|
533
563
|
): CartItemRemovePayload!
|
|
534
564
|
"""
|
|
535
565
|
Remove multiple items from the cart in a single upstream write (each line's
|
|
536
|
-
quantity is set to 0). Tolerant:
|
|
566
|
+
quantity is set to 0). Tolerant: lines absent from the cart are skipped.
|
|
537
567
|
"""
|
|
538
568
|
cartItemsRemove(
|
|
539
569
|
"""Items to remove."""
|
|
@@ -577,6 +607,15 @@ extend type Mutation {
|
|
|
577
607
|
context and is never created.
|
|
578
608
|
"""
|
|
579
609
|
cartValidate: CartValidatePayload!
|
|
610
|
+
"""
|
|
611
|
+
Move the active cart onto the request's sales channel, then reconcile its locale. Takes no
|
|
612
|
+
arguments: the cart is resolved from the request context and is never created. An empty cart, or
|
|
613
|
+
a cart already on the active channel, does not send `sc`. Otherwise one POST to `items/update`
|
|
614
|
+
with `sc` re-sends every item's index and current quantity, so Checkout reprocesses that order
|
|
615
|
+
form and drops lines the destination cannot sell. An upstream failure is reported in `userErrors`
|
|
616
|
+
and does not throw.
|
|
617
|
+
"""
|
|
618
|
+
cartSalesChannelSync: CartSalesChannelSyncPayload!
|
|
580
619
|
}
|
|
581
620
|
|
|
582
621
|
extend type Mutation {
|
|
@@ -743,6 +782,18 @@ extend type Mutation {
|
|
|
743
782
|
): CustomerOrderCancelPayload!
|
|
744
783
|
}
|
|
745
784
|
|
|
785
|
+
extend type Mutation {
|
|
786
|
+
"""
|
|
787
|
+
Removes one of the signed-in shopper's saved cards, by the id the
|
|
788
|
+
customerSavedCards read returned. Returns the refreshed list on success.
|
|
789
|
+
Throws UNAUTHORIZED / UPSTREAM_ERROR / UPSTREAM_TIMEOUT (ADR-00007).
|
|
790
|
+
"""
|
|
791
|
+
customerSavedCardRemove(
|
|
792
|
+
"""The card's id, as customerSavedCards returned it."""
|
|
793
|
+
id: ID!
|
|
794
|
+
): CustomerSavedCardRemovePayload!
|
|
795
|
+
}
|
|
796
|
+
|
|
746
797
|
"""
|
|
747
798
|
A manufacturer or designer brand.
|
|
748
799
|
Maps to VTEX Brand entity.
|
|
@@ -1804,10 +1855,10 @@ type Cart implements Node @cacheControl(maxAge: 0, scope: PRIVATE) {
|
|
|
1804
1855
|
freeShippingProgress: FreeShippingProgress
|
|
1805
1856
|
"""
|
|
1806
1857
|
Non-null when the cart belongs to a different sales channel than the request's active context. The
|
|
1807
|
-
cart is left exactly as it was: nothing here reprices it or removes an item. Converging it is
|
|
1808
|
-
write, and
|
|
1809
|
-
|
|
1810
|
-
|
|
1858
|
+
cart is left exactly as it was: nothing here reprices it or removes an item. Converging it is the
|
|
1859
|
+
`cartSalesChannelSync` write, and that write makes Checkout reprocess the same orderForm — prices,
|
|
1860
|
+
promotions, coupons and logistics are recomputed and items not sellable in the destination channel
|
|
1861
|
+
are removed by Checkout, while orderFormId, attachments and addresses survive.
|
|
1811
1862
|
"""
|
|
1812
1863
|
salesChannelMismatch: CartSalesChannelMismatch
|
|
1813
1864
|
}
|
|
@@ -2212,30 +2263,32 @@ input CartItemAddInput {
|
|
|
2212
2263
|
seller: ID = "U2VsbGVyOjE="
|
|
2213
2264
|
}
|
|
2214
2265
|
|
|
2215
|
-
"""Input for removing
|
|
2266
|
+
"""Input for removing a line from a cart."""
|
|
2216
2267
|
input CartItemRemoveInput {
|
|
2217
|
-
"""The
|
|
2218
|
-
|
|
2268
|
+
"""The line to remove: its `CartItem.lineId`."""
|
|
2269
|
+
lineId: String!
|
|
2219
2270
|
}
|
|
2220
2271
|
|
|
2221
|
-
"""Input for removing multiple
|
|
2272
|
+
"""Input for removing multiple lines from a cart in one call."""
|
|
2222
2273
|
input CartItemsRemoveInput {
|
|
2223
|
-
"""
|
|
2224
|
-
|
|
2274
|
+
"""
|
|
2275
|
+
The lines to remove: their `CartItem.lineId` values. Duplicates are collapsed.
|
|
2276
|
+
"""
|
|
2277
|
+
lineIds: [String!]!
|
|
2225
2278
|
}
|
|
2226
2279
|
|
|
2227
|
-
"""Input for increasing the quantity of a cart
|
|
2280
|
+
"""Input for increasing the quantity of a cart line."""
|
|
2228
2281
|
input CartItemQuantityIncreaseInput {
|
|
2229
|
-
"""The
|
|
2230
|
-
|
|
2282
|
+
"""The line whose quantity to increase: its `CartItem.lineId`."""
|
|
2283
|
+
lineId: String!
|
|
2231
2284
|
"""Amount to add to the current quantity. Defaults to 1."""
|
|
2232
2285
|
quantityToAdd: Int = 1
|
|
2233
2286
|
}
|
|
2234
2287
|
|
|
2235
|
-
"""Input for decreasing the quantity of a cart
|
|
2288
|
+
"""Input for decreasing the quantity of a cart line."""
|
|
2236
2289
|
input CartItemQuantityDecreaseInput {
|
|
2237
|
-
"""The
|
|
2238
|
-
|
|
2290
|
+
"""The line whose quantity to decrease: its `CartItem.lineId`."""
|
|
2291
|
+
lineId: String!
|
|
2239
2292
|
"""Amount to subtract from the current quantity. Defaults to 1."""
|
|
2240
2293
|
quantityToRemove: Int = 1
|
|
2241
2294
|
}
|
|
@@ -2270,26 +2323,24 @@ enum CartItemAddErrorCode {
|
|
|
2270
2323
|
enum CartItemRemoveErrorCode {
|
|
2271
2324
|
"""No cart context was provided (x-order-form-id header/cookie)."""
|
|
2272
2325
|
MISSING_CART_CONTEXT
|
|
2273
|
-
"""The specified
|
|
2326
|
+
"""The specified line was not found in the cart."""
|
|
2274
2327
|
ITEM_NOT_FOUND
|
|
2275
2328
|
"""The cart was not found."""
|
|
2276
2329
|
CART_NOT_FOUND
|
|
2277
|
-
"""The
|
|
2278
|
-
|
|
2330
|
+
"""The upstream checkout API returned an unusable response."""
|
|
2331
|
+
UPSTREAM_ERROR
|
|
2279
2332
|
}
|
|
2280
2333
|
|
|
2281
2334
|
"""Error codes for cart items batch remove operations."""
|
|
2282
2335
|
enum CartItemsRemoveErrorCode {
|
|
2283
2336
|
"""No cart context was provided (x-order-form-id header/cookie)."""
|
|
2284
2337
|
MISSING_CART_CONTEXT
|
|
2285
|
-
"""None of the specified
|
|
2338
|
+
"""None of the specified lines were found in the cart."""
|
|
2286
2339
|
ITEM_NOT_FOUND
|
|
2287
2340
|
"""The cart was not found."""
|
|
2288
2341
|
CART_NOT_FOUND
|
|
2289
|
-
"""
|
|
2290
|
-
|
|
2291
|
-
"""The input contained no variant IDs."""
|
|
2292
|
-
NO_VARIANT_IDS_PROVIDED
|
|
2342
|
+
"""The input contained no line IDs."""
|
|
2343
|
+
NO_LINE_IDS_PROVIDED
|
|
2293
2344
|
"""The upstream checkout API returned an unusable response."""
|
|
2294
2345
|
UPSTREAM_ERROR
|
|
2295
2346
|
}
|
|
@@ -2300,12 +2351,12 @@ enum CartItemQuantityIncreaseErrorCode {
|
|
|
2300
2351
|
MISSING_CART_CONTEXT
|
|
2301
2352
|
"""The quantity must be a positive integer."""
|
|
2302
2353
|
INVALID_QUANTITY
|
|
2303
|
-
"""The specified
|
|
2354
|
+
"""The specified line was not found in the cart."""
|
|
2304
2355
|
ITEM_NOT_FOUND
|
|
2305
2356
|
"""The cart was not found."""
|
|
2306
2357
|
CART_NOT_FOUND
|
|
2307
|
-
"""The
|
|
2308
|
-
|
|
2358
|
+
"""The upstream checkout API returned an unusable response."""
|
|
2359
|
+
UPSTREAM_ERROR
|
|
2309
2360
|
}
|
|
2310
2361
|
|
|
2311
2362
|
"""Error codes for cart item quantity decrease operations."""
|
|
@@ -2314,12 +2365,12 @@ enum CartItemQuantityDecreaseErrorCode {
|
|
|
2314
2365
|
MISSING_CART_CONTEXT
|
|
2315
2366
|
"""The quantity must be a positive integer."""
|
|
2316
2367
|
INVALID_QUANTITY
|
|
2317
|
-
"""The specified
|
|
2368
|
+
"""The specified line was not found in the cart."""
|
|
2318
2369
|
ITEM_NOT_FOUND
|
|
2319
2370
|
"""The cart was not found."""
|
|
2320
2371
|
CART_NOT_FOUND
|
|
2321
|
-
"""The
|
|
2322
|
-
|
|
2372
|
+
"""The upstream checkout API returned an unusable response."""
|
|
2373
|
+
UPSTREAM_ERROR
|
|
2323
2374
|
}
|
|
2324
2375
|
|
|
2325
2376
|
"""A domain error returned from a cart item add mutation."""
|
|
@@ -2412,6 +2463,11 @@ enum CartCouponApplyErrorCode {
|
|
|
2412
2463
|
COUPON_NOT_FOUND
|
|
2413
2464
|
"""The coupon code has expired."""
|
|
2414
2465
|
COUPON_EXPIRED
|
|
2466
|
+
"""
|
|
2467
|
+
The code was rejected while another coupon was applied, and the applied coupons were kept. The
|
|
2468
|
+
platform does not say whether the code is unknown or cannot be combined with them.
|
|
2469
|
+
"""
|
|
2470
|
+
COUPON_NOT_COMBINED
|
|
2415
2471
|
}
|
|
2416
2472
|
|
|
2417
2473
|
"""Error codes for cart coupon remove operations."""
|
|
@@ -2488,6 +2544,44 @@ type CartValidatePayload {
|
|
|
2488
2544
|
userErrors: [CartValidateError!]!
|
|
2489
2545
|
}
|
|
2490
2546
|
|
|
2547
|
+
"""Error codes for moving a cart onto the active sales channel."""
|
|
2548
|
+
enum CartSalesChannelSyncErrorCode {
|
|
2549
|
+
"""No cart context was provided (x-order-form-id header/cookie)."""
|
|
2550
|
+
MISSING_CART_CONTEXT
|
|
2551
|
+
"""The cart was not found."""
|
|
2552
|
+
CART_NOT_FOUND
|
|
2553
|
+
"""
|
|
2554
|
+
The upstream checkout API could not be reached or returned an unusable response.
|
|
2555
|
+
"""
|
|
2556
|
+
UPSTREAM_ERROR
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
"""A domain error returned from the cartSalesChannelSync mutation."""
|
|
2560
|
+
type CartSalesChannelSyncError {
|
|
2561
|
+
"""Machine-readable error code."""
|
|
2562
|
+
code: CartSalesChannelSyncErrorCode!
|
|
2563
|
+
"""Human-readable error message."""
|
|
2564
|
+
message: String!
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
"""
|
|
2568
|
+
Payload returned by the cartSalesChannelSync mutation.
|
|
2569
|
+
|
|
2570
|
+
The cart comes from the request context and is never created. An empty cart, or a cart already on
|
|
2571
|
+
the active sales channel, does not send `sc`. Otherwise one POST to `items/update` with `sc`
|
|
2572
|
+
re-sends every item's index and current quantity, so Checkout reprocesses that order form and drops
|
|
2573
|
+
lines the destination cannot sell, and then the locale is reconciled. An upstream failure is
|
|
2574
|
+
reported in `userErrors` and does not throw.
|
|
2575
|
+
"""
|
|
2576
|
+
type CartSalesChannelSyncPayload {
|
|
2577
|
+
"""
|
|
2578
|
+
The cart after the channel move and locale reconciliation, or null if errors occurred.
|
|
2579
|
+
"""
|
|
2580
|
+
cart: Cart
|
|
2581
|
+
"""Domain errors that occurred during the operation."""
|
|
2582
|
+
userErrors: [CartSalesChannelSyncError!]!
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2491
2585
|
"""The delivery channel for a shipping option."""
|
|
2492
2586
|
enum DeliveryChannel {
|
|
2493
2587
|
"""Home delivery."""
|
|
@@ -2883,8 +2977,10 @@ input ShippingAddressUpdateInput {
|
|
|
2883
2977
|
Saved address reference. Present when the shopper picked (and possibly edited) a saved address.
|
|
2884
2978
|
"""
|
|
2885
2979
|
savedAddressId: ID
|
|
2886
|
-
"""
|
|
2887
|
-
|
|
2980
|
+
"""
|
|
2981
|
+
Recipient name for the delivery address. Omit it for a destination-only write: the cart keeps its current recipient name. A blank string is rejected with MISSING_RECIPIENT_NAME.
|
|
2982
|
+
"""
|
|
2983
|
+
recipientName: String
|
|
2888
2984
|
"""Postal code for the delivery address."""
|
|
2889
2985
|
postalCode: String!
|
|
2890
2986
|
"""ISO 3166-1 alpha-3 country code (e.g. "BRA")."""
|
|
@@ -4675,3 +4771,171 @@ type CustomerOrderCancelPayload {
|
|
|
4675
4771
|
"""Typed, expected failures. Empty on success."""
|
|
4676
4772
|
userErrors: [CustomerOrderCancelError!]!
|
|
4677
4773
|
}
|
|
4774
|
+
|
|
4775
|
+
"""
|
|
4776
|
+
The signed-in shopper's saved cards, read from their persistent checkout
|
|
4777
|
+
profile. Never cart-scoped.
|
|
4778
|
+
"""
|
|
4779
|
+
type CustomerSavedCards @cacheControl(maxAge: 0, scope: PRIVATE) {
|
|
4780
|
+
"""
|
|
4781
|
+
Stable identity for cache normalization. Not a Relay Node ID: derived from the
|
|
4782
|
+
session, with no id argument and no Query.node entry.
|
|
4783
|
+
"""
|
|
4784
|
+
id: ID!
|
|
4785
|
+
"""
|
|
4786
|
+
Every card the shopper saved, in the platform's order, including expired and
|
|
4787
|
+
unusable ones. Empty when none is saved.
|
|
4788
|
+
"""
|
|
4789
|
+
cards: [CustomerSavedCard!]!
|
|
4790
|
+
}
|
|
4791
|
+
|
|
4792
|
+
"""
|
|
4793
|
+
One of the shopper's saved cards, as the account sees it. Distinct from the
|
|
4794
|
+
cart-scoped SavedCard. Never carries a card number beyond its last four digits,
|
|
4795
|
+
a BIN, or a security code.
|
|
4796
|
+
"""
|
|
4797
|
+
type CustomerSavedCard @cacheControl(maxAge: 0, scope: PRIVATE) {
|
|
4798
|
+
"""Opaque, stable cache key. Not a Relay Node ID."""
|
|
4799
|
+
id: ID!
|
|
4800
|
+
"""The card network the card belongs to."""
|
|
4801
|
+
network: CardNetwork!
|
|
4802
|
+
"""
|
|
4803
|
+
The card number's last four digits. Empty when the platform's record has none.
|
|
4804
|
+
"""
|
|
4805
|
+
lastDigits: String!
|
|
4806
|
+
"""When the card expires. Null when the platform's record has no date."""
|
|
4807
|
+
expiry: CardExpiry
|
|
4808
|
+
"""
|
|
4809
|
+
Whether the card can still be used, derived once here so the UI never re-derives it.
|
|
4810
|
+
"""
|
|
4811
|
+
status: CustomerSavedCardStatus!
|
|
4812
|
+
}
|
|
4813
|
+
|
|
4814
|
+
"""A card network, such as Visa or Mastercard."""
|
|
4815
|
+
type CardNetwork {
|
|
4816
|
+
"""
|
|
4817
|
+
The platform's payment-system id for the network. Empty when the record has none.
|
|
4818
|
+
"""
|
|
4819
|
+
id: String!
|
|
4820
|
+
"""
|
|
4821
|
+
Display name of the network (e.g. "Visa"). Falls back to the id when the record has no name.
|
|
4822
|
+
"""
|
|
4823
|
+
name: String!
|
|
4824
|
+
}
|
|
4825
|
+
|
|
4826
|
+
"""A card's expiry month and year."""
|
|
4827
|
+
type CardExpiry {
|
|
4828
|
+
"""Expiry month, from 1 to 12."""
|
|
4829
|
+
month: Int!
|
|
4830
|
+
"""Four-digit expiry year."""
|
|
4831
|
+
year: Int!
|
|
4832
|
+
}
|
|
4833
|
+
|
|
4834
|
+
"""Whether a saved card can still be used."""
|
|
4835
|
+
enum CustomerSavedCardStatus {
|
|
4836
|
+
"""The card has not expired and the platform reports nothing against it."""
|
|
4837
|
+
USABLE
|
|
4838
|
+
"""
|
|
4839
|
+
The card's expiry date has passed. Wins over any other platform report.
|
|
4840
|
+
"""
|
|
4841
|
+
EXPIRED
|
|
4842
|
+
"""The card has not expired, but the platform reports it cannot be used."""
|
|
4843
|
+
UNUSABLE
|
|
4844
|
+
}
|
|
4845
|
+
|
|
4846
|
+
"""
|
|
4847
|
+
A card network the store accepts on the request's sales channel, with the
|
|
4848
|
+
rules card entry validates a card by. Read from the store's payment systems,
|
|
4849
|
+
never from a cart.
|
|
4850
|
+
"""
|
|
4851
|
+
type CardNetworkRule @cacheControl(maxAge: 0, scope: PRIVATE) {
|
|
4852
|
+
"""
|
|
4853
|
+
The network. Its id is the platform's payment-system id, the same id a saved
|
|
4854
|
+
card's network carries.
|
|
4855
|
+
"""
|
|
4856
|
+
network: CardNetwork!
|
|
4857
|
+
"""
|
|
4858
|
+
Pattern a full card number of this network matches. Null when the store sets none.
|
|
4859
|
+
"""
|
|
4860
|
+
numberRegex: String
|
|
4861
|
+
"""
|
|
4862
|
+
Display mask for the card number, with 9 standing for a digit. Null when the store sets none.
|
|
4863
|
+
"""
|
|
4864
|
+
numberMask: String
|
|
4865
|
+
"""Pattern the security code matches. Null when the store sets none."""
|
|
4866
|
+
securityCodeRegex: String
|
|
4867
|
+
"""Display mask for the security code. Null when the store sets none."""
|
|
4868
|
+
securityCodeMask: String
|
|
4869
|
+
"""Whether the card asks for a security code."""
|
|
4870
|
+
securityCodeRequired: Boolean!
|
|
4871
|
+
"""Whether the card asks for an expiry date."""
|
|
4872
|
+
expirationRequired: Boolean!
|
|
4873
|
+
"""Whether the card asks for the holder's name."""
|
|
4874
|
+
holderNameRequired: Boolean!
|
|
4875
|
+
"""Whether a cardholder document is required for this network."""
|
|
4876
|
+
requiresDocument: Boolean!
|
|
4877
|
+
"""
|
|
4878
|
+
Whether a cardholder document field is shown for this network. Distinct from requiresDocument.
|
|
4879
|
+
"""
|
|
4880
|
+
displayDocument: Boolean!
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4883
|
+
"""
|
|
4884
|
+
One of the signed-in shopper's saved addresses a new card can be billed to.
|
|
4885
|
+
"""
|
|
4886
|
+
type CardBillingAddress @cacheControl(maxAge: 0, scope: PRIVATE) {
|
|
4887
|
+
"""Opaque, stable cache key. Not a Relay Node ID."""
|
|
4888
|
+
id: ID!
|
|
4889
|
+
"""
|
|
4890
|
+
Name of the person the address belongs to. Null when the platform's record has none.
|
|
4891
|
+
"""
|
|
4892
|
+
receiverName: String
|
|
4893
|
+
"""Street name. Null when the platform's record has none."""
|
|
4894
|
+
street: String
|
|
4895
|
+
"""Street number. Null when the platform's record has none."""
|
|
4896
|
+
number: String
|
|
4897
|
+
"""
|
|
4898
|
+
Complement, such as an apartment. Null when the platform's record has none.
|
|
4899
|
+
"""
|
|
4900
|
+
complement: String
|
|
4901
|
+
"""Neighborhood. Null when the platform's record has none."""
|
|
4902
|
+
neighborhood: String
|
|
4903
|
+
"""City. Null when the platform's record has none."""
|
|
4904
|
+
city: String
|
|
4905
|
+
"""State or province. Null when the platform's record has none."""
|
|
4906
|
+
state: String
|
|
4907
|
+
"""Postal code. Null when the platform's record has none."""
|
|
4908
|
+
postalCode: String
|
|
4909
|
+
"""
|
|
4910
|
+
Country of the address, as the platform stores it (ISO 3166-1 alpha-3).
|
|
4911
|
+
"""
|
|
4912
|
+
country: String!
|
|
4913
|
+
}
|
|
4914
|
+
|
|
4915
|
+
"""Payload returned by customerSavedCardRemove."""
|
|
4916
|
+
type CustomerSavedCardRemovePayload {
|
|
4917
|
+
"""
|
|
4918
|
+
The shopper's saved cards after the removal. Null when userErrors is non-empty.
|
|
4919
|
+
"""
|
|
4920
|
+
customerSavedCards: CustomerSavedCards
|
|
4921
|
+
"""Domain errors that stopped the removal. Empty on success."""
|
|
4922
|
+
userErrors: [CustomerSavedCardRemoveError!]!
|
|
4923
|
+
}
|
|
4924
|
+
|
|
4925
|
+
"""A domain error returned by customerSavedCardRemove."""
|
|
4926
|
+
type CustomerSavedCardRemoveError {
|
|
4927
|
+
"""Machine-readable error code."""
|
|
4928
|
+
code: CustomerSavedCardRemoveErrorCode!
|
|
4929
|
+
"""Human-readable error message."""
|
|
4930
|
+
message: String!
|
|
4931
|
+
}
|
|
4932
|
+
|
|
4933
|
+
"""Why a saved card was not removed."""
|
|
4934
|
+
enum CustomerSavedCardRemoveErrorCode {
|
|
4935
|
+
"""The id names no saved card of the signed-in shopper."""
|
|
4936
|
+
CARD_NOT_FOUND
|
|
4937
|
+
"""
|
|
4938
|
+
The platform refused the removal, or the card is still listed after it.
|
|
4939
|
+
"""
|
|
4940
|
+
REMOVAL_REFUSED
|
|
4941
|
+
}
|
|
@@ -3,9 +3,11 @@ import { AddressActionProvider, AddressActionProviderProps } from "./address-act
|
|
|
3
3
|
import { AnalyticsActionProvider, AnalyticsActionProviderProps } from "./analytics-action-provider.js";
|
|
4
4
|
import { CartActionProvider, CartActionProviderProps } from "./cart-action-provider.js";
|
|
5
5
|
import { IdentityActionProvider, IdentityActionProviderProps } from "./identity-action-provider.js";
|
|
6
|
+
import { LocaleActionProvider, LocaleActionProviderProps } from "./locale-action-provider.js";
|
|
6
7
|
import { OrderActionProvider, OrderActionProviderProps } from "./order-action-provider.js";
|
|
7
8
|
import { PaymentActionProvider, PaymentActionProviderProps } from "./payment-action-provider.js";
|
|
8
9
|
import { RegionActionProvider, RegionActionProviderProps } from "./region-action-provider.js";
|
|
10
|
+
import { SavedCardActionProvider, SavedCardActionProviderProps } from "./saved-card-action-provider.js";
|
|
9
11
|
import { SessionActionProvider, SessionActionProviderProps } from "./session-action-provider.js";
|
|
10
12
|
import { ShippingActionProvider, ShippingActionProviderProps } from "./shipping-action-provider.js";
|
|
11
|
-
export { AddressActionProvider, type AddressActionProviderProps, AnalyticsActionProvider, type AnalyticsActionProviderProps, CartActionProvider, type CartActionProviderProps, IdentityActionProvider, type IdentityActionProviderProps, OrderActionProvider, type OrderActionProviderProps, PaymentActionProvider, type PaymentActionProviderProps, RegionActionProvider, type RegionActionProviderProps, SessionActionProvider, type SessionActionProviderProps, ShippingActionProvider, type ShippingActionProviderProps };
|
|
13
|
+
export { AddressActionProvider, type AddressActionProviderProps, AnalyticsActionProvider, type AnalyticsActionProviderProps, CartActionProvider, type CartActionProviderProps, IdentityActionProvider, type IdentityActionProviderProps, LocaleActionProvider, type LocaleActionProviderProps, OrderActionProvider, type OrderActionProviderProps, PaymentActionProvider, type PaymentActionProviderProps, RegionActionProvider, type RegionActionProviderProps, SavedCardActionProvider, type SavedCardActionProviderProps, SessionActionProvider, type SessionActionProviderProps, ShippingActionProvider, type ShippingActionProviderProps };
|
|
@@ -2,9 +2,11 @@ import { AddressActionProvider } from "./address-action-provider.js";
|
|
|
2
2
|
import { AnalyticsActionProvider } from "./analytics-action-provider.js";
|
|
3
3
|
import { CartActionProvider } from "./cart-action-provider.js";
|
|
4
4
|
import { IdentityActionProvider } from "./identity-action-provider.js";
|
|
5
|
+
import { LocaleActionProvider } from "./locale-action-provider.js";
|
|
5
6
|
import { OrderActionProvider } from "./order-action-provider.js";
|
|
6
7
|
import { PaymentActionProvider } from "./payment-action-provider.js";
|
|
7
8
|
import { RegionActionProvider } from "./region-action-provider.js";
|
|
9
|
+
import { SavedCardActionProvider } from "./saved-card-action-provider.js";
|
|
8
10
|
import { SessionActionProvider } from "./session-action-provider.js";
|
|
9
11
|
import { ShippingActionProvider } from "./shipping-action-provider.js";
|
|
10
|
-
export { AddressActionProvider, AnalyticsActionProvider, CartActionProvider, IdentityActionProvider, OrderActionProvider, PaymentActionProvider, RegionActionProvider, SessionActionProvider, ShippingActionProvider };
|
|
12
|
+
export { AddressActionProvider, AnalyticsActionProvider, CartActionProvider, IdentityActionProvider, LocaleActionProvider, OrderActionProvider, PaymentActionProvider, RegionActionProvider, SavedCardActionProvider, SessionActionProvider, ShippingActionProvider };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionProviderProps } from "./inject-actions.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/sdk/actions/locale-action-provider.d.ts
|
|
4
|
+
export type LocaleActionProviderProps = ActionProviderProps;
|
|
5
|
+
/**
|
|
6
|
+
* Compiler-emitted runtime wrapper for the `locale` action namespace — a line-for-line mirror of
|
|
7
|
+
* `RegionActionProvider`. The compiler wraps every element whose definition declares
|
|
8
|
+
* `actions: { locale: [...] }` with `<LocaleActionProvider methods={[...]}>`, calls `useLocaleActions`
|
|
9
|
+
* once, narrows the surface to the declared `methods`, and publishes it through
|
|
10
|
+
* `ActionsOverrideContext` (merging with any outer namespace provider) for `useActionsOverride` to
|
|
11
|
+
* read further down. A namespace a component does not declare is never wrapped, so its hook is never
|
|
12
|
+
* called.
|
|
13
|
+
*/
|
|
14
|
+
export declare function LocaleActionProvider(props: LocaleActionProviderProps): ReactNode;
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=locale-action-provider.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useInjectActions } from "./inject-actions.js";
|
|
3
|
+
import { useLocaleActions } from "../locale/use-locale-actions.js";
|
|
4
|
+
//#region src/sdk/actions/locale-action-provider.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Compiler-emitted runtime wrapper for the `locale` action namespace — a line-for-line mirror of
|
|
7
|
+
* `RegionActionProvider`. The compiler wraps every element whose definition declares
|
|
8
|
+
* `actions: { locale: [...] }` with `<LocaleActionProvider methods={[...]}>`, calls `useLocaleActions`
|
|
9
|
+
* once, narrows the surface to the declared `methods`, and publishes it through
|
|
10
|
+
* `ActionsOverrideContext` (merging with any outer namespace provider) for `useActionsOverride` to
|
|
11
|
+
* read further down. A namespace a component does not declare is never wrapped, so its hook is never
|
|
12
|
+
* called.
|
|
13
|
+
*/
|
|
14
|
+
function LocaleActionProvider(props) {
|
|
15
|
+
return useInjectActions("locale", useLocaleActions(), props);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { LocaleActionProvider };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=locale-action-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-action-provider.js","names":[],"sources":["../../../src/sdk/actions/locale-action-provider.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { useLocaleActions } from '../locale/use-locale-actions.js';\nimport { type ActionProviderProps, useInjectActions } from './inject-actions.js';\n\nexport type LocaleActionProviderProps = ActionProviderProps;\n\n/**\n * Compiler-emitted runtime wrapper for the `locale` action namespace — a line-for-line mirror of\n * `RegionActionProvider`. The compiler wraps every element whose definition declares\n * `actions: { locale: [...] }` with `<LocaleActionProvider methods={[...]}>`, calls `useLocaleActions`\n * once, narrows the surface to the declared `methods`, and publishes it through\n * `ActionsOverrideContext` (merging with any outer namespace provider) for `useActionsOverride` to\n * read further down. A namespace a component does not declare is never wrapped, so its hook is never\n * called.\n */\nexport function LocaleActionProvider(props: LocaleActionProviderProps): ReactNode {\n return useInjectActions('locale', useLocaleActions(), props);\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,SAAgB,qBAAqB,OAA6C;CAChF,OAAO,iBAAiB,UAAU,iBAAiB,GAAG,KAAK;AAC7D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionProviderProps } from "./inject-actions.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/sdk/actions/saved-card-action-provider.d.ts
|
|
4
|
+
export type SavedCardActionProviderProps = ActionProviderProps;
|
|
5
|
+
/**
|
|
6
|
+
* Compiler-emitted runtime wrapper for the `savedCard` action namespace, structurally identical to
|
|
7
|
+
* `IdentityActionProvider`: calls `useSavedCardActions` once, narrows it to the declared `methods`,
|
|
8
|
+
* and publishes it through `ActionsOverrideContext`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SavedCardActionProvider(props: SavedCardActionProviderProps): ReactNode;
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=saved-card-action-provider.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useInjectActions } from "./inject-actions.js";
|
|
3
|
+
import { useSavedCardActions } from "../saved-cards/use-saved-card-actions.js";
|
|
4
|
+
//#region src/sdk/actions/saved-card-action-provider.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Compiler-emitted runtime wrapper for the `savedCard` action namespace, structurally identical to
|
|
7
|
+
* `IdentityActionProvider`: calls `useSavedCardActions` once, narrows it to the declared `methods`,
|
|
8
|
+
* and publishes it through `ActionsOverrideContext`.
|
|
9
|
+
*/
|
|
10
|
+
function SavedCardActionProvider(props) {
|
|
11
|
+
return useInjectActions("savedCard", useSavedCardActions(), props);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SavedCardActionProvider };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=saved-card-action-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saved-card-action-provider.js","names":[],"sources":["../../../src/sdk/actions/saved-card-action-provider.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { useSavedCardActions } from '../saved-cards/use-saved-card-actions.js';\nimport { type ActionProviderProps, useInjectActions } from './inject-actions.js';\n\nexport type SavedCardActionProviderProps = ActionProviderProps;\n\n/**\n * Compiler-emitted runtime wrapper for the `savedCard` action namespace, structurally identical to\n * `IdentityActionProvider`: calls `useSavedCardActions` once, narrows it to the declared `methods`,\n * and publishes it through `ActionsOverrideContext`.\n */\nexport function SavedCardActionProvider(props: SavedCardActionProviderProps): ReactNode {\n return useInjectActions('savedCard', useSavedCardActions(), props);\n}\n"],"mappings":";;;;;;;;;AAaA,SAAgB,wBAAwB,OAAgD;CACtF,OAAO,iBAAiB,aAAa,oBAAoB,GAAG,KAAK;AACnE"}
|
|
@@ -2,26 +2,30 @@ import { AddressActions } from "../address/use-address-actions.js";
|
|
|
2
2
|
import { AnalyticsActions } from "../analytics/use-analytics-actions.js";
|
|
3
3
|
import { CartActions } from "../cart/use-cart-actions.js";
|
|
4
4
|
import { IdentityActions } from "../identity/use-identity-actions.js";
|
|
5
|
+
import { LocaleActions } from "../locale/use-locale-actions.js";
|
|
5
6
|
import { OrderActions } from "../orders/use-order-actions.js";
|
|
6
7
|
import { PaymentActions } from "../payment/use-payment-actions.js";
|
|
7
8
|
import { RegionActions } from "../region/use-region-actions.js";
|
|
9
|
+
import { SavedCardActions } from "../saved-cards/use-saved-card-actions.js";
|
|
8
10
|
import { SessionActions } from "../session/use-session-actions.js";
|
|
9
11
|
import { ShippingActions } from "../shipping/use-shipping-actions.js";
|
|
10
12
|
//#region src/sdk/actions/types.d.ts
|
|
11
13
|
/**
|
|
12
14
|
* The `$actions` prop the compiler injects (and `mockAction` builds for tests). Each namespace is
|
|
13
15
|
* optional and each method is optional within it, because a component only receives the methods it
|
|
14
|
-
* declared under `actions: { ... }`. Ships the `address`, `analytics`, `cart`, `identity`, `
|
|
15
|
-
* `payment`, `region`, `session`, and `shipping` namespaces.
|
|
16
|
+
* declared under `actions: { ... }`. Ships the `address`, `analytics`, `cart`, `identity`, `locale`,
|
|
17
|
+
* `order`, `payment`, `region`, `savedCard`, `session`, and `shipping` namespaces.
|
|
16
18
|
*/
|
|
17
19
|
export type ComponentActions = {
|
|
18
20
|
address?: Partial<AddressActions>;
|
|
19
21
|
analytics?: Partial<AnalyticsActions>;
|
|
20
22
|
cart?: Partial<CartActions>;
|
|
21
23
|
identity?: Partial<IdentityActions>;
|
|
24
|
+
locale?: Partial<LocaleActions>;
|
|
22
25
|
order?: Partial<OrderActions>;
|
|
23
26
|
payment?: Partial<PaymentActions>;
|
|
24
27
|
region?: Partial<RegionActions>;
|
|
28
|
+
savedCard?: Partial<SavedCardActions>;
|
|
25
29
|
session?: Partial<SessionActions>;
|
|
26
30
|
shipping?: Partial<ShippingActions>;
|
|
27
31
|
};
|
|
@@ -32,7 +32,8 @@ const typePolicies = {
|
|
|
32
32
|
Shipping: { fields: { savedAddresses: replaceList } },
|
|
33
33
|
Order: { fields: { totals: replaceList } },
|
|
34
34
|
SellerOrder: { fields: { totals: replaceList } },
|
|
35
|
-
OrderItem: { fields: { customizations: replaceList } }
|
|
35
|
+
OrderItem: { fields: { customizations: replaceList } },
|
|
36
|
+
CardNetwork: { keyFields: false }
|
|
36
37
|
};
|
|
37
38
|
/**
|
|
38
39
|
* The single source of truth for InMemoryCache configuration. Both the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storefront-cache.js","names":[],"sources":["../../../src/sdk/cache/storefront-cache.ts"],"sourcesContent":["import { InMemoryCache, type InMemoryCacheConfig, type TypePolicies } from '@apollo/client';\nimport { possibleTypes } from '../generated/fragment-types.js';\n\n/**\n * Per-entity normalization and field-merge rules for the Storefront cache.\n *\n * The cart and the order share three types whose ids neither can scope\n * (docs/features/order-placed/rfc.md, 3.4): a totalizer's id is its category\n * (\"Items\"), which the cart's totalizer line selects by; an address's id is the\n * saved address itself, masked on the order and not on the cart; and a\n * customization's id is the assembly (\"Engraving\"), which two lines of one cart\n * already share. Normalized, one record would overwrite the other, so each is\n * stored inside the record that holds it, and replaced on every write: safe\n * while every fragment selects the same subfields of each.\n *\n * The lists that hold them are the server's whole answer, so each write\n * replaces the list (`merge: false`). Apollo does the same by default, but warns\n * that data may be lost whenever such a list shrinks, as when a discount line\n * leaves the cart's totalizers; a merge by id would keep that stale line.\n *\n * Other domain entries arrive with the particles that need them — see\n * docs/storefront-core/reference-free-particle-model.md § Typed documents and the shared cache.\n */\nconst replaceList = { merge: false } as const;\n\nexport const typePolicies: TypePolicies = {\n CartTotalizer: { keyFields: false },\n Address: { keyFields: false },\n CartItemCustomization: { keyFields: false },\n Cart: { fields: { totalizers: replaceList } },\n CartItem: { fields: { customizations: replaceList } },\n CartItemComposition: { fields: { customizations: replaceList } },\n Shipping: { fields: { savedAddresses: replaceList } },\n Order: { fields: { totals: replaceList } },\n SellerOrder: { fields: { totals: replaceList } },\n OrderItem: { fields: { customizations: replaceList } },\n};\n\nexport { possibleTypes };\n\n/**\n * The single source of truth for InMemoryCache configuration. Both the\n * server-side `createClient` and the client-side `StorefrontProvider`\n * consume this so SSR and CSR normalize entities identically.\n */\nexport function getCacheConfig(): InMemoryCacheConfig {\n return {\n typePolicies,\n possibleTypes,\n };\n}\n\n/**\n * The only place an `InMemoryCache` is constructed on the server path.\n * The client-side provider builds its cache from `getCacheConfig()` so the\n * config is shared verbatim without coupling to a specific InMemoryCache\n * subclass (the Next.js integration ships its own SSR-aware variant).\n */\nexport function buildCache(): InMemoryCache {\n return new InMemoryCache(getCacheConfig());\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,cAAc,EAAE,OAAO,MAAM;AAEnC,MAAa,eAA6B;CACxC,eAAe,EAAE,WAAW,MAAM;CAClC,SAAS,EAAE,WAAW,MAAM;CAC5B,uBAAuB,EAAE,WAAW,MAAM;CAC1C,MAAM,EAAE,QAAQ,EAAE,YAAY,YAAY,EAAE;CAC5C,UAAU,EAAE,QAAQ,EAAE,gBAAgB,YAAY,EAAE;CACpD,qBAAqB,EAAE,QAAQ,EAAE,gBAAgB,YAAY,EAAE;CAC/D,UAAU,EAAE,QAAQ,EAAE,gBAAgB,YAAY,EAAE;CACpD,OAAO,EAAE,QAAQ,EAAE,QAAQ,YAAY,EAAE;CACzC,aAAa,EAAE,QAAQ,EAAE,QAAQ,YAAY,EAAE;CAC/C,WAAW,EAAE,QAAQ,EAAE,gBAAgB,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"storefront-cache.js","names":[],"sources":["../../../src/sdk/cache/storefront-cache.ts"],"sourcesContent":["import { InMemoryCache, type InMemoryCacheConfig, type TypePolicies } from '@apollo/client';\nimport { possibleTypes } from '../generated/fragment-types.js';\n\n/**\n * Per-entity normalization and field-merge rules for the Storefront cache.\n *\n * The cart and the order share three types whose ids neither can scope\n * (docs/features/order-placed/rfc.md, 3.4): a totalizer's id is its category\n * (\"Items\"), which the cart's totalizer line selects by; an address's id is the\n * saved address itself, masked on the order and not on the cart; and a\n * customization's id is the assembly (\"Engraving\"), which two lines of one cart\n * already share. Normalized, one record would overwrite the other, so each is\n * stored inside the record that holds it, and replaced on every write: safe\n * while every fragment selects the same subfields of each.\n *\n * The lists that hold them are the server's whole answer, so each write\n * replaces the list (`merge: false`). Apollo does the same by default, but warns\n * that data may be lost whenever such a list shrinks, as when a discount line\n * leaves the cart's totalizers; a merge by id would keep that stale line.\n *\n * Other domain entries arrive with the particles that need them — see\n * docs/storefront-core/reference-free-particle-model.md § Typed documents and the shared cache.\n */\nconst replaceList = { merge: false } as const;\n\nexport const typePolicies: TypePolicies = {\n CartTotalizer: { keyFields: false },\n Address: { keyFields: false },\n CartItemCustomization: { keyFields: false },\n Cart: { fields: { totalizers: replaceList } },\n CartItem: { fields: { customizations: replaceList } },\n CartItemComposition: { fields: { customizations: replaceList } },\n Shipping: { fields: { savedAddresses: replaceList } },\n Order: { fields: { totals: replaceList } },\n SellerOrder: { fields: { totals: replaceList } },\n OrderItem: { fields: { customizations: replaceList } },\n // A card network's id is the platform's payment-system id and is empty when a saved card has none,\n // so two networks would collide on one entry. Each stays embedded in its own card.\n CardNetwork: { keyFields: false },\n};\n\nexport { possibleTypes };\n\n/**\n * The single source of truth for InMemoryCache configuration. Both the\n * server-side `createClient` and the client-side `StorefrontProvider`\n * consume this so SSR and CSR normalize entities identically.\n */\nexport function getCacheConfig(): InMemoryCacheConfig {\n return {\n typePolicies,\n possibleTypes,\n };\n}\n\n/**\n * The only place an `InMemoryCache` is constructed on the server path.\n * The client-side provider builds its cache from `getCacheConfig()` so the\n * config is shared verbatim without coupling to a specific InMemoryCache\n * subclass (the Next.js integration ships its own SSR-aware variant).\n */\nexport function buildCache(): InMemoryCache {\n return new InMemoryCache(getCacheConfig());\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,cAAc,EAAE,OAAO,MAAM;AAEnC,MAAa,eAA6B;CACxC,eAAe,EAAE,WAAW,MAAM;CAClC,SAAS,EAAE,WAAW,MAAM;CAC5B,uBAAuB,EAAE,WAAW,MAAM;CAC1C,MAAM,EAAE,QAAQ,EAAE,YAAY,YAAY,EAAE;CAC5C,UAAU,EAAE,QAAQ,EAAE,gBAAgB,YAAY,EAAE;CACpD,qBAAqB,EAAE,QAAQ,EAAE,gBAAgB,YAAY,EAAE;CAC/D,UAAU,EAAE,QAAQ,EAAE,gBAAgB,YAAY,EAAE;CACpD,OAAO,EAAE,QAAQ,EAAE,QAAQ,YAAY,EAAE;CACzC,aAAa,EAAE,QAAQ,EAAE,QAAQ,YAAY,EAAE;CAC/C,WAAW,EAAE,QAAQ,EAAE,gBAAgB,YAAY,EAAE;CAGrD,aAAa,EAAE,WAAW,MAAM;AAClC;;;;;;AASA,SAAgB,iBAAsC;CACpD,OAAO;EACL;EACA;CACF;AACF;;;;;;;AAQA,SAAgB,aAA4B;CAC1C,OAAO,IAAI,cAAc,eAAe,CAAC;AAC3C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CartFragmentFragment, CartItemFragmentFragment, CartItemQuantityDecreaseMutation, CartItemQuantityIncreaseMutation, CartItemRemoveMutation, MoneyFragmentFragment } from "../generated/graphql.js";
|
|
1
|
+
import { CartFragmentFragment, CartFreeShippingProgressFragmentFragment, CartItemFragmentFragment, CartItemQuantityDecreaseMutation, CartItemQuantityIncreaseMutation, CartItemRemoveMutation, MoneyFragmentFragment } from "../generated/graphql.js";
|
|
2
2
|
import "./operations.js";
|
|
3
3
|
import { TypedDocumentNode } from "@apollo/client";
|
|
4
4
|
//#region src/sdk/cart/operations.d.ts
|
|
@@ -20,6 +20,7 @@ export type Money = MoneyFragmentFragment;
|
|
|
20
20
|
export type CartItemEntity = CartItemFragmentFragment;
|
|
21
21
|
export type CartEntity = CartFragmentFragment;
|
|
22
22
|
export type CartTotalizer = CartFragmentFragment['totalizers'][number];
|
|
23
|
+
export type CartFreeShippingProgress = CartFreeShippingProgressFragmentFragment['freeShippingProgress'];
|
|
23
24
|
export type CartUserError = Readonly<{
|
|
24
25
|
code: string;
|
|
25
26
|
message: string;
|