@tiledev/sdk-shopify 0.4.1 → 0.7.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 (87) hide show
  1. package/README.md +114 -1
  2. package/dist/blogs.d.ts.map +1 -1
  3. package/dist/blogs.js +3 -3
  4. package/dist/blogs.js.map +1 -1
  5. package/dist/cart.d.ts +7 -1
  6. package/dist/cart.d.ts.map +1 -1
  7. package/dist/cart.js +49 -24
  8. package/dist/cart.js.map +1 -1
  9. package/dist/client.d.ts +20 -2
  10. package/dist/client.d.ts.map +1 -1
  11. package/dist/client.js +80 -19
  12. package/dist/client.js.map +1 -1
  13. package/dist/collections.d.ts.map +1 -1
  14. package/dist/collections.js +8 -5
  15. package/dist/collections.js.map +1 -1
  16. package/dist/customer.d.ts.map +1 -1
  17. package/dist/customer.js +3 -3
  18. package/dist/customer.js.map +1 -1
  19. package/dist/deviceStore.d.ts +9 -0
  20. package/dist/deviceStore.d.ts.map +1 -0
  21. package/dist/deviceStore.js +77 -0
  22. package/dist/deviceStore.js.map +1 -0
  23. package/dist/deviceStore.native.d.ts +14 -0
  24. package/dist/deviceStore.native.d.ts.map +1 -0
  25. package/dist/deviceStore.native.js +47 -0
  26. package/dist/deviceStore.native.js.map +1 -0
  27. package/dist/deviceStoreCore.d.ts +24 -0
  28. package/dist/deviceStoreCore.d.ts.map +1 -0
  29. package/dist/deviceStoreCore.js +40 -0
  30. package/dist/deviceStoreCore.js.map +1 -0
  31. package/dist/filters.d.ts +32 -0
  32. package/dist/filters.d.ts.map +1 -0
  33. package/dist/filters.js +67 -0
  34. package/dist/filters.js.map +1 -0
  35. package/dist/index.d.ts +5 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +23 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/productStore.d.ts +43 -0
  40. package/dist/productStore.d.ts.map +1 -0
  41. package/dist/productStore.js +309 -0
  42. package/dist/productStore.js.map +1 -0
  43. package/dist/products.d.ts.map +1 -1
  44. package/dist/products.js +28 -19
  45. package/dist/products.js.map +1 -1
  46. package/dist/queries.d.ts +24 -24
  47. package/dist/queries.d.ts.map +1 -1
  48. package/dist/queries.js +5 -3
  49. package/dist/queries.js.map +1 -1
  50. package/dist/react/ShopifyProvider.d.ts +8 -0
  51. package/dist/react/ShopifyProvider.d.ts.map +1 -1
  52. package/dist/react/ShopifyProvider.js +134 -3
  53. package/dist/react/ShopifyProvider.js.map +1 -1
  54. package/dist/react/index.d.ts +3 -0
  55. package/dist/react/index.d.ts.map +1 -1
  56. package/dist/react/index.js +9 -1
  57. package/dist/react/index.js.map +1 -1
  58. package/dist/react/useCollectionProducts.d.ts +12 -20
  59. package/dist/react/useCollectionProducts.d.ts.map +1 -1
  60. package/dist/react/useCollectionProducts.js +36 -137
  61. package/dist/react/useCollectionProducts.js.map +1 -1
  62. package/dist/react/useProduct.d.ts +36 -0
  63. package/dist/react/useProduct.d.ts.map +1 -0
  64. package/dist/react/useProduct.js +126 -0
  65. package/dist/react/useProduct.js.map +1 -0
  66. package/dist/react/useProductFeed.d.ts +57 -0
  67. package/dist/react/useProductFeed.d.ts.map +1 -0
  68. package/dist/react/useProductFeed.js +231 -0
  69. package/dist/react/useProductFeed.js.map +1 -0
  70. package/dist/react/useSearch.d.ts +30 -0
  71. package/dist/react/useSearch.d.ts.map +1 -0
  72. package/dist/react/useSearch.js +61 -0
  73. package/dist/react/useSearch.js.map +1 -0
  74. package/dist/requestCache.d.ts +48 -0
  75. package/dist/requestCache.d.ts.map +1 -0
  76. package/dist/requestCache.js +173 -0
  77. package/dist/requestCache.js.map +1 -0
  78. package/dist/types.d.ts +80 -21
  79. package/dist/types.d.ts.map +1 -1
  80. package/dist/types.js +0 -1
  81. package/dist/types.js.map +1 -1
  82. package/dist/variants.js +1 -1
  83. package/dist/variants.js.map +1 -1
  84. package/dist/wishlist.d.ts.map +1 -1
  85. package/dist/wishlist.js +4 -1
  86. package/dist/wishlist.js.map +1 -1
  87. package/package.json +9 -3
