@doswiftly/storefront-sdk 19.2.0 → 20.0.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/core/auth/session-events.d.ts +6 -9
  3. package/dist/core/auth/session-events.d.ts.map +1 -1
  4. package/dist/core/auth/session-events.js +6 -9
  5. package/dist/core/cart/cart-client.d.ts +39 -2
  6. package/dist/core/cart/cart-client.d.ts.map +1 -1
  7. package/dist/core/cart/cart-client.js +53 -3
  8. package/dist/core/cart/cart-recovery.d.ts +41 -71
  9. package/dist/core/cart/cart-recovery.d.ts.map +1 -1
  10. package/dist/core/cart/cart-recovery.js +37 -95
  11. package/dist/core/cart/cookie-config.d.ts +29 -3
  12. package/dist/core/cart/cookie-config.d.ts.map +1 -1
  13. package/dist/core/cart/cookie-config.js +35 -3
  14. package/dist/core/generated/operation-types.d.ts +237 -4
  15. package/dist/core/generated/operation-types.d.ts.map +1 -1
  16. package/dist/core/index.d.ts +3 -2
  17. package/dist/core/index.d.ts.map +1 -1
  18. package/dist/core/index.js +3 -2
  19. package/dist/core/middleware/cart-secret.d.ts +43 -0
  20. package/dist/core/middleware/cart-secret.d.ts.map +1 -0
  21. package/dist/core/middleware/cart-secret.js +55 -0
  22. package/dist/core/middleware/session-retry.d.ts +2 -2
  23. package/dist/core/middleware/session-retry.js +2 -2
  24. package/dist/core/operations/cart.d.ts +23 -0
  25. package/dist/core/operations/cart.d.ts.map +1 -1
  26. package/dist/core/operations/cart.js +65 -0
  27. package/dist/react/cookies.d.ts +6 -0
  28. package/dist/react/cookies.d.ts.map +1 -1
  29. package/dist/react/cookies.js +23 -4
  30. package/dist/react/hooks/use-cart-manager.d.ts +20 -13
  31. package/dist/react/hooks/use-cart-manager.d.ts.map +1 -1
  32. package/dist/react/hooks/use-cart-manager.js +14 -12
  33. package/dist/react/hooks/use-logout.d.ts +7 -5
  34. package/dist/react/hooks/use-logout.d.ts.map +1 -1
  35. package/dist/react/hooks/use-logout.js +37 -7
  36. package/dist/react/providers/cart-manager-provider.d.ts +3 -0
  37. package/dist/react/providers/cart-manager-provider.d.ts.map +1 -1
  38. package/dist/react/providers/storefront-client-provider.d.ts.map +1 -1
  39. package/dist/react/providers/storefront-client-provider.js +6 -0
  40. package/dist/react/server/cookie-readers.d.ts +20 -0
  41. package/dist/react/server/cookie-readers.d.ts.map +1 -1
  42. package/dist/react/server/cookie-readers.js +22 -1
  43. package/dist/react/server/index.d.ts +2 -1
  44. package/dist/react/server/index.d.ts.map +1 -1
  45. package/dist/react/server/index.js +4 -1
  46. package/dist/react/stores/cart.context.d.ts +5 -0
  47. package/dist/react/stores/cart.context.d.ts.map +1 -1
  48. package/dist/react/stores/cart.context.js +5 -0
  49. package/dist/react/stores/cart.store.d.ts +6 -0
  50. package/dist/react/stores/cart.store.d.ts.map +1 -1
  51. package/dist/react/stores/cart.store.js +6 -0
  52. package/package.json +1 -1
