@tiledev/sdk-shopify 0.10.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -0
- package/dist/cart.d.ts.map +1 -1
- package/dist/cart.js +18 -0
- package/dist/cart.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/linkTags.d.ts +70 -0
- package/dist/linkTags.d.ts.map +1 -0
- package/dist/linkTags.js +109 -0
- package/dist/linkTags.js.map +1 -0
- package/dist/queries.d.ts +13 -13
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +17 -0
- package/dist/queries.js.map +1 -1
- package/dist/react/ShopifyProvider.d.ts +16 -1
- package/dist/react/ShopifyProvider.d.ts.map +1 -1
- package/dist/react/ShopifyProvider.js +112 -11
- package/dist/react/ShopifyProvider.js.map +1 -1
- package/dist/types.d.ts +26 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/dist/queries.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const VARIANT_FRAGMENT = "\n \n fragment MoneyFields on MoneyV2
|
|
|
9
9
|
export declare const productCardFragment: () => string;
|
|
10
10
|
export declare const productFragment: () => string;
|
|
11
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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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";
|
|
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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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;
|
|
@@ -20,11 +20,11 @@ export declare const COLLECTIONS_LIST_QUERY = "\n \n \n fragment ImageFields
|
|
|
20
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 # 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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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 # 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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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,12 +46,12 @@ 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 # 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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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_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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 CartGiftCardCodesAdd($cartId: ID!, $giftCardCodes: [String!]!) {\n cartGiftCardCodesAdd(cartId: $cartId, giftCardCodes: $giftCardCodes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
53
|
-
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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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";
|
|
54
|
-
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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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_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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartGiftCardCodesAdd($cartId: ID!, $giftCardCodes: [String!]!) {\n cartGiftCardCodesAdd(cartId: $cartId, giftCardCodes: $giftCardCodes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
53
|
+
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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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";
|
|
54
|
+
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 # Discounts on the whole cart (an order discount); a line's own are on the line.\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\n }\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 # The plan the line was bought on, and what checkout takes now and later for it. Shopify\n # gives the two amounts per unit (normalize multiplies them by the quantity).\n sellingPlanAllocation {\n sellingPlan { id name }\n checkoutChargeAmount { ...MoneyFields }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n # What each discount takes off the line, and the code (or name) it came from. One code's value\n # can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).\n discountAllocations {\n discountedAmount { ...MoneyFields }\n targetType\n ... on CartCodeDiscountAllocation { code }\n ... on CartAutomaticDiscountAllocation { title }\n ... on CartCustomDiscountAllocation { title }\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";
|
|
55
55
|
/** Shop's IP-localized country (e.g. `"US"`). We use this as the fallback
|
|
56
56
|
* countryCode when applying a gift card so the cart has a payment tender. */
|
|
57
57
|
export declare const SHOP_LOCALIZATION_QUERY = "\n query ShopLocalization {\n localization {\n country { isoCode name }\n }\n }\n";
|
package/dist/queries.d.ts.map
CHANGED
|
@@ -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,2NAQ1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,kjBAc5B,CAAC;AAiDF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,cAM/B,CAAC;AAEF,eAAO,MAAM,eAAe,cAkB3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,sXAU/B,CAAC;AAEF,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,+EAK1B,CAAC;AAEF,eAAO,MAAM,cAAc,2NAQ1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,kjBAc5B,CAAC;AAiDF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,cAM/B,CAAC;AAEF,eAAO,MAAM,eAAe,cAkB3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,sXAU/B,CAAC;AAEF,eAAO,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1B,CAAC;AAEF,eAAO,MAAM,yBAAyB,yJAMrC,CAAC;AAEF,eAAO,MAAM,wBAAwB,8mBAQpC,CAAC;AAIF,eAAO,MAAM,cAAc,s2CAyC1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,isDAUjC,CAAC;AAEF,eAAO,MAAM,0BAA0B,4kDAStC,CAAC;AAIF,eAAO,MAAM,aAAa,4EAMzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mkBAqB5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,6YAQ5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,8KAKhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,m7BAU/B,CAAC;AAEF,eAAO,MAAM,4BAA4B,wwBAOxC,CAAC;AAIF,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,cAQ/B,CAAC;AAEH,eAAO,MAAM,UAAU,0IAUtB,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,uBAAuB,slCAwBnC,CAAC"}
|
package/dist/queries.js
CHANGED
|
@@ -139,6 +139,14 @@ exports.CART_FRAGMENT = `
|
|
|
139
139
|
checkoutChargeAmount { ...MoneyFields }
|
|
140
140
|
}
|
|
141
141
|
discountCodes { code applicable }
|
|
142
|
+
# Discounts on the whole cart (an order discount); a line's own are on the line.
|
|
143
|
+
discountAllocations {
|
|
144
|
+
discountedAmount { ...MoneyFields }
|
|
145
|
+
targetType
|
|
146
|
+
... on CartCodeDiscountAllocation { code }
|
|
147
|
+
... on CartAutomaticDiscountAllocation { title }
|
|
148
|
+
... on CartCustomDiscountAllocation { title }
|
|
149
|
+
}
|
|
142
150
|
appliedGiftCards {
|
|
143
151
|
id
|
|
144
152
|
lastCharacters
|
|
@@ -165,6 +173,15 @@ exports.CART_FRAGMENT = `
|
|
|
165
173
|
amountPerQuantity { ...MoneyFields }
|
|
166
174
|
compareAtAmountPerQuantity { ...MoneyFields }
|
|
167
175
|
}
|
|
176
|
+
# What each discount takes off the line, and the code (or name) it came from. One code's value
|
|
177
|
+
# can be spread over several lines: a giveaway code over two lines of its size (2026-10-08).
|
|
178
|
+
discountAllocations {
|
|
179
|
+
discountedAmount { ...MoneyFields }
|
|
180
|
+
targetType
|
|
181
|
+
... on CartCodeDiscountAllocation { code }
|
|
182
|
+
... on CartAutomaticDiscountAllocation { title }
|
|
183
|
+
... on CartCustomDiscountAllocation { title }
|
|
184
|
+
}
|
|
168
185
|
merchandise {
|
|
169
186
|
... on ProductVariant {
|
|
170
187
|
...VariantFields
|
package/dist/queries.js.map
CHANGED
|
@@ -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;;;;;;;;CAQ3C,CAAC;AAEW,QAAA,gBAAgB,GAAiB;IAC1C,sBAAc;IACd,sBAAc;;;;;;;;;;;;CAYjB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC;IAC5C,wBAAgB;;MAEd,IAAA,+BAAkB,GAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCzB,CAAC;AAEF;;;;GAIG;AACI,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC;IACnD,mBAAmB,EAAE;;;;;CAKxB,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEK,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC;IAC/C,mBAAmB,EAAE;;;;;;;;;;;;;;;;;CAiBxB,CAAC;AAlBW,QAAA,eAAe,mBAkB1B;AAEW,QAAA,mBAAmB,GAAiB;IAC7C,sBAAc;;;;;;;;;CASjB,CAAC;AAEW,QAAA,aAAa,GAAiB;IACvC,wBAAgB;IAChB,sBAAc
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../src/queries.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;AAEW,QAAA,oBAAoB,GAAiB;IAC9C,qBAAa;;;;CAIhB,CAAC;AAEW,QAAA,mBAAmB,GAAiB;IAC7C,wBAAgB;;;;;;;;;CASnB,CAAC;AAEW,QAAA,4BAA4B,GAAiB;IACtD,wBAAgB;;;;;;CAMnB,CAAC;AAEF,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;;;;;;;;;;;;;;;;;;;;;;;CAuBnB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { type CheckoutPreparation, type PrepareCheckoutOptions } from "../checkout";
|
|
3
3
|
import type { AttributionSource } from "../attribution";
|
|
4
|
+
import { type LinkTagOptions } from "../linkTags";
|
|
4
5
|
import { type ProfileChanges, type SignupInput } from "../auth/session";
|
|
5
6
|
import type { AlertMessageKey, AuthMethod, AuthOptions, AlertMessages, Cart, CartLine, CartAttribute, CartLineAttribute, CartLineGuard, CartLineInput, CartPolicy, CartWriteResult, Customer, MessageResolver, Product, ShopifyConfig, SignInAttempt, StoreCreditOptions, WaitlistEntryInput, WaitlistItem, WishlistItem, WishlistStorageAdapter } from "../types";
|
|
6
7
|
interface CartState {
|
|
@@ -95,6 +96,13 @@ interface CartState {
|
|
|
95
96
|
* is already there. Never throws: false when it could not be written or there is no cart yet.
|
|
96
97
|
*/
|
|
97
98
|
ensureCartAttributes: (pairs: CartAttribute[]) => Promise<boolean>;
|
|
99
|
+
/**
|
|
100
|
+
* Saves a link's `ref` and `utm…` tags and puts them on the cart, as for a link that reached
|
|
101
|
+
* `linkTags.subscribe` (0.11.0): for a link the app routes itself. True when the tags were saved;
|
|
102
|
+
* false when the link has none or `linkTags` is off. The cart write is tried again at checkout if it
|
|
103
|
+
* fails now. Never throws.
|
|
104
|
+
*/
|
|
105
|
+
saveLinkTags: (url: string) => Promise<boolean>;
|
|
98
106
|
}
|
|
99
107
|
interface WishlistState {
|
|
100
108
|
items: WishlistItem[];
|
|
@@ -341,8 +349,15 @@ export interface ShopifyProviderProps {
|
|
|
341
349
|
attribution?: {
|
|
342
350
|
enabled: boolean;
|
|
343
351
|
};
|
|
352
|
+
/**
|
|
353
|
+
* Saves the `ref` and `utm…` tags of each link that opens the app, and puts them on the cart, so the
|
|
354
|
+
* order says which link the shopper came from (0.11.0; see `linkTags.ts`). Off when unset or when
|
|
355
|
+
* `keepDays` is 0. The last link wins: a newer link's tags replace the older ones on the phone and on
|
|
356
|
+
* the cart. New carts get the tags for `keepDays`; a cart that already has them keeps them after that.
|
|
357
|
+
*/
|
|
358
|
+
linkTags?: LinkTagOptions;
|
|
344
359
|
}
|
|
345
|
-
export declare function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishlistKeepDeleted, wishlistStorageKey, wishlistMigrateFrom, waitlistStorageKey, waitlistMigrateFrom, messages, translate, cartPolicy, cartAttributes, auth, storeCredit, attribution, }: ShopifyProviderProps): import("react").JSX.Element;
|
|
360
|
+
export declare function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishlistKeepDeleted, wishlistStorageKey, wishlistMigrateFrom, waitlistStorageKey, waitlistMigrateFrom, messages, translate, cartPolicy, cartAttributes, auth, storeCredit, attribution, linkTags, }: ShopifyProviderProps): import("react").JSX.Element;
|
|
346
361
|
export declare function useShopify(): ShopifyContextType;
|
|
347
362
|
export declare function useCart(): CartState;
|
|
348
363
|
export declare function useWishlist(): WishlistState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShopifyProvider.d.ts","sourceRoot":"","sources":["../../src/react/ShopifyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAOV,M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,EACT,UAAU,EACV,cAAc,EACd,IAAI,EACJ,WAAW,EACX,WAAW,EACX,QAAQ,GACT,EAAE,oBAAoB,+BAgjCtB;AAED,wBAAgB,UAAU,IAAI,kBAAkB,CAI/C;AAED,wBAAgB,OAAO,IAAI,SAAS,CAEnC;AAED,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAED,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,aAAa,CAgB3C;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAK9E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,CAEpE;AAED,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -16,6 +16,7 @@ const client_1 = require("../client");
|
|
|
16
16
|
const cart_1 = require("../cart");
|
|
17
17
|
const checkout_1 = require("../checkout");
|
|
18
18
|
const attributionRecorder_1 = require("./attributionRecorder");
|
|
19
|
+
const linkTags_1 = require("../linkTags");
|
|
19
20
|
const cartPolicy_1 = require("../cartPolicy");
|
|
20
21
|
const productPage_1 = require("../productPage");
|
|
21
22
|
const errors_1 = require("../errors");
|
|
@@ -183,7 +184,7 @@ function defaultStorage() {
|
|
|
183
184
|
}
|
|
184
185
|
return null;
|
|
185
186
|
}
|
|
186
|
-
function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishlistKeepDeleted, wishlistStorageKey, wishlistMigrateFrom, waitlistStorageKey, waitlistMigrateFrom, messages, translate, cartPolicy, cartAttributes, auth, storeCredit, attribution, }) {
|
|
187
|
+
function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishlistKeepDeleted, wishlistStorageKey, wishlistMigrateFrom, waitlistStorageKey, waitlistMigrateFrom, messages, translate, cartPolicy, cartAttributes, auth, storeCredit, attribution, linkTags, }) {
|
|
187
188
|
var _a, _b;
|
|
188
189
|
const [ready, setReady] = (0, react_1.useState)(false);
|
|
189
190
|
const [error, setError] = (0, react_1.useState)(null);
|
|
@@ -465,6 +466,22 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
465
466
|
catch (e) {
|
|
466
467
|
console.error("[ShopifyProvider] waitlist init failed", e);
|
|
467
468
|
}
|
|
469
|
+
// The last link's tags before the cart, so a cart created below already carries them; then the
|
|
470
|
+
// link the app was opened with, without waiting for it (0.11.0).
|
|
471
|
+
if (linkTagOptions.current) {
|
|
472
|
+
const s = storageRef.current;
|
|
473
|
+
const stored = s ? (0, linkTags_1.readSavedLinkTags)(await Promise.resolve(s.getItem(linkTags_1.LINK_TAGS_STORAGE_KEY)).catch(() => null)) : null;
|
|
474
|
+
// A link that arrived while storage was read is newer.
|
|
475
|
+
if (stored && !savedLinkTags.current)
|
|
476
|
+
savedLinkTags.current = stored;
|
|
477
|
+
const opening = linkTagOptions.current.getInitialUrl;
|
|
478
|
+
if (opening) {
|
|
479
|
+
void Promise.resolve()
|
|
480
|
+
.then(opening)
|
|
481
|
+
.then((url) => (url ? saveLinkTagsRef.current(url) : false))
|
|
482
|
+
.catch(() => false);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
468
485
|
setCartLoad(true);
|
|
469
486
|
try {
|
|
470
487
|
const s = storageRef.current;
|
|
@@ -479,8 +496,8 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
479
496
|
const checkedOut = !!savedId && savedId === (await readCheckoutStarted(s));
|
|
480
497
|
// A cart created now is already in the configured market — `@inContext` saw to that.
|
|
481
498
|
next = checkedOut
|
|
482
|
-
? await shopify_1.shopify.cart.create({ attributes:
|
|
483
|
-
: await createFromSnapshot(await loadLineSnapshot(s), await recorder.restoreAttributes(
|
|
499
|
+
? await shopify_1.shopify.cart.create({ attributes: newCartAttributes() })
|
|
500
|
+
: await createFromSnapshot(await loadLineSnapshot(s), await recorder.restoreAttributes(newCartAttributes()));
|
|
484
501
|
if (s)
|
|
485
502
|
await Promise.resolve(s.setItem(CART_STORAGE_KEY, next.id));
|
|
486
503
|
}
|
|
@@ -489,6 +506,8 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
489
506
|
await recorder.sync(next);
|
|
490
507
|
if (mounted)
|
|
491
508
|
setCart(next);
|
|
509
|
+
// A stored cart from before the last link, or a link that landed while the cart loaded.
|
|
510
|
+
void syncLinkTagsRef.current();
|
|
492
511
|
}
|
|
493
512
|
finally {
|
|
494
513
|
if (mounted)
|
|
@@ -537,6 +556,18 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
537
556
|
*/
|
|
538
557
|
const cartAttrsRef = (0, react_1.useRef)(cartAttributes);
|
|
539
558
|
cartAttrsRef.current = cartAttributes;
|
|
559
|
+
// ── Link tags (0.11.0) ── In refs, so a new options object each render changes nothing.
|
|
560
|
+
const linkTagOptions = (0, react_1.useRef)(linkTags);
|
|
561
|
+
linkTagOptions.current = linkTags;
|
|
562
|
+
/** The last link's tags as saved. Whether they still count is decided each time they're used. */
|
|
563
|
+
const savedLinkTags = (0, react_1.useRef)(null);
|
|
564
|
+
const currentLinkTags = (0, react_1.useCallback)(() => { var _a, _b; return (0, linkTags_1.liveLinkTags)(savedLinkTags.current, (_b = (_a = linkTagOptions.current) === null || _a === void 0 ? void 0 : _a.keepDays) !== null && _b !== void 0 ? _b : 0, Date.now()); }, []);
|
|
565
|
+
/** What a new cart starts with: the provider's `cartAttributes` and the link tags that still count. */
|
|
566
|
+
const newCartAttributes = (0, react_1.useCallback)(() => {
|
|
567
|
+
var _a;
|
|
568
|
+
const tags = currentLinkTags();
|
|
569
|
+
return tags ? (0, linkTags_1.withLinkTags)((_a = cartAttrsRef.current) !== null && _a !== void 0 ? _a : [], tags) : cartAttrsRef.current;
|
|
570
|
+
}, [currentLinkTags]);
|
|
540
571
|
/**
|
|
541
572
|
* Backfills the configured attributes onto a cart that is missing them.
|
|
542
573
|
*
|
|
@@ -600,7 +631,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
600
631
|
const ensureCartId = (0, react_1.useCallback)(async () => {
|
|
601
632
|
if (cart === null || cart === void 0 ? void 0 : cart.id)
|
|
602
633
|
return cart.id;
|
|
603
|
-
const created = await shopify_1.shopify.cart.create({ attributes:
|
|
634
|
+
const created = await shopify_1.shopify.cart.create({ attributes: newCartAttributes() });
|
|
604
635
|
await persistCart(created);
|
|
605
636
|
return created.id;
|
|
606
637
|
}, [cart, persistCart]);
|
|
@@ -936,14 +967,77 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
936
967
|
await persistCart(next);
|
|
937
968
|
return next;
|
|
938
969
|
}, [cart, persistCart]);
|
|
970
|
+
/**
|
|
971
|
+
* Makes the cart's link tags the saved ones that still count: a newer link's replace an older
|
|
972
|
+
* link's, and every other attribute is kept. Nothing when none still count, so tags that ran out stay
|
|
973
|
+
* on a cart that already has them (decided 2026-10-08, Head of Engineering: "Leave them on"). Queued
|
|
974
|
+
* behind pending cart writes; no request when the cart already has them. Never throws: false when
|
|
975
|
+
* the write failed or there's no cart yet.
|
|
976
|
+
*/
|
|
977
|
+
const syncLinkTags = (0, react_1.useCallback)(async () => {
|
|
978
|
+
const tags = currentLinkTags();
|
|
979
|
+
if (!tags)
|
|
980
|
+
return true;
|
|
981
|
+
try {
|
|
982
|
+
return await serialize(async () => {
|
|
983
|
+
var _a;
|
|
984
|
+
const current = cartRef.current;
|
|
985
|
+
if (!current)
|
|
986
|
+
return false;
|
|
987
|
+
const have = (_a = current.attributes) !== null && _a !== void 0 ? _a : [];
|
|
988
|
+
if ((0, linkTags_1.cartHasLinkTags)(have, tags))
|
|
989
|
+
return true;
|
|
990
|
+
const next = await shopify_1.shopify.cart.updateAttributes(current.id, (0, linkTags_1.withLinkTags)(have, tags));
|
|
991
|
+
await persistCart(next);
|
|
992
|
+
return true;
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
catch (syncError) {
|
|
996
|
+
console.warn("[ShopifyProvider] link tags cart write failed", syncError);
|
|
997
|
+
return false;
|
|
998
|
+
}
|
|
999
|
+
}, [currentLinkTags, serialize, persistCart]);
|
|
1000
|
+
const syncLinkTagsRef = (0, react_1.useRef)(syncLinkTags);
|
|
1001
|
+
syncLinkTagsRef.current = syncLinkTags;
|
|
1002
|
+
const saveLinkTags = (0, react_1.useCallback)(async (url) => {
|
|
1003
|
+
var _a, _b;
|
|
1004
|
+
if (!(((_b = (_a = linkTagOptions.current) === null || _a === void 0 ? void 0 : _a.keepDays) !== null && _b !== void 0 ? _b : 0) > 0))
|
|
1005
|
+
return false;
|
|
1006
|
+
const tags = (0, linkTags_1.linkTagsFrom)(url);
|
|
1007
|
+
if (!tags)
|
|
1008
|
+
return false;
|
|
1009
|
+
const record = { savedAt: Date.now(), tags };
|
|
1010
|
+
savedLinkTags.current = record;
|
|
1011
|
+
const s = storageRef.current;
|
|
1012
|
+
if (s) {
|
|
1013
|
+
await Promise.resolve(s.setItem(linkTags_1.LINK_TAGS_STORAGE_KEY, JSON.stringify(record))).catch((saveError) => console.warn("[ShopifyProvider] link tags not saved", saveError));
|
|
1014
|
+
}
|
|
1015
|
+
await syncLinkTags();
|
|
1016
|
+
return true;
|
|
1017
|
+
}, [syncLinkTags]);
|
|
1018
|
+
const saveLinkTagsRef = (0, react_1.useRef)(saveLinkTags);
|
|
1019
|
+
saveLinkTagsRef.current = saveLinkTags;
|
|
1020
|
+
// Each link that reaches the running app. The host passes the same `subscribe` every render.
|
|
1021
|
+
const subscribeToLinks = linkTags === null || linkTags === void 0 ? void 0 : linkTags.subscribe;
|
|
1022
|
+
(0, react_1.useEffect)(() => {
|
|
1023
|
+
if (!subscribeToLinks)
|
|
1024
|
+
return;
|
|
1025
|
+
return subscribeToLinks((url) => {
|
|
1026
|
+
void saveLinkTagsRef.current(url);
|
|
1027
|
+
});
|
|
1028
|
+
}, [subscribeToLinks]);
|
|
939
1029
|
const cartAdopt = (0, react_1.useCallback)(async (cartId) => {
|
|
1030
|
+
var _a;
|
|
940
1031
|
// Adopted from the shopper's other device or the web store, so its market is not ours to assume.
|
|
941
1032
|
const fetched = await shopify_1.shopify.cart.get(cartId);
|
|
942
1033
|
const next = fetched ? await applyCartAttributes(await pinMarket(fetched)) : null;
|
|
943
|
-
if (next)
|
|
1034
|
+
if (next) {
|
|
944
1035
|
await persistCart(next);
|
|
945
|
-
|
|
946
|
-
|
|
1036
|
+
// This phone's link tags go with it, as on any cart of this phone's (0.11.0).
|
|
1037
|
+
await syncLinkTags();
|
|
1038
|
+
}
|
|
1039
|
+
return (_a = cartRef.current) !== null && _a !== void 0 ? _a : next;
|
|
1040
|
+
}, [persistCart, pinMarket, applyCartAttributes, syncLinkTags]);
|
|
947
1041
|
const cartFlushAttribution = (0, react_1.useCallback)(() => recorder.flushPending(), [recorder]);
|
|
948
1042
|
const cartEnsureAttributes = (0, react_1.useCallback)(async (pairs) => {
|
|
949
1043
|
try {
|
|
@@ -966,7 +1060,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
966
1060
|
}
|
|
967
1061
|
}, [serialize, persistCart]);
|
|
968
1062
|
const cartReset = (0, react_1.useCallback)(async () => {
|
|
969
|
-
const created = await shopify_1.shopify.cart.create({ attributes:
|
|
1063
|
+
const created = await shopify_1.shopify.cart.create({ attributes: newCartAttributes() });
|
|
970
1064
|
await persistCart(created);
|
|
971
1065
|
}, [persistCart]);
|
|
972
1066
|
// The wishlist module owns storage and hydration; these just wrap the mutating methods and
|
|
@@ -1045,9 +1139,15 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
1045
1139
|
// The cart's attribution lands first, then the provider's own cartAttributes (Freckled Poppy's
|
|
1046
1140
|
// labelCartForCheckout). Each queued behind pending cart writes.
|
|
1047
1141
|
flushAttribution: cartFlushAttribution,
|
|
1048
|
-
|
|
1142
|
+
// Then the link tags that still count, a newer link's in place of an older one's (0.11.0).
|
|
1143
|
+
ensureCartAttributes: async () => {
|
|
1144
|
+
var _a;
|
|
1145
|
+
const fixed = ((_a = cartAttrsRef.current) === null || _a === void 0 ? void 0 : _a.length) ? await cartEnsureAttributes(cartAttrsRef.current) : true;
|
|
1146
|
+
const tagged = await syncLinkTags();
|
|
1147
|
+
return fixed && tagged;
|
|
1148
|
+
},
|
|
1049
1149
|
}, options);
|
|
1050
|
-
}, [cartRefresh, cartSetBuyerIdentity, cartFlushAttribution, cartEnsureAttributes, checkoutStarted, sessionState.kind, (_a = sessionState.customer) === null || _a === void 0 ? void 0 : _a.email, session]);
|
|
1150
|
+
}, [cartRefresh, cartSetBuyerIdentity, cartFlushAttribution, cartEnsureAttributes, syncLinkTags, checkoutStarted, sessionState.kind, (_a = sessionState.customer) === null || _a === void 0 ? void 0 : _a.email, session]);
|
|
1051
1151
|
const authMethod = (_b = auth === null || auth === void 0 ? void 0 : auth.method) !== null && _b !== void 0 ? _b : "password";
|
|
1052
1152
|
// By its fields, so a host passing a fresh object each render doesn't rebuild the context.
|
|
1053
1153
|
const storeCreditOptions = (0, react_1.useMemo)(() => (storeCredit ? { source: storeCredit.source, tileCreditBaseUrl: storeCredit.tileCreditBaseUrl } : null), [storeCredit === null || storeCredit === void 0 ? void 0 : storeCredit.source, storeCredit === null || storeCredit === void 0 ? void 0 : storeCredit.tileCreditBaseUrl]);
|
|
@@ -1075,6 +1175,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
1075
1175
|
reset: cartReset,
|
|
1076
1176
|
flushAttribution: cartFlushAttribution,
|
|
1077
1177
|
ensureCartAttributes: cartEnsureAttributes,
|
|
1178
|
+
saveLinkTags,
|
|
1078
1179
|
},
|
|
1079
1180
|
wishlist: {
|
|
1080
1181
|
items: wlItems,
|
|
@@ -1129,7 +1230,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
1129
1230
|
ready, error, events,
|
|
1130
1231
|
// A new policy changes `cart.maxLineItems`, so the memo must see it.
|
|
1131
1232
|
resolvedPolicy,
|
|
1132
|
-
cart, cartLoading, cartAddLine, cartAddLines, cartUpdateLine, cartRemoveLine, cartApplyDiscounts, cartUpdateNote, cartSetBuyerIdentity, cartAddGiftCardCodes, cartRemoveGiftCards, cartRefresh, cartAdopt, cartReset, cartFlushAttribution, cartEnsureAttributes,
|
|
1233
|
+
cart, cartLoading, cartAddLine, cartAddLines, cartUpdateLine, cartRemoveLine, cartApplyDiscounts, cartUpdateNote, cartSetBuyerIdentity, cartAddGiftCardCodes, cartRemoveGiftCards, cartRefresh, cartAdopt, cartReset, cartFlushAttribution, cartEnsureAttributes, saveLinkTags,
|
|
1133
1234
|
wlItems, wlIds, wlHas, wlAdd, wlRemove, wlToggle, wlClear, wlRefresh,
|
|
1134
1235
|
wtItems, wtIds, wtHas, wtAdd, wtRemove, wtRefresh,
|
|
1135
1236
|
sessionState, session, authMethod, storeCreditOptions,
|