package/dist/queries.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export declare const MONEY_FRAGMENT = "\n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n";
2
- export declare const IMAGE_FRAGMENT = "\n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n";
3
- export declare const VARIANT_FRAGMENT = "\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n";
2
+ export declare const IMAGE_FRAGMENT = "\n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n";
3
+ export declare const VARIANT_FRAGMENT = "\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n";
4
4
  /**
5
5
  * For the card-only paths — collection products, search, `byIds`, recommendations. Media is
6
6
  * reduced to content types, which is all a grid asks of it (the play badge), rather than every
@@ -8,23 +8,23 @@ export declare const VARIANT_FRAGMENT = "\n \n fragment MoneyFields on MoneyV2
8
8
  */
9
9
  export declare const productCardFragment: () => string;
10
10
  export declare const productFragment: () => string;
11
- export declare const COLLECTION_FRAGMENT = "\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment CollectionFields on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image { ...ImageFields }\n }\n";
12
- export declare const CART_FRAGMENT = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n";
11
+ export declare const COLLECTION_FRAGMENT = "\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment CollectionFields on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image { ...ImageFields }\n }\n";
12
+ export declare const CART_FRAGMENT = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n";
13
13
  export declare const ADDRESS_FRAGMENT = "\n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n";
14
14
  export declare const CUSTOMER_FRAGMENT = "\n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment CustomerFields on Customer {\n id\n email\n firstName\n lastName\n phone\n acceptsMarketing\n defaultAddress { ...AddressFields }\n }\n";
15
15
  export declare const productsListQuery: () => string;
16
16
  export declare const productByHandleQuery: () => string;
17
17
  export declare const productByIdQuery: () => string;
18
18
  export declare const productRecommendationsQuery: () => string;
19
- export declare const COLLECTIONS_LIST_QUERY = "\n \n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment CollectionFields on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image { ...ImageFields }\n }\n\n query Collections($first: Int!, $after: String, $query: String, $sortKey: CollectionSortKeys, $reverse: Boolean) {\n collections(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) {\n nodes { ...CollectionFields }\n pageInfo { hasNextPage hasPreviousPage startCursor endCursor }\n }\n }\n";
20
- export declare const COLLECTION_BY_HANDLE_QUERY = "\n \n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment CollectionFields on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image { ...ImageFields }\n }\n\n query CollectionByHandle($handle: String!) {\n collection(handle: $handle) { ...CollectionFields }\n }\n";
19
+ export declare const COLLECTIONS_LIST_QUERY = "\n \n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment CollectionFields on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image { ...ImageFields }\n }\n\n query Collections($first: Int!, $after: String, $query: String, $sortKey: CollectionSortKeys, $reverse: Boolean) {\n collections(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) {\n nodes { ...CollectionFields }\n pageInfo { hasNextPage hasPreviousPage startCursor endCursor }\n }\n }\n";
20
+ export declare const COLLECTION_BY_HANDLE_QUERY = "\n \n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment CollectionFields on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image { ...ImageFields }\n }\n\n query CollectionByHandle($handle: String!) {\n collection(handle: $handle) { ...CollectionFields }\n }\n";
21
21
  export declare const collectionProductsQuery: () => string;
22
22
  export declare const searchProductsQuery: () => string;