@@ -649,8 +649,6 @@ export type CartBuyerIdentity = {
649
649
  export type CartBuyerIdentityInput = {
650
650
  /** Buyer country (ISO 3166-1 alpha-2). Hint for currency, tax and shipping eligibility before an address is set. */
651
651
  countryCode?: InputMaybe<CountryCode>;
652
- /** ID of a signed-in customer that owns this cart. Pass to bind a guest cart to a customer record. */
653
- customerId?: InputMaybe<Scalars['ID']['input']>;
654
652
  /** Buyer email address. Persisted to the order at checkout completion. */
655
653
  email?: InputMaybe<Scalars['String']['input']>;
656
654
  /** Buyer preferred language (ISO 639-1). Used for the order confirmation email and localised content. */
@@ -729,6 +727,8 @@ export type CartCreateInput = {
729
727
  export type CartCreatePayload = {
730
728
  /** The created cart on success; null when `userErrors` is non-empty. */
731
729
  cart?: Maybe<Cart>;
730
+ /** One-time cart access secret, returned only here on creation. The SDK persists it for you; if you call the API directly, store it immediately — it cannot be retrieved again. */
731
+ secret?: Maybe<Scalars['String']['output']>;
732
732
  /** Business / validation errors. Each entry carries a stable `code` (e.g. `CART_NOT_FOUND`, `NOT_ENOUGH_IN_STOCK`, `INVALID_MERCHANDISE_LINE`) — branch on `code`, never on `message`. */
733
733
  userErrors: Array<UserError>;
734
734
  /** Non-fatal advisories (informational only; the mutation itself succeeded). */
@@ -754,6 +754,14 @@ export type CartDiscountCodesUpdatePayload = {
754
754
  /** Non-fatal advisories — the mutation itself succeeded. */
755
755
  warnings: Array<CartWarning>;
756
756
  };
757
+ export type CartDowngradeOnLogoutPayload = {
758
+ /** The downgraded cart on success — same id and secret (no rotation), with the customer association, contact details, addresses and payment selection cleared but line items kept. Null when `userErrors` is non-empty. */
759
+ cart?: Maybe<Cart>;
760
+ /** Business / validation errors carrying a stable `CartErrorCode` in `code` (e.g. `CART_NOT_FOUND`). */
761
+ userErrors: Array<UserError>;
762
+ /** Non-fatal advisories — the mutation itself succeeded. */
763
+ warnings: Array<CartWarning>;
764
+ };
757
765
  export type CartLine = {
758
766
  /** Typed configurator selections filled in by the buyer (snapshot from add-to-cart). Validated server-side against the product attribute definition; carries any pricing surcharge. */
759
767
  attributeSelections: Array<AttributeSelection>;
@@ -834,12 +842,30 @@ export type CartLineUpdateInput = {
834
842
  /** New quantity. Use 0 to remove the line from the cart. */
835
843
  quantity: Scalars['Int']['input'];
836
844
  };
845
+ export type CartMergePayload = {
846
+ /** The merged cart on success — it keeps the same id and secret as the guest cart passed in, so the stored cart-id cookie stays valid. Null when `userErrors` is non-empty. */
847
+ cart?: Maybe<Cart>;
848
+ /** Business / validation errors carrying a stable `CartErrorCode` in `code` — e.g. `CART_NOT_FOUND`, `CART_CURRENCY_MISMATCH`, `CART_MERGE_REQUIRES_AUTH`. */
849
+ userErrors: Array<UserError>;
850
+ /** Non-fatal advisories — the mutation itself succeeded. */
851
+ warnings: Array<CartWarning>;
852
+ };
837
853
  export type CartRecommendations = {
838
854
  /** Products frequently bought together with cart items */
839
855
  frequentlyBoughtTogether: Array<ProductRecommendation>;
840
856
  /** Products to consider adding */
841
857
  youMayAlsoLike: Array<ProductRecommendation>;
842
858
  };
859
+ export type CartRecoveryRedeemPayload = {
860
+ /** The recovered cart on success. Null when `userErrors` is non-empty (invalid / expired link). */
861
+ cart?: Maybe<Cart>;
862
+ /** The NEW cart access secret, returned only here on a successful redemption (the link rotates the secret). Persist it immediately — it cannot be retrieved again; the previous secret no longer works. */
863
+ secret?: Maybe<Scalars['String']['output']>;
864
+ /** Business / validation errors carrying a stable `CartErrorCode` in `code` — `CART_RECOVERY_LINK_EXPIRED` / `CART_RECOVERY_LINK_INVALID` (bad or expired link), `CART_NOT_FOUND` (the cart is gone or already completed — create a fresh one) or `CART_RECOVERY_REDEEM_FAILED` (unexpected failure). No cart content is exposed on failure. */
865
+ userErrors: Array<UserError>;
866
+ /** Non-fatal advisories — the mutation itself succeeded. */
867
+ warnings: Array<CartWarning>;
868
+ };
843
869
  export type CartRemoveGiftCardInput = {
844
870
  /** ID of the cart to update. */
845
871
  cartId: Scalars['ID']['input'];
@@ -2257,6 +2283,12 @@ export type Mutation = {
2257
2283
  cartCreate: CartCreatePayload;
2258
2284
  /** Replace (not merge) the list of discount codes on the cart. Pass an empty array to clear all codes. Rate-limited to 10 requests per minute per IP+shop. */
2259
2285
  cartDiscountCodesUpdate: CartDiscountCodesUpdatePayload;
2286
+ /** Downgrade a cart to guest on logout — clears the customer association, contact details, addresses and payment selection, but keeps the line items, discount codes, selected shipping method, currency and notes. The cart id and secret are unchanged (no rotation), so the stored cart-id stays valid and the buyer keeps their items as a guest. Call from the logout flow (with the cart secret) before tearing down the auth session; the next person on a shared device then sees none of the previous buyer's data. */
2287
+ cartDowngradeOnLogout: CartDowngradeOnLogoutPayload;
2288
+ /** Merge a guest cart into the signed-in customer's existing cart on login. Call right after authenticating, passing the guest cart id (its secret travels in the cart credential header). Line quantities are summed per variant and the buyer's in-session checkout fields win. The returned cart keeps the SAME id and secret as the guest cart, so the stored cart-id stays valid. Requires authentication (`CART_MERGE_REQUIRES_AUTH` otherwise); refuses carts in different currencies (`CART_CURRENCY_MISMATCH`). */
2289
+ cartMerge: CartMergePayload;
2290
+ /** Redeem a signed cart recovery link (from an abandoned-cart email). Pass the token from the link; on success the cart is recovered and its access secret is ROTATED — the NEW secret is returned once in `secret` (persist it; the previous one no longer works), and the SDK sets the cart-id cookie to the recovered cart. Buyer self-service: the merchant sends the link, never takes over the cart. Returns `CART_RECOVERY_LINK_EXPIRED` / `CART_RECOVERY_LINK_INVALID` for a bad link (no cart content is exposed) and `CART_NOT_FOUND` when the cart no longer exists. */
2291
+ cartRecoveryRedeem: CartRecoveryRedeemPayload;
2260
2292
  /** Remove a previously applied gift card from the cart by its `CartAppliedGiftCard.id`. The storefront never has to handle the full gift card code on the client. */
2261
2293
  cartRemoveGiftCard: CartRemoveGiftCardPayload;
2262
2294
  /** Remove one or more lines from the cart by `CartLine.id`. Equivalent to `cartUpdateLines` with `quantity: 0` but lets the storefront express the intent explicitly. */
@@ -4109,6 +4141,9 @@ export type CartCompleteMutation = {
4109
4141
  shippingAddress?: Maybe<(Pick<MailingAddress, 'id' | 'firstName' | 'lastName' | 'name' | 'company' | 'streetLine1' | 'streetLine2' | 'city' | 'state' | 'stateCode' | 'country' | 'countryCode' | 'postalCode' | 'phone' | 'isDefault' | 'taxId' | 'vatNumber'> & {
4110
4142
  pickupPoint?: Maybe<Pick<PickupPoint, 'provider' | 'pointId' | 'name' | 'address'>>;
4111
4143
  })>;
4144
+ discountAllocations: Array<(Pick<OrderDiscountAllocation, 'discountCode'> & {
4145
+ amount: Pick<Money, 'amount' | 'currencyCode'>;
4146
+ })>;
4112
4147
  })>;
4113
4148
  userErrors: Array<Pick<UserError, 'message' | 'code' | 'field'>>;
4114
4149
  warnings: Array<Pick<CartWarning, 'message' | 'code' | 'target'>>;
@@ -4118,7 +4153,7 @@ export type CartCreateMutationVariables = Exact<{
4118
4153
  input?: InputMaybe<CartCreateInput>;
4119
4154
  }>;
4120
4155
  export type CartCreateMutation = {
4121
- cartCreate: {
4156
+ cartCreate: (Pick<CartCreatePayload, 'secret'> & {
4122
4157
  cart?: Maybe<(Pick<Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note' | 'email' | 'phone' | 'selectedPaymentInstrument' | 'requiresShipping' | 'createdAt' | 'updatedAt' | 'status'> & {
4123
4158
  cost: {
4124
4159
  total: Pick<Money, 'amount' | 'currencyCode'>;
@@ -4176,7 +4211,7 @@ export type CartCreateMutation = {
4176
4211
  })>;
4177
4212
  userErrors: Array<Pick<UserError, 'message' | 'code' | 'field'>>;
4178
4213
  warnings: Array<Pick<CartWarning, 'message' | 'code' | 'target'>>;
4179
- };
4214
+ });
4180
4215
  };
4181
4216
  export type CartDiscountCodesUpdateMutationVariables = Exact<{
4182
4217
  id: Scalars['ID']['input'];
@@ -4243,6 +4278,134 @@ export type CartDiscountCodesUpdateMutation = {
4243
4278
  warnings: Array<Pick<CartWarning, 'message' | 'code' | 'target'>>;
4244
4279
  };
4245
4280
  };
4281
+ export type CartDowngradeOnLogoutMutationVariables = Exact<{
4282
+ cartId: Scalars['ID']['input'];
4283
+ }>;
4284
+ export type CartDowngradeOnLogoutMutation = {
4285
+ cartDowngradeOnLogout: {
4286
+ cart?: Maybe<(Pick<Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note' | 'email' | 'phone' | 'selectedPaymentInstrument' | 'requiresShipping' | 'createdAt' | 'updatedAt' | 'status'> & {
4287
+ cost: {
4288
+ total: Pick<Money, 'amount' | 'currencyCode'>;
4289
+ subtotal: Pick<Money, 'amount' | 'currencyCode'>;
4290
+ totalTax?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4291
+ totalDuty?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4292
+ checkoutCharge?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4293
+ totalDiscount: Pick<Money, 'amount' | 'currencyCode'>;
4294
+ totalShipping?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4295
+ };
4296
+ lines: (Pick<CartLineConnection, 'totalCount'> & {
4297
+ nodes: Array<(Pick<CartLine, 'id' | 'quantity' | 'productId' | 'productTitle' | 'productHandle' | 'productType' | 'requiresShipping'> & {
4298
+ variant: (Pick<ProductVariant, 'id' | 'title' | 'sku' | 'isAvailable' | 'availableStock' | 'barcode' | 'sortOrder'> & {
4299
+ price: Pick<Money, 'amount' | 'currencyCode'>;
4300
+ compareAtPrice?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4301
+ image?: Maybe<Pick<Image, 'id' | 'url' | 'altText' | 'width' | 'height' | 'thumbhash'>>;
4302
+ selectedOptions: Array<Pick<SelectedOption, 'name' | 'value'>>;
4303
+ weight?: Maybe<Pick<Weight, 'value' | 'unit'>>;
4304
+ });
4305
+ cost: {
4306
+ pricePerUnit: Pick<Money, 'amount' | 'currencyCode'>;
4307
+ subtotal: Pick<Money, 'amount' | 'currencyCode'>;
4308
+ total: Pick<Money, 'amount' | 'currencyCode'>;
4309
+ compareAtPricePerUnit?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4310
+ };
4311
+ attributes: Array<Pick<Attribute, 'key' | 'value'>>;
4312
+ attributeSelections: Array<Pick<AttributeSelection, 'attributeDefinitionId' | 'attributeName' | 'type' | 'fillingMode' | 'billingMode' | 'optionId' | 'optionLabel' | 'optionIds' | 'textValue' | 'surchargeAmount' | 'surchargeType' | 'taxClassId' | 'linkedVariantId'>>;
4313
+ giftCardRecipient?: Maybe<Pick<GiftCardLineRecipient, 'recipientEmail' | 'recipientName' | 'message'>>;
4314
+ })>;
4315
+ pageInfo: Pick<PageInfo, 'hasNextPage' | 'hasPreviousPage' | 'startCursor' | 'endCursor'>;
4316
+ });
4317
+ buyerIdentity?: Maybe<Pick<CartBuyerIdentity, 'email' | 'phone' | 'countryCode'>>;
4318
+ discountCodes: Array<Pick<CartDiscountCode, 'code' | 'isApplicable'>>;
4319
+ discountAllocations: Array<(Pick<CartDiscountAllocation, 'discountCode'> & {
4320
+ amount: Pick<Money, 'amount' | 'currencyCode'>;
4321
+ })>;
4322
+ attributes: Array<Pick<CartAttribute, 'key' | 'value'>>;
4323
+ shippingAddress?: Maybe<(Pick<MailingAddress, 'id' | 'firstName' | 'lastName' | 'name' | 'company' | 'streetLine1' | 'streetLine2' | 'city' | 'state' | 'stateCode' | 'country' | 'countryCode' | 'postalCode' | 'phone' | 'isDefault' | 'taxId' | 'vatNumber'> & {
4324
+ pickupPoint?: Maybe<Pick<PickupPoint, 'provider' | 'pointId' | 'name' | 'address'>>;
4325
+ })>;
4326
+ billingAddress?: Maybe<(Pick<MailingAddress, 'id' | 'firstName' | 'lastName' | 'name' | 'company' | 'streetLine1' | 'streetLine2' | 'city' | 'state' | 'stateCode' | 'country' | 'countryCode' | 'postalCode' | 'phone' | 'isDefault' | 'taxId' | 'vatNumber'> & {
4327
+ pickupPoint?: Maybe<Pick<PickupPoint, 'provider' | 'pointId' | 'name' | 'address'>>;
4328
+ })>;
4329
+ selectedShippingMethod?: Maybe<(Pick<CartShippingMethod, 'handle' | 'title'> & {
4330
+ price: Pick<Money, 'amount' | 'currencyCode'>;
4331
+ })>;
4332
+ selectedPaymentMethod?: Maybe<(Pick<PaymentMethod, 'id' | 'name' | 'provider' | 'type' | 'description' | 'isDefault' | 'supportedCurrencies' | 'position'> & {
4333
+ icon?: Maybe<Pick<Image, 'id' | 'url' | 'altText' | 'width' | 'height' | 'thumbhash'>>;
4334
+ })>;
4335
+ appliedGiftCards: Array<(Pick<CartAppliedGiftCard, 'id' | 'maskedCode' | 'lastCharacters'> & {
4336
+ appliedAmount: Pick<Money, 'amount' | 'currencyCode'>;
4337
+ remainingBalance: Pick<Money, 'amount' | 'currencyCode'>;
4338
+ })>;
4339
+ completedOrder?: Maybe<Pick<Order, 'id' | 'orderNumber' | 'accessToken' | 'status' | 'paymentStatus' | 'fulfillmentStatus'>>;
4340
+ })>;
4341
+ userErrors: Array<Pick<UserError, 'message' | 'code' | 'field'>>;
4342
+ warnings: Array<Pick<CartWarning, 'message' | 'code' | 'target'>>;
4343
+ };
4344
+ };
4345
+ export type CartMergeMutationVariables = Exact<{
4346
+ guestCartId: Scalars['ID']['input'];
4347
+ }>;
4348
+ export type CartMergeMutation = {
4349
+ cartMerge: {
4350
+ cart?: Maybe<(Pick<Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note' | 'email' | 'phone' | 'selectedPaymentInstrument' | 'requiresShipping' | 'createdAt' | 'updatedAt' | 'status'> & {
4351
+ cost: {
4352
+ total: Pick<Money, 'amount' | 'currencyCode'>;
4353
+ subtotal: Pick<Money, 'amount' | 'currencyCode'>;
4354
+ totalTax?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4355
+ totalDuty?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4356
+ checkoutCharge?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4357
+ totalDiscount: Pick<Money, 'amount' | 'currencyCode'>;
4358
+ totalShipping?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4359
+ };
4360
+ lines: (Pick<CartLineConnection, 'totalCount'> & {
4361
+ nodes: Array<(Pick<CartLine, 'id' | 'quantity' | 'productId' | 'productTitle' | 'productHandle' | 'productType' | 'requiresShipping'> & {
4362
+ variant: (Pick<ProductVariant, 'id' | 'title' | 'sku' | 'isAvailable' | 'availableStock' | 'barcode' | 'sortOrder'> & {
4363
+ price: Pick<Money, 'amount' | 'currencyCode'>;
4364
+ compareAtPrice?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4365
+ image?: Maybe<Pick<Image, 'id' | 'url' | 'altText' | 'width' | 'height' | 'thumbhash'>>;
4366
+ selectedOptions: Array<Pick<SelectedOption, 'name' | 'value'>>;
4367
+ weight?: Maybe<Pick<Weight, 'value' | 'unit'>>;
4368
+ });
4369
+ cost: {
4370
+ pricePerUnit: Pick<Money, 'amount' | 'currencyCode'>;
4371
+ subtotal: Pick<Money, 'amount' | 'currencyCode'>;
4372
+ total: Pick<Money, 'amount' | 'currencyCode'>;
4373
+ compareAtPricePerUnit?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4374
+ };
4375
+ attributes: Array<Pick<Attribute, 'key' | 'value'>>;
4376
+ attributeSelections: Array<Pick<AttributeSelection, 'attributeDefinitionId' | 'attributeName' | 'type' | 'fillingMode' | 'billingMode' | 'optionId' | 'optionLabel' | 'optionIds' | 'textValue' | 'surchargeAmount' | 'surchargeType' | 'taxClassId' | 'linkedVariantId'>>;
4377
+ giftCardRecipient?: Maybe<Pick<GiftCardLineRecipient, 'recipientEmail' | 'recipientName' | 'message'>>;
4378
+ })>;
4379
+ pageInfo: Pick<PageInfo, 'hasNextPage' | 'hasPreviousPage' | 'startCursor' | 'endCursor'>;
4380
+ });
4381
+ buyerIdentity?: Maybe<Pick<CartBuyerIdentity, 'email' | 'phone' | 'countryCode'>>;
4382
+ discountCodes: Array<Pick<CartDiscountCode, 'code' | 'isApplicable'>>;
4383
+ discountAllocations: Array<(Pick<CartDiscountAllocation, 'discountCode'> & {
4384
+ amount: Pick<Money, 'amount' | 'currencyCode'>;
4385
+ })>;
4386
+ attributes: Array<Pick<CartAttribute, 'key' | 'value'>>;
4387
+ shippingAddress?: Maybe<(Pick<MailingAddress, 'id' | 'firstName' | 'lastName' | 'name' | 'company' | 'streetLine1' | 'streetLine2' | 'city' | 'state' | 'stateCode' | 'country' | 'countryCode' | 'postalCode' | 'phone' | 'isDefault' | 'taxId' | 'vatNumber'> & {
4388
+ pickupPoint?: Maybe<Pick<PickupPoint, 'provider' | 'pointId' | 'name' | 'address'>>;
4389
+ })>;
4390
+ billingAddress?: Maybe<(Pick<MailingAddress, 'id' | 'firstName' | 'lastName' | 'name' | 'company' | 'streetLine1' | 'streetLine2' | 'city' | 'state' | 'stateCode' | 'country' | 'countryCode' | 'postalCode' | 'phone' | 'isDefault' | 'taxId' | 'vatNumber'> & {
4391
+ pickupPoint?: Maybe<Pick<PickupPoint, 'provider' | 'pointId' | 'name' | 'address'>>;
4392
+ })>;
4393
+ selectedShippingMethod?: Maybe<(Pick<CartShippingMethod, 'handle' | 'title'> & {
4394
+ price: Pick<Money, 'amount' | 'currencyCode'>;
4395
+ })>;
4396
+ selectedPaymentMethod?: Maybe<(Pick<PaymentMethod, 'id' | 'name' | 'provider' | 'type' | 'description' | 'isDefault' | 'supportedCurrencies' | 'position'> & {
4397
+ icon?: Maybe<Pick<Image, 'id' | 'url' | 'altText' | 'width' | 'height' | 'thumbhash'>>;
4398
+ })>;
4399
+ appliedGiftCards: Array<(Pick<CartAppliedGiftCard, 'id' | 'maskedCode' | 'lastCharacters'> & {
4400
+ appliedAmount: Pick<Money, 'amount' | 'currencyCode'>;
4401
+ remainingBalance: Pick<Money, 'amount' | 'currencyCode'>;
4402
+ })>;
4403
+ completedOrder?: Maybe<Pick<Order, 'id' | 'orderNumber' | 'accessToken' | 'status' | 'paymentStatus' | 'fulfillmentStatus'>>;
4404
+ })>;
4405
+ userErrors: Array<Pick<UserError, 'message' | 'code' | 'field'>>;
4406
+ warnings: Array<Pick<CartWarning, 'message' | 'code' | 'target'>>;
4407
+ };
4408
+ };
4246
4409
  export type CartQueryVariables = Exact<{
4247
4410
  id: Scalars['ID']['input'];
4248
4411
  }>;
@@ -4303,6 +4466,70 @@ export type CartQuery = {
4303
4466
  completedOrder?: Maybe<Pick<Order, 'id' | 'orderNumber' | 'accessToken' | 'status' | 'paymentStatus' | 'fulfillmentStatus'>>;
4304
4467
  })>;
4305
4468
  };
4469
+ export type CartRecoveryRedeemMutationVariables = Exact<{
4470
+ token: Scalars['String']['input'];
4471
+ }>;
4472
+ export type CartRecoveryRedeemMutation = {
4473
+ cartRecoveryRedeem: (Pick<CartRecoveryRedeemPayload, 'secret'> & {
4474
+ cart?: Maybe<(Pick<Cart, 'id' | 'checkoutUrl' | 'totalQuantity' | 'note' | 'email' | 'phone' | 'selectedPaymentInstrument' | 'requiresShipping' | 'createdAt' | 'updatedAt' | 'status'> & {
4475
+ cost: {
4476
+ total: Pick<Money, 'amount' | 'currencyCode'>;
4477
+ subtotal: Pick<Money, 'amount' | 'currencyCode'>;
4478
+ totalTax?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4479
+ totalDuty?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4480
+ checkoutCharge?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4481
+ totalDiscount: Pick<Money, 'amount' | 'currencyCode'>;
4482
+ totalShipping?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4483
+ };
4484
+ lines: (Pick<CartLineConnection, 'totalCount'> & {
4485
+ nodes: Array<(Pick<CartLine, 'id' | 'quantity' | 'productId' | 'productTitle' | 'productHandle' | 'productType' | 'requiresShipping'> & {
4486
+ variant: (Pick<ProductVariant, 'id' | 'title' | 'sku' | 'isAvailable' | 'availableStock' | 'barcode' | 'sortOrder'> & {
4487
+ price: Pick<Money, 'amount' | 'currencyCode'>;
4488
+ compareAtPrice?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4489
+ image?: Maybe<Pick<Image, 'id' | 'url' | 'altText' | 'width' | 'height' | 'thumbhash'>>;
4490
+ selectedOptions: Array<Pick<SelectedOption, 'name' | 'value'>>;
4491
+ weight?: Maybe<Pick<Weight, 'value' | 'unit'>>;
4492
+ });
4493
+ cost: {
4494
+ pricePerUnit: Pick<Money, 'amount' | 'currencyCode'>;
4495
+ subtotal: Pick<Money, 'amount' | 'currencyCode'>;
4496
+ total: Pick<Money, 'amount' | 'currencyCode'>;
4497
+ compareAtPricePerUnit?: Maybe<Pick<Money, 'amount' | 'currencyCode'>>;
4498
+ };
4499
+ attributes: Array<Pick<Attribute, 'key' | 'value'>>;
4500
+ attributeSelections: Array<Pick<AttributeSelection, 'attributeDefinitionId' | 'attributeName' | 'type' | 'fillingMode' | 'billingMode' | 'optionId' | 'optionLabel' | 'optionIds' | 'textValue' | 'surchargeAmount' | 'surchargeType' | 'taxClassId' | 'linkedVariantId'>>;
4501
+ giftCardRecipient?: Maybe<Pick<GiftCardLineRecipient, 'recipientEmail' | 'recipientName' | 'message'>>;
4502
+ })>;
4503
+ pageInfo: Pick<PageInfo, 'hasNextPage' | 'hasPreviousPage' | 'startCursor' | 'endCursor'>;
4504
+ });
4505
+ buyerIdentity?: Maybe<Pick<CartBuyerIdentity, 'email' | 'phone' | 'countryCode'>>;
4506
+ discountCodes: Array<Pick<CartDiscountCode, 'code' | 'isApplicable'>>;
4507
+ discountAllocations: Array<(Pick<CartDiscountAllocation, 'discountCode'> & {
4508
+ amount: Pick<Money, 'amount' | 'currencyCode'>;
4509
+ })>;
4510
+ attributes: Array<Pick<CartAttribute, 'key' | 'value'>>;
4511
+ shippingAddress?: Maybe<(Pick<MailingAddress, 'id' | 'firstName' | 'lastName' | 'name' | 'company' | 'streetLine1' | 'streetLine2' | 'city' | 'state' | 'stateCode' | 'country' | 'countryCode' | 'postalCode' | 'phone' | 'isDefault' | 'taxId' | 'vatNumber'> & {
4512
+ pickupPoint?: Maybe<Pick<PickupPoint, 'provider' | 'pointId' | 'name' | 'address'>>;
4513
+ })>;
4514
+ billingAddress?: Maybe<(Pick<MailingAddress, 'id' | 'firstName' | 'lastName' | 'name' | 'company' | 'streetLine1' | 'streetLine2' | 'city' | 'state' | 'stateCode' | 'country' | 'countryCode' | 'postalCode' | 'phone' | 'isDefault' | 'taxId' | 'vatNumber'> & {
4515
+ pickupPoint?: Maybe<Pick<PickupPoint, 'provider' | 'pointId' | 'name' | 'address'>>;
4516
+ })>;
4517
+ selectedShippingMethod?: Maybe<(Pick<CartShippingMethod, 'handle' | 'title'> & {
4518
+ price: Pick<Money, 'amount' | 'currencyCode'>;
4519
+ })>;
4520
+ selectedPaymentMethod?: Maybe<(Pick<PaymentMethod, 'id' | 'name' | 'provider' | 'type' | 'description' | 'isDefault' | 'supportedCurrencies' | 'position'> & {
4521
+ icon?: Maybe<Pick<Image, 'id' | 'url' | 'altText' | 'width' | 'height' | 'thumbhash'>>;
4522
+ })>;
4523
+ appliedGiftCards: Array<(Pick<CartAppliedGiftCard, 'id' | 'maskedCode' | 'lastCharacters'> & {
4524
+ appliedAmount: Pick<Money, 'amount' | 'currencyCode'>;
4525
+ remainingBalance: Pick<Money, 'amount' | 'currencyCode'>;
4526
+ })>;
4527
+ completedOrder?: Maybe<Pick<Order, 'id' | 'orderNumber' | 'accessToken' | 'status' | 'paymentStatus' | 'fulfillmentStatus'>>;
4528
+ })>;
4529
+ userErrors: Array<Pick<UserError, 'message' | 'code' | 'field'>>;
4530
+ warnings: Array<Pick<CartWarning, 'message' | 'code' | 'target'>>;
4531
+ });
4532
+ };
4306
4533
  export type CartRemoveGiftCardMutationVariables = Exact<{
4307
4534
  input: CartRemoveGiftCardInput;
4308
4535
  }>;
@@ -5039,6 +5266,9 @@ export type OrderByTokenQuery = {
5039
5266
  shippingAddress?: Maybe<(Pick<MailingAddress, 'id' | 'firstName' | 'lastName' | 'name' | 'company' | 'streetLine1' | 'streetLine2' | 'city' | 'state' | 'stateCode' | 'country' | 'countryCode' | 'postalCode' | 'phone' | 'isDefault' | 'taxId' | 'vatNumber'> & {
5040
5267
  pickupPoint?: Maybe<Pick<PickupPoint, 'provider' | 'pointId' | 'name' | 'address'>>;
5041
5268
  })>;
5269
+ discountAllocations: Array<(Pick<OrderDiscountAllocation, 'discountCode'> & {
5270
+ amount: Pick<Money, 'amount' | 'currencyCode'>;
5271
+ })>;
5042
5272
  })>;
5043
5273
  };
5044
5274
  export type PaymentCreateMutationVariables = Exact<{
@@ -5288,6 +5518,9 @@ export type OrderFragment = (Pick<Order, 'id' | 'orderNumber' | 'accessToken' |
5288
5518
  shippingAddress?: Maybe<(Pick<MailingAddress, 'id' | 'firstName' | 'lastName' | 'name' | 'company' | 'streetLine1' | 'streetLine2' | 'city' | 'state' | 'stateCode' | 'country' | 'countryCode' | 'postalCode' | 'phone' | 'isDefault' | 'taxId' | 'vatNumber'> & {
5289
5519
  pickupPoint?: Maybe<Pick<PickupPoint, 'provider' | 'pointId' | 'name' | 'address'>>;
5290
5520
  })>;
5521
+ discountAllocations: Array<(Pick<OrderDiscountAllocation, 'discountCode'> & {
5522
+ amount: Pick<Money, 'amount' | 'currencyCode'>;
5523
+ })>;
5291
5524
  });
5292
5525
  export type PaymentSessionFragment = Pick<PaymentSession, 'id' | 'orderId' | 'flow' | 'provider' | 'redirectUrl' | 'clientSecret' | 'status' | 'expiresAt'>;
5293
5526
  export type PaymentWarningFragment = Pick<PaymentWarning, 'message' | 'code' | 'retryHint'>;