23
- export declare const CART_CREATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartCreate($input: CartInput) {\n cartCreate(input: $input) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
24
- export declare const CART_GET_QUERY = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n query CartGet($id: ID!) {\n cart(id: $id) { ...CartFields }\n }\n";
25
- export declare const CART_LINES_ADD_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
26
- export declare const CART_LINES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
27
- export declare const CART_LINES_REMOVE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
23
+ export declare const CART_CREATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartCreate($input: CartInput) {\n cartCreate(input: $input) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
24
+ export declare const CART_GET_QUERY = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n query CartGet($id: ID!) {\n cart(id: $id) { ...CartFields }\n }\n";
25
+ export declare const CART_LINES_ADD_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
26
+ export declare const CART_LINES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
27
+ export declare const CART_LINES_REMOVE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
28
28
  /**
29
29
  * The cart's discount codes — the whole set, not an addition: this REPLACES whatever the cart
30
30
  * carries, so a caller adding one has to send the existing ones back alongside it.
@@ -36,7 +36,7 @@ export declare const CART_LINES_REMOVE_MUTATION = "\n \n \n \n fragment Mone
36
36
  * EVERY code failed, valid or not, on every app built on this SDK. Clearing the set is `[]`, which
37
37
  * is a value rather than a null, so nothing is lost by requiring it.
38
38
  */
39
- export declare const CART_DISCOUNT_CODES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
39
+ export declare const CART_DISCOUNT_CODES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
40
40
  /**
41
41
  * The shopper's order note. It rides the cart to the order, where the merchant reads it beside the
42
42
  * line items — so it is content, not a cart attribute, and Shopify gives it its own mutation.
@@ -46,11 +46,11 @@ export declare const CART_DISCOUNT_CODES_UPDATE_MUTATION = "\n \n \n \n frag
46
46
  * not a case that only shows up when clearing. Clearing is the empty string, which is also what a
47
47
  * cart with no note reads back as.
48
48
  */
49
- export declare const CART_ATTRIBUTES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartAttributesUpdate($cartId: ID!, $attributes: [AttributeInput!]!) {\n cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
50
- export declare const CART_NOTE_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartNoteUpdate($cartId: ID!, $note: String!) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
51
- export declare const CART_BUYER_IDENTITY_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartBuyerIdentityUpdate($cartId: ID!, $buyerIdentity: CartBuyerIdentityInput!) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
52
- export declare const CART_GIFT_CARD_CODES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartGiftCardCodesUpdate($cartId: ID!, $giftCardCodes: [String!]!) {\n cartGiftCardCodesUpdate(cartId: $cartId, giftCardCodes: $giftCardCodes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
53
- export declare const CART_GIFT_CARD_CODES_REMOVE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartGiftCardCodesRemove($cartId: ID!, $appliedGiftCardIds: [ID!]!) {\n cartGiftCardCodesRemove(cartId: $cartId, appliedGiftCardIds: $appliedGiftCardIds) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
49
+ export declare const CART_ATTRIBUTES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartAttributesUpdate($cartId: ID!, $attributes: [AttributeInput!]!) {\n cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
50
+ export declare const CART_NOTE_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartNoteUpdate($cartId: ID!, $note: String!) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
51
+ export declare const CART_BUYER_IDENTITY_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartBuyerIdentityUpdate($cartId: ID!, $buyerIdentity: CartBuyerIdentityInput!) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
52
+ export declare const CART_GIFT_CARD_CODES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartGiftCardCodesUpdate($cartId: ID!, $giftCardCodes: [String!]!) {\n cartGiftCardCodesUpdate(cartId: $cartId, giftCardCodes: $giftCardCodes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
53
+ export declare const CART_GIFT_CARD_CODES_REMOVE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n sellingPlanAllocation { sellingPlan { id } }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartGiftCardCodesRemove($cartId: ID!, $appliedGiftCardIds: [ID!]!) {\n cartGiftCardCodesRemove(cartId: $cartId, appliedGiftCardIds: $appliedGiftCardIds) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
54
54
  /** Shop's IP-localized country (e.g. `"US"`). We use this as the fallback
55
55
  * countryCode when applying a gift card so the cart has a payment tender. */
56
56
  export declare const SHOP_LOCALIZATION_QUERY = "\n query ShopLocalization {\n localization {\n country { isoCode name }\n }\n }\n";
@@ -60,18 +60,18 @@ export declare const CUSTOMER_ACCESS_TOKEN_DELETE_MUTATION = "\n mutation Custo
60
60
  export declare const CUSTOMER_QUERY = "\n \n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment CustomerFields on Customer {\n id\n email\n firstName\n lastName\n phone\n acceptsMarketing\n defaultAddress { ...AddressFields }\n }\n\n query Customer($accessToken: String!) {\n customer(customerAccessToken: $accessToken) { ...CustomerFields }\n }\n";
61
61
  export declare const CUSTOMER_RECOVER_MUTATION = "\n mutation CustomerRecover($email: String!) {\n customerRecover(email: $email) {\n customerUserErrors { field message code }\n }\n }\n";
62
62
  export declare const CUSTOMER_UPDATE_MUTATION = "\n \n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment CustomerFields on Customer {\n id\n email\n firstName\n lastName\n phone\n acceptsMarketing\n defaultAddress { ...AddressFields }\n }\n\n mutation CustomerUpdate($accessToken: String!, $customer: CustomerUpdateInput!) {\n customerUpdate(customerAccessToken: $accessToken, customer: $customer) {\n customer { ...CustomerFields }\n customerUserErrors { field message code }\n }\n }\n";
63
- export declare const ORDER_FRAGMENT = "\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment OrderFields on Order {\n id\n orderNumber\n name\n processedAt\n fulfillmentStatus\n financialStatus\n statusUrl\n currencyCode\n email\n phone\n totalPrice { ...MoneyFields }\n subtotalPrice { ...MoneyFields }\n totalShippingPrice { ...MoneyFields }\n totalTax { ...MoneyFields }\n totalRefunded { ...MoneyFields }\n shippingAddress { ...AddressFields }\n lineItems(first: 50) {\n nodes {\n title\n quantity\n originalTotalPrice { ...MoneyFields }\n discountedTotalPrice { ...MoneyFields }\n variant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n }\n }\n }\n";
64
- export declare const CUSTOMER_ORDERS_QUERY = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment OrderFields on Order {\n id\n orderNumber\n name\n processedAt\n fulfillmentStatus\n financialStatus\n statusUrl\n currencyCode\n email\n phone\n totalPrice { ...MoneyFields }\n subtotalPrice { ...MoneyFields }\n totalShippingPrice { ...MoneyFields }\n totalTax { ...MoneyFields }\n totalRefunded { ...MoneyFields }\n shippingAddress { ...AddressFields }\n lineItems(first: 50) {\n nodes {\n title\n quantity\n originalTotalPrice { ...MoneyFields }\n discountedTotalPrice { ...MoneyFields }\n variant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n }\n }\n }\n\n query CustomerOrders($accessToken: String!, $first: Int!, $after: String) {\n customer(customerAccessToken: $accessToken) {\n orders(first: $first, after: $after, sortKey: PROCESSED_AT, reverse: true) {\n nodes { ...OrderFields }\n pageInfo { hasNextPage hasPreviousPage startCursor endCursor }\n }\n }\n }\n";
65
- export declare const CUSTOMER_ORDER_BY_ID_QUERY = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment OrderFields on Order {\n id\n orderNumber\n name\n processedAt\n fulfillmentStatus\n financialStatus\n statusUrl\n currencyCode\n email\n phone\n totalPrice { ...MoneyFields }\n subtotalPrice { ...MoneyFields }\n totalShippingPrice { ...MoneyFields }\n totalTax { ...MoneyFields }\n totalRefunded { ...MoneyFields }\n shippingAddress { ...AddressFields }\n lineItems(first: 50) {\n nodes {\n title\n quantity\n originalTotalPrice { ...MoneyFields }\n discountedTotalPrice { ...MoneyFields }\n variant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n }\n }\n }\n\n query CustomerOrderById($accessToken: String!) {\n customer(customerAccessToken: $accessToken) {\n orders(first: 250, sortKey: PROCESSED_AT, reverse: true) {\n nodes { ...OrderFields }\n }\n }\n }\n";
63
+ export declare const ORDER_FRAGMENT = "\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment OrderFields on Order {\n id\n orderNumber\n name\n processedAt\n fulfillmentStatus\n financialStatus\n statusUrl\n currencyCode\n email\n phone\n totalPrice { ...MoneyFields }\n subtotalPrice { ...MoneyFields }\n totalShippingPrice { ...MoneyFields }\n totalTax { ...MoneyFields }\n totalRefunded { ...MoneyFields }\n shippingAddress { ...AddressFields }\n lineItems(first: 50) {\n nodes {\n title\n quantity\n originalTotalPrice { ...MoneyFields }\n discountedTotalPrice { ...MoneyFields }\n variant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n }\n }\n }\n";
64
+ export declare const CUSTOMER_ORDERS_QUERY = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment OrderFields on Order {\n id\n orderNumber\n name\n processedAt\n fulfillmentStatus\n financialStatus\n statusUrl\n currencyCode\n email\n phone\n totalPrice { ...MoneyFields }\n subtotalPrice { ...MoneyFields }\n totalShippingPrice { ...MoneyFields }\n totalTax { ...MoneyFields }\n totalRefunded { ...MoneyFields }\n shippingAddress { ...AddressFields }\n lineItems(first: 50) {\n nodes {\n title\n quantity\n originalTotalPrice { ...MoneyFields }\n discountedTotalPrice { ...MoneyFields }\n variant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n }\n }\n }\n\n query CustomerOrders($accessToken: String!, $first: Int!, $after: String) {\n customer(customerAccessToken: $accessToken) {\n orders(first: $first, after: $after, sortKey: PROCESSED_AT, reverse: true) {\n nodes { ...OrderFields }\n pageInfo { hasNextPage hasPreviousPage startCursor endCursor }\n }\n }\n }\n";
65
+ export declare const CUSTOMER_ORDER_BY_ID_QUERY = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment OrderFields on Order {\n id\n orderNumber\n name\n processedAt\n fulfillmentStatus\n financialStatus\n statusUrl\n currencyCode\n email\n phone\n totalPrice { ...MoneyFields }\n subtotalPrice { ...MoneyFields }\n totalShippingPrice { ...MoneyFields }\n totalTax { ...MoneyFields }\n totalRefunded { ...MoneyFields }\n shippingAddress { ...AddressFields }\n lineItems(first: 50) {\n nodes {\n title\n quantity\n originalTotalPrice { ...MoneyFields }\n discountedTotalPrice { ...MoneyFields }\n variant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n }\n }\n }\n\n query CustomerOrderById($accessToken: String!) {\n customer(customerAccessToken: $accessToken) {\n orders(first: 250, sortKey: PROCESSED_AT, reverse: true) {\n nodes { ...OrderFields }\n }\n }\n }\n";
66
66
  export declare const BLOG_FRAGMENT = "\n fragment BlogFields on Blog {\n id\n handle\n title\n }\n";
67
- export declare const ARTICLE_FRAGMENT = "\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n fragment ArticleFields on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n tags\n image { ...ImageFields }\n authorV2 {\n name\n email\n bio\n }\n blog { ...BlogFields }\n }\n";
67
+ export declare const ARTICLE_FRAGMENT = "\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n fragment ArticleFields on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n tags\n image { ...ImageFields }\n authorV2 {\n name\n email\n bio\n }\n blog { ...BlogFields }\n }\n";
68
68
  export declare const BLOGS_LIST_QUERY = "\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n query Blogs($first: Int!, $after: String, $query: String, $sortKey: BlogSortKeys, $reverse: Boolean) {\n blogs(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) {\n nodes { ...BlogFields }\n pageInfo { hasNextPage hasPreviousPage startCursor endCursor }\n }\n }\n";
69
69
  export declare const BLOG_BY_HANDLE_QUERY = "\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n query BlogByHandle($handle: String!) {\n blog(handle: $handle) { ...BlogFields }\n }\n";
70
- export declare const BLOG_ARTICLES_QUERY = "\n \n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n fragment ArticleFields on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n tags\n image { ...ImageFields }\n authorV2 {\n name\n email\n bio\n }\n blog { ...BlogFields }\n }\n\n query BlogArticles($handle: String!, $first: Int!, $after: String, $sortKey: ArticleSortKeys, $reverse: Boolean) {\n blog(handle: $handle) {\n articles(first: $first, after: $after, sortKey: $sortKey, reverse: $reverse) {\n nodes { ...ArticleFields }\n pageInfo { hasNextPage hasPreviousPage startCursor endCursor }\n }\n }\n }\n";
71
- export declare const BLOG_ARTICLE_BY_HANDLE_QUERY = "\n \n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n fragment ArticleFields on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n tags\n image { ...ImageFields }\n authorV2 {\n name\n email\n bio\n }\n blog { ...BlogFields }\n }\n\n query BlogArticleByHandle($blogHandle: String!, $articleHandle: String!) {\n blog(handle: $blogHandle) {\n articleByHandle(handle: $articleHandle) { ...ArticleFields }\n }\n }\n";
70
+ export declare const BLOG_ARTICLES_QUERY = "\n \n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n fragment ArticleFields on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n tags\n image { ...ImageFields }\n authorV2 {\n name\n email\n bio\n }\n blog { ...BlogFields }\n }\n\n query BlogArticles($handle: String!, $first: Int!, $after: String, $sortKey: ArticleSortKeys, $reverse: Boolean) {\n blog(handle: $handle) {\n articles(first: $first, after: $after, sortKey: $sortKey, reverse: $reverse) {\n nodes { ...ArticleFields }\n pageInfo { hasNextPage hasPreviousPage startCursor endCursor }\n }\n }\n }\n";
71
+ export declare const BLOG_ARTICLE_BY_HANDLE_QUERY = "\n \n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n fragment ArticleFields on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n tags\n image { ...ImageFields }\n authorV2 {\n name\n email\n bio\n }\n blog { ...BlogFields }\n }\n\n query BlogArticleByHandle($blogHandle: String!, $articleHandle: String!) {\n blog(handle: $blogHandle) {\n articleByHandle(handle: $articleHandle) { ...ArticleFields }\n }\n }\n";
72
72
  /** Deleted or access-denied products come back as `null`, position-preserved. */
73
73
  export declare const nodesAsProductsQuery: () => string;
74
74
  export declare const SHOP_QUERY = "\n query ShopInfo {\n shop {\n name\n moneyFormat\n paymentSettings {\n currencyCode\n }\n }\n }\n";
75
75
  /** Each variant carries enough of its parent product to render a card without a second trip. */
76
- export declare const NODES_AS_VARIANTS_QUERY = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n query VariantNodes($ids: [ID!]!) {\n nodes(ids: $ids) {\n __typename\n ... on ProductVariant {\n ...VariantFields\n sellingPlanAllocations(first: 1) {\n nodes {\n sellingPlan { id name }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n }\n product {\n id\n title\n handle\n featuredImage { ...ImageFields }\n media(first: 250) { nodes { mediaContentType } }\n }\n }\n }\n }\n";
76
+ export declare const NODES_AS_VARIANTS_QUERY = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n # A null $imageTransform (the default) returns the original; request() declares the variable.\n url(transform: $imageTransform)\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n query VariantNodes($ids: [ID!]!) {\n nodes(ids: $ids) {\n __typename\n ... on ProductVariant {\n ...VariantFields\n sellingPlanAllocations(first: 1) {\n nodes {\n sellingPlan { id name }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n }\n product {\n id\n title\n handle\n featuredImage { ...ImageFields }\n media(first: 250) { nodes { mediaContentType } }\n }\n }\n }\n }\n";
77
77
  //# sourceMappingURL=queries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,+EAK1B,CAAC;AAEF,eAAO,MAAM,cAAc,4FAO1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mbAc5B,CAAC;AAwCF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,cAM/B,CAAC;AAEF,eAAO,MAAM,eAAe,cAiB3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,uPAU/B,CAAC;AAEF,eAAO,MAAM,aAAa,oiDA6CzB,CAAC;AAEF,eAA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AM,oBAAoB,cAQ/B,CAAC;AAEH,eAAO,MAAM,UAAU,0IAUtB,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,uBAAuB,skCAuBnC,CAAC"}
package/dist/queries.js CHANGED
@@ -10,7 +10,8 @@ exports.MONEY_FRAGMENT = `
10
10
  `;
11
11
  exports.IMAGE_FRAGMENT = `
12
12
  fragment ImageFields on Image {
13
- url
13
+ # A null $imageTransform (the default) returns the original; request() declares the variable.
14
+ url(transform: $imageTransform)
14
15
  altText
15
16
  width
16
17
  height
@@ -90,8 +91,8 @@ const productFragment = () => /* GraphQL */ `
90
91
  nodes {
91
92
  mediaContentType
92
93
  alt
93
- previewImage { url }
94
- ... on MediaImage { id image { url altText } }
94
+ previewImage { url(transform: $imageTransform) }
95
+ ... on MediaImage { id image { url(transform: $imageTransform) altText } }
95
96
  # mimeType tells the usable mp4s from the HLS/DASH manifests Shopify also returns.
96
97
  ... on Video { id sources { url mimeType width height } }
97
98
  ... on ExternalVideo { id embeddedUrl host }
@@ -142,6 +143,7 @@ exports.CART_FRAGMENT = `
142
143
  id
143
144
  quantity
144
145
  attributes { key value }
146
+ sellingPlanAllocation { sellingPlan { id } }
145
147
  cost {
146
148
  totalAmount { ...MoneyFields }
147
149
  amountPerQuantity { ...MoneyFields }
@@ -1 +1 @@
1
- {"version":3,"file":"queries.js","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":";;;AAAA,6CAAgE;AAEnD,QAAA,cAAc,GAAiB;;;;;CAK3C,CAAC;AAEW,QAAA,cAAc,GAAiB;;;;;;;CAO3C,CAAC;AAEW,QAAA,gBAAgB,GAAiB;IAC1C,sBAAc;IACd,sBAAc;;;;;;;;;;;;CAYjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC;IAC5C,wBAAgB;;MAEd,IAAA,+BAAkB,GAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BzB,CAAC;AAEF;;;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EF,2CAA2C;AAE3C,iFAAiF;AACpE,QAAA,oBAAoB,GAAG,IAAA,yBAAY,EAAC,GAAG,EAAE,CAAC,aAAa,CAAC;IACjE,IAAA,2BAAmB,GAAE;;;;;;;CAOxB,CAAC,CAAC;AAEU,QAAA,UAAU,GAAiB;;;;;;;;;;CAUvC,CAAC;AAEF,gGAAgG;AACnF,QAAA,uBAAuB,GAAiB;IACjD,wBAAgB;;;;;;;;;;;;;;;;;;;;;;CAsBnB,CAAC"}
@@ -54,6 +54,8 @@ interface CartState {
54
54
  }
55
55
  interface WishlistState {
56
56
  items: WishlistItem[];
57
+ /** The wishlisted product ids, in `items` order. The same array until the wishlist changes. */
58
+ ids: string[];
57
59
  count: number;
58
60
  has: (productId: string) => boolean;
59
61
  /** Alias for `has`. */
@@ -103,6 +105,12 @@ interface CustomerState {
103
105
  * piece of work; this is the seam it will emit through.
104
106
  */
105
107
  interface CheckoutState {
108
+ /**
109
+ * Call as checkout opens for the shared cart. A checked-out cart reads back null exactly like an
110
+ * expired one, so without this a missed `reportOrderPlaced` would refill the cart on next launch
111
+ * with what was just bought. Any later add, update or remove clears it.
112
+ */
113
+ reportCheckoutStarted: () => Promise<void>;
106
114
  /** Emits `checkout:orderPlaced`, then resets the cart so the next visit starts clean. */
107
115
  reportOrderPlaced: (details?: {
108
116
  orderId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ShopifyProvider.d.ts","sourceRoot":"","sources":["../../src/react/ShopifyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAOV,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,IAAI,EAEJ,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,aAAa,EAEb,UAAU,EACV,eAAe,EACf,QAAQ,EAER,eAAe,EACf,OAAO,EACP,aAAa,EACb,YAAY,EACZ,sBAAsB,EACvB,MAAM,UAAU,CAAC;AA4BlB,UAAU,SAAS;IACjB,IAAI,EAAE,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C;IACxB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AASD,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,UAAU,EACV,cAAc,GACf,EAAE,oBAAoB,+BA8zBtB;AAED,wBAAgB,UAAU,IAAI,kBAAkB,CAI/C;AAED,wBAAgB,OAAO,IAAI,SAAS,CAEnC;AAED,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,CAEpE;AAED,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
@@ -10,6 +10,8 @@ exports.useShopifyMessage = useShopifyMessage;
10
10
  const jsx_runtime_1 = require("react/jsx-runtime");
11
11
  const react_1 = require("react");
12
12
  const shopify_1 = require("../shopify");
13
+ const client_1 = require("../client");
14
+ const cart_1 = require("../cart");
13
15
  const cartPolicy_1 = require("../cartPolicy");
14
16
  const errors_1 = require("../errors");
15
17
  const messages_1 = require("../messages");
@@ -38,6 +40,95 @@ function lineFor(cart, input) {
38
40
  const ShopifyContext = (0, react_1.createContext)(undefined);
39
41
  const CART_STORAGE_KEY = "shopify:cart-id:v1";
40
42
  const CUSTOMER_TOKEN_KEY = "shopify:customer-token:v1";
43
+ const CART_LINES_KEY = "shopify:cart-lines:v1";
44
+ const CHECKOUT_STARTED_KEY = "shopify:checkout-started-cart-id:v1";
45
+ // Best-effort: the cart write that triggered it has already landed.
46
+ async function saveLineSnapshot(s, next) {
47
+ if (!s)
48
+ return;
49
+ try {
50
+ if (next)
51
+ await Promise.resolve(s.setItem(CART_LINES_KEY, JSON.stringify((0, cart_1.toLineSnapshot)(next))));
52
+ else
53
+ await Promise.resolve(s.removeItem(CART_LINES_KEY));
54
+ }
55
+ catch (snapshotError) {
56
+ console.warn("[ShopifyProvider] cart line snapshot write failed", snapshotError);
57
+ }
58
+ }
59
+ async function readCheckoutStarted(s) {
60
+ if (!s)
61
+ return null;
62
+ try {
63
+ return await Promise.resolve(s.getItem(CHECKOUT_STARTED_KEY));
64
+ }
65
+ catch {
66
+ return null;
67
+ }
68
+ }
69
+ async function clearCheckoutStarted(s) {
70
+ if (!s)
71
+ return;
72
+ try {
73
+ await Promise.resolve(s.removeItem(CHECKOUT_STARTED_KEY));
74
+ }
75
+ catch (markError) {
76
+ console.warn("[ShopifyProvider] checkout mark clear failed", markError);
77
+ }
78
+ }
79
+ async function loadLineSnapshot(s) {
80
+ if (!s)
81
+ return [];
82
+ try {
83
+ const raw = await Promise.resolve(s.getItem(CART_LINES_KEY));
84
+ const parsed = raw ? JSON.parse(raw) : [];
85
+ if (!Array.isArray(parsed))
86
+ return [];
87
+ return parsed.filter((line) => typeof (line === null || line === void 0 ? void 0 : line.merchandiseId) === "string" && typeof (line === null || line === void 0 ? void 0 : line.quantity) === "number" && line.quantity > 0);
88
+ }
89
+ catch {
90
+ return [];
91
+ }
92
+ }
93
+ /**
94
+ * A new cart holding the lines of one that expired. One `cartCreate` when every line is still
95
+ * sellable; a single refusal fails that whole create, so it is redone as an empty cart plus one add
96
+ * per line, skipping the refused ones. Not a shopper add, so no guard runs and nothing is toasted.
97
+ */
98
+ async function createFromSnapshot(lines, attributes) {
99
+ const inputs = lines.map((line) => {
100
+ var _a;
101
+ return ({
102
+ merchandiseId: line.merchandiseId,
103
+ quantity: line.quantity,
104
+ attributes: (_a = line.attributes) !== null && _a !== void 0 ? _a : [],
105
+ ...(line.sellingPlanId ? { sellingPlanId: line.sellingPlanId } : {}),
106
+ });
107
+ });
108
+ if (inputs.length === 0)
109
+ return shopify_1.shopify.cart.create({ attributes });
110
+ try {
111
+ return await shopify_1.shopify.cart.create({ attributes, lines: inputs });
112
+ }
113
+ catch (createError) {
114
+ if (!isLineRejection(createError))
115
+ throw createError;
116
+ }
117
+ let next = await shopify_1.shopify.cart.create({ attributes });
118
+ for (const input of inputs) {
119
+ try {
120
+ next = await shopify_1.shopify.cart.addLines(next.id, [input]);
121
+ }
122
+ catch (lineError) {
123
+ if (isLineRejection(lineError))
124
+ continue;
125
+ // A partly restored cart beats failing startup; the snapshot is rewritten from what landed.
126
+ console.warn("[ShopifyProvider] cart restore stopped early", lineError);
127
+ break;
128
+ }
129
+ }
130
+ return next;
131
+ }
41
132
  /** Alert-carrying events and the message key each resolves. */
42
133
  const EVENT_MESSAGE = {
43
134
  "cart:add": "cart.added",
@@ -146,6 +237,20 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
146
237
  policy: resolvedPolicy,
147
238
  translate: resolvedTranslate,
148
239
  };
240
+ /**
241
+ * The config, set during the first render rather than waiting for `init` in the effect below:
242
+ * children's first render can then read the product store (its keys depend on store and
243
+ * market), so a product page or grid paints from cache on frame one. Children's effects also run
244
+ * before this provider's, and with the config set their reads can start at once.
245
+ */
246
+ if (!(0, client_1.isConfigured)()) {
247
+ try {
248
+ (0, client_1.setConfig)(config);
249
+ }
250
+ catch {
251
+ // A bad config is reported by `init` below, where it has always been reported.
252
+ }
253
+ }
149
254
  /**
150
255
  * Re-applies what the render above already applied. `shopify.init()` sets both
151
256
  * from `config` for the benefit of non-React consumers, so it runs AFTER this
@@ -232,11 +337,15 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
232
337
  if (next)
233
338
  next = await applyCartAttributes(await pinMarket(next));
234
339
  if (!next) {
340
+ const checkedOut = !!savedId && savedId === (await readCheckoutStarted(s));
235
341
  // A cart created now is already in the configured market — `@inContext` saw to that.
236
- next = await shopify_1.shopify.cart.create({ attributes: cartAttrsRef.current });
342
+ next = checkedOut
343
+ ? await shopify_1.shopify.cart.create({ attributes: cartAttrsRef.current })
344
+ : await createFromSnapshot(await loadLineSnapshot(s), cartAttrsRef.current);
237
345
  if (s)
238
346
  await Promise.resolve(s.setItem(CART_STORAGE_KEY, next.id));
239
347
  }
348
+ await saveLineSnapshot(s, next);
240
349
  if (mounted)
241
350
  setCart(next);
242
351
  }
@@ -373,6 +482,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
373
482
  await Promise.resolve(s.setItem(CART_STORAGE_KEY, next.id));
374
483
  else
375
484
  await Promise.resolve(s.removeItem(CART_STORAGE_KEY));
485
+ await saveLineSnapshot(s, next);
376
486
  }, []);
377
487
  const ensureCartId = (0, react_1.useCallback)(async () => {
378
488
  if (cart === null || cart === void 0 ? void 0 : cart.id)
@@ -422,6 +532,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
422
532
  throw addError;
423
533
  }
424
534
  await persistCart(next);
535
+ await clearCheckoutStarted(storageRef.current);
425
536
  emit("cart:add");
426
537
  announceLanded(approved, next);
427
538
  return { ok: true, cart: next };
@@ -493,6 +604,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
493
604
  }
494
605
  if (next) {
495
606
  await persistCart(next);
607
+ await clearCheckoutStarted(storageRef.current);
496
608
  emit("cart:add");
497
609
  const settled = next;
498
610
  landed.forEach((input) => announceLanded(input, settled));
@@ -548,6 +660,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
548
660
  throw updateError;
549
661
  }
550
662
  await persistCart(next);
663
+ await clearCheckoutStarted(storageRef.current);
551
664
  // A quantity change is not one of the panel's alerts — emitted as a state
552
665
  // signal so a host can refresh a badge, with no copy attached.
553
666
  emit("cart:update");
@@ -576,6 +689,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
576
689
  try {
577
690
  const next = await serialize(() => shopify_1.shopify.cart.removeLines(cart.id, [lineId]));
578
691
  await persistCart(next);
692
+ await clearCheckoutStarted(storageRef.current);
579
693
  // The panel's "Removed From Cart" alert. Previously nothing fired here, so
580
694
  // the configured copy had no trigger at all.
581
695
  emit("cart:remove");
@@ -657,6 +771,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
657
771
  const wlClear = (0, react_1.useCallback)(async () => { await shopify_1.shopify.wishlist.clear(); }, []);
658
772
  const wlRefresh = (0, react_1.useCallback)(async () => { await shopify_1.shopify.wishlist.refresh({ keepDeleted: wishlistKeepDeleted }); }, [wishlistKeepDeleted]);
659
773
  const wlHas = (0, react_1.useCallback)((id) => shopify_1.shopify.wishlist.has(id), []);
774
+ const wlIds = (0, react_1.useMemo)(() => wlItems.map((item) => item.productId), [wlItems]);
660
775
  // ── Customer session ────────────────────────────────────────────────────────
661
776
  // Wraps `shopify.customer` with token persistence and the four Login alerts.
662
777
  // Bad credentials resolve `false` rather than throwing: it is an expected
@@ -780,6 +895,20 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
780
895
  console.warn("[ShopifyProvider] cart reset after order failed", resetError);
781
896
  }
782
897
  }, [emit, cartReset]);
898
+ // Read from storage rather than `cart` so the callback keeps one identity across cart changes.
899
+ const checkoutStarted = (0, react_1.useCallback)(async () => {
900
+ const s = storageRef.current;
901
+ if (!s)
902
+ return;
903
+ try {
904
+ const cartId = await Promise.resolve(s.getItem(CART_STORAGE_KEY));
905
+ if (cartId)
906
+ await Promise.resolve(s.setItem(CHECKOUT_STARTED_KEY, cartId));
907
+ }
908
+ catch (markError) {
909
+ console.warn("[ShopifyProvider] checkout mark write failed", markError);
910
+ }
911
+ }, []);
783
912
  const checkoutPaymentFailed = (0, react_1.useCallback)((paymentError) => {
784
913
  emit("checkout:paymentFailed", paymentError);
785
914
  }, [emit]);
@@ -805,6 +934,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
805
934
  },
806
935
  wishlist: {
807
936
  items: wlItems,
937
+ ids: wlIds,
808
938
  count: wlItems.length,
809
939
  has: wlHas,
810
940
  isWishlisted: wlHas,
@@ -827,6 +957,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
827
957
  refresh: authRefresh,
828
958
  },
829
959
  checkout: {
960
+ reportCheckoutStarted: checkoutStarted,
830
961
  reportOrderPlaced: checkoutOrderPlaced,
831
962
  reportPaymentFailed: checkoutPaymentFailed,
832
963
  },
@@ -836,9 +967,9 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
836
967
  // A new policy changes `cart.maxLineItems`, so the memo must see it.
837
968
  resolvedPolicy,
838
969
  cart, cartLoading, cartAddLine, cartAddLines, cartUpdateLine, cartRemoveLine, cartApplyDiscounts, cartUpdateNote, cartSetBuyerIdentity, cartRefresh, cartAdopt, cartReset,
839
- wlItems, wlHas, wlAdd, wlRemove, wlToggle, wlClear, wlRefresh,
970
+ wlItems, wlIds, wlHas, wlAdd, wlRemove, wlToggle, wlClear, wlRefresh,
840
971
  customer, token, authLoading, restoring, authLogin, authSignup, authLogout, authRecover, authRefresh,
841
- checkoutOrderPlaced, checkoutPaymentFailed,
972
+ checkoutStarted, checkoutOrderPlaced, checkoutPaymentFailed,
842
973
  ]);
843
974
  return (0, jsx_runtime_1.jsx)(ShopifyContext.Provider, { value: value, children: children });
844
975
  }